Skip to content

IPython notebook doesn't render latex equations (tries and fails) on github but they work well on local machine #9302

Open

Description

@ryu577

Hi,

I have a local ipython notebook that is able to render latex equations quite well. However, when I push this to git - https://github.com/ryu577/base/blob/master/numerical/python/DeepLearning/cs224dNLP/assignment1/wordvec_sentiment.ipynb

The equations are a mess (see section 3.1). I am using latex magic cells.

Activity

  1. takluyver commented on Mar 7, 2016

    @takluyver
    Member

    Anyone, is mathjax on Github a known issue, or should @ryu577 make a bug report to Github?

  2. takluyver commented on Mar 7, 2016

    @takluyver
    Member

    Also, it looks like you're putting the %%latex magic in a markdown cell. That has no effect - magics are only for code cells. When you do a code cell with %%latex, it produces the contents as output with a Latex mimetype.

  3. minrk commented on Mar 14, 2016

    @minrk
    Member

    This isn't GitHub, it is an actual nbconvert bug. The same thing happens when I export to HTML, which you can see on nbviewer.

    A side note: this notebook is not actually using %%latex cells. This is latex in markdown. The %%latex text in the markdown cells in this notebook has no effect, and is interpreted as plain text.

  4. minrk commented on Mar 14, 2016

    @minrk
    Member

    I tweaked the notebook a bit, and found that the lines are run together:

    prose
    $$
    \math
    $$
    prose

    The processing in nbconvert is not properly identifying the math blocks when run together like that (probably an imprecise regex). If you add blank lines surrounding the math blocks:

    prose
    
    $$
    \math
    $$
    
    more prose

    It should render correctly.

  5. modified the milestone: not ipython on May 12, 2016
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions