eflanigan00
eflanigan00

Reputation: 491

sphinx mathjax offline with anaconda distribution

I'm trying to run sphinx offline with mathjax. I'm using the anaconda distribution which runs ipython notebook with latex (mathjax I think) just fine.

I have sphinx.ext.mathjax in the extensions and everything works fine when I'm online. When I go offline the latex equations don't render.

I've added the following to try to get mathjax to use the one I think ipython notebook is using:

mathjax_path = 'C:\ProgramData\Anaconda3\Lib\site-packages\notebook\static\components\MathJax\MathJax.js'

I checked the path and it has a config/TeX-AMS-MML_HTMLorMML-full.js so I also tried:

mathjax_path = 'C:\ProgramData\Anaconda3\Lib\site-packages\notebook\static\components\MathJax\MathJax.js?config=TeX-AMS-MML_HTMLorMML-full'

Anyone have any idea how to get this to work from the mathjax provided in Anaconda?

===================================================================

Followup:

The following works for mathjax_path

mathjax_path = 'file://C:/ProgramData/Anaconda3/Lib/site-packages/notebook/static/components/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full.js'

Now mathjax doesn't render bmatrix correctly. The following only puts parenthesis by def, I need the parensthesis to extend the height of the full matrix.

.. math::

   \mathbf{A_{X}} =
   \begin{bmatrix}
   abc \\
   def \\
   g h i \\
   \end{bmatrix}

Upvotes: 0

Views: 444

Answers (1)

eflanigan00
eflanigan00

Reputation: 491

Setting mathjax_path to a file (default.js configuration) works Unfortunately the current anaconda package doesn't fully support rendering in sphinx. I downloaded mathjax and pointed there:

mathjax_path = 'file://C:/MathJax/MathJax.js?config=default.js'

https://github.com/sphinx-doc/sphinx/issues/4309

https://github.com/ContinuumIO/anaconda-issues/issues/8424

Upvotes: 0

Related Questions