<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 prescripts (placed before the expression) or postscripts (placed after it).

MathML uses the syntax below, that is a base expression, followed by an arbitrary number of postsubscript-postsuperscript pairs (attached in the given order) optionally followed by an <mprescripts> and an arbitrary number of presubscript-presuperscript pairs (attached in the given order). In addition, empty <mrow> elements can be used to represent absent scripts.

html

<mmultiscripts>
  base
  postsubscript1 postsuperscript1
  postsubscript2 postsuperscript2
  postsubscript3 postsuperscript3
  ...
  postsubscriptN postsuperscriptN
  <mprescripts/>                ⎫
  presubscript1 presuperscript1 ⎪
  presubscript2 presuperscript2 ⎬ Optional
  presubscript3 presuperscript3 ⎪
  ...                           ⎪
  presubscriptM presuperscriptM ⎭
</mmultiscripts>

Attributes

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

subscriptshift Deprecated Non-standard

A <length-percentage> indicating the minimum amount to shift the baseline of the subscript down.

superscriptshift Deprecated Non-standard

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

html

<math display="block">
  <mmultiscripts>
    <mi>X</mi>      <!-- base expression -->
    <mi>d</mi>      <!-- postsubscript -->
    <mi>c</mi>      <!-- postsuperscript -->
    <mprescripts />
    <mi>b</mi>      <!-- presubscript -->
    <mi>a</mi>      <!-- presuperscript -->
  </mmultiscripts>
</math>

Empty scripts

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

html

<math display="block">
  <mmultiscripts>
    <mi>X</mi>      <!-- base expression -->
    <mrow></mrow>   <!-- postsubscript -->
    <mi>c</mi>      <!-- postsuperscript -->
    <mprescripts />
    <mi>b</mi>      <!-- presubscript -->
    <mrow></mrow>   <!-- presuperscript -->
  </mmultiscripts>
</math>

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:

html

<math display="block">
  <mmultiscripts>
    <mtext>base</mtext>
    <mtext>postsubscript1</mtext>
    <mtext>postsupscript1</mtext>
    <mtext>postsubscript2</mtext>
    <mtext>postsupscript2</mtext>
    <mtext>postsubscript3</mtext>
    <mtext>postsupscript3</mtext>
    <mtext>postsubscript4</mtext>
    <mtext>postsupscript4</mtext>
    <mprescripts />
    <mtext>presubscript1</mtext>
    <mtext>presupscript1</mtext>
    <mtext>presubscript2</mtext>
    <mtext>presupscript2</mtext>
    <mtext>presubscript3</mtext>
    <mtext>presupscript3</mtext>
  </mmultiscripts>
</math>

Specifications

Specification
MathML Core
# prescripts-and-tensor-indices-mmultiscripts

Browser compatibility

BCD tables only load in the browser

See also