LaTeXML
LaTeXML copied to clipboard
Inconsistency: One `aligned` -> `equationgroup`, 2+ `aligned` -> `equation`
One aligned:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
a
\end{aligned}
\end{equation}
\end{document}
LaTeXML output:
<equationgroup xml:id="S0.E1">
...
</equationgroup>
Two aligned:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
a
\end{aligned}\\
\begin{aligned}
b
\end{aligned}
\end{equation}
\end{document}
LaTeXML output:
<equation xml:id="S0.E1">
...
</equation>
I can reproduce the description.
To clarify, both variants have a ltx:equation element holding the latex {equation} content, but the first (smaller) variant also has an outer ltx:equationgroup wrapper holding the tags. In the second example the tags end up inside the ltx:equation.
So indeed, a little inconsistent...
Forgive my asking, but are there any negative consequences to this inconsistency?
The example is somewhat of a misuse of aligned, in that (as I understand it), aligned is meant to collect up pairs of lhs,rhs to present a collection of "equations" in a single display (with the parts aligned). In anticipation of this, we turn \begin{equation}\begin{aligned} into an equationgroup containing several equations. The second example doesn't fit the pattern so easily, so ...
To clarify, the odd thing is that one aligned gets tranlated to an equationgroup, two aligned get translated to a single equation.
(The regex you mention is present in both cases.)
I recognize the inconsistency, but does it matter?
I noticed it when trying to convert things in Markdown where I don't have a proper strategy dealing with <equationgroup>s yet (see https://github.com/brucemiller/LaTeXML/issues/2092). That's why I was keen on getting simple <equation>s if possible.
When #2092 is resolved one way or another, it won't bother me much either.