First time here? Check out the FAQ!

Ask Your Question
1

Jupyter doesn't use the built-in MathJax

asked 9 years ago

marmistrz gravatar image

updated 9 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 9 years ago

tmonteil gravatar image

updated 9 years ago

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.

Preview: (hide)
link

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 ( 9 years ago )
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 ( 9 years ago )

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: 9 years ago

Seen: 3,158 times

Last updated: Dec 13 '15