Ask Your Question

Jupyter doesn't use the built-in MathJax

asked 2015-12-13 02:18:10 -0600

marmistrz gravatar image

updated 2015-12-13 08:11:53 -0600

tmonteil gravatar image

I have two copies of MathJax. One in /usr/lib/sagemath/local/share/mathjax, another in /usr/share/javascript/mathjax.

I open up the jupyter notebook: sage -n jupyter. I open a notebook and what I get is

Math/LaTeX rendering will be disabled.

If you have administrative access to the notebook server and a working internet connection, you can install a local copy of MathJax for offline use with the following command on the server at a Python or Jupyter prompt:

from Jupyter.external import mathjax; mathjax.install_mathjax()

But I don't want a third (sic!) copy of MathJax on my computer! How can I make Jupyter use the existing ones?

I'm using Linux Mint 17.2, used the sagemath-upstream-binary package from the PPA.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-13 08:06:19 -0600

tmonteil gravatar image

updated 2015-12-13 08:19:58 -0600

According to this log you posted on this question, you have a correct mathjax install, but it seems that jupyter is not pointing to it. Can you try the following:

sudo mkdir -p /usr/lib/sagemath/local/share/jupyter/nbextensions
cd /usr/lib/sagemath/local/share/jupyter/nbextensions
sudo ln -s ../../mathjax mathjax

While you are at it, you can also let jupyter point to jsmol as follows:

sudo ln -s ../../jsmol jsmol

However, it seems that you will not have a /usr/lib/sagemath/local/share/jupyter/kernels directory, so i do not know which problem you might encounter then, let us see.

edit flag offensive delete link more


Before your answer I was playing around a while, so I reinstalled Sage once again (the fourth time) magically, Jupyter works now...

marmistrz gravatar imagemarmistrz ( 2015-12-20 06:15:46 -0600 )edit

Ok, I noticed a weird thing. I have my .ipynb notebook in a directory ~/proj/sage. If I launch sage from within this directory, MathJax is detected properly. But if I launch sage from my home directory and then navigate to the notebook file and select it, Jupyter can't find MathJax. Any ideas?

marmistrz gravatar imagemarmistrz ( 2015-12-23 13:19:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-13 02:18:10 -0600

Seen: 1,064 times

Last updated: Dec 13 '15