我只花了一个小时来解决这个问题,我似乎无法找到解决方案。
我在没有配置的情况下加载MathJax,因此我自己配置它:
<script data-cfasync="false" type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js">
</script>
这是我的配置。它无法呈现<div class="comment">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX","input/MathML","input/AsciiMath","output/CommonHTML"],
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathMenu.js","MathZoom.js","AssistiveMML.js", "a11y/accessibility-menu.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
ignoreClass: "comment"
}
});
</script>
答案 0 :(得分:1)
看起来我找到了答案。除tex2jax
忽略此类外,asciimath2jax
还必须忽略此类。
Mathjax是配置地狱。
MathJax.Hub.Config({
jax: ["input/TeX","input/MathML","input/AsciiMath","output/CommonHTML"],
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathMenu.js","MathZoom.js","AssistiveMML.js", "a11y/accessibility-menu.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
asciimath2jax: {
ignoreClass: "comment"
},
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
ignoreClass: "comment"
}
});