Mathjax Not Rendering In Sphinx
I have a documentation set in Sphinx reST. I've included sphinx.ext.mathjax in conf.py, and included the line 'mathjax_path = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js''. I
Solution 1:
I had the same problem. I solved it by setting the mathjax_path variable (on the conf.py file) as:
mathjax_path="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
Solution 2:
You still need to declare the extention to sphinx-doc in the conf.py file.
On the top of the conf.py file, soon after import sys, os
under "general configuration" you will see the comments notes about including extentions. For mathjax you need to add it to the listed extension:
# Add any Sphinx extension module names here, as strings. They can be extensions# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig']
(I've just copy pasted my own, you may have other or no extentions listed there at the moment).
That in combination with the mathjax_path that you have already set should work.
Solution 3:
Here there are some options:
- You must install libjs-mathjax:
apt-get install libjs-mathjax
- You should put a "r" prefixing documentations lines:
r"""
:math:`a^2 + b^2 = c^2`
"""
- You must avoid spaces in the equation (with "r" prefix you avoid this solution)
"""
:math:`a^2+b^2=c^2`
"""
- You could mix all the previous solution
r"""
:math:`a^2+b^2=c^2`
"""
Post a Comment for "Mathjax Not Rendering In Sphinx"