The MathJax noErrors extension causes $\rm\LaTeX$ expressions that contain errors to show the original $\rm\LaTeX$ code rather than an error message. That is certainly appropriate for viewing questions, so that if there is an error, you can at least see the $\rm\LaTeX$. But when you are writing a post, it would often be helpful to see the error message instead, so you can correct the $\rm\LaTeX$ more easily. So I propose that the noErrors extension be disabled during the MathJax typesetting of question and answer previews.

This can be accomplished by changing the RestartMJ function in mathjax-editing.js to be

function SetNoErrors (state) {
  HUB.Config({TeX:{noErrors:{disabled:state}}});
}
function RestartMJ () {
  pending = HUB.cancelTypeset = !1;
  HUB.Queue(
    [SetNoErrors,!0],
    ["Typeset",HUB,preview],
    [SetNoErrors,!1]
  );
}

You could also clear up the problem with labels in preview by adding

    ["resetEquationNumbers",MathJax.InputJax.TeX],

to the beginning of the HUB.Queue call above.

share
    
+1 This would be very helpful when debugging hairy code. –  Bill Dubuque Jan 19 at 22:57

You must log in to answer this question.

Browse other questions tagged .