MathJax not loaded in plotly offline
See original GitHub issueplotly.offline.plot
fails (shows an unstyled plot after bailing out early due to errors) if latex is used since MathJax is not loaded in the default html. Short of getting fancy, it seems like plotly.offline.plot
might need a manual option to inject MathJax from a cdn into the head tag.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (6 by maintainers)
Top Results From Across the Web
Plotly library interferes with MathJax - Plotly Community Forum
I noticed, when included the plotly library in my HTML header, MathJax stopped working. All my LaTeX formulas appeared in raw source form ......
Read more >LaTeX-text does not work at all in plotly.offline?
I am using mac os x 10.14, python 3.7 and plotly 3.4.2 . Unfortunately plotly.offline.iplot doesn't display latex text on the chrome browser:...
Read more >Mathjax & LaTeX in dash - Plotly Community Forum
i need to ask how can i render latex using mathjax on callbacks. LaTeX doesn't work in Dash. LaTeX in dash not functioning....
Read more >LaTeX not functioning - plotly.js
In the offline subpackage, on init_notebook_mode() plotly.min.js is loaded using get_plotlyjs(). How do I edit the HTML created by ...
Read more >Latex does not work - 📊 Plotly Python
I installed Plotly 5.6.0 and Mathjax 3.2.0. I use a clean environment, with a Jupyter Notebook, with Visual Studio Code. What am I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
EDIT: Actually, this might not be the right place for this since the original issue did not explicitly specify Jupyter notebooks, might be more closely related to #105 or #444
This is not really an issue with plotly.py per-se, but is the result of issues upstream at plotly.js.
plotly.js does not encapsulate mathjax but instead relies on it being loaded globally and configured in a specific way. The problem is that there are multiple different output renderers for mathjax. Juypter globally loads mathjax with HTML output, but plotly.js requires SVG output. A quick and easy fix is just to change the output renderer for mathjax globally as this does not affect Juypter’s markdown rendering.
In order to address #445, mathjax should also be configured to set displayAlign = center since plotly.js explicitly sets this to left align. As far as I can tell in simple testing, the display alignment actually has no bearing on the output rendered by plotly.
Right now the code block I’m using to fix all these issues is:
This is actually the only reason that stops me using plotly for my publication graphics. No LaTeX in offline plotly is a serious issue, is there any news on this? #444 and #445 also addresses latex problems with plotly.