Menu
MathML Elements to Display Subscripts and Superscripts

A subscript is small letter or number placed slightly lower than the normal text that identifies a variable. Sometimes a variable may stand for a specific property, for example pressure, but say at different locations. Then the letter P could represent pressure and P1, P2, and P3 could be variables that represent specific values at different locations.

A superscript (also called an "exponent" or "power") is small letter or number placed slightly higher than the normal text. Placed just to the right of an expression, it defines how many times to use the value of that expression in a multiplication.

msub Use this element to attach a subscript to a base. Example:

x i

<math>
<msub>
<mi>x</mi>
<mi>i</mi>
</msub>
</math>

msup Use this element to attach a superscript to a base. Example:

x j

<math>
<msup>
<mi>x</mi>
<mi>j</mi>
</msup>
</math>

msubsup Use this element to attach both a subscript and a superscript to a base. Example:

x i j
<math>
<msubsup>
  <mi>x</mi>
  <mi>i</mi>
  <mi>j</mi>
</msubsup>
</math>

Note that for all the above elements, the base is the first child element.

x 3 y
<math>
  <mfrac>
  <msup>
    <mi>x</mi>
    <mi>3</mi>
  </msup>
  <mi>y</mi>
  </mfrac>
</math>

Shown above, a variable with a superscript, or exponent, is used in the numerator of a fraction.

y 6 ( x + y 2 )
<math>
  <mfrac>
  <mi>y</mi>
  <mrow>
     <mn>6</mn>
    <mo>(</mo>
    <mi>x</mi>
    <mo>+</mo>
      <msup>
      <mi>y</mi>
      <mn>2</mn>
      </msup>
    <mo>)</mo>
  </mrow>
  </mfrac>
</math>

Shown above is a variable with an exponent used in the denominator of a fraction. The variable with the exponent is part of a complex expression. The complex expression is created by using the mrow element to specify which elements go in the numerator and which go in the denominator.

6 ( x + y 2 ) 3
<math>
  <mroot>
    <mrow>
    <mn>6</mn>
    <mo>(</mo>
    <mi>x</mi>
    <mo>+</mo>
      <msup>
      <mi>y</mi>
      <mn>2</mn>
      </msup>
    <mo>)</mo>
    </mrow>
  <mn>3</mn>
  </mroot>
</math>

Similarly, shown above is a variable with an exponent used in the base of a radical. The variable with the exponent is part of a complex expression. The complex expression is created by using the mrow element to specify which elements go in the base and which go in the index.


Learn more at amazon.com

More Graphics Design Tips:
• Inkscape Grouping
• Five Surprising Reasons I Use Krita for Photo Editing
• Graphics Design for Beginners - Cropping Images
• Paint.Net Ink Sketch, Oil Painting, and Pencil Sketch Artistic Effects
• Where To Find Free Stock Photography, Clip Art, And Other Graphics For Your Web Site
• Create Animated Glistening Gold Text With SVG
• Graphic Design Meets Open Source
• History of Type Development and Type Terminology
• What is Blender? The Software's Origins and Evolution
• Basic Inkscape Vector Drawing