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
I just discovered that the notebook formats the same LaTeX input in different ways depending upon your choice of equation delimiter for LaTeX/mathjax which traditionally should not matter.
An example of this bug (plus a png of the correctly rendered incorrect rendering, since github apparently has its own bugs regarding displaying LaTeX/mathjax embedded in notebooks) can be found at https://gist.github.com/michaelpacer/2b627ffe8f10cde53926.
Put briefly, it's not supposed to matter whether you choose to delimit LaTeX formatted math with \(…\) and $…$ for inline equations or \[…\] or $$…$$ for displayed equations. Of course, because \ is used as an escape character we have to instead use\\(…\\)\\[…\\], which in theory is fine. However, because LaTeX formatted subscripts use the _ symbol, and that conflicts with markdown's interpretation of _…_ as an indicator of italics, it seems that notebook parses these two different ways of delimiting equations differently. If you use \\(…\\)\\[…\\] then you need to escape underscores \_ but that means that your LaTeX is now invalid outside of the notebook (as can be seen in the rendering of \_ when using $…$ and $$…$$ as the delimiters).
For now it seems safer to guide people to just use $…$ and $$…$$, since then at least it will interpret valid LaTeX properly (this has the unfortunate side-effect of conflicting with one of the LaTeX "deadly sins", but I think that's a less big issue than writing inaccurate LaTeX to get accurate formatting, imho).
I'm not sure if there is going to be an easy or even possible fix for this (since I know this kind of parsing is incredibly difficult to manage) but I was befuddled with why my properly formatted LaTeX was not being rendered at all, so I figured I'd bring it to people's attention.
The text was updated successfully, but these errors were encountered:
I just discovered that the notebook formats the same LaTeX input in different ways depending upon your choice of equation delimiter for LaTeX/mathjax which traditionally should not matter.
An example of this bug (plus a png of the correctly rendered incorrect rendering, since github apparently has its own bugs regarding displaying LaTeX/mathjax embedded in notebooks) can be found at https://gist.github.com/michaelpacer/2b627ffe8f10cde53926.
Put briefly, it's not supposed to matter whether you choose to delimit LaTeX formatted math with
\(…\)
and$…$
for inline equations or\[…\]
or$$…$$
for displayed equations. Of course, because\
is used as an escape character we have to instead use\\(…\\)
\\[…\\]
, which in theory is fine. However, because LaTeX formatted subscripts use the_
symbol, and that conflicts with markdown's interpretation of_…_
as an indicator of italics, it seems that notebook parses these two different ways of delimiting equations differently. If you use\\(…\\)
\\[…\\]
then you need to escape underscores\_
but that means that your LaTeX is now invalid outside of the notebook (as can be seen in the rendering of\_
when using$…$
and$$…$$
as the delimiters).For now it seems safer to guide people to just use
$…$
and$$…$$
, since then at least it will interpret valid LaTeX properly (this has the unfortunate side-effect of conflicting with one of the LaTeX "deadly sins", but I think that's a less big issue than writing inaccurate LaTeX to get accurate formatting, imho).I'm not sure if there is going to be an easy or even possible fix for this (since I know this kind of parsing is incredibly difficult to manage) but I was befuddled with why my properly formatted LaTeX was not being rendered at all, so I figured I'd bring it to people's attention.
The text was updated successfully, but these errors were encountered: