Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx 7.2 breaks previously-working MathJax ?config= #11658

Closed
AA-Turner opened this issue Aug 30, 2023 · 1 comment · Fixed by #11659
Closed

Sphinx 7.2 breaks previously-working MathJax ?config= #11658

AA-Turner opened this issue Aug 30, 2023 · 1 comment · Fixed by #11659

Comments

@AA-Turner
Copy link
Member

AA-Turner commented Aug 30, 2023

Describe the bug

NumPy removed the ?config=scipy-mathjax from their mathjax_path in numpy/numpy#24516, as Sphinx (intentionally) errored with Local asset file paths must not contain query strings. This broke MathJax rendering, as reported in numpy/numpy#24534.

Sphinx provides the mathjax2_config and mathjax3_config variables to provide configuration, but these aren't used by NumPy.

MathJax 3 moved away from the ?config= variable (reference), but NumPy/SciPy still use MathJax 2.7.1, with their versions last updated in 2017.

I'm tempted to special-case MathJax.js here to avoid the error.

How to Reproduce

Download and unzip https://github.com/scipy/scipy-mathjax into _static/scipy-mathjax.

extensions = ['sphinx.ext.mathjax']
mathjax_path = "scipy-mathjax/MathJax.js?config=scipy-mathjax"
html_static_path = ['_static']
Maths
-----

Here's some maths:

.. math::
    T_n(x) = \\frac{z^n + z^{-n}}{2} \\\\
    z\\frac{dx}{dz} = \\frac{z - z^{-1}}{2}.

and some more:

.. math:: x = \\frac{z + z^{-1}}{2}.

Environment Information

Sphinx 7.2.4

Sphinx extensions

``['sphinx.ext.mathjax']``

Additional context

cc: @mattip -- do you know if there are any plans for NumPy/SciPy to update to MathJax 3?

A

@AA-Turner
Copy link
Member Author

I've proposed two potential fixes in #11659.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant