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

IPython Notebook's MathJax and Plot.ly's Mathjax conflict #360

Closed
FunkySayu opened this issue Nov 25, 2015 · 6 comments
Closed

IPython Notebook's MathJax and Plot.ly's Mathjax conflict #360

FunkySayu opened this issue Nov 25, 2015 · 6 comments
Milestone

Comments

@FunkySayu
Copy link

Hi.

It looks like the plot.ly's Mathjax configuration overwrite the Notebook configuration when you export this as HTML.

In rendered files, MathJax does not render the formula in dollars. In notebook with plotly, all formulas are on the left, which is quite annoying.

Is there any fast-solution to fix this ? My rendering must work on a random computer connected to internet if possible.

@FunkySayu
Copy link
Author

Here is a little test to understand what I am talking about

sample tests

@chriddyp
Copy link
Member

Hey @FunkySayu - Yikes! Thanks for reporting. There might be a quick-fix that embeds some javascript in a cell after you run init_notebook_mode that re-runs ipython's mathjax config, but I'm not entirely sure of the details right now.

@FunkySayu
Copy link
Author

I found a bad solution which is to edit the rendered file and modify the way plot.ly call mathjax in it. This suxx, but it works as a bad fix for what I am doing.

I just edit the modify the patern in MathJax.Hub.Config(\(.*\),MathJax.Hub.Configured by the original Notebook configuration :

MathJax.Hub.Config({displayAlign:"center",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[['$$','$$'],["\\[","\\]"]],processEscapes:true,processEnvironments:true},"HTML-CSS":{styles:{'.MathJax_Display':{"margin": 0}},linebreaks:{automatic:true}}})

This suxx, but as a hotfix for your documents, it can be cool.

@rgbkrk
Copy link
Contributor

rgbkrk commented Jan 7, 2016

This definitely makes me wonder about better encapsulation of outputs. Right now any javascript on the page can be affected by javascript from outputs.

@jonmmease jonmmease added this to the v3.4.0 milestone Sep 22, 2018
@jonmmease
Copy link
Contributor

The offline latex/MathJax issues are going to be resolved by plotly/plotly.js#2994 and #1169. Follow along if you're interested!

@jonmmease
Copy link
Contributor

Done in #1243 and will be released in version 3.4.0. When used in the notebook, plotly.js is now configured to not alter the global MathJax configuration.

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

No branches or pull requests

4 participants