我使用MathJax在我的站点上呈现数学,并注意到在“显示”/“块”数学前后存在间距不相等的问题。
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
displayAlign: "left",
tex2jax: {
inlineMath: [ ['\\(','\\)'] ],
displayMath: [ ['\\[','\\]'] ],
},
CommonHTML: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
TeX: {extensions: ['AMSmath.js', 'AMSsymbols.js']}
});
</script>
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=default"></script>
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
<br>
<br>
\[ R_{\mu \nu }-{\tfrac {1}{2}}R\,g_{\mu \nu }+\Lambda g_{\mu \nu }={\frac {8\pi G}{c^{4}}}T_{\mu \nu } \]
<br>
<br>
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
如您所见,数学后的间距(55 it )大于(39 it )之前的间距,而它应该是相等的。
怎么解决这个问题?
发布于 2018-04-23 04:09:51
不是来自mathjax,而是来自你的html。检查元素(F12),您将看到在MMM之后只采取了一个<br>
。线,在方程之后取两行。
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
displayAlign: "left",
tex2jax: {
inlineMath: [ ['\\(','\\)'] ],
displayMath: [ ['\\[','\\]'] ],
},
CommonHTML: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
TeX: {extensions: ['AMSmath.js', 'AMSsymbols.js']}
});
</script>
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=default"></script>
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM<br>
<br>
<br>
\[ R_{\mu \nu }-{\tfrac {1}{2}}R\,g_{\mu \nu }+\Lambda g_{\mu \nu }={\frac {8\pi G}{c^{4}}}T_{\mu \nu } \]
<br>
<br>
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
https://stackoverflow.com/questions/49977918
复制