1

I found that I could not use square brackets as label of arrow when using tikz-cd package to draw commutative diagram. A MWE:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
        \begin{tikzcd}
        Z \arrow[r,"[1]"]& X
    \end{tikzcd}
\end{document}

I got the following error:

Argument of \tikz@quote@@parser has an extra }. ^^I\end{tikzcd}

If I use instead \arrow[r]{[1]}, I get no error but the brackets are not showed in the pdf.

I looked through the documentation of tikz-cd and failed to find the reason.

Thanks for you help.

2
  • 4
    Did you try \arrow[r,"{[1]}"] in order to “hide” the inner bracket?
    – egreg
    Jan 5, 2021 at 8:47
  • That works indeed! Thank you.
    – Doug Liu
    Jan 6, 2021 at 7:47

0

Browse other questions tagged .