I'm using IPython notebook on OSX Lion. I have installed node.js and my IPython is version 2.2.0. When I try to use the print preview feature, markdown cells with Latex content don't render the latex. Instead the markdown is rendered without any formatting.
Here is the error message in the console:
WARNING:tornado.access:404 GET /nbconvert/html/custom.css (::1) 1.29ms referer=http://localhost:8888/nbconvert/html/Test%20Notebook.ipynb?download=false
There was apparently an issue with this earlier. But it has since been closed. I just downloaded the latest version of node.js.
My version is:
v0.10.31
Any ideas?
I will also add that I had a similar problem on a Ubuntu 12.04 setup; thus, I don't think this issue is isolated.
The answer is discovered here in a commit to the master branch of IPython.
This fix though isn't in Anaconda. I had to manually download the source from GitHub and put the fix in myself.
Edit: In response to the comment below, here is a more detailed description of the fix:
The 2.1.0 release of IPython contains a file
/IPython/nbconvert/templates/html/mathjax.tpl
which has a script element that points to an unavailable resource:
https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML
The IPython source on GitHub though has the updated, correct resource:
https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML
Thus, I downloaded the IPython tar, replace the faulty src attribute in the mathjax.tpl file, then run
python setup.py install
The following pertains to an Anaconda distribution in Mac OS:
> ipython --version
2.0.0
> which ipython
/Users/<username>/anaconda/bin/ipython
> cd /Users/<username>/anaconda
> find . -name "mathjax.tpl"
./lib/python2.7/site-packages/IPython/nbconvert/templates/html/mathjax.tpl
./pkgs/ipython-2.0.0-py27_0/lib/python2.7/site-packages/IPython/nbconvert/templates/html/mathjax.tpl
> grep http ./lib/python2.7/site-packages/IPython/nbconvert/templates/html/mathjax.tpl
<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
Edit that tpl
file with a text editor, and replace the URL with the following one:
https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML
> grep http ./lib/python2.7/site-packages/IPython/nbconvert/templates/html/mathjax.tpl
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
That ought to fix it for now.