Question

I write an ipython notebook which correctly display the equations on my local machine. However, when I paste the ipynb file to Gist and use the nbviewer to view it, some math equation disappear. What causes the problem? Any way to fix it? The ipynb has the the following latex code in Markdown cell: \begin{align} F(P)=f_L(P)+f_G(P_{i,j})+f_{elec}(P,\phi_{ext},\phi_{int})\qquad (1) \end{align}

Was it helpful?

Solution

The problem you are facing is that nbviewer uses nbconvert to convert the ipynb to html. Nbconvert inturn uses pandoc to do the conversion and pandoc strips raw latex (the \align in your case) when converting markdown to html.
You can try to embed the raw LaTeX into $s to make pandoc aware, however not all constructs are supported and will be converted (see Github Issue for more details).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top