Math rendering

From Prime-Wiki
Jump to: navigation, search

Math rendering

This is a brief introduction to how to post maths in wiki format.

All maths notation needs to appear between the math tags, <math> and </math>.

Math commands are preceded by a backslash, like this: \sum.

The < math > command

LaTeX commands are case-sensitive, and take one of the following two formats:

They start with a backslash \ and then have a name consisting of letters only. Command names are terminated by a space, a number or any other "non-letter".
They consist of a backslash \ and exactly one non-letter.

Some commands need an argument, which has to be given between curly braces { } after the command name. Some commands support optional parameters, which are added after the command name in square brackets []. The general syntax is:

\commandname[option1,option2,...]{argument1}{argument2}...

Special characters

The following symbols are reserved characters that either have a special meaning under LaTeX or are unavailable in all the fonts. If you enter them directly in your text, they will normally not render, but rather do things you did not intend.

# $ % ^ & _ { } ~ \

These characters can be entered by adding a prefix backslash:

\# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}

The other symbols and many more can be rendered with special commands in mathematical formulae or as accents.

The backslash character \ can not be entered by adding another backslash in front of it (\\); this sequence is used for line breaking. For introducing a backslash in math mode, you can use \backslash instead.

The command \~ produces a tilde which is placed over the next letter. For example \~n/ gives ñ. To produce just the character ~, use \~{} which places a ~ over an empty box. Alternatively \sim produces a large centred ~ which may be more appropriate in some situations, but may not render properly in simple expressions which are converted to HTML.

Similarly, the command \^ produces a hat over the next character, for example \^{o} produces ô. If you need in text to display the ^ symbol you have to use \textasciicircum.

Accents/diacritics

\dot{a}, \ddot{a}, \acute{a}, \grave{a} [math]\dot{a}, \ddot{a}, \acute{a}, \grave{a}[/math]
\check{a}, \breve{a}, \tilde{a}, \bar{a} [math]\check{a}, \breve{a}, \tilde{a}, \bar{a}[/math]
\hat{a}, \widehat{a}, \vec{a} [math]\hat{a}, \widehat{a}, \vec{a}[/math]

Standard numerical functions

\exp_a b = a^b, \exp b = e^b, 10^m [math]\exp_a b = a^b, \exp b = e^b, 10^m[/math]
\ln c, \lg d = \log e, \log_{10} f [math]\ln c, \lg d = \log e, \log_{10} f[/math]
\sin a, \cos b, \tan c, \cot d, \sec e, \csc f [math]\sin a, \cos b, \tan c, \cot d, \sec e, \csc f[/math]
\arcsin h, \arccos i, \arctan j [math]\arcsin h, \arccos i, \arctan j[/math]
\sinh k, \cosh l, \tanh m, \coth n [math]\sinh k, \cosh l, \tanh m, \coth n[/math]
\left\vert s \right\vert [math]\left\vert s \right\vert[/math]
\min(x,y), \max(x,y) [math]\min(x,y), \max(x,y)[/math]

Bounds

\min x, \max y, \inf s, \sup t [math]\min x, \max y, \inf s, \sup t[/math]
\lim u, \liminf v, \limsup w [math]\lim u, \liminf v, \limsup w[/math]
\dim p, \deg q, \det m, \ker\phi [math]\dim p, \deg q, \det m, \ker\phi[/math]

Projections

\Pr j, \hom l, \lVert z \rVert, \arg z [math]\Pr j, \hom l, \lVert z \rVert, \arg z[/math]

Differentials and derivatives

dt, \operatorname{d}\!t, \partial t, \nabla\psi [math]dt, \operatorname{d}\!t, \partial t, \nabla\psi[/math]
dy/dx, \operatorname{d}\!y/\operatorname{d}\!x, {dy \over dx}, {\operatorname{d}\!y\over\operatorname{d}\!x}, {\partial^2\over\partial x_1\partial x_2}y [math]dy/dx, \operatorname{d}\!y/\operatorname{d}\!x, {dy \over dx}, {\operatorname{d}\!y\over\operatorname{d}\!x}, {\partial^2\over\partial x_1\partial x_2}y[/math]
\prime, f^\prime, f', f, f^{(3)}, \dot y, \ddot y [math]\prime, f^\prime, f', f'', f^{(3)} \!, \dot y, \ddot y[/math]

Letter-like symbols or constants

\infty, \aleph, \hbar [math]\infty, \aleph, \hbar[/math]
\Im, \imath, \jmath, \ell, \wp, \Re [math]\Im, \imath, \jmath, \ell, \wp, \Re[/math]

Modular arithmetic

s_k \equiv 0 \pmod{m} [math]s_k \equiv 0 \pmod{m}[/math]
a\,\bmod\,b [math]a\,\bmod\,b[/math]
\gcd(m, n), \operatorname{lcm}(m, n) [math]\gcd(m, n), \operatorname{lcm}(m, n)[/math]
\mid, \not\mid [math]\mid, \not\mid[/math]

Radicals

\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{x^3+y^3 \over 2} [math]\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{x^3+y^3 \over 2}[/math]

Operators

+, -, \pm, \mp, \dot+ [math]+, -, \pm, \mp, \dot+[/math]
\times, \div, /, \backslash [math]\times, \div, /, \backslash[/math]
\cdot, * \ast, \star, \circ, \bullet [math]\cdot, * \ast, \star, \circ, \bullet[/math]
\oplus, \ominus, \otimes, \oslash, \odot [math]\oplus, \ominus, \otimes, \oslash, \odot[/math]
\bigoplus, \bigotimes, \bigodot [math]\bigoplus, \bigotimes, \bigodot[/math]

Sets

\{ \}, \emptyset [math]\{ \}, \emptyset[/math]
\in, \notin, \ni, \not\ni [math]\in, \notin, \ni, \not\ni[/math]
\cap, \sqcap, \bigcap [math]\cap, \sqcap, \bigcap[/math]
\cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus [math]\cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus[/math]
\setminus, \times [math]\setminus, \times[/math]
\subset, \supset, \subseteq, \not\subseteq, \sqsubseteq, \supseteq, \not\supseteq, \sqsupseteq [math]\subset, \supset, \subseteq, \not\subseteq, \sqsubseteq, \supseteq, \not\supseteq, \sqsupseteq[/math]

Relations

=, \ne, \neq, \equiv, \not\equiv [math]=, \ne, \neq, \equiv, \not\equiv[/math]
\dot=, \overset{\underset{\mathrm{def}}{}}{=}, := [math]\dot=, \overset{\underset{\mathrm{def}}{}}{=}, := \![/math]
\sim, \simeq, :\sim, \cong, \not\cong [math]\sim, \simeq, :\sim, \cong, \not\cong[/math]
\approx, \asymp, \propto [math]\approx, \asymp, \propto[/math]
<, \not<, \ll, \not\ll [math]\lt , \not\lt , \ll, \not\ll[/math]
>, \not>, \gg, \not\gg [math]\gt , \not\gt , \gg, \not\gg[/math]
\le, \leq, \not\leq [math]\le, \leq, \not\leq[/math]
\ge, \geq, \not\geq [math]\ge, \geq, \not\geq[/math]
\prec, \not\prec, \preceq, \not\preceq [math]\prec, \not\prec, \preceq, \not\preceq[/math]
\succ, \not\succ, \succeq, \not\succeq [math]\succ, \not\succ, \succeq, \not\succeq[/math]

Geometric

\parallel, \not\parallel [math]\parallel, \not\parallel[/math]
\perp, \angle, 45^\circ [math]\perp, \angle, 45^\circ[/math]
\bigcirc, \triangle \bigtriangleup, \bigtriangledown [math]\bigcirc, \triangle \bigtriangleup, \bigtriangledown[/math]

Logic

\forall, \exists, \not\exists [math]\forall, \exists, \not\exists[/math]
\vee, \bigvee [math]\vee, \bigvee[/math]
\land, \wedge, \bigwedge [math]\land, \wedge, \bigwedge[/math]
\bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \lnot \neg, \not\operatorname{R}, \bot, \top [math]\bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \lnot \neg, \not\operatorname{R}, \bot, \top[/math]
\vdash, \dashv, \not\vdash, \not\dashv, \models [math]\vdash, \dashv, \not\vdash, \not\dashv, \models[/math]

Arrows

\Rightarrow, \not\Rightarrow, \Longrightarrow [math]\Rightarrow, \not\Rightarrow, \Longrightarrow[/math]
\Leftarrow, \not\Leftarrow, \Longleftarrow [math]\Leftarrow, \not\Leftarrow, \Longleftarrow[/math]
\Leftrightarrow, \not\Leftrightarrow, \Longleftrightarrow \iff [math]\Leftrightarrow, \not\Leftrightarrow, \Longleftrightarrow \iff[/math]
\Uparrow, \Downarrow, \Updownarrow [math]\Uparrow, \Downarrow, \Updownarrow[/math]
\rightarrow \to, \not\rightarrow, \longrightarrow [math]\rightarrow \to, \not\rightarrow, \longrightarrow[/math]
\leftarrow \gets, \not\leftarrow, \longleftarrow [math]\leftarrow \gets, \not\leftarrow, \longleftarrow[/math]
\leftrightarrow, \not\leftrightarrow, \longleftrightarrow [math]\leftrightarrow, \not\leftrightarrow, \longleftrightarrow[/math]
\uparrow, \downarrow, \updownarrow [math]\uparrow, \downarrow, \updownarrow[/math]
\nearrow, \swarrow, \nwarrow, \searrow [math]\nearrow, \swarrow, \nwarrow, \searrow[/math]
\mapsto, \longmapsto [math]\mapsto, \longmapsto[/math]
\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \rightleftharpoons [math]\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \rightleftharpoons[/math]
\hookrightarrow \hookleftarrow [math]\hookrightarrow \hookleftarrow[/math]

Special

\amalg \S \% \dagger \ddagger \ldots \cdots [math]\amalg \S \% \dagger \ddagger \ldots \cdots[/math]
\smile \frown \wr \triangleleft \triangleright [math]\smile \frown \wr \triangleleft \triangleright[/math]
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \flat, \natural, \sharp [math]\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \flat, \natural, \sharp[/math]

Subscripts, superscripts, integrals

Feature Syntax How it looks rendered
Superscript a^2 [math]a^2[/math]
Subscript a_2 [math]a_2[/math]
Grouping 10^{30} a^{2+2} [math]10^{30} a^{2+2}[/math]
a_{i,j} b_{f'} [math]a_{i,j} b_{f'}[/math]
Combining sub & super without and with horizontal separation x_2^3 [math]x_2^3[/math]
{x_2}^3 [math]{x_2}^3 \,\![/math]
Super super 10^{10^{8}} [math]10^{10^{8}}[/math]
Preceding and/or additional sub & super \sideset{_1^2}{_3^4}\prod_a^b [math]\sideset{_1^2}{_3^4}\prod_a^b[/math]
{}_1^2\!\Omega_3^4 [math]{}_1^2\!\Omega_3^4[/math]
Stacking \overset{\alpha}{\omega} [math]\overset{\alpha}{\omega}[/math]
\underset{\alpha}{\omega} [math]\underset{\alpha}{\omega}[/math]
\overset{\alpha}{\underset{\gamma}{\omega}} [math]\overset{\alpha}{\underset{\gamma}{\omega}}[/math]
\stackrel{\alpha}{\omega} [math]\stackrel{\alpha}{\omega}[/math]
Derivatives x', y, f', f [math]x', y'', f', f''[/math]
x^\prime, y^{\prime\prime} [math]x^\prime, y^{\prime\prime}[/math]
Derivative dots \dot{x}, \ddot{x} [math]\dot{x}, \ddot{x}[/math]
Underlines, overlines, vectors \hat a \ \bar b \ \vec c [math] \hat a \ \bar b \ \vec c[/math]
\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} [math] \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}[/math]
\overline{g h i} \ \underline{j k l} [math] \overline{g h i} \ \underline{j k l}[/math]
Arc (workaround) \overset{\frown} {AB} [math]\overset{\frown} {AB}[/math]
Arrows A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C [math] A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C[/math]
Overbraces \overbrace{ 1+2+\cdots+100 }^{5050} [math]\overbrace{ 1+2+\cdots+100 }^{5050}[/math]
Underbraces \underbrace{ a+b+\cdots+z }_{26} [math]\underbrace{ a+b+\cdots+z }_{26}[/math]
Sum \sum_{k=1}^N k^2 [math]\sum_{k=1}^N k^2[/math]
Sum (force \textstyle) \textstyle \sum_{k=1}^N k^2 [math]\textstyle \sum_{k=1}^N k^2[/math]
Sum in a fraction (default \textstyle) \frac{\sum_{k=1}^N k^2}{a} [math]\frac{\sum_{k=1}^N k^2}{a}[/math]
Sum in a fraction (force \displaystyle) \frac{\displaystyle \sum_{k=1}^N k^2}{a} [math]\frac{\displaystyle \sum_{k=1}^N k^2}{a}[/math]
Sum in a fraction (alternative limits style) \frac{\sum\limits^{^N}_{k=1} k^2}{a} [math]\frac{\sum\limits^{^N}_{k=1} k^2}{a}[/math]
Product \prod_{i=1}^N x_i [math]\prod_{i=1}^N x_i[/math]
Product (force \textstyle) \textstyle \prod_{i=1}^N x_i [math]\textstyle \prod_{i=1}^N x_i[/math]
Coproduct \coprod_{i=1}^N x_i [math]\coprod_{i=1}^N x_i[/math]
Coproduct (force \textstyle) \textstyle \coprod_{i=1}^N x_i [math]\textstyle \coprod_{i=1}^N x_i[/math]
Limit \lim_{n \to \infty}x_n [math]\lim_{n \to \infty}x_n[/math]
Limit (force \textstyle) \textstyle \lim_{n \to \infty}x_n [math]\textstyle \lim_{n \to \infty}x_n[/math]
Integral \int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx [math]\int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx[/math]
Integral (alternative limits style) \int_{1}^{3}\frac{e^3/x}{x^2}\, dx [math]\int_{1}^{3}\frac{e^3/x}{x^2}\, dx[/math]
Integral (force \textstyle) \textstyle \int\limits_{-N}^{N} e^x\, dx [math]\textstyle \int\limits_{-N}^{N} e^x\, dx[/math]
Integral (force \textstyle, alternative limits style) \textstyle \int_{-N}^{N} e^x\, dx [math]\textstyle \int_{-N}^{N} e^x\, dx[/math]
Double integral \iint\limits_D \, dx\,dy [math]\iint\limits_D \, dx\,dy[/math]
Triple integral \iiint\limits_E \, dx\,dy\,dz [math]\iiint\limits_E \, dx\,dy\,dz[/math]
Quadruple integral \iiiint\limits_F \, dx\,dy\,dz\,dt [math]\iiiint\limits_F \, dx\,dy\,dz\,dt[/math]
Line or path integral \int_{(x,y)\in C} x^3\, dx + 4y^2\, dy [math]\int_{(x,y)\in C} x^3\, dx + 4y^2\, dy[/math]
Closed line or path integral \oint_{(x,y)\in C} x^3\, dx + 4y^2\, dy [math]\oint_{(x,y)\in C} x^3\, dx + 4y^2\, dy[/math]
Intersections \bigcap_{i=_1}^n E_i [math]\bigcap_{i=_1}^n E_i[/math]
Unions \bigcup_{i=_1}^n E_i [math]\bigcup_{i=_1}^n E_i[/math]

Fractions, matrices, multilines

Feature Syntax How it looks rendered
Fractions \frac{2}{4}=0.5 or {2 \over 4}=0.5 [math]\frac{2}{4}=0.5[/math]
Small fractions \tfrac{2}{4} = 0.5 [math]\tfrac{2}{4} = 0.5[/math]
Large (normal) fractions \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a [math]\dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a[/math]
Large (nested) fractions \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a [math]\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a[/math]
Cancellations in fractions
Note does not work with MathJax
workaround: using \not
\cfrac{x}{1 + \cfrac{\not{y}}{\not{y}}} = \cfrac{x}{2} [math]\cfrac{x}{1 + \cfrac{\not{y}}{\not{y}}} = \cfrac{x}{2}[/math]
Binomial coefficients \binom{n}{k} [math]\binom{n}{k}[/math]
Small binomial coefficients \tbinom{n}{k} [math]\tbinom{n}{k}[/math]
Large (normal) binomial coefficients \dbinom{n}{k} [math]\dbinom{n}{k}[/math]
Matrices
\begin{matrix}
x & y \\
z & v
\end{matrix}
[math]\begin{matrix} x & y \\ z & v \end{matrix}[/math]
\begin{vmatrix}
x & y \\
z & v
\end{vmatrix}
[math]\begin{vmatrix} x & y \\ z & v \end{vmatrix}[/math]
\begin{Vmatrix}
x & y \\
z & v
\end{Vmatrix}
[math]\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}[/math]
\begin{bmatrix}
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\end{bmatrix}
[math]\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix} [/math]
\begin{Bmatrix}
x & y \\
z & v
\end{Bmatrix}
[math]\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}[/math]
\begin{pmatrix}
x & y \\
z & v
\end{pmatrix}
[math]\begin{pmatrix} x & y \\ z & v \end{pmatrix}[/math]
\bigl( \begin{smallmatrix}
a&b\\ c&d
\end{smallmatrix} \bigr)
[math] \bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) [/math]
Case distinctions
f(n) =
\begin{cases}
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
\end{cases}
[math]f(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases}[/math]
Multiline equations
\begin{align}
f(x) & = (a+b)^2 \\
& = a^2+2ab+b^2 \\
\end{align}
[math] \begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \end{align} [/math]
\begin{alignat}{2}
f(x) & = (a-b)^2 \\
& = a^2-2ab+b^2 \\
\end{alignat}
[math] \begin{alignat}{2} f(x) & = (a-b)^2 \\ & = a^2-2ab+b^2 \\ \end{alignat} [/math]
Multiline equations (must define number of columns used ({lcr}) (should not be used unless needed)
\begin{array}{lcl}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
[math]\begin{array}{lcl} z & = & a \\ f(x,y,z) & = & x + y + z \end{array}[/math]
Multiline equations (more)
\begin{array}{lcr}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
[math]\begin{array}{lcr} z & = & a \\ f(x,y,z) & = & x + y + z \end{array}[/math]
Breaking up a long expression so that it wraps when necessary, at the expense of destroying correct spacing
f(x) =
\sum_{n=0}^\infty a_n x^n =
a_0+a_1x+a_2x^2+\cdots
[math]f(x) = \sum_{n=0}^\infty a_n x^n = a_0 +a_1x+a_2x^2+\cdots[/math]
Simultaneous equations
\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}
[math]\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}[/math]
Arrays
\begin{array}{|c|c|c|} a & b & S \\
\hline
0&0&1\\
0&1&1\\
1&0&1\\
1&1&0\\
\end{array}
[math] \begin{array}{|c|c|c|} a & b & S \\ \hline 0&0&1\\ 0&1&1\\ 1&0&1\\ 1&1&0\\ \end{array} [/math]

Parenthesizing big expressions, brackets, bars

You can use various delimiters with \left and \right:

Feature Syntax How it looks rendered
Bad ( \frac{1}{2} ) [math]( \frac{1}{2} )[/math]
Good \left ( \frac{1}{2} \right ) [math]\left ( \frac{1}{2} \right )[/math]
Parentheses \left ( \frac{a}{b} \right ) [math]\left ( \frac{a}{b} \right )[/math]
Brackets \left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack [math]\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack[/math]
Braces \left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace [math]\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace[/math]
Angle brackets \left \langle \frac{a}{b} \right \rangle [math]\left \langle \frac{a}{b} \right \rangle[/math]
Bars and double bars
\left | \frac{a}{b} \right \vert \quad \left \Vert \frac{c}{d} \right \|
[math]\left | \frac{a}{b} \right \vert \quad \left \Vert \frac{c}{d} \right \|[/math]
Floor and ceiling functions: \left \lfloor \frac{a}{b} \right \rfloor \quad \left \lceil \frac{c}{d} \right \rceil [math]\left \lfloor \frac{a}{b} \right \rfloor \quad \left \lceil \frac{c}{d} \right \rceil[/math]
Slashes and backslashes \left / \frac{a}{b} \right \backslash [math]\left / \frac{a}{b} \right \backslash[/math]
Up, down, and up-down arrows \left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow [math]\left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow[/math]
Delimiters can be mixed,
as long as \left and \right match
\left [ 0,1 \right ) \left \langle \psi \right |
[math]\left [ 0,1 \right ) \left \langle \psi \right |[/math]
Use \left. and \right. if you
do not want a delimiter to appear
\left . \frac{A}{B} \right \} \to X [math]\left . \frac{A}{B} \right \} \to X[/math]
Size of the delimiters (add "l" or "r" to indicate the side for proper spacing) ( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ] [math]( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ][/math]
\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots \Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle [math]\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots \Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle[/math]
\big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| | [math]\| \big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| |[/math]
\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots \Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \ceil [math]\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots \Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \rceil[/math]
\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow [math]\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow[/math]
\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow [math]\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow[/math]
/ \big/ \Big/ \bigg/ \Bigg/ \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash [math]/ \big/ \Big/ \bigg/ \Bigg/ \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash[/math]

Alphabets and typefaces

Greek alphabet
\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega [math]\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega[/math]
\alpha \beta \gamma \delta \epsilon \zeta \eta \theta [math]\alpha \beta \gamma \delta \epsilon \zeta \eta \theta[/math]
\iota \kappa \lambda \mu \nu \xi \pi \rho [math]\iota \kappa \lambda \mu \nu \xi \pi \rho[/math]
\sigma \tau \upsilon \phi \chi \psi \omega [math]\sigma \tau \upsilon \phi \chi \psi \omega[/math]
\varepsilon \varpi \varrho \varsigma \vartheta \varphi [math]\varepsilon \varpi \varrho \varsigma \vartheta \varphi[/math]
Hebrew symbols
\aleph [math]\aleph[/math]
Blackboard bold/scripts
\mathbb{ABCDEFGHI} [math]\mathbb{ABCDEFGHI}[/math]
\mathbb{JKLMNOPQR} [math]\mathbb{JKLMNOPQR}[/math]
\mathbb{STUVWXYZ} [math]\mathbb{STUVWXYZ}[/math]
Boldface
\mathbf{ABCDEFGHI} [math]\mathbf{ABCDEFGHI}[/math]
\mathbf{JKLMNOPQR} [math]\mathbf{JKLMNOPQR}[/math]
\mathbf{STUVWXYZ} [math]\mathbf{STUVWXYZ}[/math]
\mathbf{abcdefghijklm} [math]\mathbf{abcdefghijklm}[/math]
\mathbf{nopqrstuvwxyz} [math]\mathbf{nopqrstuvwxyz}[/math]
\mathbf{0123456789} [math]\mathbf{0123456789}[/math]
Boldface (Greek)
\boldsymbol{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega} [math]\boldsymbol{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega}[/math]
\boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta} [math]\boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta}[/math]
\boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho} [math]\boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho}[/math]
\boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega} [math]\boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega}[/math]
\boldsymbol{\varepsilon \varpi \varrho \varsigma \vartheta \varphi} [math]\boldsymbol{\varepsilon \varpi \varrho \varsigma \vartheta \varphi}[/math]
Italics (default for Latin alphabet)
\mathit{0123456789} [math]\mathit{0123456789}[/math]
Greek italics
\mathit{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega} [math]\mathit{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega}[/math]
Roman typeface
\mathrm{ABCDEFGHI} [math]\mathrm{ABCDEFGHI}[/math]
\mathrm{JKLMNOPQR} [math]\mathrm{JKLMNOPQR}[/math]
\mathrm{STUVWXYZ} [math]\mathrm{STUVWXYZ}[/math]
\mathrm{abcdefghijklm} [math]\mathrm{abcdefghijklm}[/math]
\mathrm{nopqrstuvwxyz} [math]\mathrm{nopqrstuvwxyz}[/math]
\mathrm{0123456789} [math]\mathrm{0123456789}[/math]
Sans serif
\mathsf{ABCDEFGHI} [math]\mathsf{ABCDEFGHI}[/math]
\mathsf{JKLMNOPQR} [math]\mathsf{JKLMNOPQR}[/math]
\mathsf{STUVWXYZ} [math]\mathsf{STUVWXYZ}[/math]
\mathsf{abcdefghijklm} [math]\mathsf{abcdefghijklm}[/math]
\mathsf{nopqrstuvwxyz} [math]\mathsf{nopqrstuvwxyz}[/math]
\mathsf{0123456789} [math]\mathsf{0123456789}[/math]
Sans serif Greek
\mathsf{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega} [math]\mathsf{\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega}[/math]
Calligraphy/script
\mathcal{ABCDEFGHI} [math]\mathcal{ABCDEFGHI}[/math]
\mathcal{JKLMNOPQR} [math]\mathcal{JKLMNOPQR}[/math]
\mathcal{STUVWXYZ} [math]\mathcal{STUVWXYZ}[/math]
Fraktur typeface
\mathfrak{ABCDEFGHI} [math]\mathfrak{ABCDEFGHI}[/math]
\mathfrak{JKLMNOPQR} [math]\mathfrak{JKLMNOPQR}[/math]
\mathfrak{STUVWXYZ} [math]\mathfrak{STUVWXYZ}[/math]
\mathfrak{abcdefghijklm} [math]\mathfrak{abcdefghijklm}[/math]
\mathfrak{nopqrstuvwxyz} [math]\mathfrak{nopqrstuvwxyz}[/math]
\mathfrak{0123456789} [math]\mathfrak{01234567890}[/math]
Small scriptstyle text
{\scriptstyle\text{abcdefghijklm}} [math]{\scriptstyle\text{abcdefghijklm}}[/math]

Mixed text faces

Feature Syntax How it looks rendered
Italicised characters (spaces are ignored) x y z [math]x y z[/math]
Non-italicised characters \text{x y z} [math]\text{x y z}[/math]
Mixed italics (bad) \text{if} n \text{is even} [math]\text{if} n \text{is even}[/math]
Mixed italics (good) \text{if }n\text{ is even} [math]\text{if }n\text{ is even}[/math]
Mixed italics (alternative: ~ or "\ " forces a space) \text{if}~n\ \text{is even} [math]\text{if}~n\ \text{is even}[/math]

Color

Equations can use color with the \color command.

  • {\color{Blue}{x^2}}+{\color{Orange}{2x}}-{\color{LimeGreen}{1}}
    [math]{\color{Blue}{x^2}}+{\color{Orange}{2x}}-{\color{LimeGreen}{1}}[/math]
  • x_{1,2}=\frac{{\color{Blue}{-b}}\pm\sqrt{\color{Red}{b^2-4ac}}}{\color{Green}{2a}}
    [math]x_{1,2}=\frac{{\color{Blue}{-b}}\pm\sqrt{\color{Red}{b^2-4ac}}}{\color{Green}{2a}}[/math]

