fred-wang / TeXZilla

LALR Javascript LaTeX-to-MathML converter compatible with Unicode
http://fred-wang.github.io/TeXZilla/
130 stars 21 forks source link

{align*} breaks the parser #77

Open pepelsbey opened 2 months ago

pepelsbey commented 2 months ago

I used some MathML to LaTeX converters to supply annotations for all MathML formulas on MDN. I also tested some outputs with TeXZilla and noticed that formulas using {align*} weren't properly parsed. Once replaced with \begin{aligned}, it worked fine.

Errored:

\begin{align*}
  x + 3y + 4z &= 2 \\
      3y - 4z &= 5 \\
            z &= 4
\end{align*}

Worked:

\begin{aligned}
  x + 3y + 4z &= 2 \\
      3y - 4z &= 5 \\
            z &= 4
\end{aligned}

Not sure what’s the difference (the rendering seems identical), but other parsers support the {align*} notation. For example, Temml.

fred-wang commented 2 months ago

Apparently this is to control automatic numbering of formulas: https://tex.stackexchange.com/questions/9514/whats-the-difference-between-align-and-align

TeXZilla follows https://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html and so does not support the starred versions.