How do I configure mathjax for iPython notebooks?

后端 未结 5 1007
借酒劲吻你
借酒劲吻你 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:28

    A simple test to make sure that you're getting the configuration correct is to change preferredFont: "TeX" to scale: 200. Then save and reload a notebook. The math should be obviously way bigger than before. So assuming that worked, it means your config.js is doing what it needs to.

    Now, more to the point, try adding another line so that your configuration looks like

    MathJax.Hub.Config({
      "HTML-CSS": {
        availableFonts: ["TeX"],
        preferredFont: "TeX",
      }
    });
    

    Don't forget to fully refresh the notebook page after you've saved that. This overrides (what I'm guessing is) the default value of that availableFonts variable, which would allow STIX if mathjax can't find TeX. I'm not sure why it seems to ignore the preferred font, but this seems more like a mathjax issue than an ipython issue.

    So now, if it still isn't in TeX font (which mathjax seems to call MathJax_Math-Italic.otf, or similar), I would guess that mathjax just can't find that font, and may have fallen back on something else. If that is the case, there's something messed up about your mathjax installation.

提交回复
热议问题