Mathjax:如何处理这种奇怪的行为?

Mathjax: how to deal with this strange behavior?

我正在使用 markdown 编辑器,并且在我网站的所有页面中都加载了 Mathjax。

我发现这行乳胶效果很好:

$(u_1)$

但是这个不行(基本上latex不行):

$(u_1,u_2)$

为了完成这项工作,我必须写这样的东西:

$(u\_1,u\_2)$

我这里也有类似的问题。这不起作用:

$$M=\left(\begin{array}{cc}
a & b \
c & d \
\end{array}\right)$$

但这行得通:

$$M=\left(\begin{array}{cc}
a & b \\
c & d \\
\end{array}\right)$$

这是 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.

以后:

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).

正如关于 SO 的其他答案(参见顶部的 link)所指出的,一些降价解析器比其他解析器更了解类似 TeX 的语法。