MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Underbrace clipped for 3‑column matrices

Open DanielSevillano opened this issue 5 months ago • 2 comments

Issue Summary

Placing a 3-column matrix inside \underbrace causes the brace to be clipped. It works correctly when the matrix has 1, 2, or 4 columns.

Technical details:

  • MathJax Version: 4.0
  • Client OS: Windows 11
  • Browser: Firefox 142

Loading MathJax via:

<script async src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js"></script>

Supporting information:

Output

Image

Code

$$\underbrace{
    \begin{pmatrix}
        1 \\ 2
    \end{pmatrix}
}_A \quad
\underbrace{
    \begin{pmatrix}
        1 & 2 \\
        3 & 4
    \end{pmatrix}
}_B \quad
\underbrace{
    \begin{pmatrix}
        1 & 2 & 3 \\
        4 & 5 & 6
    \end{pmatrix}
}_C \quad
\underbrace{
    \begin{pmatrix}
        1 & 2 & 3 & 4 \\
        5 & 6 & 7 & 8
    \end{pmatrix}
}_D$$

DanielSevillano avatar Sep 06 '25 12:09 DanielSevillano

Looks like there is some CSS that is causing the problem for the CHTML output. Try adding

mjx-stretchy-h > mjx-ext {
  padding: 0 ! important;
}

to the CSS for your page and see if that clears things up for you.

I will make a PR to fix this in the next release.

dpvc avatar Sep 06 '25 14:09 dpvc

It works perfectly now, thank you!

DanielSevillano avatar Sep 06 '25 23:09 DanielSevillano