Files
pandoc/test/command/11266.md
T
Erik Demaine c248f880e5 Math: respect TeX groups and comments. (#11887)
Prevent math delimiters inside TeX brace groups and percent comments
from prematurely closing an equation:

* Generalize the existing inline `\text` group handling to arbitrary
  brace groups, and support groups in display math too.
* Recognize unescaped `%` as starting a comment through the next newline.
  Ignore any braces or math delimiters within it.

Developed with OpenAI Codex.

PR revised by John MacFarlane.
2026-10-05 15:34:23 -07:00

525 B

% pandoc -t latex
$$
\begin{eqnarray}
S &\rightarrow& a A                      \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A  \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A  \nonumber \\
C &\rightarrow& \epsilon                 \nonumber
\end{eqnarray}
$$
^D
\begin{eqnarray}
S &\rightarrow& a A                      \nonumber \\
A &\rightarrow& d B \ | \ b A \ | \ c A  \nonumber \\
B &\rightarrow& a c \ | \ b C \ | \ c A  \nonumber \\
C &\rightarrow& \epsilon                 \nonumber
\end{eqnarray}