MathML: The markup Language for Maths

MathML is markup language for describing mathematical notation and capturing both its structure and content. It is XML base language processed on World Wide Web. We are writing just XML like tags to describe the equation. Let’s make case study how we can write that. Just for your information let me tell you that Current version of MathML is 3.0 as on 20th Oct, 2014[1], and before deploying your script on a web server ensure that your client use HTML5 supported browser.

Example 1

For example I want to display equation like this

Screenshot - 20-10-2014 , 13_29_30Image 1


                                    <mi> x </mi>
                                    <mo> + </mo>
                                    <mo> – </mo>
                                    <mi> Z</mi>
                       <mo> = </mo>
                        <mi> P</mi>              

Here I want to display an equation shown image 1. I will start my markup language given in example. A very super tag will be <math>, which describe that here they are going to display any equation of mathematics.

<mrow>: describe new mathematical row.

<msup>: this describe the mathematical superscript.

<msub>: they describe mathematical subscript. In both the tag <msup> and <msub> , we are nestadly writing three kind of tag listed below,

<mi>: describe mathematical identifier

<mn>: describes the mathematical numbers.

<mo>: this describe mathematical operators like +,-,=;

Example 2:

Let’s take another example, where I’m going to use a bracket as a say I want to display 2 x 2 metrics as given in Example.

Image 2

<mi> A </mi> <mo>=</mo>
            <mfenced open=”[” close=”]”>
                        <mtd> <mi> X</mi> </mtd>
                        <mtd> <mi> Y</mi></mtd>
                        <mtd> <mi> A</mi> </mtd>
                        <mtd> <mi> B</mi></mtd>

<mfenced> : is tag, allow us to provide custom opening and closing parebtheses (such as bracket), and also it support separators like: “,” “|”,”;” and many more.

It has attribute like open, close, separators, Mathcolor, class,id, style, and mathbackground. In our example I’m using a big bracket as opening and closing. Inside this tag I have used, <mtable> is the mathematical Teble representation. As we have in the HTML,<table> tag.

<mtable> : mathematical table

<mtr>: mathematical table Row

<mtd>: mathematical Table data

Example 3:

Screenshot - 20-10-2014 , 14_14_55Image 3

                <mi> 8 </mi>
                <mn> 3 </mn>
                <mi> 9 </mi>

<msqrt>: used to make the square root

<mroot>: customized root.>

Example 4:

Screenshot - 20-10-2014 , 14_21_03Image 4


<mfrac>: to display fractional value like x/y.



Share Post