There are several alternate notations styles

  • {\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1}
    [math]{\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1}[/math]
  • \color{Blue}x^2\color{Black}+\color{Orange}2x\color{Black}-\color{LimeGreen}1
    [math]\color{Blue}x^2\color{Black}+\color{Orange}2x\color{Black}-\color{LimeGreen}1[/math]
  • \color{Blue}{x^2}+\color{Orange}{2x}-\color{LimeGreen}{1}
    [math]\color{Blue}{x^2}+\color{Orange}{2x}-\color{LimeGreen}{1}[/math]

Some color names are predeclared according to the following table, you can use them directly for the rendering of formulas (or for declaring the intended color of the page background).

Colors supported (black ones not supported)
[math]\color{Blue}{\text{Blue}}[/math] [math]\color{BlueGreen}{\text{BlueGreen}}[/math] [math]\color{BlueViolet}{\text{BlueViolet}}[/math] [math]\color{BrickRed}{\text{BrickRed}}[/math]
[math]\color{Brown}{\text{Brown}}[/math] [math]\color{BurntOrange}{\text{BurntOrange}}[/math] [math]\color{CadetBlue}{\text{CadetBlue}}[/math] [math]\color{CarnationPink}{\text{CarnationPink}}[/math]
[math]\color{DarkOrchid}{\text{DarkOrchid}}[/math] [math]\color{Emerald}{\text{Emerald}}[/math] [math]\color{ForestGreen}{\text{ForestGreen}}[/math] [math]\color{Fuchsia}{\text{Fuchsia}}[/math]
[math]\color{Mahogany}{\text{Mahogany}}[/math] [math]\color{Maroon}{\text{Maroon}}[/math] [math]\color{Melon}{\text{Melon}}[/math] [math]\color{MidnightBlue}{\text{MidnightBlue}}[/math]
[math]\color{Mulberry}{\text{Mulberry}}[/math] [math]\color{NavyBlue}{\text{NavyBlue}}[/math] [math]\color{OliveGreen}{\text{OliveGreen}}[/math] [math]\color{Orange}{\text{Orange}}[/math]
[math]\color{OrangeRed}{\text{OrangeRed}}[/math] [math]\color{Orchid}{\text{Orchid}}[/math] [math]\color{Peach}{\text{Peach}}[/math] [math]\color{Periwinkle}{\text{Periwinkle}}[/math]
[math]\color{PineGreen}{\text{PineGreen}}[/math] [math]\color{Plum}{\text{Plum}}[/math] [math]\color{ProcessBlue}{\text{ProcessBlue}}[/math] [math]\color{Purple}{\text{Purple}}[/math]
[math]\color{RawSienna}{\text{RawSienna}}[/math] [math]\color{Red}{\text{Red}}[/math] [math]\color{RedOrange}{\text{RedOrange}}[/math] [math]\color{RedViolet}{\text{RedViolet}}[/math]
[math]\color{Rhodamine}{\text{Rhodamine}}[/math] [math]\color{RoyalBlue}{\text{RoyalBlue}}[/math] [math]\color{RoyalPurple}{\text{RoyalPurple}}[/math] [math]\color{RubineRed}{\text{RubineRed}}[/math]
[math]\color{Salmon}{\text{Salmon}}[/math] [math]\color{SeaGreen}{\text{SeaGreen}}[/math] [math]\color{Sepia}{\text{Sepia}}[/math] [math]\color{SkyBlue}{\text{SkyBlue}}[/math]

Note that color should not be used as the only way to identify something, because it will become meaningless on black-and-white media or for color-blind people.

Spacing

Note that <math></math> handles most spacing automatically, but you may sometimes want manual control.

Feature Syntax How it looks rendered
double quad space a \qquad b [math]a \qquad b[/math]
quad space a \quad b [math]a \quad b[/math]
text space a\ b [math]a\ b[/math]
large space a\;b [math]a\;b[/math]
small space a\,b [math]a\,b[/math]
tiny space (use for multiplication of factors) ab [math]ab[/math]
no space (use for multi-letter variables) \mathit{ab} [math]\mathit{ab}[/math]
small negative space a\!b [math]a\!b[/math]