Design Your Website More Professionally
Facebook

MathML – Underscripts and Overscripts

Up to know we have discussed about basics of MathML and using expressions as subscripts and superscripts. We also expressed different mathematical and Greek symbols and their HTML codes. Two other important MathML features are underscripts and overscripts, used to usually add symbols over or under the main expression . . .

The following examples show how to use ‘<munder>‘ and ‘<mover>‘ for underscripts and overscripts, respectively:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

      <munder>

         <mi>A</mi>

         <mo>&UnderBrace;</mo>

      </munder>

</math>

 

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

      <mover>

         <mi>A</mi>

         <mo>&OverBar;</mo>

      </mover>

</math>

The result is:

HTML5-MathML-underscript and overscript

The first input tag is used for the main expression and the second one is for the underscript/overscripts.

Some attributes exist here for underscripts and overscripts; they are used to set that the script must be as a limit, with a small size, or as an accent, with a larger size. For underscripts use ‘accentunder= “true” ‘:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

      <munder accentunder=”false”>

         <mi>A</mi>

         <mo>&rarr;</mo>

      </munder>

      <munder accentunder=”true”>

         <mi>A</mi>

         <mo>&rarr;</mo>

      </munder>

</math>

 You can see the difference in the following image (the latter attribute is set to true):

HTML5-MathML-underscript-accentunder

And for overscripts use ‘accent=”true” ‘:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

      <mover accent=”false”>

         <mi>&xi;</mi>

         <mo>&sim;</mo>

      </mover >

      <mover accent=”true”>

         <mi>&xi;</mi>

         <mo>&sim;</mo>

      </mover >

</math>

 This leads to:

HTML5-MathML-overscript-accent

 

Note that the orders of inputted tags are main expression, underscript and overscript, respectively; and the attributes are also added to the expression. You must see:

HTML5-MathML-munderover

And finally if you want to use multi-expressions instead of one single character in each part, the inputted tags can get replaced by ‘<mrow>‘ to make a group:

<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’block’>

            <munderover>

                        <mrow>

                                    <mi>x</mi>

                                    <mo>+</mo>

                                    <mi>y</mi>

                        </mrow>

                        <mo>&rarr;</mo>

                        <mo>&oline;</mo>

            </munderover>

</math>

That would be:

HTML5-MathML-munderover-mrow

The script posts are finished here. You are now able to make subscripts, superscripts, underscripts and overscripts. Let’s start a new HTML5 MathML topic.

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>