MDN self-hosted library · e01.org

<mmultiscripts>

The <mmultiscripts> MathML element is used to attach an arbitrary number of subscripts and superscripts to an expression at once, generalizing the msubsup element. Scripts can be either pre-scripts (placed before the expression) or post-scripts (placed after it).

no runnable cells mathml-element upstream source

The <mmultiscripts> MathML element is used to attach an arbitrary number of subscripts and superscripts to an expression at once, generalizing the msubsup element. Scripts can be either pre-scripts (placed before the expression) or post-scripts (placed after it).

MathML uses the syntax below, that is a base expression, followed by an arbitrary number of post-subscript and post-superscript pairs (attached in the given order) optionally followed by an mprescripts element and an arbitrary number of pre-subscript and pre-superscript pairs (attached in the given order). In addition, empty mrow elements can be used to represent absent scripts.

<mmultiscripts>
  base
  post-sub-script-1 post-sup-script-1
  post-sub-script-2 post-sup-script-2
  post-sub-script-3 post-sup-script-3
  ...
  post-sub-script-N post-sup-script-N
  <mprescripts />                    ⎫
  pre-sub-script-1 pre-sup-script-1  ⎪
  pre-sub-script-2 pre-sup-script-2  ⎬ Optional
  pre-sub-script-3 pre-sup-script-3  ⎪
  ...                                ⎪
  pre-sub-script-M pre-sup-script-N  ⎭
</mmultiscripts>

Attributes

This element's attributes include the global MathML attributes as well as the following deprecated attributes:

  • subscriptshift
  • : A length-percentage indicating the minimum amount to shift the baseline of the subscript down.
  • superscriptshift
  • : A length-percentage indicating the minimum amount to shift the baseline of the superscript up.

[!NOTE] For the subscriptshift and superscriptshift attributes, some browsers may also accept legacy MathML lengths.

Examples

Using <mprescripts>

Children after the <mprescripts> element are placed as pre-scripts (before the base expression):

```css hidden html, body { height: 100%; }

body { display: grid; place-items: center; font-size: 2rem; }


```html-nolint
<math display="block">
  <mmultiscripts>
    <mi>X</mi> <!-- base expression -->
    <mi>a</mi> <!-- post-sub-script -->
    <mi>b</mi> <!-- post-sup-script -->
    <mprescripts />
    <mi>c</mi> <!-- pre-sub-script -->
    <mi>d</mi> <!-- pre-sup-script -->
  </mmultiscripts>
</math>

700

Empty scripts

Empty <mrow> elements can be used to represent absent scripts:

```css hidden html, body { height: 100%; }

body { display: grid; place-items: center; font-size: 2rem; }


```html-nolint
<math display="block">
  <mmultiscripts>
    <mi>X</mi>    <!-- base expression -->
    <mrow></mrow> <!-- post-sub-script -->
    <mi>b</mi>    <!-- post-sup-script -->
    <mprescripts />
    <mi>c</mi>    <!-- pre-sub-script -->
    <mrow></mrow> <!-- pre-sup-script -->
  </mmultiscripts>
</math>

700

Order of scripts

Here is a more complex example with many scripts, so you can see in which order they are attached to the base:

```css hidden html, body { height: 100%; }

body { display: grid; place-items: center; font-size: 2rem; }


```html-nolint
<math display="block">
  <mmultiscripts>
    <mi>X</mi> <!-- base expression -->
    <mn>1</mn> <!-- post-sub-script-1 -->
    <mn>2</mn> <!-- post-sup-script-1 -->
    <mn>3</mn> <!-- post-sub-script-2 -->
    <mn>4</mn> <!-- post-sup-script-2 -->
    <mprescripts />
    <mn>5</mn> <!-- pre-sub-script-1 -->
    <mn>6</mn> <!-- pre-sup-script-1 -->
    <mn>7</mn> <!-- pre-sub-script-2 -->
    <mn>8</mn> <!-- pre-sup-script-2 -->
  </mmultiscripts>
</math>

700

Technical summary

Implicit ARIA role None

Specifications

Browser compatibility

See also

  • msub (Subscript)
  • msup (Superscript)
  • msubsup (Subscript-superscript pair)