Mathjax: how to deal with this strange behavior?

喜夏-厌秋 提交于 2019-12-02 07:55:21
Peter Krautzberger

This is a common issue of mixing LaTeX-input with Markdown. From the MathJax documentation:

There cannot be HTML tags within the math delimiters (other than <br>) as TeX-formatted math does not include HTML tags.

And later:

Another source of difficulty is when MathJax is used in content management systems that have their own document processing commands that are interpreted before the HTML page is created. For example, many blogs and wikis use formats like Markdown to allow you to create the content of you pages. In Markdown, the underscore is used to indicate italics, and this usage will conflict with MathJax’s use of the underscore to indicate a subscript. Since Markdown is applied to the page first, it will convert your subscripts markers into italics (inserting tags into your mathematics, which will cause MathJax to ignore the math).

As other answers on SO (see the link at the top) point out, some markdown parsers are more aware of TeX-like syntax than others.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!