scriptlevel="0" on "msup"

Q

How to prevent <msup> using smaller fonts?

✍: FYIcenter.com

A

Each MathML element carries an attribute called "scriptlevel" to control its font size. The "scriptlevel" starts from 0 at <math> element and passes down to most child elements without any changes.

But when a child element needs to be shifted vertically like superscript, subscript, overscript, underscript, numerator, denominator, etc., its "scriptlevel" will be increased by 1. This tells the browser to reduce the font size by 71%.

If you don't want this to happen on a <msup> element, you can add the "scriptlevel" attribute explicitly to override its value. The example below shows that the font size of number "4" on the right hand side stays with the original value.

<math><msup><mn>5</mn><msup><mn>4</mn><msup><mn>3</mn>
  <mn>2</mn></msup></msup></msup> <mo>=</mo>
  <msup><mn>5</mn><msup scriptlevel="0"><mn>4</mn><msup><mn>3</mn>
  <mn>2</mn></msup></msup></msup></math>
    543
      2 =
      543
      2

 

⇒ Stretched and Large Operators

⇐ displaystyle="true" on "mfrace"

⇑ Subscripts, Fractions and "scriptlevel"

⇑⇑ MathML (Mathematical Markup Language)

2026-10-24, ∼1826🔥, 0💬