brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
961 stars 101 forks source link

Robustness to stacked aligned environments #2383

Closed dginev closed 3 months ago

dginev commented 3 months ago

There appears to have been a change of behavior where a particular stacked alignment configuration triggers an edge case error. If I am diagnosing this right, the necessary conditions are:

A minimal example is:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

Safe:

\begin{eqnarray}
\begin{aligned}
  A  % this is OK
\end{aligned}
\end{eqnarray}

In contrast:

\begin{eqnarray}
\begin{aligned}
{A}
\end{aligned}
\end{eqnarray} % an ERROR is emitted here

Also broken:

\begin{eqnarray}
\begin{aligned}
 A \\
\end{aligned}
\end{eqnarray}  % an ERROR is emitted here

\end{document}

The original document contained this exact stacking, for a 2-line display equation. It may have been an author mistake, but the error cascade is quite problematic - the example I was examining had the entire conversion Fatal as a result. This works well in pdflatex.