MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Custom environment not working (4.0.0-beta7)

Open DanielSevillano opened this issue 9 months ago • 2 comments

Issue Summary

I have a custom environment defined (divmatrix) to write matrices with a divider in my webpage. This is what I want to achieve:

\left(\begin{array}{ccc|c}
    % content
\end{array}\right)

This is how I have defined the environment:

divmatrix: ["\\left(\\begin{array}{ccc|c}", "\\end{array}\\right)"]

This is how I'm using it:

A= \begin{divmatrix}
    2 & 0 & 0 & -3 \\
    3 & -1 & 0 & 2 \\
    -1 & 3 & 5 & -2
\end{divmatrix}

It was working correctly when I was using MathJax 3.2.2. However, the following error appeared when I upgraded to version 4.0.0-beta7: \begin{divmatrix} ended with \end{array}.

Technical details:

  • MathJax Version: 4.0.0-beta7
  • Client OS: Windows 11
  • Browser: Firefox 138

MathJax configuration:

MathJax = {
    tex: {
        inlineMath: [["$", "$"]],
        environments: {
            divmatrix: ["\\left(\\begin{array}{ccc|c}", "\\end{array}\\right)"]
        }
};

Loading MathJax via:

<script async src="https://cdn.jsdelivr.net/npm/[email protected]/tex-mml-chtml.js"></script>

DanielSevillano avatar May 10 '25 23:05 DanielSevillano

This is a duplicate of mathjax/MathJax-src#1137, which is fixed in mathjax/MathJax-src#1139. It has been merged into develop, but is not yet in a release. We are readying beta.8, and it will be available there.

I will put a patch together for you tomorrow.

dpvc avatar May 19 '25 23:05 dpvc

Oh, that's why I didn't find any similar open issue. Don't worry about the patch, I can wait for beta.8 and I don't want to take up your time.

Thank you so much for your work!

DanielSevillano avatar May 20 '25 09:05 DanielSevillano

It's working in MathJax 4.0.0-rc4, thanks!

DanielSevillano avatar Jul 11 '25 12:07 DanielSevillano

Thanks for the confirmation.

dpvc avatar Jul 11 '25 12:07 dpvc