spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
450 stars 130 forks source link

outdated mathjax path in built html #806

Closed fkuehlein closed 1 month ago

fkuehlein commented 1 month ago

Hi!

When I build my docs using nbsphinx and upload them on our website, LaTeX equations fail to be displayed. I noticed that the html files contain a

<script defer="defer" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

which might cause the problem as on one hand, cdn.mathjax.org has long been retired and on the other, browsers might refuse to load the http:// resource.

I tried setting the mathjax path by adding

mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"

to my conf.py, but it doesn't change anything.

Please excuse that I haven't managed to provide a minimal example to reproduce this yet. Also not entirely sure if this is a problem with nbsphinx or sphinx itself. All the more, any help is greatly appreciated :-)


I use:

mgeier commented 1 month ago

Thanks for reporting this!

nbsphinx does some manipulations with the MathJax settings, but it shouldn't touch the URL/path.

Can you please try to create a minimal Sphinx example without nbsphinx and see what happens?

If the problem still appears without nbsphinx, please report this to https://github.com/sphinx-doc/sphinx/issues.

fkuehlein commented 1 month ago

Ooops, I just found that the mathjax_path was set to the outdated URL somewhere else in the conf.py where I hadn't found it. Just removing that resolved my problem ... my bad, thank you anyway for the quick reply!