astoff / tikz-cd

Commutative diagrams with TikZ
46 stars 3 forks source link

tikzcd environment is fragile on blank lines #17

Closed dlyongemallo closed 1 year ago

dlyongemallo commented 1 year ago

For example, this works:

\begin{tikzcd}
A \arrow{r}{a} \arrow{d}{b}
&B \arrow{d}{c}\\
C \arrow{r}{d} &D
\end{tikzcd}

But this doesn't (or a newline anywhere within the environment):

\begin{tikzcd}

A \arrow{r}{a} \arrow{d}{b}

&B \arrow{d}{c}\\

C \arrow{r}{d} &D

\end{tikzcd}

It results in a Missing $ inserted error.

(See https://github.com/leo-colisson/zx-calculus/issues/4 for more context.)

astoff commented 1 year ago

This is already an issue with a plain \matrix [matrix of math nodes], right? Then it would be a bug in TikZ itself -- or, rather, it should be consider to be "just the way it is".

dlyongemallo commented 1 year ago

Okay, thanks. I already found a workaround but reported it just in case it could be fixed upstream. I guess the issue is more fundamental than first appeared.