LaTeXMathML Guide

The following document is a guideline for the use of LaTeXMathML, especially as it is implemented in the Odyssey system (the code base for the Pillars website). Much of the material on this page is copied verbatim from Dr. Douglas Woodall's orignal notes about the program. For more details, visit his LaTeXMathML website.

LaTeXMathML works by including any mathematics in LaTeX format between dollar signs: \$...\$. (To print a dollar sign, escape it as \\$.)

Differences from LaTeX

  1. Equations cannot be delimited by \[...\] or \begin{displaymath}...\end{displaymath}, but much the same effect can be achieved by the sequence
    <blockquote>\$\displaystyle{ ... }\$</blockquote>
    Unlike in LaTeX, \displaystyle and \texstyle behave as functions acting on what immediately follows them, and so if you want the whole equation set in display-style, then the braces are necessary. (If you use \displaystyle{ or \texstyle{ in an array entry, make sure that the closing } is inside the same array entry.)
  2. Aligned equations can be produced by the sequence
    <blockquote>\$\begin{eqnarray} ... \end{eqnarray}\$</blockquote>
    Note that, unlike in LaTeX, dollars are needed here: the command \begin{eqnarray} is only recognized once the equation has already started. As in LaTeX, eqnarrays are set in display-style by default.
  3. The sequences \begin{eqnarray}, \end{eqnarray}, \begin{array} and \end{array} are not parsed but are recognized as literal character strings; so they will not be recognized if you insert any spaces into them.
  4. LaTeX commands are not interpreted outside equations, and non-mathematical LaTeX commands (e.g., \label) are not interpreted at all. There is no mechanism for numbering equations; \eqno and \nonumber are not recognized.
  5. In arrays, \multicolumn is not recognized (although in principle it could be added), and there is no mechanism for inserting vertical lines between columns or horizontal lines between rows, or for changing the inter-column or inter-row space. (Using \\[1ex] simply causes the next line of the array to start with [1ex].) Otherwise, most pure LaTeX mathematical commands are recognized, but most AMS additional commands aren't. Note that some commands, like \scriptstyle, are implemented but ignored by some browsers.
  6. Optional arguments are not recognized, but a new command \root has been introduced to take the place of \sqrt with an optional argument. Thus to get $\root32$ use \root32, not \sqrt[3]2.
  7. Although constructs can be nested within equations, it is not possible to nest equation and non-equation. For example, the construct   \$...\mbox{...\$.\$...}\$    will not work.
  8. It seems to be a feature of MathML, or possibly a bug in some browsers, that if you end an equation with </math>, with the punctuation mark outside the equation, then the browser will feel entitled to put the equation at the end of one line and the punctuation mark at the start of the next line. To avoid this happening with inline equations in LaTeXMathML, it is necessary always to include closing punctuation marks inside the \$...\$ — exactly the opposite of what one should do in LaTeX.
  9. There is no "Roman" command in MathML, and so \mathrm has been implemented in the same way as \mbox; in particular, spaces in the input will appear in the output.
  10. A small number of purely numerical fractions exist and are produced by commands of the form \frac12 (with no braces or spaces)—see the list below. Otherwise \frac behaves as in LaTeX.
  11. < is a significant character in HTML. To print it use \lt in equations (and &lt; outside equations).
  12. Large summation signs, etc., without limits can sometimes get too big. For example, the input
    \$\sum a_i + \sum_{i=0}^\infty b_i.\$
    produces $\sum a_i + \sum_{i=0}^\infty b_i.$ In some browsers, the presence of the second summation sign, with limits, makes the first one too big. Enclosing the first one in braces, as in {\sum a_i}, produces ${\sum a_i} + \sum_{i=0}^\infty b_i ,$ which is arguably better. (This is a bug in LaTeXMathML, but one that would be difficult to correct.)
  13. Instances of \overbrace and \underbrace will be replaced by \overbracket and \underbracket respectively, displaying horizontal square brackets. This is because horizontal curly brace characters are not part of the standard font sets for math symbols, and would not display for most people.
    If you wish to use horizontal braces with your own installation of LaTeXMathML, try one of these Chinese True Type fonts, freely available from Arphic Technology: AR PL KaitiM Big5, AR PL Mingti2L Big5, AR PL SungtiL GB or AR PL KaitiM GB (any one of the four should suffice).
  14. The behaviour of LaTeXMathML is undetermined if there are syntax errors in the input, e.g., unmatched braces; but generally speaking, it tries to produce output even in situations where LaTeX would report an error and give up.

LaTeXMathML Characters and Functions
(Characters that are not available have been replaced by the nearest available alternative)
Greek Letters
$\alpha$ \alpha $\pi$ \pi $\Gamma$ \Gamma
$\beta$ \beta $\rho$ \rho $\Delta$ \Delta
$\gamma$ \gamma $\sigma$ \sigma $\Theta$ \Theta
$\delta$ \delta $\tau$ \tau $\Lambda$ \Lambda
$\epsilon$ \epsilon $\upsilon$ \upsilon $\Xi$ \Xi
$\zeta$ \zeta $\phi$ \phi $\Pi$ \Pi
$\eta$ \eta $\chi$ \chi $\Sigma$ \Sigma
$\theta$ \theta $\psi$ \psi $\Upsilon$ \Upsilon
$\iota$ \iota $\omega$ \omega $\Phi$ \Phi
$\kappa$ \kappa $\varepsilon$ \varepsilon $\Psi$ \Psi
$\lambda$ \lambda $\vartheta$ \vartheta $\Omega$ \Omega
$\mu$ \mu $\varpi$ \varpi
$\nu$ \nu $\varrho$ \varrho
$\xi$ \xi $\varsigma$ \varsigma
note: no \omicron $\varphi$ \varphi
$\frac12$ \frac12 $\frac15$ \frac15 $\frac56$ \frac56
$\frac13$ \frac13 $\frac25$ \frac25 $\frac18$ \frac18
$\frac23$ \frac23 $\frac35$ \frac35 $\frac38$ \frac38
$\frac14$ \frac14 $\frac45$ \frac45 $\frac58$ \frac58
$\frac34$ \frac34 $\frac16$ \frac16 $\frac78$ \frac78
Binary Operators
$\pm$ \pm $\mp$ \mp $\cdot$ \cdot
$\times$ \times $\div$ \div $\star$ \star
$\cup$ \cup $\cap$ \cap $\ast$ \ast
$\sqcup$ \sqcup $\sqcap$ \sqcap $\circ$ \circ
$\vee$ \vee, \lor $\wedge$ \wedge, \land $\bullet$ \bullet
$\oplus$ \oplus $\ominus$ \ominus $\diamond$ \diamond
$\odot$ \odot $\oslash$ \oslash $\uplus$ \uplus
$\otimes$ \otimes $\bigcirc$ \bigcirc $\amalg$ \amalg
$\bigtriangleup$ \bigtriangleup $\bigtriangledown$ \bigtriangledown $\dagger$ \dag, \dagger
$\triangleleft$ \triangleleft, \lhd $\triangleright$ \triangleright, \rhd $\ddagger$ \ddag, \ddagger
$\unlhd$ \unlhd $\unrhd$ \unrhd $\wr$ \wr
$\setminus$ \setminus
BIG Operators
$\sum$ \sum $\prod$ \prod $\bigoplus$ \bigoplus
$\bigcup$ \bigcup $\bigcap$ \bigcap $\bigotimes$ \bigotimes
$\bigvee$ \bigvee $\bigwedge$ \bigwedge $\bigodot$ \bigodot
$\int$ \int $\oint$ \oint $\biguplus$ \biguplus
$\bigsqcup$ \bigsqcup $\bigsqcap$ \bigsqcap $\coprod$ \coprod
Binary Relations
$\lt$ \lt $\gt$ \gt $\ne$ \ne, \neq
$\le$ \le, \leq, \leqslant $\ge$ \ge, \geq, \geqslant $\equiv$ \equiv
$\ll$ \ll $\gg$ \gg $:=$ :=
$\prec$ \prec $\succ$ \succ $\doteq$ \doteq
$\preceq$ \preceq $\succeq$ \succeq $\sim$ \sim
$\subset$ \subset $\supset$ \supset $\simeq$ \simeq
$\subseteq$ \subseteq $\supseteq$ \supseteq $\approx$ \approx
$\sqsubset$ \sqsubset $\sqsupset$ \sqsupset $\cong$ \cong
$\sqsubseteq$ \sqsubseteq $\sqsupseteq$ \sqsupseteq $\Join$ \Join, \bowtie
$\in$ \in $\ni$ \ni, \owns $\notin$ \notin
$\vdash$ \vdash $\dashv$ \dashv $\perp$ \perp
$\mid$ \mid $\parallel$ \parallel $\models$ \models
$\smile \smile $\frown$ \frown $\asymp$ \asymp
$\propto$ \propto
$($ ( $)$ )
$[$ [ or \lbrack $]$ ] or \rbrack
$\{$ \{ or \lbrace $\}$ \} or \rbrace
$\lfloor$ \lfloor $\rfloor$ \rfloor
$\lceil$ \lceil $\rceil$ \rceil
$\langle$ \langle $\rangle$ \rangle
$/$ / $\backslash$ \backslash
$|$ | or \vert $\|$ \| or \Vert
$\uparrow$ \uparrow $\Uparrow$ \Uparrow
$\downarrow$ \downarrow $\Downarrow$ \Downarrow
$\updownarrow$ \updownarrow $\Updownarrow$ \Updownarrow
Additional sizes
$\big[ ~ \big]$ \big $\Big[ ~ \Big]$ \Big
$\bigg[ ~ \bigg]$ \bigg $\Bigg[ ~ \Bigg]$ \Bigg
$|\!|$ \! -3/18em (often apparently ignored)
$||$ nothing, 0em
$|\,|$ \, 3/18em
$|\:|$ \: or \>4/18em
$|\;|$ \; 5/18em
$|~|$ ~ 1/3em
$|\quad|$ \quad 1em
$|\qquad|$ \qquad 2em
$a'$ a' $a^{\prime}$ a^{\prime}
$b''$ b'' $b^{\prime\prime}$ b^{\prime\prime}
$c'''$ c''' $c^{\prime\prime\prime}$ c^{\prime\prime\prime}
$d''''$ d'''' $d^{\prime\prime\prime\prime}$ d^{\prime\prime\prime\prime}
Miscellaneous Symbols
$\ldots$ \ldots $\cdots$ \cdots $\forall$ \forall
$\vdots$ \vdots $\ddots$ \ddots $\exists$ \exists
$\Re$ \Re $\Im$ \Im $\aleph$ \aleph
$\hbar$ \hbar $\ell$ \ell $\wp$ \wp
$\emptyset$ \emptyset $\infty$ \infty $\surd$ \surd
$\partial$ \partial $\nabla$ \nabla $\triangle$ \triangle
$\square$ \square $\diamond$ \diamond
$\Box$ \Box $\Diamond$ \Diamond
$\bot$ \bot $\top$ \top $\angle$ \angle
$\neg$ \neg, \lnot $\therefore$ \therefore $ \$ $ \\$
Standard Functions
$\sin$ \sin $\cos$ \cos $\tan$ \tan
$\arcsin$ \arcsin $\arccos$ \arccos $\arctan$ \arctan
$\sinh$ \sinh $\cosh$ \cosh $\tanh$ \tanh
$\cot$ \cot $\coth$ \coth $\csc$ \csc
$\deg$ \deg $\det$ \det $\dim$ \dim
$\arg$ \arg $\exp$ \exp $\gcd$ \gcd
$\hom$ \hom $\inf$ \inf $\ker$ \ker
$\lim$ \lim $\liminf$ \liminf $\limsup$ \limsup
$\lg$ \lg $\ln$ \ln $\log$ \log
$\max$ \max $\min$ \min $\Pr$ \Pr
$\sec$ \sec $\sup$ \sup
$\leftarrow$ \leftarrow, \gets $\longleftarrow$ \longleftarrow $\uparrow$ \uparrow
$\rightarrow$ \rightarrow, \to $\longrightarrow$ \longrightarrow $\downarrow$ \downarrow
$\leftrightarrow$ \leftrightarrow $\longleftrightarrow$ \longleftrightarrow $\updownarrow$ \updownarrow
$\Leftarrow$ \Leftarrow $\Longleftarrow$ \Longleftarrow $\Uparrow$ \Uparrow
$\Rightarrow$ \Rightarrow $\Longrightarrow$ \Longrightarrow $\Downarrow$ \Downarrow
$\Leftrightarrow$ \Leftrightarrow $\Longleftrightarrow$ \Longleftrightarrow $\Updownarrow$ \Updownarrow
$\mapsto$ \mapsto $\longmapsto$ \longmapsto $\iff$ \iff (bigger spaces)
Commands with Arguments
$x^2$ x^2 $y_a$ y_a
$\frac27$ \frac27 $\stackrel q n $ \stackrel q n
$f \atop v$ f \atop v $k \choose r $ k \choose r
$\sqrt4$ \sqrt4 $\root32$ \root32 (see note)
Diacritical Marks
$\acute a ~ \acute W$ \acute $\grave a ~ \grave W$ \grave $\breve a ~ \breve W$ \breve
$\dot a ~ \dot W$ \dot $\ddot a ~ \ddot W$ \ddot $\check a ~ \check W$ \check
$\hat a ~ \hat W$ \hat $\widehat a ~ \widehat W$ \widehat $\mathring a ~ \mathring W$ \mathring
$\tilde a ~ \tilde W$ \tilde $\widetilde a ~ \widetilde W$ \widetilde
$\vec a ~ \vec W$ \vec $\overrightarrow a ~ \overrightarrow W$ \overrightarrow $\overleftarrow a ~ \overleftarrow W$ \overleftarrow
$\bar a ~ \bar W$ \bar $\overline a ~ \overline W$ \overline $\underline a ~ \underline W$ \underline
$\overbracket{a+b+\cdots+z}^{26}$ \overbracket{...}^{26}
$\underbracket{a+b+\cdots+z}_{26}$ \underbracket{...}_{26}
$\overbrace{a+b+\cdots+z}^{26}$ \overbrace{...}^{26} (see note)
$\underbrace{a+b+\cdots+z}_{26}$ \underbrace{...}_{26}
Type Styles
$\sum_{n=0}^\infty x_n$ \sum_{n=0}^\infty x_n
$\displaystyle \sum_{n=0}^\infty x_n$ \displaystyle \sum_{n=0}^\infty x_n
$\textstyle \sum_{n=0}^\infty x_n$ \textstyle \sum_{n=0}^\infty x_n
$\scriptstyle \sum_{n=0}^\infty x_n$ \scriptstyle \sum_{n=0}^\infty x_n
(ignored by some browsers)
$\scriptscriptstyle \sum_{n=0}^\infty x_n$ \scriptscriptstyle \sum_{n=0}^\infty x_n
$\mbox{a b c A B C~1+2=3}$ \mbox{a b c A B C~1+2=3}
$\mathrm{a b c A B C~1+2=3}$ \mathrm{a b c A B C~1+2=3} (see note)
$\mathit{a b c A B C~1+2=3}$ \mathit{a b c A B C~1+2=3}
$\mathbf{a b c A B C~1+2=3}$ \mathbf{a b c A B C~1+2=3}
$\mathsf{a b c A B C~1+2=3}$ \mathsf{a b c A B C~1+2=3} (in some browsers, unlike in LaTeX, letters remain italic)
$\mathsf{\mathrm{a b c A B C~1+2=3}}$ \mathsf{\mathrm{a b c A B C~1+2=3}}
$\mathtt{a b c A B C~1+2=3}$ \mathtt{a b c A B C~1+2=3}
Note: The following three fonts work only for capital letters and, except in Internet Explorer, only at the top level of subnesting.
$\mathbb{ABC{DEF}GHI}$ \mathbb{ABC{DEF}GHI}
$\displaystyle{ A = \left\{\begin{array}{c c c} 1-x & 0 & 0 \\ 0 & 1-x & 0 \\ 0 & 0 & 1-x \end{array}\right\} }$ \displaystyle{ A = \left\{\begin{array}{c c c} 1-x & 0 & 0 \\ 0 & 1-x & 0 \\ 0 & 0 & 1-x \end{array}\right\} }
$\displaystyle{ f(x) := \left\{\begin{array}{l l} x^2 \sin \frac1x & \textrm{if } x \ne 0, \\ 0 & \textrm{if } x = 0 . \end{array}\right. }$ \displaystyle{ f(x) := \left\{\begin{array}{l l} x^2 \sin \frac1x & \textrm{if } x \ne 0, \\ 0 & \textrm{if } x = 0 . \end{array}\right. }
$\begin{eqnarray} x & = & \frac{-7 \pm \sqrt{49 - 24}}{6} \\ & = & -\frac13 \textrm{ or } -2. \end{eqnarray}$ \begin{eqnarray} x & = & \frac{-7 \pm \sqrt{49 - 24}}{6} \\ & = & -\frac13 \textrm{ or } -2. \end{eqnarray}