For example, let us say that I want to use macro to typeset matrices. Just in case I later decide that I want to somehow change how they look, I can then change it in one place - in this macro.

MathJax Documentation says that \newenvironment works. But if I try the same syntax I use in TeX, it does not seem to work.


$\newenvironment{mymatrix}{\left(\begin{smallmatrix}}{\end{smallmatrix}\right)}\begin{mymatrix}a&b\\-b&a\end{mymatrix}$ does not work $\left(\begin{smallmatrix}a&b\\-b&a\end{smallmatrix}\right)$ works

$\newenvironment{mymatrix}{\left(\begin{smallmatrix}}{\end{smallmatrix}\right)}\begin{mymatrix}a&b\\-b&a\end{mymatrix}$ does not work
$\left(\begin{smallmatrix}a&b\\-b&a\end{smallmatrix}\right)$ works

  • 3
    $\begingroup$ This should be working now (v2.4 includes the fix). $\endgroup$ Commented May 19, 2014 at 22:01
  • $\begingroup$ And indeed it does work, as can be seen also from the example in my post. Thanks for your work! $\endgroup$ Commented May 20, 2014 at 7:31
  • $\begingroup$ @DavideCervone I flagged this post since I think that it should be tagged (status-completed), but this tag can only be added by mods. Perhaps you could also update your answer and mention there, that the bug has already been fixed. (This information will be more visible in answer than in comment.) $\endgroup$ Commented May 20, 2014 at 8:03
  • $\begingroup$ I have added a note to my answer as well. Thanks for the suggestion. $\endgroup$ Commented May 20, 2014 at 13:22

1 Answer 1


It's a bug in MathJax's processing of \begin{x}...\end{x}. I'm opening an issue tracker for it on the MathJax GitHub site.

Edit: This is now fixed in v2.4 of MathJax.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .