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, and before deploying your script on a web server ensure that your client use HTML5 supported browser.
For example I want to display equation like this
<body> <math> <mrow> <msup> <mi> x </mi> <mn>2</mn> </msup> <mo> + </mo> <msub> <mi>3</mi> <mn>x</mn> </msub> <mo> – </mo> <mi> Z</mi> <mo> = </mo> <mi> P</mi> </mrow> </math> </body>
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 +,-,=;
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.
<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
<msqrt>: used to make the square root
<mroot>: customized root.>
<mfrac>: to display fractional value like x/y.