You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the HTML output of a notebook, there is no spacing between a Latex equation and the line above.
In notebook (correct):
In HTML output (incorrect):
A quick look at the source shows that this is because the MathJax span and div are not wrapped in a <p> in the generated HTML, as in the actual notebook.
The text was updated successfully, but these errors were encountered:
This is presumably a difference between mistune and marked's markdown rendering. We may be able to deal with it, though, in our custom handling of math in mistune.
This is definitely an nbconvert issue, though, and not a notebook one.
Had the same issue today. Solved it conveniently by modifying the MathJax template file mathjax.tpl (should be located in python3.5/site-packages/nbconvert/templates/html/. Just look for the following snippet:
and change {"margin": 0} to {"margin-top": "10px", "margin-bottom": "10px"}.
(FYI: {"margin": "10px"} would also increase the margin at the sides (left and right) which can bring you a horizontal scrolling bar in the HTML if your equations are too wide.
I really wonder why 0 is the default here... It looks really ugly and un-LaTeX-ish...
This is a problem for me, too. It's easy to add a space above an equation in the notebook by inserting a blank line, but when converting to latex this becomes a paragraph break, which is often undesired.
In the HTML output of a notebook, there is no spacing between a Latex equation and the line above.
In notebook (correct):

In HTML output (incorrect):

A quick look at the source shows that this is because the MathJax span and div are not wrapped in a
<p>
in the generated HTML, as in the actual notebook.The text was updated successfully, but these errors were encountered: