Ask Your Question
1

Jupyter doesn't use the built-in MathJax

asked 2015-12-13 09:18:10 +0200

marmistrz gravatar image

updated 2015-12-13 15:11:53 +0200

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
2

answered 2015-12-13 15:06:19 +0200

tmonteil gravatar image

updated 2015-12-13 15:19:58 +0200

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

Comments

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 13:15:46 +0200 )edit
1

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 20:19:24 +0200 )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

Stats

Asked: 2015-12-13 09:18:10 +0200

Seen: 2,986 times

Last updated: Dec 13 '15