-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Embedding interactive Plotly.js plots in Sphinx disables LaTeX rendering via MathJax #2403
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
Comments
Until this issue is resolved a work-around is to embed the div element into an empty HTML site
and to include this file as an
This way both MathJax profiles do not interfere with each other. |
This has been addressed in plotly.js 1.42 by #2994. You'll need to set See https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-support-mathjax for more information. Thanks! |
Works like a charm. Thanks! |
First of all, thanks for the great set of Plotly libraries!
I would like to embed plots into a Sphinx documentation which makes use of LaTeX via its sphinx.ext.mathjax extension. I do not want to embed the plots as images like jpg in order to keep them interactive.
My strategy to achieve that is to
_static
folder,plotly.offline.plot
with theinclude_plotlyjs
flag set to False using the.. raw:: html
directive,script
reference to Plotly.js into each HTML file's head element using the following code snipped in Sphinx'_templates
folder:With that strategy the generated html file include the following
script
tags:<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7./MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
,<script type="text/javascript" src="_static/plotly-latest.min.js"></script>
.While Plotly's plots are shown as expected, LaTeX embeddings using the
:math:
directive do not render anymore.TeX-AMS-MML_HTMLorMML
profile.Is there any way to use the same MathJax profile in Plotly.js as in Sphinx?
The text was updated successfully, but these errors were encountered: