Sunday, 2 June 2013

tikz-cd error: Single ampersand used with wrong catcode

tikz-cd error: Single ampersand used with wrong catcode

I'm trying to draw a diamond-shaped commutative diagram using the tikz-cd package. Below is my LaTeX source:
\documentclass{amsart}

\usepackage{tikz}
\usepackage{tikz-cd}

\begin{document}

\[\begin{tikzcd}
& A \arrow{dl}\arrow{dr} &\\
B \arrow{dr} & \arrow{dl} C\\
& D &
\end{tikzcd}\]

\end{document}
When I compile this using pdflatex, I get the error:
Package pgfbasematrix Error: Single ampersand used with wrong catcode.
I've looked around on this site, in the documentation and online, and I've only seen this error arise before when using Beamer or trying to define a newcommand. Since I'm doing neither, I'm at a loss as to what's going on.

No comments:

Post a Comment