mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.23k stars 1.16k forks source link

`aligned` not rendering the first square bracket. #3279

Open yuxi-liu-wired opened 2 months ago

yuxi-liu-wired commented 2 months ago

Issue Summary

aligned not rendering the first square bracket.

Steps to Reproduce:

Try rendering this:

$$
\begin{aligned}
    [1] &= 1
\end{aligned}
$$

results in = 1

image

It can be bypassed by putting a curly bracket at the start.

$$
\begin{aligned}{}
    [1] &= 1
\end{aligned}
$$

This is different from the default behavior of LaTeX as rendered by pdfTeX, which renders the first square bracket without issue.

Technical details:

I am loading MathJax via

<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js"></script>
dpvc commented 2 months ago

This is a duplicate of #2888 and #3216. It is fixed in v4 (currently out in beta release). The behavior in LaTeX changed in the fall of 2020 (after MathJax v3's implementation of aligned), and that new behavior is now reflected in v4.