Skip to content

Add option to choose mathjax load method #9864

@raphaeltimbo

Description

@raphaeltimbo

Is your feature request related to a problem? Please describe.

Plotly uses mathjax v2, so to render graphs using this package we have to make sphinx also use mathjax v2 with (see #9563):

mathjax_path = (
    "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
)

The problem in Sphinx 4.3 is that now, as discussed in #9450, mathjax is loaded with the “defer” option instead of “async”, and this breaks plotly rendering.

Describe the solution you'd like
In the mathjax2_config dict, it would be nice to have an option "load_method" in which we would be able to choose "async" or "defer"

Additional context
Error that shows up in the console:
image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensions:mathematicsThe `sphinx.ext.imgmath`, `sphinx.ext.jsmath`, or `sphinx.ext.mathjax` extensionsmarkuptype:bug

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions