# Underscripts and overscripts

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

Underscripts and overscripts are represented using the munder and mover elements, respectively. The syntax of munder is as follows:

<munder> base underscript </munder>

The munder element has one attribute called accentunder. If this is set to true, the underscript is treated like an accent and if false like a limit. Accents are rendered in normal size and closer to the base; on the other hand, limits are rendered in a smaller size and farther away from the base. The following example shows an underscript rendered as an accent:

``````<mrow>
<munder accentunder="true">
<mrow>
<mn>1</mn>
<mo>+</mo>
<mn>2</mn>
<mo>+</mo>
<mo>&ctdot;</mo>
<mi>n</mi>
</mrow>
<mo>&UnderBrace;</mo>
</munder>
</mrow>
``````

If the base is an mo element with movablelimits="true" and displaystyle="false", then the underscript is rendered as a subscript and the accentunder attribute is ignored.

The syntax of mover is:

<mover> base overscript </mover>

The mover element has one attribute: accent. If this is set to true, the overscript is treated like an accent and if false like a limit. Accents are rendered in normal size and closer to the base, whereas limits are rendered in a smaller size and farther away from the base. The following example shows an overscript rendered as an accent:

``````<mover accent="true">
<mi>x</mi>
<mo>&Hat;</mo>
</mover>
``````

The following example shows an overscript rendered as a limit:

``````<mover accent="false">
<mi>x</mi>
<mo>&Hat;</mo>
</mover>
``````

If base is an operator with movablelimits="true" and displaystyle="false", then the overscript is rendered as a superscript and the accent attribute is ignored.

In addition, MathML provides the munderover element for attaching both an underscript and overscript to a base expression. This produces a better visual appearance than if you use separate munder and mover elements. This is because the vertical spacing of the underscript and overscript is more symmetrical relative to the base and both the scripts follow the slant of the base. This element has the following syntax:

<munderover> base underscript overscript </munderover>

Here is an example of its use:

``````<mrow>
<munderover>
<mo>&int;</mo>
<mi>a</mi>
<mi>b</mi>
</munderover>
<mi>f</mi>
<mo>&ApplyFunction;</mo>
<mrow>
<mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
<mo>&DifferentialD;</mo><mi>x</mi>
</mrow>
``````

The munderover element accepts both accent and accentunder as attributes. If the base is an operator with movablelimits="true" and displaystyle="false", then the underscript is rendered as a subscript, the overscript is rendered as a superscript, and the accent attribute is ignored.

 Tipp der data2type-Redaktion: Zum Thema MathML bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: