【发布时间】:2017-07-11 22:36:17
【问题描述】:
我正在尝试通过 MathJax 在 MathML 中使用 OpenMath。代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mixed Markup</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
MathML: {
extensions: ["content-mathml.js"]
}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>
<mrow>
<mi>sin</mi>
<mo>⁡<!--FUNCTION APPLICATION--></mo>
<mfenced><mi>x</mi></mfenced>
</mrow>
<mo>+</mo>
<mn>5</mn>
</mrow>
<annotation encoding="application/x-tex">
\sin x + 5
</annotation>
<annotation-xml encoding="application/openmath+xml">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMS cd="arith1" name="plus"/>
<OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
<OMI>5</OMI>
</OMA>
</annotation-xml>
</semantics>
</math>
</body>
当我写上面的代码时,annotation-xal标签和OMA的内容是 像下面捕获的图像一样着色为红色
(有关更多详细信息,
encoding上的红线原因是Wrong attribute value
而xmlns 是URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
并且在 MathML3 (http://www.w3.org/TR/MathML3/chapter5.html#html.annotation.xml) 的文档中,他们说
"请注意,如果未将 MathML 视为 XML 文档,则示例中使用的命名空间可扩展性可能不可用。...特别是 HTML 解析器将 xmlns 属性视为普通属性,因此 OpenMath 示例将被分类被 HTML 验证器视为无效。”
但我不明白它的含义,特别是“MathML 没有被视为 XML 文档”
如何在 MathML 和 MathJax 中使用 OpenMath(?)?
【问题讨论】:
-
未来注意事项:cdn.mathjax.org 即将结束生命周期,请查看mathjax.org/cdn-shutting-down 了解迁移提示。