【问题标题】:MathJax fails with semantics annotationsMathJax 因语义注释而失败
【发布时间】:2017-08-22 13:49:06
【问题描述】:

MathJax 无法将以下 mathml 转换为 SVG

<math>
  <semantics>
    <!-- Content MathML -->
    <annotation-xml encoding="MathML-Content">
    <apply><min/>
        <bvar><ci>x</ci></bvar>
        <condition>
        <apply><notin/><ci>x</ci><ci type="set">B</ci></apply>
        </condition>
        <apply><power/><ci>x</ci><cn>2</cn></apply>
    </apply>
    </annotation-xml >
  </semantics>
</math>

是否因为不正确的编码 encoding="MathML-Content" 而失败? MathJax 失败的原因可能是什么。

【问题讨论】:

  • 您在多个论坛发帖时可能需要添加备注。
  • 我投了反对票,因为除了“它对我有用”之外,您的问题没有提供足够的信息来为您提供答案。你甚至没有说“未能隐蔽”是什么意思。您是否收到 MathJax“数学处理错误”?您是否从 MathJax 收到控制台错误?页面过程中是否还有其他数学运算?您是在浏览器或 mathjax-node 中使用 MathJax 吗?你用的是什么配置?

标签: mathjax mathml


【解决方案1】:

正如我在 my response 在 MathJax 论坛上的帖子中提到的,MathJax 可以完美地呈现您的表达。我在下面包含了一个 sn-p,它显示了它将这个表达式渲染为 SVG。

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    MathML: {extensions: ["content-mathml.js"]}
  });
</script>
<script type="text/javascript"
   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=MML_SVG"></script>
   
<math>
  <semantics>
    <!-- Content MathML -->
    <annotation-xml encoding="MathML-Content">
      <apply><min/>
        <bvar><ci>x</ci></bvar>
        <condition>
          <apply><notin/><ci>x</ci><ci type="set">B</ci></apply>
        </condition>
        <apply><power/><ci>x</ci><cn>2</cn></apply>
      </apply>
    </annotation-xml>
  </semantics>
</math>

您做错了什么,但没有向我们提供足够的信息来帮助您找出问题所在。在您的问题已在 MathJax 论坛中得到解答后,在此处交叉发布不太可能为您提供更好的答案。

【讨论】:

  • 我可以从特定目录动态加载 content-mathml.js 吗?
  • 我的意思是,我们如何从本地文件系统加载扩展?
  • 我在 phantomjs 中动态加载 mathjax,那么我应该什么时候加载扩展?我曾尝试使用 MathJax.Hub.Config({ MathML: {extensions: ["content-mathml.js"]} });但没有运气。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-08
  • 1970-01-01
  • 2016-01-11
  • 1970-01-01
  • 2017-06-14
相关资源
最近更新 更多