Displaying Mathml equations

感情迁移 提交于 2019-12-04 05:43:42

Putting your file in a filename named mml-prb.xhtml works. Note the extension.

Including

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML"></script>

and then using

    <math xmlns="http://www.w3.org/1998/Math/MathML">
        <mroot>
            <mrow>
                <mi>x</mi>
            </mrow>
            <mn>4</mn>
        </mroot>
    </math>

works in Chrome and Firefox

Update:

Since the mathjax cdn is shutting down, change

<script type="text/javascript" async
  src="https://cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?...">
</script>

to

<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?...">
</script>

as others have said you need to serve as xml for FF3, if you want to use mathml-in-html5 served as text/html you need firefox 4 (or webkit nightlies)

You should use xml and serve it as such (i.e. use correct mimetype), which means you have to use xhtml and mathml tags with proper namespaces. Take how W3C serves the example as an example.

Note: HTML5 is NOT xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!