通过在 Rmd 文档的开头添加以下语句,我可以在 RStudio 中的 R markdown 文档中自动编号 mathjax 方程:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "all",
formatNumber: function (n) {return '9.'+n}
}
}
});
</script>
以下也适用,但不适用于 $$..$$ 方程,只有用\begin{equation}..\end{equation} 括起来的方程。
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "AMS",
formatNumber: function (n) {return '9.'+n}
}
}
});
</script>
我可以使用
\tag{mylabel}
将编号更改为静态标签在 $$..$$ 中,自动编号将跳过该等式。不幸的是,跳过没有标签添加
\tag{}
结果方程仍然标有 ()。有谁知道如何摆脱空括号?
有没有人知道一个简单的语句可以添加到 mathjax 脚本语句或 Rmd 文档中的 $$..$$ 方程中,它将自动编号的节号添加到方程编号?
来自这里的大部分信息:
http://mathjax.readthedocs.org/en/latest/tex.html#automatic-equation-numbering
谢谢
最佳答案
您可以使用 \notag
或 \nonumber
在表达式上以防止对其应用自动标记。因此,如果您使用的是 autoNuber: "all"
, 你可以做
$$E=mc^2\nonumber$$
得到没有数字的方程。
关于r - RStudio 中 R markdown 文档中的自动编号方程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35026405/