Search code examples
mathversionupdatesmathjax

Delay when changing math on page using Mathjax 2.6 instead of 2.4


I try to get ride of the Mathjax rendering issues in Chrome (vertical lines at end of equations). So I tried to update from Mathjax 2.4 to version 2.6. This fixes the rendering issue in Chrome, but now the old math vanishes, inline text moves to the left and a second later the new math is visible and the text move to the right again. In version 2.4 the new math just replaces the old one and the text around did not move. I use mainly the following code for updating a math-element:
HTML:

<span id="vEnd">\\({v_{\text {End}}=0}\\) \\(\frac{\text m}{\text s}\\)</span>

Javascript:

QUEUE.Push(function() {
math = MathJax.Hub.getAllJax("vEnd")[0];
});
  window.UpdateMath = function(TeX) {
    QUEUE.Push(["Text", math, "\\displaystyle{" + TeX + "}"]);
  }
....
  UpdateMath("v_{End}= 0");

Here is the working example using Mathjax 2.4: JSFiddle with Mathjax 2.4

And here is the same code using Mathjax 2.6: JSFiddle with Mathjax 2.6

Is it possible to achieve the same appearance like in 2.4 using version 2.6? How do I have to change tho code to prevent the math vanishing before the new math is ready?


Solution

  • Based on the comment of Peter (thanks!) I got to a blog by Jan Marthedal and he provides a solution here Grouping Typesets With MathJax.
    Short version: Just adding

     MathJax.Hub.processSectionDelay=0;
    

    to the MathJax configuration file does the trick.