mathjax 是如何工作的?
我正在一个项目中使用 Mathjax,但无法弄清楚它是如何工作的。我将 MathML 与以下代码一起使用:
<body>
<math>
<mi>x</mi>
<mo>+</mo>
<mn>2</mn>
</math>
</body>
此代码工作正常。
我对 XML 文件的理解是它们需要通过 AJAX 调用和解释,但 MathML 似乎在页面加载后立即通过 MathJax 呈现。是否有一个 onload
方法可以在页面加载后立即呈现 MathJax?我尝试在文档中搜索将 XML 转换为 MathJax 图形的方法,但找不到任何内容。我还尝试在 XML 标签和 Mathjax 字体之间寻找某种映射,但也没有找到任何东西。有什么想法吗?
I'm using Mathjax in a project I'm working on but cannot figure out how it works. I'm using MathML with the following code:
<body>
<math>
<mi>x</mi>
<mo>+</mo>
<mn>2</mn>
</math>
</body>
This code works fine.
My understanding of XML files was that they needed to be called and interpreted via AJAX, but MathML seems to be rendered through MathJax as soon as the page loads. Is there an onload
method that renders MathJax as soon as the page loads? I've tried searching the documentation for a method that converts the XML to MathJax graphics but cannot find anything. I've also tried looking for some kind of map between XML tags and Mathjax fonts but havent been able to find anything there either. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,MathJax 使用一个
onload
处理程序来最初排版页面。我不清楚您想要完成什么,但是如果您需要在
onload
处理程序运行后修改页面上的数学,您将需要使用 MathJax 处理队列来发出新的排版命令。请参阅修改页面上的数学文档。标签和字体之间没有映射(翻译比这更复杂)。同样,了解您想要实现的目标会有所帮助。
MathJax 支持社区在 MathJax 用户论坛 和开发者论坛,因此您可以尝试在那里提问。
达维德
Yes, there is an
onload
handler that MathJax uses to typeset the page initially.I'm not clear on what you are trying to accomplish, but if you need to modify the mathematics on the page after the
onload
handler runs, you will need to use the MathJax processing queue to issue a new typeset command. See the modifying math on the page documentation.There is no mapping between tags and fonts (the translation is more complicated than that). Again, it would help to know what you are trying to accomplish.
The MathJax support community is more active on the MathJax user forum and the developer forum, so you might try asking there.
Davide