首页 > 解决方案 > 嵌套在 html 中时,MathJax 不呈现乳胶

问题描述

我有这种类型的公式嵌套在 html 中:

<div><p>$$</p></div>
<div><p> a, b \in \mathbb{R}, then applies (a+b)^{2} = a^{2} + ab + b^{2} </p></div>
<div><p>$$</p></div>

这不会渲染。但是,当它全部放在一条线上时,它会这样做,如下所示:

<div><p>$$ a, b \in \mathbb{R}, then applies (a+b)^{2} = a^{2} + ab + b^{2} $$ </p></div>

我的配置如下所示:

<script type="text/javaScript">
    window.MathJax = {
    tex2jax: {
      inlineMath: [ ['$','$'], ["\[","\]"] ],
       displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
       processEnvironments: true,
      processEscapes: true
    },
                MathML: {
                    extensions: ['content-mathml.js']
                },
                // Center justify equations in code and markdown cells. Elsewhere
                // we use CSS to left justify single line equations in code cells.
                displayAlign: 'center',
                "HTML-CSS": {
                    availableFonts: [],
                    imageFont: null,
                    preferredFont: null,
                    webFont: "STIX-Web",
                    styles: {'.MathJax_Display': {"margin": 0}},
                    linebreaks: { automatic: true }
                },
  };
</script>

<script  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,Safe">
</script>

任何关于为什么这可能不起作用的建议都非常受欢迎。感谢您的关注

标签: javascripthtmlformattingmathjax

解决方案


推荐阅读