jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.69k stars 558 forks source link

issues with latex < #504

Open minrk opened 7 years ago

minrk commented 7 years ago

reported at https://github.com/jupyter/nbviewer/issues/647 by @hzzyyy, with handy notebook for reproducing the bugs:

https://nbviewer.jupyter.org/github/hzzyyy/try/blob/master/latex%20parenthesis%20bug.ipynb

mpacer commented 7 years ago

So it looks like we might need to treat < and possibly > as a special case, using a character entities in html (&lt; and &gt;).

But I can't figure out why it doesn't have the parsing error if there's a space before the <.

mpacer commented 7 years ago

Also, nbconvert is still using 4.3.0 instead of 5.0.0? Is there a reason?

mpacer commented 7 years ago

This appears to be a well known issue with MathJax, where having no spaces around < and > is explicitly discouraged in the MathJax docs.

So to support this is possible, but then we're explicitly flouting that recommendation and implicitly encouraging people to use nonstandard conventions for writing math in MathJax (as opposed to pure LaTeX).

mpacer commented 7 years ago

Also, technically for pandoc output it should not accept some of these markdown cells as successfully specified math delimiters:

from pandoc math docs(emphasis added)

The opening $ must have a non-space character immediately to its right, while the closing $ must have a non-space character immediately to its left, and must not be followed immediately by a digit.

zasdfgbnm commented 7 years ago

https://github.com/jupyter/nbconvert/pull/514