11

I am a tikz-cd user trying to render a document that uses diagrams.sty. I am getting the error "THIS (S) SHOULD NEVER HAPPEN" when running the minimal example below in Overleaf (and locally too). I should note that I am using the latest (v3.96) release of the package. Any ideas on how to get rid of the error?

\documentclass{standalone}
\usepackage{diagrams}

\begin{document}
    \begin{diagram}
        A & \rTo & B
    \end{diagram}
\end{document}
1
  • you could try with an older latex on overleaf. Commented Oct 8, 2022 at 9:01

1 Answer 1

15

It should be reported to the package author (also the version on ctan does not run at all as it fails a date self-check).

It is missing an \unskip for current latex, this patches it to run without warning.

\documentclass{standalone}
\usepackage{diagrams}

\makeatletter
\def\foo#1\endgraf\unskip#2\foo{\def\row@to@buffer{#1\endgraf\unskip\unskip#2}}
\expandafter\foo\row@to@buffer\foo
\makeatother
\begin{document}
    \begin{diagram}
        A & \rTo & B
    \end{diagram}
\end{document}
3
  • I never used to have this error, but I just switched to a new Windows 11 laptop and am getting this with my new Miktex/TeXstudio installation. Unfortunately, this patch also generates errors: "Undefined control sequence. \expandafter\foo\row@to@buffer" and "Paragraph ended before \foo was complete." So any further help here would be appreciated. Commented Apr 7, 2023 at 7:47
  • @GregFriedman I just tested the above with texlive 2023 and it ran without error. If you have an exmple post it as a new question Commented Apr 7, 2023 at 9:40
  • Done - posted here: tex.stackexchange.com/questions/682353/…. Thanks Commented Apr 10, 2023 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .