Skip to content

Include Mathjax.js on per-page basis #6241

@jabl

Description

@jabl

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

Currently in a documentation project we have many pages, of which only a very small subset needs mathjax. However, enabling the sphinx.ext.mathjax extension causes mathjax.js to be included in every page. This is a bit unfortunate since mathjax is huge.

Describe the solution you'd like

Mathjax.js is included in only the pages which need it, and not every page.

Describe alternatives you've considered

Current system works, but makes all pages that don't need mathjax bigger and slower than they need to.

Additional context

I mentioned this as a comment in #5497 , where it was suggested that I open a new issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensions:mathematicsThe `sphinx.ext.imgmath`, `sphinx.ext.jsmath`, or `sphinx.ext.mathjax` extensionstype:enhancementenhance or introduce a new feature

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions