Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TeX.Environment() to use the correct end environment. #1455

merged 1 commit into from May 11, 2016


None yet
3 participants
Copy link

commented May 3, 2016

There is no issue number for this. It turned up when I was checking another bug, but was unrelated to it. You are supposed to be able to use


(after loading the TeX newcommand extension) in order to define a new command, where prefix is the TeX code to insert at the beginning of the environment, suffix is the TeX to insert at the end, n is the number of arguments required for the environment, and default is the default for the argument. The n and default are not required.

This works as advertised, except for one thing: if the prefix includes a \begin{...} and the suffix includes an \end{...}, MathJax issues an error about the nesting being wrong. With this fix, the begin and end work properly. E.g.,


would cause \begin{nested} a& b \end{nested} to produce the message '\begin{matrix} ended by \end{nested}` without the patch. With the patch, you should get a matrix as expected.


This comment has been minimized.

Copy link

commented May 11, 2016

LGTM (afaict)

@dpvc dpvc merged commit 1d84967 into mathjax:develop May 11, 2016

@dpvc dpvc deleted the dpvc:environment-fix branch May 11, 2016

@pkra pkra added this to the MathJax v2.x.x milestone May 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.