Mathjax:如何处理这种奇怪的行为? [英] Mathjax: how to deal with this strange behavior?

查看:101
本文介绍了Mathjax:如何处理这种奇怪的行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using the markdown editor and I have loaded Mathjax in all pages of my website.

我已经意识到这一行乳胶效果很好:

I have realized that this line of latex works well:

$(u_1)$

但是,这不起作用(基本上乳胶不起作用):

However, this one does not work (basically latex does not work):

$(u_1,u_2)$

为了使这项工作有效,我必须编写如下内容:

In order to make this work, I have to write something like this:

$(u\_1,u\_2)$

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

I have a similar problem here. This does not work:

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

但这可行:

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

推荐答案

这是常见问题 a>将LaTeX输入与Markdown混合. 摘自MathJax文档 :

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

在数学定界符内(<br>除外)不能有HTML标记,因为TeX格式的数学不包括HTML标记.

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

后来:

另一个困难来源是在内容管理系统中使用MathJax时,这些内容管理系统具有自己的文档处理命令,这些命令在创建HTML页面之前会被解释.例如,许多博客和Wiki使用Markdown之类的格式来允许您创建页面内容.在Markdown中,下划线用于表示斜体,这种用法将与MathJax的下划线用于表示下标相冲突.由于Markdown首先应用于页面,它将下标标记转换为斜体(将标记插入数学中,这将导致MathJax忽略数学).

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上的其他答案(请参阅顶部的链接)指出,某些降价解析器比其他解析器更了解类似TeX的语法.

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.

这篇关于Mathjax:如何处理这种奇怪的行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