0

Using Sublime Text 3, I'm writing a Markdown document that includes math. The Markdown Preview package enables real-time rendering of the document in the browser (Firefox). So as I write, the changes are visible. For completeness, I'm using Ubuntu 12.04.

For smaller documents this works mostly fine, however, as the document grows (e.g. 500 lines) the real-time rendering starts to stop working. The raw text does get updated, however, the formatting and math do not get rendered. Instead, the Typesetting math indicator on lower-left of browser screen freezes. For example:

stuck typesetting example.

Looking at the browser console, I see the following message:

console message

where the first two lines are originally there (when things are correctly rendered for the first time) but the last message is when the Typesetting math is stuck.

The resolution is simply to reload the browser page and the Typsetting math: goes to 100% and all works. But then again after a few more edits the Typesetting math gets stuck again.

What might be causing this? This feature is very helpful when it works. But requiring reloading (which also takes you to the top of the page) really limits its utility.

Hamid
  • 1,355
  • 1
  • 11
  • 21
  • Do you get any messages in the browser console? It looks like MathJax may have crashed, and you may find a useful message there. You might also try the beta version from `http://beta.mathjax.org/mathjax/latest/MathJax.js` and see if that works better. The v2.4 release is imminent (probably this weekend), but you can try that sight now. – Davide Cervone Jun 12 '14 at 21:46
  • @DavideCervone I've updated with question with a snapshot of the console. Indeed, there is an error message. Note: the picture is larger than shown in post (right-click and choose 'view image'). Does that narrow the problem? – Hamid Jun 13 '14 at 13:45
  • Can you try using the unpacked version of MathJax, so that the line number in the error message is accurate? (Use `mathjax/latest/unpacked/MathJax.js`.) It is strange that this sometimes works and sometimes doesn't. You might also try typing `MtahJax.Message.Log()` in the console window and see if anything indicates a file failed to load. – Davide Cervone Jun 13 '14 at 19:36
  • @DavideCervone I used the unpacked version of the latest release (2.3.9) and the too much recursion error pointed to `MathJax.js:235`. However, updating to the current master-version of MathJax solved the problem. See below. – Hamid Jun 13 '14 at 23:56
  • glad that v2.4 has resolved the problem for you. Still not sure what caused it before, but line 235 has changed in v2.4, so I'm glad that helped. – Davide Cervone Jun 14 '14 at 12:26

1 Answers1

0

Upgrading the MathJax built into the Sublime Text 3 Markdown Preview package resolved the problem. Namely, upgrading to the latest release of v2.4 from github.

In Linux, this can be done by downloading the latest MathJax from github. Then navigate to the following location:

~/.config/sublime-text-3/Packages/OmniMarkupPreviewer/public/

There you find the built in mathjax folder. Rename or remove it and paste in the newest release downloaded from github (changing folder name to mathjax).

Hamid
  • 1,355
  • 1
  • 11
  • 21