-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline math not rendered correctly #3103
Comments
This is due to an interaction between Markdown and LaTeX notation. In particular, the underscore,
in your output, which shows that the first and third underscores are being matched as the delimiters for italics, and have been removed by the Jekyll markdown engine and replaced by For your no. 3, it looks like Jekyll is interpreting the All of these problems are due to the fact that Markdown engine you are using in Jekyll doesn't know anything about mathematical notation and is trying to interpret the LaTeX as Markdown commands. Since Markdown is being run on the server to produce the HMTL page that is sent to the browser, and MathJax runs in the browser, the damage to the mathematics is done long before MathJax sees it, and there is nothing MathJax can do about that. Typora uses a markdown engine that knows about mathematical notation, and is able to protect the mathematics from being processed as Markdown, and that is why the results work properly for you there. This is not about the consistency of MathJax, but of the consistency of the Markdown processors in use. They are not the same, and don't handle the mathematics the same. Here are some articles about using MathJax in Jekyll that might help you get a more consistent experience. I have not tested any of them. |
❤️❤️❤️ Thanks so much for your reply. Now I have direction on what to do next, and I'll post a possible fix after testing. |
As explained by @dpvc, the problem I had was due to the markdown engine kramdown. After reading the kramdown doc from here and doing some experiments, solutions for Jekyll with kramdown are:
Although I'm pretty confused why kramdown won't use the standard markdown syntax 💔 and I can't have consistent output with Typora or VSCode unless I can find a way to configure their markdown engine accordingly. |
Issue Summary
I have encountered several inline math rendering problems when using a Jekyll theme jekyll-theme-chirpy. I've posted an issue in that repo but the author thinks it's not relevant to that repo, so I'm trying to find some help here.
Steps to Reproduce
Here are several examples where my math equations were not rendered correctly.
The following markdown file summarizes the problems I encountered so far. It can be found here
This is what it looks like on the GitHub page, and a live version can be found here
(Strange behavior with No.1, can't render with No.2)
(Escape
|
with\
is working, but{
and}
need to be escaped with\\
)This is what it looks like on Typora (which also uses MathJax for rendering, check here),
(No.1 and No.2 have no problem with Typora)
(Typora requires escaping
{
and}
but not|
)Technical details:
(The MathJax configuration was copied from the
inspect
of this GitHub page)I am using the following MathJax configuration:
and loading MathJax via
Summary and Questions
I'm not sure how to check the MathJax version that is being used on Typora, so I can't provide any useful information on that.
My questions are:
Thanks!
The text was updated successfully, but these errors were encountered: