leo-colisson / zx-calculus

A package to typeset ZX calculus directly in LaTeX.
12 stars 1 forks source link

ZX environment is fragile on blank lines #4

Closed dlyongemallo closed 8 months ago

dlyongemallo commented 8 months ago

If there are any blank lines, it breaks compilation.

For example, this is fine:

\begin{ZX}
\zxZ{\alpha} \arrow[r] & \zxFracX-{\pi}{4}
\end{ZX}

But this is not:

\begin{ZX}

\zxZ{\alpha} \arrow[r] & \zxFracX-{\pi}{4}

\end{ZX}

The above results in Missing $ inserted and causes an emergency stop.

tobiasBora commented 8 months ago

Thanks. So the problem seems to boil down to tikzcd, so if you want you can report this there. Meanwhile, I disabled explicitly newlines in \begin{ZX} in order to get a clearer error message. This is fixed in bf59bfd867fcb760f2779c2b5740d5d0d68bed2d

I’m also curious, are you fine with having a clearer error message, or would you really want to be able to do the above syntax? If so, what is your use-case?

dlyongemallo commented 8 months ago

I'm fine with a clearer error message. My use case is that I'm using zx-calculus within the latex environment in Anki cards, and for reasons I can't pin down, it sometimes injects additional newlines into the code that it actually sends to the latex compiler. I've worked around this by replacing the newlines with spaces.

Where should tikzcd issues be reported?

tobiasBora commented 8 months ago

Oh that's a funny application. You can report issues on their github page here https://github.com/astoff/tikz-cd