JupyterBook で 数式に \\( \\), \\[ \\] を使う方法

Jupyter Book で数式に \\[, \\], \\(, \\) を使うには、 _config.yml に次の記述を追加します。

sphinx:
  config:
    mathjax_path: https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
    mathjax_config:
      tex2jax:
        inlineMath: [["$","$"], ["\\(", "\\)"]]
        displayMath: [["$$","$$"], ["\\[", "\\]"]]
    myst_update_mathjax: false

すると html ビルド のときには数式が表示されるようになります。 (ほかのビルドでは試していません。)

参考: https://github.com/jupyter-book/jupyter-book/issues/1212

いいなと思ったら応援しよう!