]> MathToWeb - User's Guide (learn how to generate MathML from LaTeX)
 MathToWeb .com Home|Support

MathToWeb User's Guide Version 3.0.1 - 2010/04/28

Note to Firefox users:  If you are seeing numerous square boxes (they look like this:     ) in the guide below, it means your MathML fonts are not up to date.   They can be updated here:  Firefox MathML fonts.
If you are using an up-to-date version of Firefix (3.0+), see the Mozilla 1.9, STIX (BETA) FONTS at the above link.

### Using MathToWeb

MathToWeb will convert any text file containing mathematical expressions written in AMS-Latex to MathML. In this respect, the file extension is of no importance, it could be: *.txt, *.xml, *.htm, etc., MathToWeb will convert them all in the same way. The file extension does become important when it comes to displaying your documents in a browser however, and the *.xml extension, along with the mandatory declarations found in the template below are recommended for this purpose.

MathToWeb can be downloaded as a graphics-based program (a picture of which can be seen on the home page) or a command-line program. The former is very simple to use: simply select a file (one that contains AMS-Latex math expressions that you would like converted to MathML) and press the 'Convert' button. For information on the using the command-line version, click here.

Regardless of which version you use (graphics or command-line), MathToWeb will create a separate file into which it will place your converted text. It will put this file in the same directory as the source file and name it by tacking '_MathToWeb_###' to the original file name.

MathToWeb can be used in one of two general ways:

• Place just your Latex math expressions in one or more text files. Convert these (one at a time) to MathML using MathToWeb (it will create separate files containing your converted MathML for each) and move this text to your main document as it develops. The main document must be built from the template below or at least, have the same declarations. This web site was constructed in such a way.

• Embed your Latex math expressions within the final document (based on the template below) and have MathToWeb convert this to MathML. MathToWeb will identify the Latex math environments within the document and insert MathML in their place. Again, a separate file will be created containing your final, converted text.

There are a few things to be aware of before writing documents containing MathML.

MathML is an XML application and web pages that use it must comply with strict XML syntax rules.
This can be achieved by writing your web pages in a form of HTML called XHTML (see the Wiki page on XHTML).

It is not difficult to conform to the XHTML standard. Four essential rules follow:

• All tags must be written in lower-case letters. For example, one would write <h1>, not <H1>.
• Tags must be closed. For example, <p>...</p> and <br />.
• Tags must be nested correctly. Don't do this: <u><b>x</u></b>; instead, write: <u><b>x</b></u> or <b><u>x</u></b>
• Attributes must be enclosed in quotation marks (either single or double). For example: style="font-size: 11px;".

Below is a template that contains all the necessary XHTML declarations etc. that are required to have MathML display properly in a browser. It should be copied and saved to a text file with an .xml extension (for example, my_web_page_template.xml).

Within the body of this template you'll find a couple of example equations written in Latex. These can be deleted and replaced with your own work; however, before doing this, it is instructive to convert the template, as is, to MathML. This simple procedure is explained below.

#### Testing the template

• Copy the template to a text file and save it in a directory of your choice as test.xml.
(You can name it anything you like, but be sure it has an .xml extension.)
• It has been pointed out in the Support Forum recently (Feb. 2008), that [Windows-Vista + MathPlayer plug-in + IE7] may object to the .xml file extension, but .xhtml can be used successfully in its place. All other browsers are fine with the .xml extension.
• Use the 'Browse' button of MathToWeb to locate and open the above file (an image of MathToWeb is on the home page).
• Press the 'Convert' button. MathToWeb will identify all AMS-Latex math environments in the present document and convert them to MathML.
* A separate file will be created containing your converted text. In this instance, it will be named: test_MathToWeb_000.xml.
View this file using the 'Open File...' command on your browser's 'File' menu; or just press the 'View in Firefox' button (you must have Firefox installed if running Windows - the button uses the default browser in other operating systems).

Template for web pages that will contain MathML

A single click inside the text-area will 'Select All'.

### Math environments

• MathToWeb parses only on AMS-Latex math environments, either inline formulae such as $...$, or display environments such as $$...$$, with only a few exceptions (such as cross-references to equations), it generally ignores everything else.
A complete list of math environments that MathToWeb recognizes follows, and there is more information on each of them individually below.

 Inline environments $...$ $$...$$
 Display environments equation multline gather align flalign alignat equation* multline* gather* align* flalign* alignat*
 Specialized environments subequations
 Subordinate environments split cases gathered aligned alignedat

• An 'inline environment' places the equation in question within the text in which it is declared, so that it reads as part of the sentence.
• A 'display environment' places the equation on a separate line of its own, so that it stands out from other text.
• The starred forms (e.g. equation*) of the above display environments are unnumbered and they are used when no cross-references to a particular equation will be made.
• MathToWeb does not support flalign and alignat (or their starred forms) at this time.
Actually, flalign and flalign* can be used, but they are treated in a similar fashion to align and align*.
• There are two environments available to break up single long equations into multiple lines or rows:  multline and split.
Both use \\ to specify the start of new rows; however, they differ in that split allows for alignment points to be specified using &.
• A subordinate environment must be used inside a display environment.
• split must be used inside: equation, gather or align (or their * forms).
Do not use it inside multline or multline*.
• cases, gathered and aligned, must be used inside equation or equation*.
• MathToWeb requires a \tag{<your-tag>} declaration to be made on all un-starred display environments: equationmultlinegather and align, as well as on subequations. This tells MathToWeb what equation number is to be displayed for the math environment in question, and it displays it in parentheses. For example,

 \tag{1.1}\label{equation-eg}   x_1 + x_2 + x_3   ${x}_{1}+{x}_{2}+{x}_{3}$ (1.1)

The command \tag*{...} is also supported, for example, \tag*{iv}, and it causes the text that you supply to be typeset literally, with no parentheses being added. These two commands, \tag, and \tag*, while being supported by AMS-Latex, are not generally used except to override an automatically generated number. For this reason, we will colour these commands light blue (\tag) in the examples below, to mean that their usage is MathToWeb specific (supported, but not required in Latex).
In addition, the command \notag can be used to suppress particular numbers on the multi-number display environments: align and gather. The command must be placed to the immediate left of the row separator \\, as follows, ...(a+b+c) \notag\\, on the line in which the number is to be suppressed.
• \label{<your-label>} declarations are required in both Latex and MathToWeb if a particular equation is to be cross-referenced (see Cross-referencing your equations). There are several examples in the list below. Note that it is customary to use hyphens '-' to break up multi-word label names rather than underscores '_', because the latter is the Latex command for 'subscript'. It is also common to see colons used in label names to separate an initial short word describing what is being labelled from the desired label name itself. For example, \label{eq:hamiltonian-for-system} uses 'eq:' in the label name to specify that this is an 'equation'. Other short prefixes used in this manner are: 'eq:' (equation), 'fig:' (figure), 'sec:' (section).
 Environment Properties Example Rendering
 $...$  or  $$...$$ inline unnumbered this equation, $(a+b)$ is inline... this equation, $\left(a+b\right)$ is inline...
$...$
• displayed
• unnumbered
  $a^3+b^2+c$ 
 ${a}^{3}+{b}^{2}+c$ () 
 \begin{equation*} ... \end{equation*} 
• displayed
• unnumbered
  \begin{equation*} a_1 + b_2 + c \end{equation*} 
 ${a}_{1}+{b}_{2}+c$ () 
 ... 
• displayed
• numbered
• single equation /
single number
  \tag{1.1}\label{equation-eg} x_1 + x_2 + x_3 
 ${x}_{1}+{x}_{2}+{x}_{3}$ (1.1)
 \begin{multline} ... \end{multline} 
• displayed
• numbered
• single equation \
single number
  \begin{multline} \tag{1.2}\label{multline-eg} a+b+c+d+e+f+g\\ +h+i+j+k\\ +l+m+n \end{multline} 
 $\begin{array}{c}a+b+c+d+e+f+g\\ +h+i+j+k\\ +l+m+n\end{array}$ (1.2)
• MathToWeb's implementation of multline left-aligns the first row, centre-aligns the middle row (or rows), and right-aligns the last row, as can be seen in the above example. This behaviour can be modified by applying the commands \shoveleft and \shoveright, which take as their argument the entire row in question, excluding the row separator \\. These commands are used only on the middle rows and have the effect of forcing them left or right. An example using \shoveright is below.

  \begin{multline} \tag{1.2}\label{multline-shoveright-eg} a+b+c+d+e+f+g\\ \shoveright{+h+i+j+k}\\ +l+m+n \end{multline} 
 $\begin{array}{c}a+b+c+d+e+f+g\\ +h+i+j+k\\ +l+m+n\end{array}$ (1.2)
 \begin{gather} ... \end{gather} 
• displayed
• numbered
• multi-equation /
multi-numbered
  \begin{gather} a_1=b+c+d \tag{1.3}\label{gather-eq1}\\ a_2=e+f+g+h+i+j+k+l+m \tag{1.4}\label{gather-eq2}\\ a_3=n+o+p+q \tag{1.5}\label{gather-eq3} \end{gather} 
 $\begin{array}{c}{a}_{1}=b+c+d\\ {a}_{2}=e+f+g+h+i+j+k+l+m\\ {a}_{3}=n+o+p+q\end{array}$ (1.3) (1.4) (1.5)
• gather centre-aligns all of its rows as can be seen from the above example.
• The subordinate environment split can be used within the gather environment (see the section on split below).
 \begin{align} ... \end{align} 
• displayed
• numbered
• multi-equation /
multi-numbered
  \begin{align} a&=b & A&=B & x&=y+z \tag{1.6}\label{align-eq1}\\ cd&=ef & CD&=EF & k&=m \tag{1.7}\label{align-eq2}\\ g+h&=i+j & G+H&=I+J & nq&=rs \tag{1.8}\label{align-eq3} \end{align} 
 $\begin{array}{cccccccc}\hfill a& =b\hfill & \phantom{\rule{1em}{0ex}}& \hfill A& =B\hfill & \phantom{\rule{1em}{0ex}}& \hfill x& =y+z\hfill \\ \hfill cd& =ef\hfill & \phantom{\rule{1em}{0ex}}& \hfill CD& =EF\hfill & \phantom{\rule{1em}{0ex}}& \hfill k& =m\hfill \\ \hfill g+h& =i+j\hfill & \phantom{\rule{1em}{0ex}}& \hfill G+H& =I+J\hfill & \phantom{\rule{1em}{0ex}}& \hfill nq& =rs\hfill \end{array}$ (1.6) (1.7) (1.8)
• align permits alignment points to be specified using & and rows by \\, and is commonly used to vertically align two or more equations, usually on binary operators such as equal signs (the example above illustrates this).
• Alignment for this environment is actually as follows:  right & left & right & left & right & left ... .
• To have numbering suspended on a particular row, place a \notag command instead of  \tag{...}\label{...}.
• The subordinate environment split can be used within the align environment (see the section on split below).
• The spacing around the equal sign in the above example is not optimal. This problem is being addressed and it is hoped that a solution will be at hand in the near future.
• \text{...} can be used inside any of the math environments, but in case of align, it is often used to annotate a multi-line equation line-by-line
(the example below illustrates this).
• There a couple of things to note regarding this example:
• \notag is used to suspend numbering on the second line (the first row is numbered 1.9, the second has no tag, the last is 2.0).
• References to other equations using the command \ref{...} (or \eqref{...}) are made from inside \text{...} calls.
• MathToWeb treats references (which are, in fact, just links) that are inside MathML differently that those that are outside. Looking at the MathML for the example below, we see that the hyperlinks representing cross-references (which are inside MathML code) are actually XML xlink calls made from <mrow> tags, for example,
<mrow xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="#align-eq1">1.6</mrow>, rather than normal HTML hyperlinks <a href="#align-eq1">1.6</a>. The former is necessary for links inside MathML, which is an XML application. Although not illustrated here, MathToWeb does use the latter mentioned HTML links for cross-references outside of MathML code (see Cross-referencing your equations for more on this topic).
  \begin{align} y& = x_0+x_1-x_2+x_3-\dotsb && \text{by \ref{align-eq1}} \tag{1.9}\label{align-eq4}\\ & = y_0+y_1 && \text{by \eqref{align-eq2}} \notag \\ & = q_0-q_1+q_2 && \text {by Axiom 4.} \tag{2.0}\label{align-eq5} \end{align} 
 (1.9) () (2.0)
 \begin{split} ... \end{split} 
• subordinate
• numbered by parent environment as a single equation
• split must be used inside: equation, gather or align (or their * forms).
Do not use it inside multline or multline*.
• The subordinate environment split allows a single equation to be broken into multiple lines in such a way that rows are marked by \\ and alignment points by &. Each split has associated with it just one equation number (see 2.1 in example below, and 1.4 in the example below that).
• split  inside  equation
• In this instance, split must constitute the entire body of the equation.
• Take a look at this more realistic example.
  \tag{2.1}\label{equation-split-eg} \begin{split} a_2+a_3+a_4&=e+f+g+h\\ &\quad +i+j+k\\ &=l+m+n \end{split} 
 $\begin{array}{ll}{a}_{2}+{a}_{3}+{a}_{4}& =e+f+g+h\\ & \phantom{\rule{1.00em}{0ex}}+i+j+k\\ & =l+m+n\end{array}$ (2.1)
• split  inside  gather or align
  \begin{gather} a_1=b+c+d \tag{1.3}\label{gather-eq1}\\ \begin{split} a_2+a_3+a_4&=e+f+g+h\\ &\quad +i+j+k\\ &=l+m+n \end{split} \tag{1.4}\label{gather-eq2} \\ a_5=o+p+q+r+s+t+u+v+w \tag{1.5}\label{gather-eq3} \end{gather} 

 $\begin{array}{c}{a}_{1}=b+c+d\\ \begin{array}{ll}{a}_{2}+{a}_{3}+{a}_{4}& =e+f+g+h\\ & \phantom{\rule{1.00em}{0ex}}+i+j+k\\ & =l+m+n\end{array}\\ {a}_{5}=o+p+q+r+s+t+u+v+w\end{array}$ (1.3) (1.4) (1.5)
 \begin{gathered} ... \end{gathered}   \begin{aligned} ... \end{aligned} 
• subordinate
• numbered by parent environment as a single equation
• gathered and aligned must be used inside: equation or equation*.
• These environments exist primarily to allow delimiters to be placed around multi-lined equation structures, as a whole, something that can not done using gather or align because these expand to the full width of the line, allowing nothing else.

For example, one might try the following in order to place curly braces around an align structure; however, such a construct will produce an error, both in Latex and MathToWeb.  \left\{ \begin{align} ... \end{align} \right\}  Error:  align can not be nested inside equation.
Similar code below using aligned rather than align, however, works as expected.
\tag*{- ii -}\label{eq:aligned-eg1} \left\{ \begin{aligned} a&=b\\ &=c \end{aligned} \right\}   $\left\{\begin{array}{cc}\hfill a& =b\hfill \\ & =c\hfill \end{array}\right\}$ - ii -
* Recall that \tag*{...} typesets whatever text is supplied literally, with no parentheses being added.
  \tag{2.5}\label{equation-aligned-eg} \left.\begin{aligned} y_0&=n_0+n_1\\ z_0&=r_0+r_1 \end{aligned}\right\} \qquad \text{$Y_0$ equations} 
There are a couple of points to note regarding the above example:
• \left. is used in place of \left\{, to insert a 'phantom delimiter' that does not appear, but which makes the necessary match with the automatically sized right pairing delimiter \right\}. Recall that the \left and \right commands cause the pairing delimiters \{ and \} to be automatically sized.  (MathToWeb also supports \right.).
Looking at the MathML for this example, we see that <mphantom>...</mphantom> tags are used to accomplish this effect.
• On the second-last line we have \text{$Y_0$ equations}. A \text{...} call, in which there exists a nested inline math environment, $Y_0$. This is allowed in Latex and MathToWeb.
 \begin{cases} ... \end{cases} 
• subordinate
• numbered by parent environment as a single equation
• cases must be used inside: equation or equation*.
  \tag{2.6}\label{eq:cases-eg} \delta_{mn} = \begin{cases} 1& \text{if $n = m$}\\ 0& \text{if $n \neq m$} \end{cases} 
Another example
 \begin{subequations} ... \end{subequations} 
• displayed
• numbered subordinately using lower-case Latin letters (a, b, c,...) relative to the parent number.
• With subequations you get a reference to the entire equation group (see  "\label{eq:group}"  below which is numbered 2.7).
• The multi-equation display environments that can be used within subequations are:  gather, align and flalign.
(The * forms of these are permissible also, however, there is not much point in this.)
  \begin{subequations}\tag{2.7}\label{eq:group} \begin{align} a&=b+c+d\tag{2.7a}\label{eq:first}\\ e&=f+g\tag{2.7b}\label{eq:second}\\ h&=i+j+k+l\tag{2.7c}\label{eq:third} \end{align} \end{subequations} 
 $\begin{array}{cc}\hfill a& =b+c+d\hfill \\ \hfill e& =f+g\hfill \\ \hfill h& =i+j+k+l\hfill \end{array}$ (2.7a) (2.7b) (2.7c)

### Using the \intertext{...} command

MathToWeb supports the command \intertext{...} which is used to insert short interjectional remarks in the middle of multi-line display environments, while at the same time preserving alignment.

• \intertext can be used only within:  gather, gather*, align, align*, flalign, flalign* and split.
• Do not use it inside:  multline, multline*, gathered, aligned and cases.
• The command must be placed right after a \\ (see the example below).
• Any single word or short phrase can be used in an \intertext statement. For example: "and" or "it follows that".

