I’m having difficulty rendering latex tikz-cd diagrams. Could anyone help?

I feel like this should work:




A \arrow[rd, "f"] & B



But it’s not rendering.

I copied and pasted the code example from here:

And that code renders perfectly. I am wondering if the problem is the body of the diagram rather than any of the latex headers?