Use display="inline" with displaystyle="normal"

Q

How to prevent "compact" style when using <math> as an inline element?

✍: FYIcenter.com

A

By default, <math> element is rendered as an inline element in "compact" display style.

If you want to keep it as an inline element and displayed in "normal" style, you need add the displaystyle="normal" option in the <math> tag.

Here is a comparison of "compact" and "normal" styles of inline <math> elements:

<math>
<munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow>
<mi>∞</mi></munderover><mi>i</mi>
<mo>=</mo><mn>1</mn><mo>+</mo><mo>…</mo>
</math>

<math displaystyle="normal">
<munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow>
<mi>∞</mi></munderover><mi>i</mi>
<mo>=</mo><mn>1</mn><mo>+</mo><mo>…</mo>
</math>

Here is how they are rendered in the Web browser: ∑i=1 ∞i =1+… ∑i=1 ∞i =1+…

Note that some browser may fail to respect the displaystyle="normal" option. You can use MathJax Live Editor to see the differences.

Use 'math' as Inline Element in Normal Style
Use 'math' as Inline Element in Normal Style

 

⇒ Use "math" as Block Element

⇐ Use "math" as Inline Element

⇑ Introduction to MathML (Mathematical Markup Language)

⇑⇑ MathML (Mathematical Markup Language)

2026-10-17, ∼1752🔥, 0💬