代码之家  ›  专栏  ›  技术社区  ›  nam

从microsoftoffice文档中的数学公式获取MathML的一个问题

  •  0
  • nam  · 技术社区  · 5 年前

    我正在展示以下内容 Microsoft Office Math Microsoft WORD . 但是当我得到它的时候 MathML (如前所述) here )并在下面的HTML文件中使用它,公式显示为 inline 模式。

    问题 :这是Microsoft数学功能中的错误。或者还有什么原因?我认为 从MS WORD获取的应具有 display="block" <math...> 但它没有。为什么?

    WORD文档中的数学公式

    enter image description here

    :

    <math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><mrow><munderover><mo stretchy="false">∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mrow><mn>100</mn></mrow></munderover><mrow><msub><mrow><mi>a</mi></mrow><mrow><mi>n</mi></mrow></msub></mrow></mrow></math>
    

    包含上述MathML的HTML页面(从MS WORD中的数学公式获得)

    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title>MathJax TeX to MathML Page</title>
        <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
        </script>
    </head>
    <body>
        <p>Test</p>
        <math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><mrow><munderover><mo stretchy="false">∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mrow><mn>100</mn></mrow></munderover><mrow><msub><mrow><mi>a</mi></mrow><mrow><mi>n</mi></mrow></msub></mrow></mrow></math>
    </body>
    </html>
    

    enter image description here

    0 回复  |  直到 5 年前
        1
  •  0
  •   Jason Coleman    5 年前

    这个 <moverunder> 应该 ref ). 当MathML是HTML页面的一部分时,哪个浏览器会以这种方式呈现它?是否使用渲染库(例如。, MathJax )或者只是让浏览器渲染?从目前的情况来看,尽管MathML是HTML5规范的一部分,但它在大多数浏览器中仍然没有像wed一样得到广泛支持。我怀疑这可能会使 更糟的