-
Notifications
You must be signed in to change notification settings - Fork 293
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
LaTeX not rendering in Plotly figures #8131
Comments
Thanks for the bug. Related issue #7801 |
Duplicate of #7801 |
re-opening this since it has a good explanation of the remaining issue - that latex doesn't render within plotly widgets |
Hi all, I have the same issue, but seeing exactly the same using Jupyter Lab as well. Did a little bit of digging, and found this plotly issue: plotly/plotly.py#515 Based on the discussion there, I've put together this workaround, that seems to work in VSCode as well: import plotly
from IPython.display import display, HTML
plotly.offline.init_notebook_mode()
display(HTML(
'<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG"></script>'
)) |
@tomas-mazak Thanks for the workaround! Would be great if this issue could be revisited so plotly LaTeX labels in VS Code work out of the box. Thanks! |
This package relies on MathJax within HTML working in order to render derivations, and this is broken in VSCode (the relevant bug is microsoft/vscode-jupyter#7801, but it seems to have been auto-closed without resolution; see also https://github.com/microsoft/vscode-jupyter/issues/12537 and maybe microsoft/vscode-jupyter#8131). It's possible that given time I'll be able to find a workaround (as I did for colab), but this looks if anything less trivial than colab -- since there's no browser tools etc., and google searches are much less promising. For now, directly flag the issue to users as a vscode-jupyter issue.
This fix the title but removes the rest of the labels for me. |
Environment data
Expected behaviour
Successfully have LaTeX render in Plotly figures when running on either Jupyter Notebook or JupyterLab from a Chrome browser (Version 95.0.4638.54). Tested this with the examples directly from Plotly: https://plotly.com/python/LaTeX/
Note: Using Chrome because there is a bug in Firefox that prevents proper rendering of Plotly figures with Mathjax (plotly/plotly.js#5993)
It looks like this may be related to this issue: #6802 since you can wrap the above figure in Plotly FigureWidget:
Actual behaviour
No LaTeX rendering when using the same Jupyter notebook in VS Code.
Steps to reproduce:
Simply run any of the above code in VS Code with the same environment as listed above.
The text was updated successfully, but these errors were encountered: