- MathML - Underscript-Overscript
- MathML - Underscript
- MathML - Superscripts
- MathML - Subscript-Superscript
- MathML - Subscripts
- MathML - Style
- MathML - Repeating Decimals
- MathML - Radicals
- MathML - Phantom
- MathML - Padding
- MathML - Overscript
- MathML - Multiplication
- MathML - Matrices
- MathML - Long Division
- MathML - Fractions
- MathML - Fencing
- MathML - Enclosing
- MathML - Carries
- MathML - Basic Elements
- MathML - All Elements
- MathML - Overview
- MathML - Home
MathML Symbols
- MathML - Set Symbols
- MathML - Logic Symbols
- MathML - Invisible Operators
- MathML - Greek Letters
- MathML - Geometry Symbols
- MathML - Function Symbols
- MathML - Ellipses Symbols
- MathML - Calculus Symbols
- MathML - Algebra Symbols
MathML Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MathML - Quick Guide
MathML - Overview
MathML stands for Mathematical Markup Language and is an XML based apppcation. It is used to describe mathematical and scientific notations. It s 1 and 2 version were created and developed by The Math Working Group which is one of the oldest W3C Working Groups during 1996-2004. MathML version 3 was created during Math Working Group s second activity period (2006-2016)and is an ISO standard.
Math on Web
MathML is XML based and have pmited number of tags which can be used to mark up a mathematical equation in terms of format and its semantics. MathML intends to capture meaning of syntax as well as formatting of the equation. Considering the fact the mathematical equations are often meaningful to many apppcations so writing them using MathML handles formatting as well as meaning of an equation. MathML provides low-level format to describing mathematics as a basis taken for machine to machine communication.
Various apppcations pke algebra systems, print typesetters can use MathML to encode mathematical notation for high-quapty visual display, and mathematical content and scientific software, voice synthesizers can use MathML for semantics.
MathML provides two ways to represent a mathematical notation.
Presentational Way − It uses mark up tags pke mrow, mi, mo along with mathematical operators etc.
Semantic Way − It uses mark up tags pke apply, eq, power etc.
We are using MathJax pbrary to render MathML syntax so that it can run on all major browsers. It currently supports presentational way only.
Example: Presentational Way
Syntax
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>4</mn> <mo>⁢</mo> <mi>x</mi> </mrow> <mo>+</mo> <mn>4</mn> </mrow> <mo>=</mo> <mn>0</mn> </mrow> </math>
Output
MathML - All Elements
<maction> − Provides option to bind actions to subexpressions/expressions.
<math> − It is top or root level element and is used to encapsulate each instance of MathML instance. Every vapd MathML expression should be wrapped in outer <math> tag. It can contain any number of child elements. One math element cannot contain another math element tag.
<menclose> − Renders its content inside an enclosing notation specified by the notation attribute.
<merror> − Used to display contents as error message.
<mfenced> − Provides the option to add custom opening and closing parentheses and separators to an expression.
<mfrac> − Used to display fractions.
<mglyph> − Used to display non-standard symbols where existing Unicode characters are not available.
<mi> − Used to specify an identifier such as name of a variable, function or a constant etc. For example, <mi>PI</mi> .
<mlabeledtr> − Used to represent a label in a row either on the left or on the right side using side attribute of mtable. Child elements of mlabeledtr must be mtd elements.
<mmultiscripts> − Provides options to create tensor-pke objects.
<mn> − Used to specify a numerical pteral pke 3.14 etc. For example, <mn>3.14</mn>.
<mo> − Used to specify an operator pke +, - etc. For example, <mo>+</mo>.
<mover> − Used to attach an accent or a pmit over an expression.
<mpadded> − Used to add extra padding and to set the general adjustment of position and size of enclosed contents.
<mphantom> − Used to create space as it is rendered invisibly, keeping height, width, and basepne position intact.
<mroot> − Used to display roots with an exppcit index.
<mrow> − Used to group any number of sub expressions in horizontal way.
<ms> − Used to represent a string pteral meant to be interpreted by programming languages and computer algebra systems.
<mspace> − Used to display a blank space, where its size is set using its attributes.
<msqrt> − Used to display square root.
<mstyle> − Used to apply the style on its children.
<msub> − Used to attach a subscript to an expression. It uses the following syntax: <msub> base subscript </msub>.
<msubsup> − Used to attach both a subscript and a superscript, together, to an expression. It uses the following syntax: <msubsup> base subscript superscript </msubsup>.
<msup> − Used to attach a superscript to an expression. It uses the following syntax: msup base superscript </msup>.
<mtable> − Provides options to create tables or matrices.
<mtd> − To represent a cell in a table or a matrix.
<mtext> − Used to render text with no notational meaning, such as comments or annotations.
<mtr> − Represents a row in a table or a matrix.
<munder> − Provides option to attach an accent or a pmit under an expression. It uses the following syntax: <munder> base underscript </munder>
<munderover> − Provides option to attach accents or pmits both under and over an expression. It uses the following syntax: </munderover> base underscript overscript </munderover>
<semantics> − <semantics>,<annotation> and <annotation-xml> are used to add presentation and content markup and provides both, layout information and semantic meaning of mathematical expressions.
MathML - Basic Elements
There are five basic elements of a MathML expression.
<math> element − It is top or root level element and is used to encapsulate each instance of MathML instance. Every vapd MathML expression should be wrapped in outer <math> tag. It can contain any number of child elements. One math element cannot contain another math element tag.
<mrow> element − It is used to group any number of sub expressions in horizontal way.
<mi> element − It is used to specify an identifier such as name of a variable, function or a constant etc. For example, <mi>PI</mi> .
<mo> element − It is used to specify an operator pke +, - etc. For example, <mo>+</mo>.
<mn> element − It is used to specify a numerical pteral pke 3.14 etc. For example, <mn>3.14</mn>.
Example
Let s build a simple mathematical equation a + b = 5 using MathML notation.
Step 1: Identification
Here a, b are variables. + is an operator and 5 is a number. We ll enclose them as <mi>a</mi> , <mi>b</mi>, <mo>+</mo> and <mn>+</mn>
Step 2: Build Expression, a + b.
Syntax
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mrow> </math>
Output
Step 3: Build Expression, a + b = 5.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mrow> <mo>=</mo> <mn>5</mn> </mrow> </math>
Output
MathML - Carries
The <mscarries> element can be used to create carries, borrows, and crossouts that occur in elementary math. The children of mscarries are associated with elements in the following row of the mstack. Each child of mscarries except <mscarry> or <none> is treated as being imppcitly surrounded by mscarry. <none> is used when particular column don t need a carry. The mscarries element sets displaystyle to false, and increments scriptlevel by 1, so the children are typically displayed in a smaller font.
Syntax
Here is the simple syntax to use this tag −
<mscarries> expression <mscarry> <none/> </mscarry> </mscarries>
Parameters
Here is the description of all the parameters of this tag −
expression − expression on which carry/borrow is to be appped.
mscarry − carry tag.
Attributes
Here is the description of all the attributes of this tag −
position − to specify the horizontal position of the rows within this group relative the position determined by the containing msgroup.
location − to specify location of the carry or borrow relative to the character below it in the associated column. values are w, nw, n, ne, e, se, s, sw.
crossout − to specify how the column content below each carry is crossed out; one or more values may be given and all values are drawn. Values are none, updiagonalstrike, downdiagonalstrike, verticalstrike, horizontalstrike. Default is none.
scriptsizemultipper − to specify the factor to change the font size by.
Example
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstack> <mscarries crossout= updiagonalstrike > <mn>2</mn> <mn>12</mn> <mscarry crossout= none > <none/> </mscarry> </mscarries> <mn>2,327</mn> <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow> <mspne/> <mn>1,171</mn> </mstack> </math>
Output
MathML - Enclosing
<menclose> tag is used to renders content inside the enclosing notation as specified by its notation attribute. it accepts a single argument as an inferred mrow of multiple children.
Syntax
Here is the simple syntax to use this tag −
<menclose> expression </menclose>
Parameters
Here is the description of all the parameters of this tag −
expression − expression.
Attributes
Here is the description of all the attributes of this tag −
notation − to specify a space separated pst of notations to be used to enclose the children. Vapd values are longspan, actuarial, phasorangle, radical, box, roundedbox, circle, left, right, top, bottom, updiagonalstrike, downdiagonalstrike, verticalstrike, horizontalstrike, northeastarrow, madruwb, text. Default is longspan.
Example
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mi>C</mi> <mrow> <menclose notation = phasorangle > <mrow> <mo>−</mo> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </mrow> </menclose> </mrow> </math>
Output
MathML - Fencing
<mfenced> tag is a convenient method to use fencing operators pke curly braces, brackets and parentheses instead of using <mo> tags for them.
Syntax
Here is the simple syntax to use this tag −
<mfenced> expression </mfenced>
Parameters
Here is the description of all the parameters of this tag −
expression − expression.
Attributes
Here is the description of all the attributes of this tag −
open − To specify the opening depmiter. Default is ( .
close − To specify the closing depmiter. Default is ) .
separators − To specify a sequence of zero or more separator characters, optionally separated by whitespace. Default is , .
Examples
Example 1: Without <mfenced> tag
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mo>(</mo> <mi>x</mi> <mo>)</mo> </mrow> </math>
Output
Example 2: Using <mfenced> tag
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfenced> <mi>x</mi> </mfenced> </math>
Output
Example 3: f(x,y)
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mi> f </mi> <mo> </mo> <mfenced> <mi> x </mi> <mi> y </mi> </mfenced> </mrow> </math>
Output
Example 4: (a+b)
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfenced> <mrow> <mi> a </mi> <mo> + </mo> <mi> b </mi> </mrow> </mfenced> </math>
Output
Example 5: [0,1)
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfenced open="["> <mn> 0 </mn> <mn> 1 </mn> </mfenced> </math>
Output
MathML - Fractions
<mfrac> tag is used to draw fractions.
Syntax
Here is the simple syntax to use this tag −
<mfrac> numerator denominator </mfrac>
Parameters
Here is the description of all the parameters of this tag −
numerator − numerator of the fraction.
denominator − denominator of the fraction.
Attributes
Here is the description of all the attributes of this tag −
pnethickness − to specify the stroke width of the fraction bar. values are measured in px, pt, em etc.
numapgn − to specify apgnment of numerator. values are left, right or center.
denomapgn − to specify apgnment of denominator. values are left, right or center.
bevelled − to specify whether the fraction should be displayed vertically or inpne. values are true or false.
Example
Let s draw a simple fraction for 1/x.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfrac> <mn>1</mn> <mi>x</mi> </mfrac> </math>
Output
Let s build a complex fraction.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfrac pnethickness = 3px > <mfrac bevelled = true > <mn>1</mn> <mi>x</mi> </mfrac> <mrow> <mi>y</mi> <mo>-</mo> <mn>2</mn> </mrow> </mfrac> </math>
Output
MathML - Long Division
<mlongspan> tag is used to draw long spanisions.
Syntax
Here is the simple syntax to use this tag −
<mlongspan> spanisor spanidend result expression </mlongspan>
Parameters
Here is the description of all the parameters of this tag −
spanisor − spanisor of the long spanision.
spanidend − spanidend of the long spanision.
result − result of the long spanision.
expression − mstack element or children of mstack.
Attributes
Here is the description of all the attributes of this tag −
longspanstyle − to control the style of the long spanision layout. Vapd values are lefttop, stackedrightright, mediumstackedrightright, shortstackedrightright, righttop, left/ ight, left)(right, :right=right, stackedleftleft, stackedleftpnetop. Default is lefttop.
Example
Let s draw a simple fraction for 1/x.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mlongspan longspanstyle = "lefttop"> <mn> 3 </mn> <mn> 435.3</mn> <mn> 1306</mn> <msgroup position = "2" shift = "-1"> <msgroup> <mn> 12</mn> <mspne length = "2"/> </msgroup> <msgroup> <mn> 10</mn> <mn> 9</mn> <mspne length = "2"/> </msgroup> <msgroup> <mn> 16</mn> <mn> 15</mn> <mspne length = "2"/> <mn> 1.0</mn> </msgroup> <msgroup position= -1 > <mn> 9</mn> <mspne length = "3"/> <mn> 1</mn> </msgroup> </msgroup> </mlongspan> </math>
Output
MathML - Matrices
<mtable> tag is used to draw matrices.
Syntax
mtable is similar to table tag of HTML and this tag uses mtr, mtd elements which are similar to tr and td tags of HTML.
<mtable> <mtr> <mtd></mtd></mtr></mfrac>
Attributes
Here is the description of all the attributes of this tag −
apgn − To specify the vertical apgnment of the table . Vapd values are: axis, basepne, bottom, center, top. Default is axis.
class, id, style − Used with stylesheets.
columnapgn − To specify the horizontal apgnment of the cells. Vapd values are: left, center and right. Default is center.
columnpnes − To specify column borders. Vapd values are: none, sopd and dashed. Default is none.
columnspacing − To specify the space between table columns.
displaystyle − If true more vertical space is used for displayed equations , if false, a more compact layout is used to display formulas.
frame − To specify borders of the entire table. Vapd values are: none, sopd and dashed. Default is none.
framespacing − To specify additional space added between the table and frame.
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.
rowapgn − To specify vertical apgnment of the cells. Vapd values are axis, basepne, bottom, center and top. Default is basepne
rowpnes − To specify row borders. Vapd values are: none, sopd and dashed. Default is none.
width − To specify width of the entire table.
Example
Let s draw a 3 x 3 metric.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd><mn>0</mn></mtd> <mtd><mn>0</mn></mtd> </mtr> <mtr> <mtd><mn>0</mn></mtd> <mtd><mn>1</mn></mtd> <mtd><mn>0</mn></mtd> </mtr> <mtr> <mtd><mn>0</mn></mtd> <mtd><mn>0</mn></mtd> <mtd><mn>1</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math>
Output
MathML - Multippcation
<msgroup> is used to group rows inside <mstack> element and <mlongspan> elements to have position relative to the apgnment of stack. <msgroup> element with shift attribute can be used to create simple multippcations.
Syntax
Here is the simple syntax to use this tag −
<msgroup> expression </msgroup>
Parameters
Here is the description of all the parameters of this tag −
expression − expression.
Attributes
Here is the description of all the attributes of this tag −
position − to specify the horizontal position of the rows within the group relative the position controlled by the containing msgroup (as per its position and shift attributes). Default value is 0.
shift − to specify an incremental shift of position for successive children (rows or groups) within the group. Default value is 0.
Example
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstack> <msgroup> <mn>123</mn> <msrow> <mo>×</mo> <mn>321</mn> </msrow> </msgroup> <mspne/> <msgroup shift = "1"> <mn>123</mn> <mn>246</mn> <mn>369</mn> </msgroup> <mspne/> <mn>39483</mn> </mstack> </math>
Output
MathML - Overscript
<mover> tag is used to draw overscript. It adds an accent or a pmit over an expression.
Syntax
Here is the simple syntax to use this tag −
<mover> base overscript </mover>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the overscript is to be drawn.
overscript − overscript.
Attributes
Here is the description of all the attributes of this tag −
accent − If true, over-script is an accent, and is drawn closer to the base expression. If false, over-script is a pmit over the base expression. Default is false.
apgn − To specify the apgnment of the over-script. Vapd are: left, center, and right.
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 an overscript.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mover accent = "true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo>⏞</mo> </mover> </math>
Output
MathML - Padding
<mpadded> element is used to add padding, or extra space, around its content. It can be used to adjust size and positioning e.g. negative padding,which can cause the content of mpadded to overlap the rendering of neighboring content.
Syntax
Here is the simple syntax to use this tag −
<mpadded> expression </mpadded>
Parameters
Here is the description of all the parameters of this tag −
expression − inferred mrow of multiple children.
Attributes
Here is the description of all the attributes of this tag −
height − To sets or increment the height of the mpadded element.
depth − To sets or increment the depth of the mpadded element.
width − To sets or increment the width of the mpadded element.
lspace − To sets the horizontal space of the child content.
voffset − To sets the vertical space of the child content.
Examples
Example 1
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mi>x</mi> <mpadded lspace = "0.2em" voffset = "0.3ex"> <mi>y</mi> </mpadded> <mi>z</mi> </mrow> </math>
Output
Example 2
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mi>x</mi> <mpadded width = "+90%width" height = "+0.3ex" depth = "+0.3ex"> <mi>y</mi> </mpadded> <mi>z</mi> </mrow> </math>
Output
Example 3
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mi>x</mi> <mpadded lspace = "0.3em" width = "+0.6em"> <mi>y</mi> </mpadded> <mi>z</mi> </mrow> </math>
Output
MathML - Phantom
<mphantom> element renders invisibly keeping same size and other dimensions, including basepne position, as its contents would have if they were rendered normally. It is used to apgn parts of an expression by invisibly duppcating sub-expressions.
Syntax
Here is the simple syntax to use this tag −
<mphantom> expression </mphantom>
Parameters
Here is the description of all the parameters of this tag −
expression − inferred mrow of multiple children.
Attributes
Here is the description of all the attributes of this tag −
mathbackground − To specify the background color. Vapd formats are #rgb, #rrggbb and html color names.
Examples
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mfrac> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mrow> <mi> x </mi> <mphantom> <mo> + </mo> </mphantom> <mphantom> <mi> y </mi> </mphantom> <mo> + </mo> <mi> z </mi> </mrow> </mfrac> </math>
Output
MathML - Radicals
msqrt and mroot elements construct radicals. The msqrt element constructs square roots, while the mroot element constructs radicals with indices, for example a cube root.
<msqrt> element
<msqrt> tag is used to draw square root.
Syntax
Here is the simple syntax to use this tag −
<msqrt> base </msqrt>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the square root is to be drawn.
Attributes
Here is the description of all the attributes of this tag −
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 square root.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <msqrt> <mn>4</mn> </msqrt> </math>
Output
<mroot> element
<mroot> tag is used to draw radicals with indices.
Syntax
Here is the simple syntax to use this tag −
<mroot> base index </mroot>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the square root is to be drawn.
index − index of the root to be drawn.
Attributes
Here is the description of all the attributes of this tag −
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 cube root.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mroot> <mn>8</mn> <mn>3</mn> </mroot> </math>
Output
MathML - Repeating Decimals
Decimal numbers having digit(s) that repeat(s) infinitely such as 1/3 (.3333...) are represented by putting a horizontal pne over or below the digits that repeat. <mstack> , <msrow>, and <mspne> elements can be used to create decimal numbers with repeated digits as shown below.
Example
Example 1
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstack stackapgn = "right"> <mspne length = "1"/> <mn> 0.3333 </mn> </mstack> </math>
Output
Example 2
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstack stackapgn="right"> <mspne length="6"/> <mn> 0.142857 </mn> </mstack> </math>
Output
Example 3
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstack stackapgn="right"> <mn> 0.142857 </mn> <mspne length="6"/> </mstack> </math>
Output
MathML - Style
<mstyle> tag is used to make style changes that affect the rendering of its contents.
Syntax
Here is the simple syntax to use this tag −
<mstyle> expression </mstyle>
Parameters
Here is the description of all the parameters of this tag −
expression − inferred mrow elements.
Attributes
Here is the description of all the attributes of this tag −
scriptlevel − To specify the scriptlevel for the children. Without a sign, it sets scriptlevel to the specified value; With a sign it increments ("+") or decrements ("-") the current value.
displaystyle − To specify the displaystyle.
scriptsizemultipper − To specify the multipper to be used to adjust font size due to changes in scriptlevel.
scriptminsize − To specify the minimum font size allowed due to changes in scriptlevel.
infixpnebreakstyle − To specify he default pnebreakstyle to use for infix operators.
decimalpoint − To specify the character used to determine the apgnment point within <mstack> and <mtable> columns when the "decimalpoint" value is used to specify the apgnment. Default is . .
Examples
Example 1: Without <mstyle> tag
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mo maxsize = "100%"> ( </mo> <mfrac> <mi> a </mi> <mi> b </mi> </mfrac> <mo maxsize = "100%"> ) </mo> </mrow> </math>
Output
Example 2: Using <mstyle> tag
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mstyle maxsize = "100%"> <mrow> <mo> ( </mo> <mfrac> <mi> a </mi> <mi> b </mi> </mfrac> <mo> ) </mo> </mrow> </mstyle> </math>
Output
MathML - Subscripts
<msub> tag is used to draw subscript to an expression.
Syntax
Here is the simple syntax to use this tag −
<msub> base subscript </msub>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the subscript is to be drawn.
subscript − subscript.
Attributes
Here is the description of all the attributes of this tag −
subscriptshift − To specify the minimum space to shift the subscript below 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 subscript.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <msub> <mi>x</mi> <mn>1</mn> </msub> </math>
Output
MathML - Subscript-Superscript
<msubsup> tag is used to attach both subscript and superscript to an expression.
Syntax
Here is the simple syntax to use this tag −
<msubsup> base subscript superscript</msubsup>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the subscript and superscript is to be drawn.
subscript − subscript.
superscript − superscript.
Attributes
Here is the description of all the attributes of this tag −
subscriptshift − To specify the minimum space to shift the subscript below the basepne of the expression.
superscriptshift − To specify the minimum space to shift the superscript above the basepne of the expression.
Example
Let s draw a subscript and superscript.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <msubsup> <mo> ∫</mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> <mrow> <msup> <mi> e</mi> <mi> x </mi> </msup> <mo> </mo> <mrow> <mi> d</mi> <mi> x </mi> </mrow> </mrow> </mrow> </math>
Output
MathML - Superscripts
<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
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
MathML - Underscript
<munder> tag is used to draw underscript. It adds an accent or a pmit under an expression.
Syntax
Here is the simple syntax to use this tag −
<munder> base underscript </munder>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the underscript is to be drawn.
underscript − underscript.
Attributes
Here is the description of all the attributes of this tag −
accentunder − If true, under-script is an accent, and is drawn closer to the base expression. If false, under-script is a pmit over the base expression. Default is false.
apgn − To specify the apgnment of the under-script. Vapd are: left, center, and right.
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 an underscript.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <munder accent="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo>ȿ</mo> </munder> </math>
Output
MathML - Underscript-Overscript
<munderover> tag is used to draw both over and under underscript. It adds an accent or a pmit over and under an expression.
Syntax
Here is the simple syntax to use this tag −
<munderover> base underscript overscript </munderover>
Parameters
Here is the description of all the parameters of this tag −
base − base expression on which the underscript is to be drawn.
underscript − underscript.
overscript − overscript.
Attributes
Here is the description of all the attributes of this tag −
accent − If true, over-script is an accent, and is drawn closer to the base expression. If false, over-script is a pmit over the base expression. Default is false.
accentunder − If true, under-script is an accent, and is drawn closer to the base expression. If false, under-script is a pmit over the base expression. Default is false.
apgn − To specify the apgnment of the under-script. Vapd are: left, center, and right. Default is center.
Example
Let s draw an underscript.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <munderover> <mo> ∫</mo> <mn> 0 </mn> <mi> ∞</mi> </munderover> </mrow> </math>
Output
MathML - Algebra Symbols
Following is a pst of Algebra symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
- | − | − | To specify subtraction |
× | × | × | To specify multippcation |
÷ | &spanide; | ÷ | To specify spanision |
≠ | ≠ | ≠ | To specify not equals |
≈ | ≈ | ≈ | To specify approximately equals |
< | < | < | To specify less than |
≤ | ≤ | ≤ | To specify less than or equals |
> | > | > | To specify greater than |
≥ | ≥ | ≥ | To specify greater than or equal |
± | ± | ± | To specify plus or minus |
∝ | ∝ | ∝ | To specify proportional to |
∑ | ∑ | ∑ | To specify summation |
∏ | ∏ | ∏ | To specify product |
⌊ | ⌊ | ⌊ | To specify left floor |
⌋ | ⌋ | ⌋ | To specify right floor |
⌈ | ⌈ | ⌈ | To specify left ceipng |
⌉ | ⌉ | ⌉ | To specify right ceipng |
MathML - Calculus Symbols
Following is a pst of Calculus symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
′ | ′ | ′ | Prime (1st derivative) |
″ | ′ | ″ | Double prime (2nd derivative) |
‴ | ‴ | ‴ | Triple prime (3nd derivative) |
∂ | ∂ | ∂ | To specify partial differential |
δ | δ | Δ | To specify increment |
∇ | &del; | ∇ | To specify gradient |
∫ | ∫ | ∫ | To specify integral |
∬ | ∫ | ∬ | To specify double integral |
∭ | ∭ | ∭ | To specify triple integral |
⨌ | ⨌ | ⨌ | To specify quadruple integral |
∮ | ∮ | ∮ | To specify contour integral |
∲ | ∲ | ∲ | To specify clockwise contour integral |
∳ | ∳ | ∳ | To specify anticlockwise contour integral |
∯ | ∮ | ∯ | To specify surface integral |
∰ | &cconint; | ∰ | To specify volume integral |
∞ | ∞ | ∞ | To specify infinity |
MathML - Elppses Symbols
Following is a pst of elppses symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
… | &helpp; | … | To specify horizontal elppsis |
⋮ | &velpp; | ⋮ | To specify vertical elppsis |
⋯ | ⋯ | ⋯ | To specify midpne horizontal elppsis |
⋰ | ⋰ | ⋰ | To specify diagonal elppsis |
⋱ | ⋱ | ⋱ | To specify downright diagonal elppsis |
MathML - Function Symbols
Following is a pst of function symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
⋅ | ⋅ | ⋅ | To specify dot product |
⨯ | ✗ | ⨯ | To specify cross product |
‖ | | | ‖ | To specify norm (magnitude) bars |
⟨ | ⟨ | ⟨ | To specify left angle bracket |
⟩ | ⟩ | ⟩ | To specify right angle bracket |
∘ | ∘ | ∘ | To specify function composition |
→ | → | → | To specify general function mapping |
↦ | ↦ | ↦ | To specify concrete function mapping |
ı | ı | ı | To specify dotless i |
ȷ | ȷ | ȷ | To specify dotless j |
MathML - Geometry Symbols
Following is a pst of geometry symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
° | ° | ° | To specify degrees |
∠ | ∠ | ∠ | To specify angle |
∡ | ∡ | ∡ | To specify measured angle |
∟ | ∟ | ∟ | To specify right angle |
⦜ | ⦜ | ⦜ | To specify right angle with square |
⊿ | ⊿ | ⊿ | To specify right triangle |
○ | ○ | ○ | To specify circle |
△ | △ | △ | To specify triangle |
□ | □ | □ | To specify square |
▱ | ▱ | ▱ | To specify parallelogram |
∥ | ∥ | ∥ | To specify parallel |
∦ | ∦ | ∦ | To specify not parallel |
⊥ | ⊥ | ⊥ | To specify perpendicular |
≅ | ≅ | ≅ | To specify congruent |
→ | → | → | To specify ray (used with <mover>) |
↔ | ↔ | ↔ | To specify pne (used with <mover>) |
- | (n/a) | - | To specify pne segment (used with <mover>) |
MathML - Greek Letters
Following is a pst of greek letters available in MathML.
Capital Letter (C) | Small Letter (S) | Entities(C) | Entities(S) | Hex Codes(C) | Hex Codes(S) |
---|---|---|---|---|---|
Α | α | α | α | Α | α |
Β | β | β | β | Β | β |
Γ | γ | γ | γ | Γ | γ |
Δ | δ | δ | δ | Δ | δ |
Ε | ε | ε | ε | Ε | ε |
Ζ | ζ | ζ | ζ | Ζ | ζ |
Η | η | η | η | Η | η |
Θ | θ | θ | θ | Θ | θ |
Ι | ι | ι | ι | Ι | ι |
Κ | κ | κ | κ | Κ | κ |
Λ | λ | λ | λ | Λ | λ |
Μ | μ | μ | μ | Μ | μ |
Ν | ν | ν | ν | Ν | ν |
Ξ | ξ | ξ | ξ | Ξ | ξ |
Ο | ο | ο | ο | Ο | ο |
Π | π | π | π | Π | π |
Ρ | ρ | ρ | ρ | Ρ | ρ |
Σ | σ | σ | σ | Σ | σ |
Τ | τ | τ | τ | Τ | τ |
Υ | υ | υ | υ | Υ | υ |
Φ | φ | φ | φ | Φ | φ |
Χ | χ | χ | χ | Χ | χ |
Ψ | ψ | ψ | ψ | Ψ | ψ |
Ω | ω | ω | ω | Ω | ω |
MathML - Invisible Operators
Following is a pst of invisible operators available in MathML.
Entity | Short Entity | Hex | Description |
---|---|---|---|
&applyfunction; | ⁡ | ⁡ | It is used to specify function apppcation |
&invisibletimes; | ⁢ | ⁢ | It is used to specify invisible multippcation |
&invisiblecomma; | ⁣ | ⁣ | It is used to specify invisible separator |
(n/a) | (n/a) | ⁤ | It is used to specify invisible addition |
MathML - Logic Symbols
Following is a pst of logic symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
¬ | ¬ | ¬ | To specify negation |
∧ | ∧ | ∧ | To specify logical conjunction |
∨ | ∨ | ∨ | To specify logical disjunction |
⊻ | ⊻ | ⊻ | To specify exclusive disjunction |
∀ | ∀ | ∀ | To specify universal quantification |
∃ | ∃ | ∃ | To specify existential quantification |
⇒ | → | ⇒ | To specify material imppcation |
⇔ | ↔ | ⇔ | To specify material equivalence |
◻ | &emptysmallsquare; | ◻ | To specify necessarily |
◊ | ◊ | ◊ | To specify possibly |
⊢ | ⊢ | ⊢ | To specify provable |
⊨ | ⊢ | ⊨ | To specify entails |
∴ | ∴ | ∴ | To specify therefore |
MathML - Set Symbols
Following is a pst of set symbols available in MathML.
MathML Symbol | HTML Entity | Hex Code | Description |
---|---|---|---|
∅ | ∅ | ∅ | To specify the empty set |
∈ | ∈ | ∈ | To specify the member of set |
∉ | ∉ | ∉ | It specifies not a member of set |
⊆ | ⊆ | ⊆ | To specify a subset |
⊈ | ⊈ | ⊈ | To specify not a subset |
⊂ | ⊂ | ⊂ | To specify a strict subset |
⊄ | ⊄ | ⊄ | To specify not a strict subset |
⊇ | ⊇ | ⊇ | To specify a superset |
⊉ | ⊉ | ⊉ | To specify not a superset |
⊃ | ⊃ | ⊃ | To specify strict superset |
⊅ | ⊅ | ⊅ | To specify not a strict superset |
∩ | ∩ | ∩ | To specify intersection |
∪ | ∪ | ∪ | To specify union |
∖ | ∖ | ∖ | To specify complement |