The following example was borrowed from section 3.10 of AMS User's Guide for the amsmath Package (Version 2.0)
(\tag{...} and \label{...} commands have been added).
The position of the word "and" is significant here. Notice that it is aligned on the page margin, rather than the equation margin.

  \begin{align} A_1&=N_0(\lambda;\Omega')-\phi(\lambda;\Omega'), \tag{2.8}\label{eq:align1}\\ A_2&=\phi(\lambda;\Omega')-\phi(\lambda;\Omega), \tag{2.9}\label{eq:align2}\\ \intertext{and} A_3&=\mathcal{B}(\lambda;\omega). \tag{3.0}\label{eq:align3} \end{align} 
 $\begin{array}{ccc}\phantom{\rule{1.00em}{0ex}}& \hfill {A}_{1}& ={N}_{0}\left(\lambda ;\Omega \text{'}\right)-\phi \left(\lambda ;\Omega \text{'}\right),\hfill \\ \phantom{\rule{1.00em}{0ex}}& \hfill {A}_{2}& =\phi \left(\lambda ;\Omega \text{'}\right)-\phi \left(\lambda ;\Omega \right),\hfill \\ \multicolumn{2}{c}{\text{and}}\\ \phantom{\rule{1.00em}{0ex}}& \hfill {A}_{3}& =ℬ\left(\lambda ;\omega \right).\hfill \end{array}$ (2.8) (2.9) () (3.0)

### Punctuation

#### General

 $.$ .  (period) $/$ /   (forward slash) $|$ | $,$ ,  (comma) $;$ ;  (semi-colon)
 $:$ :  (colon) $:$ \colon $!$ ! $?$ ?

#### Dots

 $\cdots$ \dotsb "dots with binary operators/relations" $\dots$ \dotsc "dots with commas" $\cdots$ \dotsi "dots with integrals" $\cdots$ \dotsm "multiplication dots" $\dots$ \dotso "other dots"
 $\ddots$ \ddots $⋮$ \vdots

The commands  \cdots  and  \ldots  are also supported by MathToWeb, although the AMS literature encourages the use of the more
semantically oriented commands:   \dotsb, \dotsc, \dotsi, \dotsm and \dotso .

Examples:

${a}_{1}+{a}_{2}+\cdots +{a}_{n}=\sum _{i=1}^{n}{a}_{i}$ $a_1 + a_2 + \dotsb + a_n = \sum_{i=1}^n a_i$("dots with binary operators/relations") MathML

${L}_{1}\left(x\right)\le \cdots \le f\left(x\right)\cdots \le {U}_{2}\left(x\right)\le {U}_{1}\left(x\right)$ $L_1(x) \le \dotsb \le f(x) \dotsb \le U_2(x) \le U_1(x)$ MathML

${P}_{k}=\left\{{x}_{0},{x}_{1},\dots ,{x}_{n}\right\}$ $P_k = \{x_0,x_1, \dotsc, x_n\}$("dots with commas") MathML

$\underset{{K}_{1}}{\int }\underset{{K}_{2}}{\int }\cdots \underset{{K}_{n}}{\int }$ $\int_{K_1} \int_{K_2} \dotsi \int_{K_n}$("dots with integrals") MathML

$x\left(x+1\right)\cdots \left(x+n\right)$ $x(x+1) \dotsm (x+n)$("multiplication dots") MathML Other examples

### Special 'escaped' characters

Care must be taken when using the following characters which are used internally by Latex and MathToWeb.
Each must be preceded by a \ character (a backslash) in order to have it interpreted properly, as the list below illustrates.
Note particularly, that curly braces are in this list.

\# \$\% \& \~ \_ \^ \\ \{ \} Note: MathToWeb processes only the contents of Latex math environments, one of which is delimited by dollar symbols,$...$(see AMS math environments). If a dollar symbol is present anywhere else in a given document, either inside or outside of a math environment, it must be escaped using \$.

Example:

$\left\{{P}_{#}\right\}$ $\{ P_{\#} \}$ MathML

MathToWeb recognizes standard HTML/XML comments:    <!--    -->   .
It will skip-over any text between these delimiters, so if it is desirable to temporarily comment out certain LaTeX equations contained in your document, it can be done in this way.

### Spaces

 Example Syntax Command Synonym Description $uv$ u v - - - - - - - - normal spacing $u\phantom{\rule{0.167em}{0ex}}v$ u \, v \, \thinspace thin space $u\phantom{\rule{0.222em}{0ex}}v$ u \: v \: \medspace medium space $u\phantom{\rule{0.278em}{0ex}}v$ u \; v \; \thickspace thick space $u\phantom{\rule{1.00em}{0ex}}v$ u \quad v \quad - - - - quad space $u\phantom{\rule{2.00em}{0ex}}v$ u \qquad v \qquad - - - - double quad space

Example:

$\int \int f\left(x,y\right)\phantom{\rule{0.278em}{0ex}}\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy$ $\iint f(x,y) \;\, dx \, dy$ MathML

#### Accents

 $\stackrel{˙}{x}$ \dot{x} $\stackrel{⇀}{x}$ \vec{x} $\stackrel{¨}{x}$ \ddot{x} $\stackrel{´}{x}$ \acute{x} $\overline{x}$ \bar{x} $\stackrel{}{x}$ \grave{x} $\stackrel{^}{x}$ \hat{x} $\stackrel{˘}{x}$ \breve{x} $\stackrel{˜}{x}$ \tilde{x}

#### Primes

 ${x}^{\prime }$ x' or x^\prime ${x}^{\prime \prime }$ x'' or x^{\prime\prime} (Note: The  '  used above for both single and double primes is the single quotation mark from the keyboard.)

• Single or multiple characters can be underlined using code such as \underline{A} which is rendered as $\underset{‾}{A}$.    A practical example is below.

• Any symbol can be typeset below or above a particular base character using the commands \underset and \overset.
\underset{*}{A} $\to \phantom{\rule{1.00em}{0ex}}\underset{*}{A}$ \overset{*}{Z} $\to \phantom{\rule{1.00em}{0ex}}\stackrel{*}{Z}$

$f\text{'}\left(a\right)=\underset{h\to 0}{\mathrm{lim}}\genfrac{}{}{0.1ex}{}{f\left(a+h\right)-f\left(a\right)}{h}$ $f'(a) = \lim_{h \to 0} \frac{f(a+h)-f(a)}{h}$ MathML

$\mathbf{a}=a\stackrel{^}{a}$ $\mathbf{a} = a \mathbf{ \hat{a} }$ MathML

$\stackrel{¨}{r}=\left(\stackrel{¨}{x},\stackrel{¨}{y},\stackrel{¨}{z}\right)$ $\mathbf{ \ddot{r} } = (\ddot{x}, \ddot{y}, \ddot{z})$ MathML

${\underset{‾}{e}}_{\phantom{\rule{0.167em}{0ex}}i}=\genfrac{}{}{0.1ex}{}{\partial {x}^{k}}{\partial {y}^{i}}{\underset{‾}{E}}_{\phantom{\rule{0.167em}{0ex}}k}$ ${\underline{e}}_{\, i} = \frac{\partial x^k}{\partial y^i} {\underline{E}}_{\, k}$ MathML

### Roots

The \sqrt command produces a square root. A different radix can be specified by making use of the optional argument (see the middle example below).

$\sqrt{2}$ $\sqrt{2}$ $\sqrt[3]{2}$ $\sqrt[3]{2}$ $\sqrt{\genfrac{}{}{0.1ex}{}{1-{\delta }_{n}}{N}}$ $\sqrt{\frac{1-\delta_n}{N}}$ MathML

### Fractions

The \frac command takes two arguments, the numerator being the first and the denominator the second.

(At present, MathToWeb has limited support \dfrac and \tfrac (d=display-style, t=text-style), in that it will display them in the same way it does \frac.)

$\genfrac{}{}{0.1ex}{}{a}{b}$ $\frac{a}{b}$

Example:

The example below was borrowed from the Short Math Guide for Latex, version 1.09,  p 12.

 $\phantom{\rule{1.00em}{0ex}}\Re z=\genfrac{}{}{0.1ex}{}{n\pi \genfrac{}{}{0.1ex}{}{\theta +\psi }{2}}{{\left(\genfrac{}{}{0.1ex}{}{\theta +\psi }{2}\right)}^{2}+{\left(\genfrac{}{}{0.1ex}{}{1}{2}\mathrm{log}|\genfrac{}{}{0.1ex}{}{B}{A}|\right)}^{2}}.$ ()
 $$\Re{z} = \frac{n\pi \dfrac{\theta +\psi}{2}}{ \left(\dfrac{\theta +\psi}{2}\right)^2 + \left( \dfrac{1}{2} \log \left\lvert\dfrac{B}{A}\right\rvert\right)^2}.$$ 

### Binomials

The \binom command takes two arguments.

(At present, MathToWeb has limited support \dbinom and \tbinom (d=display-style, t=text-style), in that it will display them in the same way it does \binom.)

$\left(\genfrac{}{}{0}{}{a}{b}\right)$ $\binom{a}{b}$

### Top and bottom embellishments

 $\stackrel{˜}{\mathrm{abcde}}$ \widetilde{abcde} $\stackrel{^}{\mathrm{abcde}}$ \widehat{abcde} $\stackrel{‾}{\mathrm{abcde}}$ \overline{abcde} $\underset{‾}{\mathrm{abcde}}$ \underline{abcde}
 $\stackrel{⏞}{\mathrm{abcde}}$ \overbrace{abcde} $\underset{⏟}{\mathrm{abcde}}$ \underbrace{abcde} $\stackrel{⟵}{\mathrm{abcde}}$ \overleftarrow{abcde} $\underset{⟵}{\mathrm{abcde}}$ \underleftarrow{abcde}
 $\stackrel{⟶}{\mathrm{abcde}}$ \overrightarrow{abcde} $\underset{⟶}{\mathrm{abcde}}$ \underrightarrow{abcde} $\stackrel{⟷}{\mathrm{abcde}}$ \overleftrightarrow{abcde} $\underset{⟷}{\mathrm{abcde}}$ \underleftrightarrow{abcde}

In addition, \overbrace can take a superscript and \underbrace a subscript:

 \overbrace{abcde}^{123} $\stackrel{123}{\stackrel{⏞}{\mathrm{abcde}}}$ \underbrace{abcde}_{123} $\underset{123}{\underset{⏟}{\mathrm{abcde}}}$ Other examples

Examples:

$\stackrel{⟶}{\mathrm{AB}}+\stackrel{⟶}{\mathrm{BC}}=\stackrel{⟶}{\mathrm{AC}}$ $\overrightarrow{AB} + \overrightarrow{BC} = \overrightarrow{AC}$ MathML

$\stackrel{‾}{{\left(\Delta n\right)}^{2}}\equiv \stackrel{‾}{{\left(n-\overline{n}\right)}^{2}}$ $\overline{ { (\Delta n) }^2 } \equiv \overline{ { (n - \bar{n}) }^2 }$ MathML

### Extensible horizontal arrows

\xleftarrow and \xrightarrow will widen automatically to accommodate the width of their superscripts and subscripts. These commands allow one optional argument (in square brackets) that represents the subscript, and have one mandatory argument (in curly braces) that represents the superscript.

 \xleftarrow[a]{A} \xrightarrow[b]{B}

Examples:

$A \; \xleftarrow{\alpha \pm 2 - 1} \; B \; \xrightarrow[H^+]{{130}^\circ C} \; C$ MathML

$\xrightarrow{ \text{this converts to} }$ MathML

### Extensible vertical arrows

 $↑$ \uparrow $⇑$ \uparrow $↓$ \uparrow $⇓$ \uparrow $↕$ \uparrow $⇕$ \uparrow

Example:

$\genfrac{}{}{0.1ex}{}{{A}^{2}}{{B}^{3}}↑$ $\frac{A^2}{B^3} \uparrow$ MathML

### Delimiter sizes

Pairing delimiters (see the next section) will not adjust their height to enclose their contents unless you specifically request it. This can be achieved using a pair of \big... prefixes (see the list below), which set the delimiters to a particular fixed size, or by using \left and \right, which causes auto-sizing.

The second example illustrates the use of the commands \left \right which auto-size the parentheses on which they act (these are absent in the first example, for comparison).

$\left(\genfrac{}{}{0.1ex}{}{{A}^{2}}{{b}_{n}}\right)$ $( \frac{A^2}{b_n} )$ MathML

$\left(\genfrac{}{}{0.1ex}{}{{A}^{2}}{{b}_{n}}\right)$ $\left( \frac{A^2}{b_n} \right)$ MathML

 $f↦\genfrac{}{}{0.1ex}{}{1}{\sqrt{2\pi }}{\left\{\underset{-\pi }{\overset{\pi }{\int }}f\left(t\right){e}^{-ikt}\phantom{\rule{0.167em}{0ex}}dt\right\}}_{k\in ℤ}$ $f \mapsto \frac{1}{\sqrt{2 \pi}} \left\{\int_{-\pi}^\pi f(t) e^{-i k t} \, dt \right\}_{k \in \mathbb{Z}}$ MathML

 ( ) \left \right \bigl \bigr \Bigl \Bigr \biggl \biggr \Biggl \Biggr $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$

### Delimiters (extensible, pairing delimiters)

 $\left(\phantom{\rule{0.278em}{0ex}}\right)$ ( ) $\left[\phantom{\rule{0.278em}{0ex}}\right]$ [ ] $\left\{\phantom{\rule{0.278em}{0ex}}\right\}$ \{ \}or\lbrace \rbrace
 $|\phantom{\rule{0.278em}{0ex}}|$ \lvert \rvert $\parallel \phantom{\rule{0.278em}{0ex}}\parallel$ \lVert \rVert $⟨\phantom{\rule{0.278em}{0ex}}⟩$ \langle \rangle
 $⌈\phantom{\rule{0.278em}{0ex}}⌉$ \lceil \rceil $⌊\phantom{\rule{0.278em}{0ex}}⌋$ \lfloor \rfloor $⎰\phantom{\rule{0.278em}{0ex}}⎱$ \lmoustache \rmoustache

Examples:

$\left(\genfrac{}{}{0.1ex}{}{a}{b}\right)$ $\left( \frac{a}{b} \right)$ MathML

$|\genfrac{}{}{0.1ex}{}{f\left(x+{\delta }_{m}\right)-f\left(x\right)}{{\delta }_{m}}|\ge \zeta$ $\left\lvert \frac{f(x+\delta_m) - f(x)}{\delta_m} \right\rvert \ge \zeta$ MathML

 $⟨\genfrac{}{}{0.1ex}{}{{\mathbf{p}}^{2}}{m}⟩=⟨\mathbf{r}\mathbf{\cdot }\mathbf{\nabla }V\left(r\right)⟩$ $\left\langle \frac{\mathbf{p}^2}{m} \right\rangle = \langle \mathbf{r} \boldsymbol{\cdot} \boldsymbol{\nabla} V(r) \rangle$ MathML

$1=\sum _{n}|{u}_{n}⟩⟨{u}_{n}|$ $1 = \sum_n \lvert u_n \rangle \langle u_n \rvert$ MathML

In the last example above, we have matched a \lvert delimiter (on the left), to a \rangle delimiter (on the right) and vise versa, demonstrating the point that any left pairing delimiter can, in fact, be matched to any right pairing delimiter.

Note:  MathToWeb pre-defines the function \abs{x}$\to \phantom{\rule{0.278em}{0ex}}|x|$ so that it can be used directly.
In Latex, recommended practice is to place the following command in the preamble: \providecommand{\abs}[1]{\lvert#1\rvert}
(see section 6.2, Short Math Guide for Latex, version 1.09).

### Extensible, non-pairing symbols

 $|$ \vert $‖$ \Vertor\|
 $/$ / $\$ \backslash

Examples:

$\genfrac{}{}{0.1ex}{}{{u}^{3}}{4}{|}_{1}^{2}$ $\frac{u^3}{4} \vert_1^2$ MathML

$\genfrac{}{}{0.1ex}{}{{A}^{2}}{3}/B$ $\frac{A^2}{3} / B$ MathML

### Functions (named operators)

#### Hyperbolic and trigonometric functions

 $\mathrm{arcsinh}$ \arcsinh $\mathrm{arccosh}$ \arccosh $\mathrm{arctanh}$ \arctanh $\mathrm{arccsch}$ \arccsch $\mathrm{arcsech}$ \arcsech $\mathrm{arccoth}$ \arccoth
 $\mathrm{sinh}$ \sinh $\mathrm{cosh}$ \cosh $\mathrm{tanh}$ \tanh $\mathrm{csch}$ \csch $\mathrm{sech}$ \sech $\mathrm{coth}$ \coth
 $\mathrm{arcsin}$ \arcsin $\mathrm{arccos}$ \arccos $\mathrm{arctan}$ \arctan $\mathrm{arccsc}$ \arccsc $\mathrm{arcsec}$ \arcsec $\mathrm{arccot}$ \arccot
 $\mathrm{sin}$ \sin $\mathrm{cos}$ \cos $\mathrm{tan}$ \tan $\mathrm{csc}$ \csc $\mathrm{sec}$ \sec $\mathrm{cot}$ \cot

The light-blue coloured operator names such as  \arcsinh  are supported by MathToWeb, but not by Latex where they would be handled using the command \DeclareMathOperator or \operatorname, see below (MathToWeb supports the latter).

#### Limits

 $\mathrm{lim}$ \lim \liminf \limsup
 $\underset{⟵}{\mathrm{lim}}$ \varprojlim $\underset{⟶}{\mathrm{lim}}$ \varinjlim $\underset{‾}{\mathrm{lim}}$ \varliminf $\stackrel{‾}{\mathrm{lim}}$ \varlimsup
 \injlim \projlim

The command \textstyle can be applied to:  \lim  ,  \liminf  and   \limsup  .  See the first two limit examples below.

#### Other

 $\mathrm{arg}$ \arg $\mathrm{deg}$ \deg $\mathrm{det}$ \det $\mathrm{dim}$ \dim $\mathrm{exp}$ \exp $\mathrm{gcd}$ \gcd
 $\mathrm{hom}$ \hom $\mathrm{inf}$ \inf $\mathrm{ker}$ \ker $\mathrm{lg}$ \lg $\mathrm{ln}$ \ln $\mathrm{log}$ \log
 $\mathrm{max}$ \max $\mathrm{min}$ \min $\mathrm{Pr}$ \Pr $\mathrm{sup}$ \sup

#### Defining your own named operator using \operatorname{..}

Below we have defined a named operator which we call "skew":
\operatorname{skew}(x) $\to \phantom{\rule{0.278em}{0ex}}\mathrm{skew}\left(x\right)$

Note:  The most common Latex command for declaring new named operators is \DeclareMathOperator. This command is not yet supported by MathToWeb.

Examples:

${\mathrm{cos}}^{2}t=\genfrac{}{}{0.1ex}{}{1+\mathrm{cos}2t}{2}$ $\cos^2 t = \frac{ 1 + \cos{2t} }{ 2 }$ MathML

${\mathrm{log}}_{a}x=\genfrac{}{}{0.1ex}{}{\mathrm{ln}x}{\mathrm{ln}a}$ $\log_a x = \frac{\ln x}{\ln a}$ MathML

$\underset{n\to \infty }{\mathrm{lim}}{p}_{n}$ $\lim_{n \to \infty} p_n$ MathML

${\mathrm{lim}}_{n\to \infty }{p}_{n}$ $\textstyle\lim_{n \to \infty} p_n$ ( forcing \textstyle ) MathML

The above two examples are identical, with the exception that in the second, we have applied \textstyle to the \lim operator.
Forcing \textstyle on an operator such as \lim has the effect of shifting underscripts to subscripts and overscripts to superscripts, making the equation compact (in the vertical direction) and more suitable for inline display.
MathToWeb makes this command available for:   \lim,  \liminf  and  \limsup.

$\limsup_{n \to \infty} \; \sqrt[n]{c_n} \le \alpha$ MathML

$\liminf_{n \to \infty} \, \frac{c_{n+1}}{c_n}$ MathML

### Placing text within an equation using \text{..}

Text can be inserted into the LaTeX of any equation environment using \text{...}.

It is important to note that, if required, inline LaTeX enviroments (i.e. $...$) can be nested within text,
e.g. \text{this inline equation, $A_i$ is nested within the text} (see the third example below).

The examples below should be adequate to demonstate the use of this command.

$A\phantom{\rule{0.278em}{0ex}}\text{means}\phantom{\rule{0.278em}{0ex}}B$ $A \; \text{means} \; B$ (Recall that \; is a thick space. Below we use \qquad, a double quad space.)

$\sum _{n=-\infty }^{\infty }{c}_{n}{e}^{inx}\phantom{\rule{2.00em}{0ex}}\text{means}\phantom{\rule{2.00em}{0ex}}\underset{N\to \infty }{\mathrm{lim}}\phantom{\rule{0.222em}{0ex}}\sum _{n=-N}^{N}{c}_{n}{e}^{inx}$
$\sum_{n=-\infty}^{\infty} c_n e^{inx} \qquad \text{means} \qquad \lim_{N \to \infty} \: \sum_{n=-N}^N c_n e^{inx}$ MathML

 \begin{equation*} \delta_{mn} = \begin{cases} 1& \text{if $n = m$}\\ 0& \text{if $n \neq m$} \end{cases} \end{equation*} MathML


Use \newcommand to create your own Latex commands which you name and define using known Latex.
(Note: Use only lower- or upper-case letters when defining command-names, e.g. \mycommand{..}[..]{..}.)

These are good commands to use when the same Latex occurs at multiple locations in a particular document. Instead of typing it over and over, simply define a new command to represent it, and place that in your document at all the locations where it is required.


The syntax of these commands is as follows:
('number of arguments', the optional argument in square brackets, must be an integer between 0 and 9 inclusive.)

\newcommand{\command-name}[number of arguments]{command text, using #1, #2 etc. to denote arguments}

Example:

 ${x}_{1}^{i}...{x}_{n}^{i}$  $\ki{x}$ 


 >java -jar mathtoweb.jar -ncf myncf1.txt test.xml

If it is desirable to include more than one new-command file, separate them using commas, as follows:
 >java -jar mathtoweb.jar -ncf myncf1.txt, myncf2.txt test.xml

### Math font switches

The following math font switches are supported by MathToWeb:  \mathbf,  \mathbb,   \mathcal,  \mathfrak,  \mathit  and  \mathsf.
There use is described in more detail below.

#### Blackboard bold letters (no lower-case)

Usage:  \mathbb{A}

$𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ$

#### Boldface letters

Usage:  \mathbf{A} (These are often used to denote vectors.)

Example:

$\mathbf{A}={\mathbf{r}}_{2}-{\mathbf{r}}_{1}$ $\mathbf{A} = \mathbf{r}_2 - \mathbf{r}_1$ MathML

#### Calligraphic letters (no lower-case)

Usage:  \mathcal{A}

$𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵$

#### Fraktur letters

Usage:  \mathfrak{A}

$𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌ\Im 𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔\Re 𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ$ $𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷$

Example:

$d𝔑={𝔉}_{1\sigma }\phantom{\rule{0.278em}{0ex}}d{\Omega }^{\prime }$ $d\mathfrak{N} = \mathfrak{F}_{1\sigma} \; d\Omega^\prime$ MathML

#### Italic letters

Usage:  \mathit{A}

#### Sans-serif letters

Usage:  \mathsf{A}

### Greek letters

 $\Delta$ \Delta $\Gamma$ \Gamma $\Lambda$ \Lambda $\Omega$ \Omega $\Phi$ \Phi $\Pi$ \Pi $\Psi$ \Psi $\Sigma$ \Sigma $\Theta$ \Theta $\Upsilon$ \Upsilon $\Xi$ \Xi
 $\alpha$ \alpha $\beta$ \beta $\chi$ \chi $\delta$ \delta $\epsilon$ \epsilon $\eta$ \eta $\gamma$ \gamma $\iota$ \iota $\kappa$ \kappa $\lambda$ \lambda $\mu$ \mu $\nu$ \nu
 $\omega$ \omega $\phi$ \phi $\pi$ \pi $\psi$ \psi $\rho$ \rho $\sigma$ \sigma $\tau$ \tau $\theta$ \theta $\upsilon$ \upsilon $\xi$ \xi $\zeta$ \zeta
 $ϝ$ \digamma $ϵ$ \varepsilon $\varkappa$ \varkappa $\varphi$ \varphi $\varpi$ \varpi $\varrho$ \varrho $\varsigma$ \varsigma $\vartheta$ \vartheta

Bold Greek:  \boldsymbol{\alpha}

Example:

${(\mathbf{A} \times \mathbf{B})}_{\alpha} = \epsilon_{\alpha \beta \gamma} A_{\beta} B_{\gamma}$

${\left(\mathbf{A}×\mathbf{B}\right)}_{\alpha }={\epsilon }_{\alpha \beta \gamma }{A}_{\beta }{B}_{\gamma }$ MathML

### Bold math symbols in general

Most math symbols can be rendered in bold type using the command \boldsymbol or \pmb ("poor man's bold").
These are meant to be applied to only one symbol at a time.

Usage:  \boldsymbol{\somechar}

$\exists \phantom{\rule{0.278em}{0ex}}\partial \phantom{\rule{0.278em}{0ex}}\hslash \phantom{\rule{0.278em}{0ex}}\infty \phantom{\rule{0.278em}{0ex}}\nabla \phantom{\rule{0.278em}{0ex}}\forall \phantom{\rule{0.278em}{0ex}}±\phantom{\rule{0.278em}{0ex}}\cap \ll \phantom{\rule{0.278em}{0ex}}\sim \phantom{\rule{0.278em}{0ex}}⇒\phantom{\rule{0.278em}{0ex}}⋔\phantom{\rule{0.278em}{0ex}}\propto$ normal
$\mathbf{\exists }\phantom{\rule{0.278em}{0ex}}\mathbf{\partial }\phantom{\rule{0.278em}{0ex}}\mathbf{\hslash }\phantom{\rule{0.278em}{0ex}}\mathbf{\infty }\phantom{\rule{0.278em}{0ex}}\mathbf{\nabla }\phantom{\rule{0.278em}{0ex}}\mathbf{\forall }\phantom{\rule{0.278em}{0ex}}\mathbf{±}\phantom{\rule{0.278em}{0ex}}\mathbf{\cap }\phantom{\rule{0.278em}{0ex}}\mathbf{\ll }\phantom{\rule{0.278em}{0ex}}\mathbf{\sim }\phantom{\rule{0.278em}{0ex}}\mathbf{⇒}\phantom{\rule{0.278em}{0ex}}\mathbf{⋔}\phantom{\rule{0.278em}{0ex}}\mathbf{\propto }$ bold

Example:

$D_{\infty} \sim \boldsymbol{\pi} \mathbf{D}_{\boldsymbol{\infty}} \boldsymbol{+} \boldsymbol{\dotsb}$

${D}_{\infty }\sim \mathbf{\pi }{\mathbf{D}}_{\mathbf{\infty }}\mathbf{+}\mathbf{\cdots }$

### Symbols

Many people will be familiar with the Short Math Guide for Latex, version 1.09 (written by Michael Downes). Several of the symbol tables below have been made to resemble the tables in this excellent publication as closely as possible.

#### Common symbols

 $\infty$ \infty $\hslash$ \hslash $\partial$ \partial $\nabla$ \nabla $\varnothing$ \emptyset $\exists$ \exists $\nexists$ \nexists $\forall$ \forall $\Re$ \Re $\Im$ \Im $\in$ \in $\parallel$ \parallel $\perp$ \perp $\propto$ \propto $\because$ \because $\therefore$ \therefore

#### Other less common symbols

 $\aleph$ \aleph $\beth$ \beth $\daleth$ \daleth $\gimel$ \gimel $\complement$ \complement $\ell$ \ell $\mho$ \mho $\wp$ \wp $Ⓢ$ \circledS
 $#$ \# $&$ \& $\angle$ \angle $‵$ \backprime $★$ \bigstar \blacklozenge $\blacksquare$ \blacksquare $▴$ \blacktriangle $▾$ \blacktriangledown
 $\perp$ \bot $♣$ \clubsuit \diamondsuit $♭$ \flat $♥$ \heartsuit $◊$ \lozenge $\measuredangle$ \measuredangle $♮$ \natural $¬$ \neg
 $♯$ \sharp $♠$ \spadesuit $\sphericalangle$ \sphericalangle $\square$ \square $\surd$ \surd $\top$ \top $▵$ \triangle $▿$ \triangledown $\varnothing$ \varnothing

### Binary operator symbols

 $*$ * $+$ + $-$ - \amalg $*$ \ast $⌅$ \barwedge $◯$ \bigcirc $▽$ \bigtriangledown $△$ \bigtriangleup \boxdot $\boxminus$ \boxminus $⊞$ \boxplus $⊠$ \boxtimes $•$ \bullet
 $\cap$ \cap $⋒$ \Cap $\cdot$ \cdot $·$ \centerdot $\circ$ \circ $⊛$ \circledast $⊚$ \circledcirc $⊝$ \circleddash $\cup$ \cup $⋓$ \Cup $⋎$ \curlyvee $⋏$ \curlywedge $†$ \dagger $‡$ \ddagger
 $\diamond$ \diamond $÷$ \div $\divideontimes$ \divideontimes $\dotplus$ \dotplus $⌆$ \doublebarwedge $⋗$ \gtrdot $⊺$ \intercal $⋋$ \leftthreetimes $⋖$ \lessdot $⋉$ \ltimes $\mp$ \mp $\odot$ \odot $\ominus$ \ominus $\oplus$ \oplus
 $\oslash$ \oslash $\otimes$ \otimes $±$ \pm $⋌$ \rightthreetimes $⋊$ \rtimes $\setminus$ \setminus \smallsetminus $\sqcap$ \sqcap $\bigsqcup$ \sqcup $\star$ \star $×$ \times $◃$ \triangleleft $▹$ \triangleright $\uplus$ \uplus
 $\vee$ \vee $⊻$ \veebar $\wedge$ \wedge $\wr$ \wr

### Relation symbols:  <  =  >  ~  $\succ$ and variants

 $<$ < $>$ > $=$ = $\approx$ \approx $\approxeq$ \approxeq $\approx$ \asymp $≌$ \backcong $\backsim$ \backsim $\backsimeq$ \backsimeq $\Bumpeq$ \Bumpeq $\bumpeq$ \bumpeq $\circeq$ \circeq $\cong$ \cong $≔$ \coloneq $⋞$ \curlyeqprec $⋟$ \curlyeqsucc $\doteq$ \doteq $\doteqdot$ \doteqdot $\eqcirc$ \eqcirc $≕$ \eqcolon
 $⪖$ \eqslantgtr $⪕$ \eqslantless $\eqsim$ \esim  ( \eqsim ) $\equiv$ \equiv $\fallingdotseq$ \fallingdotseq $\ge$ \geq  ( \ge ) $\geqq$ \geqq  \geqslant $\gg$ \gg $⋙$ \ggg  ( \Gg, \gggtr )  \gnapprox $\gneqq$ \gneqq $⪈$ \gneq $⋧$ \gnsim $⪆$ \gtrapprox $⋗$ \gtrdot $⋛$ \gtreqless $⪌$ \gtreqqless $\gtrless$ \gtrless $\gtrsim$ \gtrsim
  \gvertneqq $\le$ \leq  ( \le ) $\leqq$ \leqq  \leqslant $⪅$ \lessapprox $⋖$ \lessdot $⋚$ \lesseqgtr $⪋$ \lesseqqgtr $\lessgtr$ \lessgtr $\lesssim$ \lesssim $\ll$ \ll $⋘$ \lll  ( \Ll, \llless )  \lnapprox $\lneqq$ \lneqq $⪇$ \lneq $⋦$ \lnsim  \lvertneqq $\not\approx$ \napprox $\ncong$ \ncong $\ne$ \neq  ( \ne )
 $\not\equiv$ \nequiv  \ngeq $\geqq ̸$ \ngeqq $⩾̸$ \ngeqslant $\ngtr$ \ngtr  \nleq $\leqq ̸$ \nleqq $⩽̸$ \nleqslant $\nless$ \nless $\nprec$ \nprec  \npreceq $\nsim$ \nsim $\not\simeq$ \nsimeq $\prec$ \prec $⪷$ \precapprox $\preccurlyeq$ \preccurlyeq  \preceq $⪹$ \precnapprox  \precneqq $⋨$ \precnsim
 $\precsim$ \precsim $\stackrel{?}{=}$ \questeq $\risingdotseq$ \risingdotseq $\sim$ \sim $\simeq$ \simeq $\succ$ \succ $⪸$ \succapprox $\succcurlyeq$ \succcurlyeq $⪰$ \succeq $⪺$ \succnapprox  \succneqq $⋩$ \succnsim $\succsim$ \succsim  \thickapprox  \thicksim $\triangleq$ \triangleq

### Relation symbols:  arrows

 $↺$ \circlearrowleft $↻$ \circlearrowright $↶$ \curvearrowleft $↷$ \curvearrowright $⇊$ \downdownarrows $⇃$ \downharpoonleft $⇂$ \downharpoonright  $⇓$ \Downarrow $↩$ \hookleftarrow $↪$ \hookrightarrow $←$ \leftarrow  ( \gets ) $⇐$ \Leftarrow $↢$ \leftarrowtail $↽$ \leftharpoondown $↼$ \leftharpoonup
 $⇇$ \leftleftarrows $↔$ \leftrightarrow $⇔$ \Leftrightarrow  ( \iff ) $⇆$ \leftrightarrows $⇋$ \leftrightharpoons $↭$ \leftrightsquigarrow $⇚$ \Lleftarrow $⟵$ \longleftarrow $⟸$ \Longleftarrow $⟷$ \longleftrightarrow $⟺$ \Longleftrightarrow  \longmapsto $⟶$ \longrightarrow $⟹$ \Longrightarrow $↫$ \looparrowleft
 $↬$ \looparrowright $↰$ \Lsh $↦$ \mapsto $⊸$ \multimap  $⇍$ \nLeftarrow $⇎$ \nLeftrightarrow $⇏$ \nRightarrow $↗$ \nearrow $↚$ \nleftarrow $↮$ \nleftrightarrow $↛$ \nrightarrow $↖$ \nwarrow $\to$ \rightarrow  ( \to ) $⇒$ \Rightarrow $↣$ \rightarrowtail
 $⇁$ \rightharpoondown $⇀$ \rightharpoonup $⇄$ \rightleftarrows $⇌$ \rightleftharpoons $⇉$ \rightrightarrows $↝$ \rightsquigarrow $⇛$ \Rrightarrow $↱$ \Rsh $↘$ \searrow $↙$ \swarrow $↞$ \twoheadleftarrow $↠$ \twoheadrightarrow $⇑$ \Uparrow $↕$ \updownarrow $⇕$ \Updownarrow
 $↿$ \upharpoonleft $↾$ \upharpoonright $⇈$ \upuparrows

### Relation symbols:  miscellaneous

 $϶$ \backepsilon $\because$ \because $\between$ \between $◂$ \blacktriangleleft $▸$ \blacktriangleright $\bowtie$ \bowtie $⊣$ \dashv $⌢$ \frown $\in$ \in $\mid$ \mid $\vDash$ \models $\ni$ \ni or \owns $\nmid$ \nmid $\notin$ \notin $\nparallel$ \nparallel $\nmid$ \nshortmid $\nparallel$ \nshortparallel $⊈$ \nsubseteq
 $⫅̸$ \nsubseteqq $⊉$ \nsupseteq $⫆̸$  supseteqq $⋪$ \ntriangleleft $⋬$ \ntrianglelefteq $⋫$ \ntriangleright $⋭$ \ntrianglerighteq $⊬$ \nvdash $⊮$ \nVdash $⊭$ \nvDash $⊯$ \nVDash $\parallel$ \parallel $\perp$ \perp $⋔$ \pitchfork $\propto$ \propto $\mid$ \shortmid $\parallel$ \shortparallel $⌢$ \smallfrown
 $⌣$ \smallsmile $⌣$ \smile $⊏$ \sqsubset $⊑$ \sqsubseteq $⊐$ \sqsupset $⊒$ \sqsupseteq $\subset$ \subset $⋐$ \Subset $\subseteq$ \subseteq $⫅$ \subseteqq $⊊$ \subsetneq $⫋$ \subsetneqq $\supset$ \supset $⋑$ \Supset $\supseteq$ \supseteq $⫆$ \supseteqq $⊋$ \supsetneq $⫌$ \supsetneqq
 $\therefore$ \therefore $⊴$ \trianglelefteq $⊵$ \trianglerighteq $\propto$ \varpropto $⊊︀$ \varsubsetneq $⫋︀$ \varsubsetneqq $⊋︀$ \varsupsetneq $⫌︀$ \varsupsetneqq  \vartriangle $⊲$ \vartriangleleft $⊳$ \vartriangleright $⊢$ \vdash $⊩$ \Vdash $\models$ \vDash $\Vvdash$ \Vvdash

### Integrals, sums and other variable-size operators

 $\int$ \int $\int \int$ \iint $\int \int \int$ \iiint $\int \int \int \int$ \iiiint $\int \cdots \int$ \idotsint $\oint$ \oint $∯$ \oiint
 $\sum$ \sum $\prod$ \prod $\coprod$ \coprod $\bigcup$ \bigcup $\bigcap$ \bigcap $⨆$ \bigsqcup $⨄$ \biguplus
 $\bigvee$ \bigvee $\bigwedge$ \bigwedge $⨀$ \bigodot $⨁$ \bigoplus $⨂$ \bigotimes

The \textstyle command can be applied to any of the above operators. It must be placed so that it immediately precedes the operator on which it acts, for example $\textstyle\int xdx$ (several examples are below).

Examples:

$\int f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\int f(x)\,dx$ $\underset{a}{\overset{b}{\int }}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\int_a^b f(x)\,dx$ $\underset{a}{\overset{b}{\int }}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\textstyle\int_a^b f(x)\,dx$

$\int \int \int f\left(x,y,z\right)\phantom{\rule{0.278em}{0ex}}\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz$ $\iiint f(x,y,z) \;\, dx \, dy \, dz$ $\int \int \int f\left(x,y,z\right)$ $\textstyle\iiint f(x,y,z)$

$\underset{V}{\int \int \int }\Phi {\mathbf{\nabla }}^{2}\phi \phantom{\rule{0.278em}{0ex}}\phantom{\rule{0.167em}{0ex}}dV$ $\iiint_V \Phi \boldsymbol{\nabla}^2\phi \;\, dV$

$\underset{C}{\oint }\mathbf{A}\mathbf{\cdot }\phantom{\rule{0.167em}{0ex}}d\mathbf{r}$ $\oint_C \mathbf{A} \boldsymbol{\cdot} \, d\mathbf{r}$

$\underset{\Delta S}{∯}\phantom{\rule{0.278em}{0ex}}d\mathbf{S}\circ$ $\oiint_{\Delta S} \; d\mathbf{S} \circ$

$\int \cdots \int f\left({x}_{1},\dots ,{x}_{k}\right)\phantom{\rule{0.222em}{0ex}}\phantom{\rule{0.167em}{0ex}}d{x}_{1}\dots d{x}_{k}$ $\idotsint f(x_1,\dotsc , x_k) \:\, dx_1 \dotsc dx_k$

$\sum _{k=1}^{n}{c}_{k}$ $\sum_{k=1}^n c_k$ $\sum _{k=1}^{n}{c}_{k}$ $\textstyle\sum_{k=1}^n c_k$

$\prod _{i=1}^{k}\left(1-{u}_{i}\right)$ $\prod_{i=1}^k (1-u_i)$ $\prod _{i=1}^{k}\left(1-{u}_{i}\right)$ $\textstyle\prod_{i=1}^k (1-u_i)$

$\bigcup _{n=1}^{\infty }{A}_{n}\in ℛ$ $\bigcup_{n=1}^\infty A_n \in \mathcal{R}$ $\bigcup _{n=1}^{\infty }{A}_{n}$ $\textstyle\bigcup_{n=1}^\infty A_n$

$\bigcap _{n=1}^{\infty }{A}_{n}\in ℛ$ $\bigcap_{n=1}^\infty A_n \in \mathcal{R}$ $\bigcap _{n=1}^{\infty }{A}_{n}$ $\textstyle\bigcap_{n=1}^\infty A_n$

$\underset{\Delta S}{\int \int }\left(\mathbf{\nabla }×\mathbf{A}\right)\mathbf{\cdot }\mathbf{n}\phantom{\rule{0.278em}{0ex}}dS$ $\iint_{\Delta S} (\boldsymbol{\nabla} \times \mathbf{A} ) \boldsymbol{\cdot} \mathbf{n} \; dS$

$\genfrac{}{}{0.1ex}{}{8{a}^{5}}{5}\underset{\phi =0}{\overset{\pi /2}{\int }}\phantom{\rule{0.278em}{0ex}}\underset{\theta =0}{\overset{\pi /2}{\int }}\mathrm{sin}\theta \phantom{\rule{0.278em}{0ex}}\phantom{\rule{0.167em}{0ex}}d\theta \phantom{\rule{0.167em}{0ex}}d\phi$
$\frac{8a^5}{5} \int_{\phi=0}^{\pi/2} \; \int_{\theta = 0}^{\pi/2} \sin{\theta} \;\, d\theta \, d \phi$

#### The \substack command

The \substack command is used to create multi-line subscripts or superscripts, usually on sums, but it can be used elsewhere.

$\sum _{\genfrac{}{}{0}{}{A}{B}}$ $\sum_{\substack{A \\ B}}$ $\sum _{\genfrac{}{}{0}{}{A}{B}}^{\genfrac{}{}{0}{}{C}{D}}$ $\sum_{\substack{A \\ B}}^{\substack{C \\ D}}$

$\sum _{\genfrac{}{}{0}{}{0\le i\le m}{0\le j\le n}}{A}_{\mathrm{ij}}$ $\sum_{\substack{0 \le i \le m \\ 0 \le j \le n}} A_{ij}$

$\underset{\genfrac{}{}{0}{}{x\to {x}^{\circ }\in B}{x\in D}}{\mathrm{lim}}\phantom{\rule{0.278em}{0ex}}I\left(x,t\right)$ $\lim_{\substack{x \to x^\circ \in B \\ x \in D}} \; I(x,t)$

#### The \nolimits command

The \nolimits command can be used to force limits from an over/under configuration to that of superscript/subscript. It must be placed immediately to the right of the base to which it applies (see the examples below).

$\underset{a}{\overset{b}{\int }}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\int_a^b f(x)\,dx$ ${\int }_{a}^{b}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\int\nolimits_a^b f(x)\,dx$

Note: When requiring "textstyle", MathToWeb will sometimes give more satisfactory results if \nolimits is used in addition to \textstyle (see the examples below).

${\int }_{a}^{b}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ $\textstyle\int\nolimits_a^b f(x)\,dx$ ${\bigcup }_{n=1}^{\infty }{A}_{n}$ $\textstyle\bigcup\nolimits_{n=1}^\infty A_n$

### Matrices

Note: Although it hasn't been shown, the matrix structures below must be placed inside some sort of math environment to have them display properly in a browser. The unnumbered display environment, \begin{equation*} ... \end{equation*} works well for the purpose of testing.

  \begin{matrix} a&b\\ c&d \end{matrix} 
$\begin{array}{cc}a& b\\ c& d\end{array}$
  \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} 
$\begin{array}{cc}a& b\\ c& d\end{array}$
To place pairing delimiters
such as parentheses around this:
  \bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) 
$\left(\begin{array}{cc}a& b\\ c& d\end{array}\right)$
  \begin{pmatrix} a&b\\ c&d \end{pmatrix} 
$\left(\begin{array}{cc}a& b\\ c& d\end{array}\right)$
  \begin{bmatrix} a&b\\ c&d \end{bmatrix} 
$\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$
  \begin{Bmatrix} a&b\\ c&d \end{Bmatrix} 
$\left\{\begin{array}{cc}a& b\\ c& d\end{array}\right\}$
  \begin{vmatrix} a&b\\ c&d \end{vmatrix} 
$|\begin{array}{cc}a& b\\ c& d\end{array}|$
  \begin{Vmatrix} a&b\\ c&d \end{Vmatrix} 
$\parallel \begin{array}{cc}a& b\\ c& d\end{array}\parallel$

Example:

$\left(\begin{array}{ccc}{a}_{11}& \cdots & {a}_{1n}\\ ⋮& \ddots & ⋮\\ {a}_{m1}& \cdots & {a}_{\mathrm{mn}}\end{array}\right)$
  \begin{pmatrix} a_{11} & \dotsm & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} & \dotsm & a_{mn} \end{pmatrix} 
Another example

### Boxed formulae

The \boxed{...} command places a box around its argument.

$\begin{array}{|c|}\hline {\zeta }_{\varphi }\left(z\right)\equiv {\Psi }_{\phi }\left(z\right)\phantom{\rule{1.00em}{0ex}}\forall \phantom{\rule{0.278em}{0ex}}z\ge \eta \\ \hline\end{array}$ $\boxed{ \zeta_\varphi(z) \equiv \Psi_\phi(z) \quad \forall \; z \geq \eta }$

### Examples

#### \overbrace

$\overbrace{a + ar + ar^2 + \dotsb = \frac{a}{1-r}}^{ \text{converges if and only if$|r| < 1$} }$

MathML

#### \underbrace

$\underbrace{A_p = g_{pq}A^p}_{ \text{ For rectangular coordinates$g_{pq}=1$if$p=q$, and$0$if$p \neq q$} }$

MathML

#### \ddots and \vdots

 $\left(\begin{array}{ccc}{a}_{11}-\lambda & \cdots & {a}_{1n}\\ ⋮& \ddots & ⋮\\ {a}_{n1}& \cdots & {a}_{\mathrm{nn}}-\lambda \end{array}\right)\left(\begin{array}{c}{x}_{1}\\ ⋮\\ {x}_{n}\end{array}\right)=\mathbf{0}$ ()
  \begin{equation*} { \begin{pmatrix} a_{11}-\lambda & \dotsm & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{n1} & \dotsm & a_{nn}-\lambda \end{pmatrix} } { \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} } { = \mathbf{0} } \end{equation*} 
MathML

#### splitinsideequation

This example was borrowed from section 3.4 of AMS User's Guide for the amsmath Package (Version 2.0).
(One addition to this code was made, the \tag{1} command on the second line, which is required by MathToWeb, but optional in Latex.)

  \tag{1}\label{e:barwq} \begin{split} H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2} \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\ &\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr]. \end{split} 

 $\begin{array}{ll}{H}_{c}& =\genfrac{}{}{0.1ex}{}{1}{2n}\sum _{l=0}^{n}{\left(-1\right)}^{l}{\left(n-l\right)}^{p-2}\sum _{{l}_{1}+\dots +{l}_{p}=l}\prod _{i=1}^{p}\left(\genfrac{}{}{0}{}{{n}_{i}}{{l}_{i}}\right)\\ & \phantom{\rule{1.00em}{0ex}}\cdot \left[\left(n-l\right)-\left({n}_{i}-{l}_{i}\right){\right]}^{{n}_{i}-{l}_{i}}\cdot \left[{\left(n-l\right)}^{2}-\sum _{j=1}^{p}{\left({n}_{i}-{l}_{i}\right)}^{2}\right].\end{array}$ (1)
MathML

#### casesinsideequation

  \tag{2}\label{eq:cases-eg} H(j\omega) = \begin{cases} e^{-j\omega\,t_0}& \text{for $\abs{\omega} < \omega_c$}\\ 0& \text{for $\abs{\omega}>\omega_c$} \end{cases} `

MathML