mathb
mathb copied to clipboard
Refuses to render sometimes with valid LaTeX
http://mathb.in/39606
Looks like it's an issue with subscripts after parentheses? Came across the exact same issue. Only works with the first one in a section, any subsequent breaks it.
http://mathb.in/50948
Seems to be caused by Markdown converting the underscores into <em> tags, since the closing parenthesis is seen as a word boundary.
Not sure of an easy way to fix this.
The underscores should be escaped with a backslash so that Markdown does not convert them to <em>
tags.
Example: http://mathb.in/51078
$$
(Foo)\_{a} \\
(Foo)\_{a}
$$
But then they're literally underscores instead of being rendered as subscripts On Jan 28, 2016 12:36 PM, "Susam Pal" [email protected] wrote:
The underscores should be escaped with a backslash so that Markdown does not convert them to tags.
Example: http://mathb.in/51078
$$ (Foo){a}
(Foo){a} $$— Reply to this email directly or view it on GitHub https://github.com/susam/mathb/issues/8#issuecomment-176296329.
I overlooked the fact that the subscripts were not rendered. My bad. Thanks for explaining the issue.
Part of the problem is caused by this line in the JavaScript code (https://github.com/susam/mathb/blob/0433c40cdc5f97dd8e7f9861dcf6b512baa5bcd9/scripts/mathb.js#L229) that tries to preserve the backslashes as literal backslashes. Due to this code, the backslashes in the input no longer function in escape sequences. When I wrote this, I thought it was a good idea. But it seems like a problem now.
By the way, with a quick test on http://math.stackexchange.com/questions/ask, I see that the code at http://mathb.in/51078 that is breaking on MathB.in seems to be rendering fine on Math StackExchange. I'll have to see how they are doing this right.
It will take me a while to get back to this project. So in the meantime, any pull requests are very welcome.
I wonder if this is related:
Doesn't work:
\[
\dot{\varepsilon}_{13} n_{3}
\]
Works:
\[
\dot\varepsilon_{13} n_{3}
\]
Works:
\[
\dot{\varepsilon}_{13} n_3
\]
It appears that }_something_{
will render something
as italic instead of picking up subscripts in math mode.
This is no longer be an issue. MathB.in now uses the TeXMe parser which handles a mix of Markdown (GFM) and LaTeX (MathJax) code robustly.