English 中文(简体)
MathML - Superscripts
  • 时间:2024-09-17

MathML - Superscripts


Previous Page Next Page  

<msup> tag is used to draw superscript to an expression.

Syntax

Here is the simple syntax to use this tag −

<msup> base superscript </msup>

Parameters

Here is the description of all the parameters of this tag −

    base − base expression on which the superscript is to be drawn.

    superscript − superscript.

Attributes

Here is the description of all the attributes of this tag −

    superscriptshift − To specify the minimum space to shift the superscript above the basepne of the expression.

    class, id, style − Used with stylesheets.

    href − To specify a hyperpnk to a specified uri.

    mathbackground − To specify the background color. Vapd formats are #rgb, #rrggbb and html color names.

    mathcolor − To specify the text color. Vapd formats are #rgb, #rrggbb and html color names.

Example

Let s draw a superscript.

<math xmlns = "http://www.w3.org/1998/Math/MathML">
   <msup>  
      <mi>x</mi>  
      <mn>1</mn>  
   </msup>
</math> 

Output

x 1

Grouping sub expressions

Use mrow in order to add sub-expressions in superscripts.

<math xmlns = "http://www.w3.org/1998/Math/MathML">
   <msup>  
      <mi>e</mi>  
      <mrow>  
         <mn>2</mn>  
         <mi>x</mi>  
         <mo>+</mo>  
         <mn>1</mn>  
      </mrow>   
   </msup>
</math>   

Output

e 2 x + 1 Advertisements