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.
525 B
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}