javascript - 为什么 \\ 在 mathjax 中不显示换行符?
问题描述
我的印象是你应该使用\\
mathjax 换行,但是我无法让它工作。我在这里做错了什么?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<p><span class="math display">\[
1 x x^2 \\
1 y y^2 \\
1 z z^2 \\
\]</span></p>
</div>
</body>
</html>
我希望看到 3 行,但我明白了:
其他 stackoverflow 帖子声称\\
应该可以工作,例如:https ://math.meta.stackexchange.com/questions/11720/new-line-within-mathjax
解决方案
正如上面评论中所指出的,这在 mathjax 3.0 中不起作用。
作为一种解决方法,我发现以下 markdown 可以使用 pandoc 正确转换为 HTML:
you can use this:
\begin{equation}
\displaylines{I = \int \rho R^{2} dV \\ Y = 1}
\end{equation}
or alternatively an align block, e.g:
$$
\begin{alignat}{2}
I & = \int \rho R^{2} dV & + P \\
Y & = 1 & + x
\end{alignat}
$$
和:pandoc --from=markdown --to=html5 --mathjax="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" -s file.md -o file.html
推荐阅读
- java - 在 kotlin 中使用 java 方法的可能性
- reactjs - React - 将电子邮件验证添加到空输入验证
- sas - 如何正确使用SAS中的SCAN功能
- excel - Excel VBA Internet Explorer Onclick 以单击下拉菜单
- python - views.py 和 urls.py 不连接以执行功能
- python - 神经网络不会“在任何地方”收敛
- docker - nginx 背后的 Grafana:重定向太多
- python - 如何在不复制父文件路径的情况下使用 shutil.copytree?
- python - 从列表中选择 n 个值,跨越范围
- spring-boot - Spring Security AuthenticationSuccessHandler 和 MockMvc