Reverting math rendering back to HTML CSS

I was using Julia on JupyterLab when I ran across a weird problem. I had quite a lot of huge equations in my outputs, and I changed my math renderer (right click → render Math as) to the different options available until I switched to one of the options that just displays the output as plain LaTeX code. Since its a plain LaTeX code (and possibly is being interpreted as not math by the system), right clicking on this doesn’t lead to the math rendering option anymore, meaning that I am basically stuck with every output equation being displayed as LaTeX code (the same thing happens in other different files that I am running; so the change has somehow become global). This is not ideal for me, so I would like to change it back to HTML-CSS again.

I checked up the issue on the net but I found nothing that helps me (most of the results were too complicated for me to understand; also, I did not find this specific issue anywhere else). I tried looking into my anaconda3 folder and changing stuff, but couldn’t really locate the folder which configures math rendering. It would be an immense help if someone could tell me how to get things back to normal. Thanks in advance!

Cross-posted here without indication of cross-posting.

Please if you cross-post the same post the same content, link at all sites each post. It helps reduce multiple people giving your the same advice and also helps everyone find the solution months from now.

I just somehow activated what you are seeing, too. Sadly, I cannot tell you how I stumbled into setting it. I was working in JupyterLab Version 3.4.8.
First I was getting it working well and then I somehow right-clicked weirdly and Latex all became represented by text after that. And I for a bit I was stuck because as you point out, now the MathJax menu is gone.
I was able to close that one and open another session on MyBinder and get it back.
For example, maybe close out your browser window and try going to launch via here (under ’ JupyterLab + Binder’ here. There I was able to toggle back on HTML-CSS under ‘Math Settings’ > ‘Math Renderer’. After that I closed the session and when I reopened another one, I was able to right-click specifically on the text of a latex equation, such as $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ and toggle the settings again. Maybe you can try that? And then re-open the one where it wasn’t working to try again.

1 Like

Thanks for the response; I restarted my system again and this time the previous settings did display the equation is proper math notation (no LaTeX; also, I had changed to preview HTML from HTML CSS). Right click worked fine, so I reverted it back to HTML CSS. Not sure what happened.

I think it is a setting that can get cached into the browser for a bit. I, too, am not sure how I even triggered it but fussing around with it quite a bit, I was able to trigger it getting stuck like you described.

I’m glad though it appears easy to chase out or resolve with a little time and/or reinitiating of things.

I realize this thread is pretty old, and now semi-obsolete for default jupyter installs, but people may still run into this (and it’s really frustrating when you do). So, here’s the answer for posterity: in MathJax 2 if you search for and clear cookies with the name mjx in them it should reset MathJax’s renderer choice (and other options). Specifically, I’m seeing mjx.menu on a current install with the mathjax2 extension, but my notes suggest it has been named slightly differently in the past.

Unfortunately over the years browsers have made it somewhat harder to delete cookies this selectively, but for example in firefox, you can do this in the developer tools under “Storage”. Not sure about other browsers, I didn’t immediately see a way to do this in chrome. (If this is for a local install, probably resetting all cookies on localhost isn’t going to be too terrible.)

(Also: MathJax 3 appears to use localStorage instead of a cookie to save renderer info; but current jupyter doesn’t (yet?) let you switch renderers, so this is not so relevant.)

1 Like