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

Support version 3 of MathJax and add config.typesetMath #6073

Merged
merged 47 commits into from
Mar 5, 2022
Merged

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Dec 23, 2021

TODOs:

  • dashboard test using npm run mathjax3
  • dashboard example using npm run mathjax3chtml when need to output chtml on the page as well as svg output for plotly graphs | thanks to @akhmerov
  • jasmine tests
  • add image test using mathjax-v3
  • documentation

@plotly/plotly_js

@akhmerov
Copy link

akhmerov commented Jan 3, 2022

Note that this won't work if the page mathjax3 uses a chtml output plugin and AFAIU most people prefer chtml. A workaround requires creating a separate virtual document for MathJax to use in typesetting, see #4563 (comment) for a prototype implementation.

EDIT: Also #4563 should be linked to this PR.

@akhmerov
Copy link

akhmerov commented Jan 5, 2022

Another regression is that compared to the v2 API this doesn't preserve the MathJax settings.

@archmoj
Copy link
Contributor Author

archmoj commented Jan 5, 2022

@akhmerov thanks very much for the notes.
Please see 4ba005f.
With your workaround now one could use npm run mathjax3chtml to test chtml with svg on the same page when _mockedV2API flag is set to true on the MathJax object.

@akhmerov
Copy link

akhmerov commented Jan 5, 2022

Thanks! Note that you don't actually need to mock v2 API to combine the outputs. I mocked the API to make it work with the current plotly implementation and combined with a second virtual document from another recipe. Instead you'll want to use just the recipe from mathjax/MathJax#2705 (comment).

@archmoj
Copy link
Contributor Author

archmoj commented Jan 5, 2022

Thanks! Note that you don't actually need to mock v2 API to combine the outputs. I mocked the API to make it work with the current plotly implementation and combined with a second virtual document from another recipe. Instead you'll want to use just the recipe from mathjax/MathJax#2705 (comment).

Good news. Let me fix that part then :)

@archmoj
Copy link
Contributor Author

archmoj commented Jan 6, 2022

@akhmerov the PR is ready for your review :)

@alexcjohnson
Copy link
Collaborator

Looks good! Only the question about inlineMath delimiters is blocking.

@akhmerov thanks for the reviews! Re: tex2svgPromise, I think we should merge with the current structure, but if performance becomes a concern it's good to know this is an option.

@archmoj
Copy link
Contributor Author

archmoj commented Mar 4, 2022

@alexcjohnson this PR is pretty much ready for the final review.
Thank you!

archmoj and others added 2 commits March 4, 2022 18:10
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Very nice work!

@archmoj archmoj changed the title Add support for MathJax version 3 Support version 3 of MathJax and add config.typesetMath Mar 5, 2022
@archmoj archmoj merged commit 3f6c0eb into master Mar 5, 2022
@archmoj archmoj deleted the mathjax-v3 branch March 5, 2022 01:35
kMutagene added a commit to plotly/Plotly.NET that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants