有没有办法用 Sphinx 在第一个文件中渲染 MathML?
我在 conf.py 中启用了 mathjax 扩展。它与 latex 一起使用效果很好
但是,如果我用 math ML 替换它,它会渲染它,但会显示所有 xml 代码。例如,
产生
在 Sphinx 中,数学由 mathjax 扩展呈现。在 https://www.mathjax.org/ mathjax 声称他们支持 MathML。
最佳答案
在不知道您想要的输出的情况下很难回答,但是从 doc
The "math" directive inserts blocks with mathematical content (display formulas, equations) into the document. The input format is LaTeX math syntax with support for Unicode symbols
因此,无法将 MMl 与 ..math::
一起使用
如果你输出的是HTML,你可以试试raw或 literal指令而不是让 block 保持原样。该 block 将在兼容 MML 的浏览器中正确显示。如果您包含具有正确配置的 mathjax 库,它也会处理。
关于python-sphinx - Sphinx 是否支持 MathML(通过 mathjax 扩展)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50536532/