Skip to content

Change default MathJax URL to v3 rather than v2#469

Merged
emilykl merged 4 commits into
mainfrom
default-mathjax-v3
Jul 22, 2026
Merged

Change default MathJax URL to v3 rather than v2#469
emilykl merged 4 commits into
mainfrom
default-mathjax-v3

Conversation

@emilykl

@emilykl emilykl commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

The next major Plotly.js release will drop MathJax v2 support, so before releasing that version in Plotly.py we will need to update Kaleido to use MathJax v3 (or v4) rather than v2 by default, so that everything works smoothly together.

I've made the change to v3 in this PR, but v4 would also be reasonable IMO.

@emilykl emilykl self-assigned this Jul 16, 2026
@emilykl
emilykl requested review from ayjayt and camdecoster July 21, 2026 18:41
@camdecoster

Copy link
Copy Markdown
Contributor

Could you provide some info about the sections of code that have been removed? Were those only required for MathJax v2?

@emilykl

emilykl commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

@camdecoster Sure. These two are definitely no longer needed:

  • '?config=TeX-AMS-MML_SVG' was the old way of specifying a specific configuration when loading MathJax; starting with v3, you just link directly to the specific *.js file that you want (tex-svg.min.js in our case).
  • window.PlotlyConfig = {MathJaxConfig: 'local'} was an old pattern that plotly.js used for configuring the way the library uses MathJax (see an example here), but MathJaxConfig is no longer referenced in the codebase

On the other hand, MathJax.Hub.Config no longer exists starting with MathJax v3, but there's a new API for setting config options and this line should probably be ported over to the new API. I'll make that change.

@emilykl

emilykl commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

@camdecoster Update on the config options: I added the snippet

        <script>MathJax = {svg: {blacker: 0}};</script>

to the page template, which would be the MathJax v3 equivalent of the v2 config I removed, but I see zero visible difference in the resulting image, so I'm inclined to just leave it out.

camdecoster
camdecoster previously approved these changes Jul 22, 2026
@emilykl
emilykl merged commit 73732d4 into main Jul 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants