How do I configure mathjax for iPython notebooks?

后端 未结 5 1045
借酒劲吻你
借酒劲吻你 2021-02-06 05:16

I\'m trying to find a way for mathjax to not use STIX fonts for math in my iPython notebook. Instead, I\'d much rather have it use the \'TeX\' fonts. According to the documentat

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 05:26

    Jupyter ships with its own (smaller) version of MathJax. This is why it is not able to find the (Computer Modern) 'TeX' font -- there only is the STIX font.

    To fix this, I was able to do the following:

    1. Download MathJax 2.7 and copy the jax directory.
    2. Replace Jupyter's jax directory with the copied one:
    • For the default environment: ~/anaconda3/lib/python3.7/site-packages/notebook/static/components/MathJax/jax
    • For a different environment: ~/anaconda3/envs//lib/python3.7/site-packages/notebook/static/components/MathJax/jax
    1. Restart Jupyter, right-click on a piece of math and switch the 'Math Renderer' to SVG.

    (Adjust python version in path if yours is not 3.7; If you are using miniconda the path should be ~/opt/miniconda3/lib/...)

提交回复
热议问题