astoff / tikz-cd

Commutative diagrams with TikZ
44 stars 3 forks source link

tikzcd environment is fragile on blank lines #17

Closed dlyongemallo closed 8 months ago

dlyongemallo commented 8 months 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 8 months 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 7 months 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.