我试图显示一个简单的方程式,但它不起作用。我的代码如下(html5):
<math xmlns="http://www.w3.org/1998/Math/MathML" display = 'block'>
<mrow>
<msub>
<mi>a</mi>
<mi>i</mi>
</msub>
<mo>=</mo>
<msub>
<mi>a</mi>
<mi>z</mi>
</msub>
<sin/>
<mi mathvariant='normal' fontfamily='Times New Roman'>α</mi>
<mo>−</mo>
<msub>
<mi>a</mi>
<mi>x</mi>
</msub>
<cos/>
<mi mathvariant='normal' fontfamily='Times New Roman'>α</mi>
</mrow>
</math>
在 Opera 或 Chrome 中,我既看不到三角运算,也看不到子索引。在 Firefox 中,我可以看到子索引,但看不到三角运算。 有人可以说错误在哪里吗?提前致谢。
最佳答案
不幸的是,答案很简单:Chrome、Opera 和 IE 不支持 MathML。
Firefox 有一个 very solid implementation (但尚未完成),Safari 只有一个 very partial implementation . Firefox 和 Safari 都不支持 Content MathML。
这就是为什么您需要使用像 MathJax (cf MathML support ) 或 jqmath 这样的 polyfill .
这些 polyfill 都不支持 Content MathML,因此您需要遵循 MvG 的建议来生成 Presentation MathML。
在较旧的 IE (6-9) 上,用户可以安装 MathPlayer plugin这是唯一支持所有 Presentation 和 Content MathML 的实现。
关于html - MathML 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18656638/