Skip to content

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

Description

@FunkySayu

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.

Activity

  1. FunkySayu commented on Nov 25, 2015

    @FunkySayu
    Author

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

    sample tests

  2. chriddyp commented on Nov 25, 2015

    @chriddyp
    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.

  3. FunkySayu commented on Nov 25, 2015

    @FunkySayu
    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.

  4. rgbkrk commented on Jan 7, 2016

    @rgbkrk
    Contributor

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

  5. added this to the v3.4.0 milestone on Sep 22, 2018
  6. jonmmease commented on Sep 22, 2018

    @jonmmease
    Contributor

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

  7. jonmmease commented on Oct 30, 2018

    @jonmmease
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions