0

I'm displaying following Microsoft Office Math equation in display mode in my Microsoft WORD. But when I get it's MathML (as explained here) and use it in following HTML file, the equation displays in inline mode.

Question: Is this bug in Microsoft Math feature. Or what else could be a reason? I think the MathML obtained from MS WORD should have the attribute display="block" in the <math...> tag but it doesn't. Why?

Math equation in WORD document

enter image description here

MathML obtained from above Math equation in WORD document:

<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>

HTML Page containing above MathML (obtained from MATH equation in 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>

Display view of the above HTML page

enter image description here

nam
  • 21,967
  • 37
  • 158
  • 332
  • I doubt if anyone except Microsoft will be able to provide a definitive answer to the "why" question. We could speculate that it's because in the OOXML the difference in the two layouts is marked by the presence/absence of an oMathPara element **outside** the oPara element and the developers decided not to try to translate that aspect of the display into mathml. But in any case you could use Word's File->Feedback->Uservoice mechanism to suggest a change. –  Oct 13 '19 at 09:51

1 Answers1

0

The <moverunder> should render that as you see it in Word (ref ). What browser is rendering the MathML that way when part of an HTML page? Are you using a rendering library (e.g., MathJax ) or just letting the browser render it? As it stands, despite being part of the HTML5 spec, MathML still isn’t as widely supported in most browsers as we’d all like. I suspect it may render even worse in another browser (if that is a concern).