Math formulas (LaTeX2e unofficial reference manual (October 2018))

## Math formulas

Produce mathematical text by putting LaTeX into math mode or display math mode (see Modes). This example shows both.

    The wave equation for \( u \) is
    \begin{displaymath}
      \frac{\partial^2u}{\partial t^2} = c^2\nabla^2u
    \end{displaymath}
    where \( \nabla^2 \) is the spatial Laplacian and \( c \) is constant.

Math mode is for inline mathematics. In the above example it is invoked by the starting `\(` and finished by the matching ending `\)`. Display math mode is for displayed equations and here is invoked by the `displaymath` environment. Note that any mathematical text whatever, including mathematical text consisting of just one character, is handled in math mode.

When in math mode or display math mode, LaTeX handles many aspects of your input text differently than in other text modes. For example,

    contrast x+y with \( x+y \)

in math mode the letters are in italics and the spacing around the plus sign is different.

There are three ways to make inline formulas, to put LaTeX in math mode.

    \( mathematical material \)
    $ mathematical material $
    \begin{math} mathematical material \end{math}

The first form is preferred and the second is quite common, but the third form is rarely used. You can sometimes use one and sometimes another, as in `\(x\) and $y$`. You can use these in paragraph mode or in LR mode (see Modes).

To make displayed formulas, put LaTeX into display math mode with either:

    \begin{displaymath}
      mathematical material
    \end{displaymath}

or

    \begin{equation}
      mathematical material
    \end{equation}

(see displaymath, see equation). The only difference is that with the `equation` environment, LaTeX puts a formula number alongside the formula. The construct `\[ math \]` is equivalent to `\begin{displaymath} math \end{displaymath}`. These environments can only be used in paragraph mode (see Modes).

The two mathematics modes are similar, but there are some differences. One involves the placement of subscripts and superscripts; in display math mode they are further apart and in inline math mode they are closer together.

Sometimes you want the display math typographical treatment to happen in the inline math mode. For this, the `\displaystyle` declaration forces the size and style of the formula to be that of `displaymath`. Thus `\(\displaystyle \sum_{n=0}^\infty x_n\)` will have the limits above and below the summation sign, not next to it. Another example is that

    \begin{tabular}{r|cc}
      \textsc{Name}  &\textsc{Series}  &\textsc{Sum}  \\  \hline
      Arithmetic     &\( a+(a+b)+(a+2b)+\cdots+(a+(n-1)b) \)
                       &\( na+(n-1)n\cdot\frac{b}{2}\)  \\
      Geometric      &\( a+ab+ab^2+\cdots+ab^{n-1} \)
                       &\(\displaystyle a\cdot\frac{1-b^n}{1-b}\)  \\
    \end{tabular}

because it has no `\displaystyle`, the ‘`Arithmetic`’ line’s fraction will be scrunched. But, because of its `\displaystyle`, the ‘`Geometric`’ line’s fraction will be easy to read, with characters the same size as in the rest of the line.

The American Mathematical Society has made freely available a set of packages that greatly expand your options for writing mathematics, `amsmath` and `amssymb` (also be aware of the `mathtools` package that is an extension to, and loads, `amsmath`). New documents that will have mathematical text should use these packages. Descriptions of these packages is outside the scope of this document; see their documentation on CTAN.

### Subscripts & superscripts

Synopsis (in math mode or display math mode), one of:

    base^exp
    base^{exp}

or, one of:

    base_exp
    base_{exp}

Make exp appear as a superscript of base (with the caret character, `^`) or a subscript (with underscore, `_`).

In this example the `0`’s and `1`’s are subscripts while the `2`’s are superscripts.

    \( (x_0+x_1)^2 \leq (x_0)^2+(x_1)^2 \)

To have the subscript or superscript contain more than one character, surround the expression with curly braces, as in `e^{-2x}`. This example’s fourth line shows curly braces used to group an expression for the exponent.

    \begin{displaymath}
      (3^3)^3=27^3=19\,683
      \qquad
      3^{(3^3)}=3^{27}=7\,625\,597\,484\,987
    \end{displaymath}

LaTeX knows how to handle a superscript on a superscript, or a subscript on a subscript, or supers on subs, or subs on supers. So, expressions such as `e^{x^2}` and `x_{i_0}` give correct output. Note the use in those expressions of curly braces to give the base a determined exp. If you enter `\(3^3^3\)` then you get ‘`Double superscript`’.

LaTeX does the right thing when something has both a subscript and a superscript. In this example the integral has both. They come out in the correct place without any author intervention.

    \begin{displaymath}
      \int_{x=a}^b f'(x)\,dx = f(b)-f(a)
    \end{displaymath}

Note the parentheses around `x=a` to make the entire expression a subscript.

To put a superscript or subscript before a symbol, use a construct like `{}_t K^2`. The empty curly braces `{}` give the subscript something to attach to and keeps it from accidentally attaching to a prior symbols.

Using the subscript or superscript command outside of math mode or display math mode, as in `the expression x^2`, will get you the error ‘`Missing $ inserted`’.

A common reason to want subscripts outside of a mathematics mode is to typeset chemical formulas. There are packages for that such as `mhchem`; see CTAN.

### Math symbols

LaTeX provides almost any mathematical or technical symbol that anyone uses. For example, if you include `$\pi$` in your source, you will get the pi symbol π. See the `Comprehensive LaTeX Symbol List` at https://ctan.org/tex-archive/info/symbols/comprehensive/.

Here is a list of commonly-used symbols. It is by no means exhaustive. Each symbol is described with a short phrase, and its symbol class, which determines the spacing around it, is given in parenthesis. Unless said otherwise, the commands for these symbols can be used only in math mode. To redefine a command so that it can be used whatever the current mode, see \ensuremath.

`\|`

  ∥ Parallel (relation). Synonym: `\parallel`.

`\aleph`

  ℵ Aleph, transfinite cardinal (ordinary).

`\alpha`

  α Lowercase Greek letter alpha (ordinary).

`\amalg`

  ⨿ Disjoint union (binary)

`\angle`

  ∠ Geometric angle (ordinary). Similar: less-than sign `<` and angle bracket `\langle`.

`\approx`

  ≈ Almost equal to (relation).

`\ast`

  ∗ Asterisk operator, convolution, six-pointed (binary). Synonym: `*`, which is often a superscript or subscript, as in the Kleene star. Similar: `\star`, which is five-pointed, and is sometimes used as a general binary operation, and sometimes reserved for cross-correlation.

`\asymp`

  ≍ Asymptotically equivalent (relation).

`\backslash`

  \ Backslash (ordinary). Similar: set minus `\setminus`, and `\textbackslash` for backslash outside of math mode.

`\beta`

  β Lowercase Greek letter beta (ordinary).

`\bigcap`

  ⋂ Variable-sized, or n-ary, intersection (operator). Similar: binary intersection `\cap`.

`\bigcirc`

  ⚪ Circle, larger (binary). Similar: function composition `\circ`.

`\bigcup`

  ⋃ Variable-sized, or n-ary, union (operator). Similar: binary union `\cup`.

`\bigodot`

  ⨀ Variable-sized, or n-ary, circled dot operator (operator).

`\bigoplus`

  ⨁ Variable-sized, or n-ary, circled plus operator (operator).

`\bigotimes`

  ⨂ Variable-sized, or n-ary, circled times operator (operator).

`\bigtriangledown`

  ▽ Variable-sized, or n-ary, open triangle pointing down (operator).

`\bigtriangleup`

  △ Variable-sized, or n-ary, open triangle pointing up (operator).

`\bigsqcup`

  ⨆ Variable-sized, or n-ary, square union (operator).

`\biguplus`

  ⨄ Variable-sized, or n-ary, union operator with a plus (operator). (Note that the name has only one p.)

`\bigvee`

  ⋁ Variable-sized, or n-ary, logical-and (operator).

`\bigwedge`

  ⋀ Variable-sized, or n-ary, logical-or (operator).

`\bot`

  ⊥ Up tack, bottom, least element of a partially ordered set, or a contradiction (ordinary). See also `\top`.

`\bowtie`

  ⋈ Natural join of two relations (relation).

`\Box`

  □ Modal operator for necessity; square open box (ordinary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\bullet`

  • Bullet (binary). Similar: multiplication dot `\cdot`.

`\cap`

  ∩ Intersection of two sets (binary). Similar: variable-sized operator `\bigcap`.

`\cdot`

  ⋅ Multiplication (binary). Similar: Bullet dot `\bullet`.

`\chi`

  χ Lowercase Greek chi (ordinary).

`\circ`

  ∘ Function composition, ring operator (binary). Similar: variable-sized operator `\bigcirc`.

`\clubsuit`

  ♣ Club card suit (ordinary).

`\complement`

  ∁ Set complement, used as a superscript as in `$S^\complement$` (ordinary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. Also used: `$S^{\mathsf{c}}$` or `$\bar{S}$`.

`\cong`

  ≅ Congruent (relation).

`\coprod`

  ∐ Coproduct (operator).

`\cup`

  ∪ Union of two sets (binary). Similar: variable-sized operator `\bigcup`.

`\dagger`

  † Dagger relation (binary).

`\dashv`

  ⊣ Dash with vertical, reversed turnstile (relation). Similar: turnstile `\vdash`.

`\ddagger`

  ‡ Double dagger relation (binary).

`\Delta`

  Δ Greek uppercase delta, used for increment (ordinary).

`\delta`

  δ Greek lowercase delta (ordinary).

`\Diamond`

  ◇ Large diamond operator (ordinary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\diamond`

  ⋄ Diamond operator (binary). Similar: large diamond `\Diamond`, circle bullet `\bullet`.

`\diamondsuit`

  ♢ Diamond card suit (ordinary).

`\div`

  ÷ Division sign (binary).

`\doteq`

  ≐ Approaches the limit (relation). Similar: geometrically equal to `\Doteq`.

`\downarrow`

  ↓ Down arrow, converges (relation). Similar: `\Downarrow` double line down arrow.

`\Downarrow`

  ⇓ Double line down arrow (relation). Similar: `\downarrow` single line down arrow.

`\ell`

  ℓ Lowercase cursive letter l (ordinary).

`\emptyset`

  ∅ Empty set symbol (ordinary). The variant form is `\varnothing`.

`\epsilon`

  ϵ Lowercase lunate epsilon (ordinary). Similar to Greek text letter. More widely used in mathematics is the script small letter epsilon `\varepsilon` ε. Related: the set membership relation `\in` ∈.

`\equiv`

  ≡ Equivalence (relation).

`\eta`

  η Lowercase Greek letter (ordinary).

`\exists`

  ∃ Existential quantifier (ordinary).

`\flat`

  ♭ Musical flat (ordinary).

`\forall`

  ∀ Universal quantifier (ordinary).

`\frown`

  ⌢ Downward curving arc (ordinary).

`\Gamma`

  Γ uppercase Greek letter (ordinary).

`\gamma`

  γ Lowercase Greek letter (ordinary).

`\ge`

  ≥ Greater than or equal to (relation). This is a synonym for `\geq`.

`\geq`

  ≥ Greater than or equal to (relation). This is a synonym for `\ge`.

`\gets`

  ← Is assigned the value (relation). Synonym: `\leftarrow`.

`\gg`

  ≫ Much greater than (relation). Similar: much less than `\ll`.

`\hbar`

  ℏ Planck constant over two pi (ordinary).

`\heartsuit`

  ♡ Heart card suit (ordinary).

`\hookleftarrow`

  ↩ Hooked left arrow (relation).

`\hookrightarrow`

  ↪ Hooked right arrow (relation).

`\iff`

  ⟷ If and only if (relation). It is `\Longleftrightarrow` with a `\thickmuskip` on either side.

`\Im`

  ℑ Imaginary part (ordinary). See: real part `\Re`.

`\imath`

  Dotless i; used when you are putting an accent on an i (see Math accents).

`\in`

  ∈ Set element (relation). See also: lowercase lunate epsilon `\epsilon`ϵ and small letter script epsilon `\varepsilon`.

`\infty`

  ∞ Infinity (ordinary).

`\int`

  ∫ Integral (operator).

`\iota`

  ι Lowercase Greek letter (ordinary).

`\Join`

  ⨝ Condensed bowtie symbol (relation). Not available in Plain TeX.

`\jmath`

  Dotless j; used when you are putting an accent on a j (see Math accents).

`\kappa`

  κ Lowercase Greek letter (ordinary).

`\Lambda`

  Λ uppercase Greek letter (ordinary).

`\lambda`

  λ Lowercase Greek letter (ordinary).

`\land`

  ∧ Logical and (binary). This is a synonym for `\wedge`. See also logical or `\lor`.

`\langle`

  ⟨ Left angle, or sequence, bracket (opening). Similar: less-than `<`. Matches `\rangle`.

`\lbrace`

  { Left curly brace (opening). Synonym: `\{`. Matches `\rbrace`.

`\lbrack`

  [ Left square bracket (opening). Synonym: `[`. Matches `\rbrack`.

`\lceil`

  ⌈ Left ceiling bracket, like a square bracket but with the bottom shaved off (opening). Matches `\rceil`.

`\le`

  ≤ Less than or equal to (relation). This is a synonym for `\leq`.

`\leadsto`

  ⇝ Squiggly right arrow (relation). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. To get this symbol outside of math mode you can put `\newcommand*{\Leadsto}{\ensuremath{\leadsto}}` in the preamble and then use `\Leadsto` instead.

`\Leftarrow`

  ⇐ Is implied by, double-line left arrow (relation). Similar: single-line left arrow `\leftarrow`.

`\leftarrow`

  ← Single-line left arrow (relation). Synonym: `\gets`. Similar: double-line left arrow `\Leftarrow`.

`\leftharpoondown`

  ↽ Single-line left harpoon, barb under bar (relation).

`\leftharpoonup`

  ↼ Single-line left harpoon, barb over bar (relation).

`\Leftrightarrow`

  ⇔ Bi-implication; double-line double-headed arrow (relation). Similar: single-line double headed arrow `\leftrightarrow`.

`\leftrightarrow`

  ↔ Single-line double-headed arrow (relation). Similar: double-line double headed arrow `\Leftrightarrow`.

`\leq`

  ≤ Less than or equal to (relation). This is a synonym for `\le`.

`\lfloor`

  ⌊ Left floor bracket (opening). Matches: `\floor`.

`\lhd`

  ◁ Arrowhead, that is, triangle, pointing left (binary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. For the normal subgroup symbol you should load `amssymb` and use `\vartriangleleft` (which is a relation and so gives better spacing).

`\ll`

  ≪ Much less than (relation). Similar: much greater than `\gg`.

`\lnot`

  ¬ Logical negation (ordinary). Synonym: `\neg`.

`\longleftarrow`

  ⟵ Long single-line left arrow (relation). Similar: long double-line left arrow `\Longleftarrow`.

`\longleftrightarrow`

  ⟷ Long single-line double-headed arrow (relation). Similar: long double-line double-headed arrow `\Longleftrightarrow`.

`\longmapsto`

  ⟼ Long single-line left arrow starting with vertical bar (relation). Similar: shorter version `\mapsto`.

`\longrightarrow`

  ⟶ Long single-line right arrow (relation). Similar: long double-line right arrow `\Longrightarrow`.

`\lor`

  ∨ Logical or (binary). Synonym: wedge `\wedge`.

`\mapsto`

  ↦ Single-line left arrow starting with vertical bar (relation). Similar: longer version `\longmapsto`.

`\mho`

  ℧ Conductance, half-circle rotated capital omega (ordinary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\mid`

  ∣ Single-line vertical bar (relation). A typical use of `\mid` is for a set `\{\, x \mid x\geq 5 \,\}`.

  Similar: `\vert` and `|` produce the same single-line vertical bar symbol but without any spacing (they fall in class ordinary) and you should not use them as relations but instead only as ordinals, i.e., footnote symbols. For absolute value, see the entry for `\vert` and for norm see the entry for `\Vert`.

`\models`

  ⊨ Entails, or satisfies; double turnstile, short double dash (relation). Similar: long double dash `\vDash`.

`\mp`

  ∓ Minus or plus (relation).

`\mu`

  μ Lowercase Greek letter (ordinary).

`\nabla`

  ∇ Hamilton’s del, or differential, operator (ordinary).

`\natural`

  ♮ Musical natural notation (ordinary).

`\ne`

  ≠ Not equal (relation). Synonym: `\neq`.

`\nearrow`

  ↗ North-east arrow (relation).

`\neg`

  ¬ Logical negation (ordinary). Synonym: `\lnot`. Sometimes instead used for negation: `\sim`.

`\neq`

  ≠ Not equal (relation). Synonym: `\ne`.

`\ni`

  ∋ Reflected membership epsilon; has the member (relation). Synonym: `\owns`. Similar: is a member of `\in`.

`\not`

  Long solidus, or slash, used to overstrike a following operator (relation).

  Many negated operators are available that don’t require `\not`, particularly with the `amssymb` package. For example, `\notin` is typographically preferable to `\not\in`.

`\notin`

  ∉ Not an element of (relation). Similar: not subset of `\nsubseteq`.

`\nu`

  ν Lowercase Greek letter (ordinary).

`\nwarrow`

  ↖ North-west arrow (relation).

`\odot`

  ⊙ Dot inside a circle (binary). Similar: variable-sized operator `\bigodot`.

`\oint`

  ∮ Contour integral, integral with circle in the middle (operator).

`\Omega`

  Ω uppercase Greek letter (ordinary).

`\omega`

  ω Lowercase Greek letter (ordinary).

`\ominus`

  ⊖ Minus sign, or dash, inside a circle (binary).

`\oplus`

  ⊕ Plus sign inside a circle (binary). Similar: variable-sized operator `\bigoplus`.

`\oslash`

  ⊘ Solidus, or slash, inside a circle (binary).

`\otimes`

  ⊗ Times sign, or cross, inside a circle (binary). Similar: variable-sized operator `\bigotimes`.

`\owns`

  ∋ Reflected membership epsilon; has the member (relation). Synonym: `\ni`. Similar: is a member of `\in`.

`\parallel`

  ∥ Parallel (relation). Synonym: `\|`.

`\partial`

  ∂ Partial differential (ordinary).

`\perp`

  ⟂ Perpendicular (relation). Similar: `\bot` uses the same glyph but the spacing is different because it is in the class ordinary.

`\phi`

  ϕ Lowercase Greek letter (ordinary). The variant form is `\varphi` φ.

`\Pi`

  Π uppercase Greek letter (ordinary).

`\pi`

  π Lowercase Greek letter (ordinary). The variant form is `\varpi` ϖ.

`\pm`

  ± Plus or minus (binary).

`\prec`

  ≺ Precedes (relation). Similar: less than `<`.

`\preceq`

  ⪯ Precedes or equals (relation). Similar: less than or equals `\leq`.

`\prime`

  ′ Prime, or minute in a time expression (ordinary). Typically used as a superscript: `$f^\prime$`; `$f^\prime$` and `$f'$` produce the same result. An advantage of the second is that `$f'''$` produces the desired symbol, that is, the same result as `$f^{\prime\prime\prime}$`, but uses rather less typing. You can only use `\prime` in math mode. Using the right single quote `'` in text mode produces a different character (apostrophe).

`\prod`

  ∏ Product (operator).

`\propto`

  ∝ Is proportional to (relation)

`\Psi`

  Ψ uppercase Greek letter (ordinary).

`\psi`

  ψ Lowercase Greek letter (ordinary).

`\rangle`

  ⟩ Right angle, or sequence, bracket (closing). Similar: greater than `>`. Matches:`\langle`.

`\rbrace`

  } Right curly brace (closing). Synonym: `\}`. Matches `\lbrace`.

`\rbrack`

  ] Right square bracket (closing). Synonym: `]`. Matches `\lbrack`.

`\rceil`

  ⌉ Right ceiling bracket (closing). Matches `\lceil`.

`\Re`

  ℜ Real part, real numbers, cursive capital R (ordinary). Related: double-line, or blackboard bold, R `\mathbb{R}`; to access this, load the `amsfonts` package.

`\restriction`

  ↾ Restriction of a function (relation). Synonym: `\upharpoonright`. Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\revemptyset`

  ⦰ Reversed empty set symbol (ordinary). Related: `\varnothing`. Not available in plain TeX. In LaTeX you need to load the `stix` package.

`\rfloor`

  ⌋ Right floor bracket, a right square bracket with the top cut off (closing). Matches `\lfloor`.

`\rhd`

  ◁ Arrowhead, that is, triangle, pointing right (binary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. For the normal subgroup symbol you should instead load `amssymb` and use `\vartriangleright` (which is a relation and so gives better spacing).

`\rho`

  ρ Lowercase Greek letter (ordinary). The variant form is `\varrho` ϱ.

`\Rightarrow`

  ⇒ Implies, right-pointing double line arrow (relation). Similar: right single-line arrow `\rightarrow`.

`\rightarrow`

  → Right-pointing single line arrow (relation). Synonym: `\to`. Similar: right double line arrow `\Rightarrow`.

`\rightharpoondown`

  ⇁ Right-pointing harpoon with barb below the line (relation).

`\rightharpoonup`

  ⇀ Right-pointing harpoon with barb above the line (relation).

`\rightleftharpoons`

  ⇌ Right harpoon up above left harpoon down (relation).

`\searrow`

  ↘ Arrow pointing southeast (relation).

`\setminus`

  ⧵ Set difference, reverse solidus or reverse slash, like \ (binary). Similar: backslash `\backslash` and also `\textbackslash` outside of math mode.

`\sharp`

  ♯ Musical sharp (ordinary).

`\Sigma`

  Σ uppercase Greek letter (ordinary).

`\sigma`

  σ Lowercase Greek letter (ordinary). The variant form is `\varsigma` ς.

`\sim`

  ∼ Similar, in a relation (relation).

`\simeq`

  ≃ Similar or equal to, in a relation (relation).

`\smallint`

  ∫ Integral sign that does not change to a larger size in a display (operator).

`\smile`

  ⌣ Upward curving arc, smile (ordinary).

`\spadesuit`

  ♠ Spade card suit (ordinary).

`\sqcap`

  ⊓ Square intersection symbol (binary). Similar: intersection `cap`.

`\sqcup`

  ⊔ Square union symbol (binary). Similar: union `cup`. Related: variable-sized operator `\bigsqcup`.

`\sqsubset`

  ⊏ Square subset symbol (relation). Similar: subset `\subset`. Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\sqsubseteq`

  ⊑ Square subset or equal symbol (binary). Similar: subset or equal to `\subseteq`.

`\sqsupset`

  ⊐ Square superset symbol (relation). Similar: superset `\supset`. Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\sqsupseteq`

  ⊒ Square superset or equal symbol (binary). Similar: superset or equal `\supseteq`.

`\star`

  ⋆ Five-pointed star, sometimes used as a general binary operation but sometimes reserved for cross-correlation (binary). Similar: the synonyms asterisk `*` and `\ast`, which are six-pointed, and more often appear as a superscript or subscript, as with the Kleene star.

`\subset`

  ⊂ Subset (occasionally, is implied by) (relation).

`\subseteq`

  ⊆ Subset or equal to (relation).

`\succ`

  ≻ Comes after, succeeds (relation). Similar: is less than `>`.

`\succeq`

  ⪰ Succeeds or is equal to (relation). Similar: less than or equal to `\leq`.

`\sum`

  ∑ Summation (operator). Similar: Greek capital sigma `\Sigma`.

`\supset`

  ⊃ Superset (relation).

`\supseteq`

  ⊇ Superset or equal to (relation).

`\surd`

  √ Radical symbol (ordinary). The LaTeX command `\sqrt{...}` typesets the square root of the argument, with a bar that extends to cover the argument.

`\swarrow`

  ↙ Southwest-pointing arrow (relation).

`\tau`

  τ Lowercase Greek letter (ordinary).

`\theta`

  θ Lowercase Greek letter (ordinary). The variant form is `\vartheta` ϑ.

`\times`

  × Primary school multiplication sign (binary). See also `\cdot`.

`\to`

  → Right-pointing single line arrow (relation). Synonym: `\rightarrow`.

`\top`

  ⊤ Top, greatest element of a partially ordered set (ordinary). See also `\bot`.

`\triangle`

  △ Triangle (ordinary).

`\triangleleft`

  ◁ Not-filled triangle pointing left (binary). Similar: `\lhd`. For the normal subgroup symbol you should load `amssymb` and use `\vartriangleleft` (which is a relation and so gives better spacing).

`\triangleright`

  ▷ Not-filled triangle pointing right (binary). For the normal subgroup symbol you should instead load `amssymb` and use `\vartriangleright` (which is a relation and so gives better spacing).

`\unlhd`

  ⊴ Left-pointing not-filled underlined arrowhead, that is, triangle, with a line under (binary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. For the normal subgroup symbol load `amssymb` and use `\vartrianglelefteq` (which is a relation and so gives better spacing).

`\unrhd`

  ⊵ Right-pointing not-filled underlined arrowhead, that is, triangle, with a line under (binary). Not available in plain TeX. In LaTeX you need to load the `amssymb` package. For the normal subgroup symbol load `amssymb` and use `\vartrianglerighteq` (which is a relation and so gives better spacing).

`\Uparrow`

  ⇑ Double-line upward-pointing arrow (relation). Similar: single-line up-pointing arrow `\uparrow`.

`\uparrow`

  ↑ Single-line upward-pointing arrow, diverges (relation). Similar: double-line up-pointing arrow `\Uparrow`.

`\Updownarrow`

  ⇕ Double-line upward-and-downward-pointing arrow (relation). Similar: single-line upward-and-downward-pointing arrow `\updownarrow`.

`\updownarrow`

  ↕ Single-line upward-and-downward-pointing arrow (relation). Similar: double-line upward-and-downward-pointing arrow `\Updownarrow`.

`\upharpoonright`

  ↾ Up harpoon, with barb on right side (relation). Synonym: `\restriction`. Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\uplus`

  ⊎ Multiset union, a union symbol with a plus symbol in the middle (binary). Similar: union `\cup`. Related: variable-sized operator `\biguplus`.

`\Upsilon`

  Υ uppercase Greek letter (ordinary).

`\upsilon`

  υ Lowercase Greek letter (ordinary).

`\varepsilon`

  ε Small letter script epsilon (ordinary). This is more widely used in mathematics than the non-variant lunate epsilon form `\epsilon` ϵ. Related: set membership `\in`.

`\vanothing`

  ∅ Empty set symbol. Similar: `\emptyset`. Related: `\revemptyset`. Not available in plain TeX. In LaTeX you need to load the `amssymb` package.

`\varphi`

  φ Variant on the lowercase Greek letter (ordinary). The non-variant form is `\phi` ϕ.

`\varpi`

  ϖ Variant on the lowercase Greek letter (ordinary). The non-variant form is `\pi` π.

`\varrho`

  ϱ Variant on the lowercase Greek letter (ordinary). The non-variant form is `\rho` ρ.

`\varsigma`

  ς Variant on the lowercase Greek letter (ordinary). The non-variant form is `\sigma` σ.

`\vartheta`

  ϑ Variant on the lowercase Greek letter (ordinary). The non-variant form is `\theta` θ.

`\vdash`

  ⊢ Provable; turnstile, vertical and a dash (relation). Similar: turnstile rotated a half-circle `\dashv`.

`\vee`

  ∨ Logical or; a downwards v shape (binary). Related: logical and `\wedge`. Similar: variable-sized operator `\bigvee`.

`\Vert`

  ‖ Vertical double bar (ordinary). Similar: vertical single bar `\vert`.

  For a norm symbol, you can use the `mathtools` package and put in your preamble `\DeclarePairedDelimiter\norm{\lVert}{\rVert}`. This gives you three command variants for double-line vertical bars that are correctly horizontally spaced: if in the document body you write the starred version `$\norm*{M^\perp}$` then the height of the vertical bars will match the height of the argument, whereas with `\norm{M^\perp}` the bars do not grow with the height of the argument but instead are the default height, and `\norm[size command]{M^\perp}` also gives bars that do not grow but are set to the size given in the size command, e.g., `\Bigg`.

`\vert`

  | Single line vertical bar (ordinary). Similar: double-line vertical bar `\Vert`. For such that, as in the definition of a set, use `\mid` because it is a relation.

  For absolute value you can use the `mathtools` package and in your preamble put `\DeclarePairedDelimiter\abs{\lvert}{\rvert}`. This gives you three command variants for single-line vertical bars that are correctly horizontally spaced: if in the document body you write the starred version `$\abs*{\frac{22}{7}}$` then the height of the vertical bars will match the height of the argument, whereas with `\abs{\frac{22}{7}}` the bars do not grow with the height of the argument but instead are the default height, and `\abs[size command]{\frac{22}{7}}` also gives bars that do not grow but are set to the size given in the size command, e.g., `\Bigg`.

`\wedge`

  ∧ Logical and (binary). Synonym: `\land`. See also logical or `\vee`. Similar: variable-sized operator `\bigwedge`.

`\wp`

  ℘ Weierstrass p (ordinary).

`\wr`

  ≀ Wreath product (binary).

`\Xi`

  Ξ uppercase Greek letter (ordinary).

`\xi`

  ξ Lowercase Greek letter (ordinary).

`\zeta`

  ζ Lowercase Greek letter (ordinary).

The following symbols are most often used in plain text but LaTeX provides versions to use in mathematical text.

`\mathdollar`

  Dollar sign in math mode: $.

`\mathparagraph`

  Paragraph sign (pilcrow) in math mode, ¶.

`\mathsection`

  Section sign in math mode §.

`\mathsterling`

  Sterling sign in math mode: £.

`\mathunderscore`

  Underscore in math mode: _.

#### Blackboard bold

Synopsis:

    \usepackage{amssymb}   % in preamble
      ...
    \mathbb{uppercase-letter}

Provide blackboard bold symbols, sometimes also known as doublestruck letters, used to denote number sets such as the natural numbers, the integers, etc.

Here

    \( \forall n \in \mathbb{N}, n^2 \geq 0 \)

the `\mathbb{N}` gives blackboard bold symbol ℕ representing the natural numbers.

If you use other than an uppercase letter then you do not get an error but you get strange results, including unexpected characters.

There are packages that give access to symbols other than just the capital letters; look on CTAN.

#### Calligraphic

Synopsis:

    \mathcal{uppercase-letters}

Use a script-like font.

In this example the graph identifier is output in a cursive font.

    Let the graph be \( \mathcal{G} \).

If you use something other than an uppercase letter then you do not get an error. Instead you get unexpected output. For instance, `\mathcal{g}` outputs a close curly brace symbol, while `\mathcal{+}` outputs a plus sign.

#### `\boldmath` & `\unboldmath`

Synopsis (used in paragraph mode or LR mode):

    \boldmath \( math \)

or

    \unboldmath \( math \)

Declarations to change the letters and symbols in math to be in a bold font, or to countermand that and bring back the regular (non-bold) default. They must be used when not in math mode or display math mode (see Modes). Both commands are fragile (see \protect).

In this example each `\boldmath` command takes place inside an `\mbox`,

    we have $\mbox{\boldmath \( v \)} = 5\cdot\mbox{\boldmath \( u \)$}$

which means `\boldmath` is only called in a text mode, here LR mode, and explains why LaTeX must switch to math mode to set `v` and `u`.

If you use either command inside math mode, as with `Trouble: \( \boldmath x \)`, then you get something like ‘`LaTeX Font Warning: Command \boldmath invalid in math mode on input line 11`’ and ‘`LaTeX Font Warning: Command \mathversion invalid in math mode on input line 11`’.

There are many issues with `\boldmath`. New documents should use the `bm` package provided by the LaTeX Project team. A complete description is outside the scope of this document (see the full documentation on CTAN) but even this small example

    \usepackage{bm}   % in preamble
    ...
    we have $\bm{v} = 5\cdot\bm{u}$

shows that it is an improvement over `\boldmath`.

#### Dots, horizontal or vertical

Ellipses are the three dots (usually three) indicating that a pattern continues.

    \begin{array}{cccc}
      a_{0,0}    &a_{0,1}   &a_{0,2} &\ldots \\
      a_{1,0}    &\ddots                     \\
      \vdots
    \end{array}

LaTeX provides these.

`\cdots`

  Horizontal ellipsis with the dots raised to the center of the line, as in ⋯. Used as: `\( a_0\cdot a_1\cdots a_{n-1} \)`.

`\ddots`

  Diagonal ellipsis, ⋱. See the above array example for a usage.

`\ldots`

  Ellipsis on the baseline, …. Used as: `\( x_0,\ldots x_{n-1} \)`. Another example is the above array example. A synonym is `\mathellipsis`. A synonym from the `amsmath` package is `\hdots`.

  You can also use this command outside of mathematical text, as in `The gears, brakes, \ldots{} are all broken`. (In a paragraph mode or LR mode a synonym for `\ldots` is `\dots`.)

`\vdots`

  Vertical ellipsis, ⋮. See the above array example for a usage.

The `amsmath` package has the command `\dots` to semantically mark up ellipses. This example produces two different-looking outputs for the first two uses of the `\dots` command.

    \usepackage{amsmath}  % in preamble
      ...
    Suppose that \( p_0, p_1, \dots, p_{n-1} \) lists all of the primes.
    Observe that \( p_0\cdot p_1 \dots \cdot p_{n-1} +1 \) is not a
      multiple of any \( p_i \).
    Conclusion: there are infinitely many primes \( p_0, p_1, \dotsc \).

In the first line LaTeX looks to the comma following `\dots` to determine that it should output an ellipsis on the baseline. The second line has a `\cdot` following `\dots` so LaTeX outputs an ellipsis that is on the math axis, vertically centered. However, the third usage has no follow-on character so you have to tell LaTeX what to do. You can use one of the commands: `\dotsc` if you need the ellipsis appropriate for a comma following, `\dotsb` if you need the ellipses that fits when the dots are followed by a binary operator or relation symbol, `\dotsi` for dots with integrals, or `\dotso` for others.

### Math functions

These commands produce roman function names in math mode with proper spacing.

`\arccos`

  Inverse cosine

`\arcsin`

  Inverse sine

`\arctan`

  Inverse tangent

`\arg`

  Angle between the real axis and a point in the complex plane

`\bmod`

  Binary modulo operator, used as in `\( 5\bmod 3=2 \)`

`\cos`

  Cosine

`\cosh`

  Hyperbolic cosine

`\cot`

  Cotangent

`\coth`

  Hyperbolic cotangent

`\csc`

  Cosecant

`\deg`

  Degrees

`\det`

  Determinant

`\dim`

  Dimension

`\exp`

  Exponential

`\gcd`

  Greatest common divisor

`\hom`

  Homomorphism

`\inf`

  Infinum

`\ker`

  Kernel

`\lg`

  Base 2 logarithm

`\lim`

  Limit

`\liminf`

  Limit inferior

`\limsup`

  Limit superior

`\ln`

  Natural logarithm

`\log`

  Logarithm

`\max`

  Maximum

`\min`

  Minimum

`\pmod`

  Parenthesized modulus, as used in `\( 5\equiv 2\pmod 3 \)`

`\Pr`

  Probability

`\sec`

  Secant

`\sin`

  Sine

`\sinh`

  Hyperbolic sine

`\sup`

  sup

`\tan`

  Tangent

`\tanh`

  Hyperbolic tangent

The `amsmath` package adds improvements on some of these, and also allows you to define your own. The full documentation is on CTAN, but briefly, you can define an identity operator with `\DeclareMathOperator{\identity}{id}` that is like the ones above but prints as ‘`id`’. The starred form `\DeclareMathOperator*{\op}{op}` sets any limits above and below, as is traditional with `\lim`, `\sup`, or `\max`.

### Math accents

LaTeX provides a variety of commands for producing accented letters in math. These are different from accents in normal text (see Accents).

`\acute`

  Math acute accent

`\bar`

  Math bar-over accent

`\breve`

  Math breve accent

`\check`

  Math háček (check) accent

`\ddot`

  Math dieresis accent

`\dot`

  Math dot accent

`\grave`

  Math grave accent

`\hat`

  Math hat (circumflex) accent

`\mathring`

  Math ring accent

`\tilde`

  Math tilde accent

`\vec`

  Math vector symbol

`\widehat`

  Math wide hat accent

`\widetilde`

  Math wide tilde accent

When you are putting an accent on an i or a j, the tradition is to use one without a dot, `\imath` or `jmath` (see Math symbols).

### Over- and Underlining

LaTeX provides commands for making overlines or underlines, or putting braces over or under some material.

`\underline{text}`

  Underline text. Works inside math mode, and outside. The line is always completely below the text, taking account of descenders, so in `\(\underline{y}\)` the line is lower than in `\(\underline{x}\)`. This command is fragile (see \protect).

  Note that the package `ulem` does text mode underlining and allows line breaking as well as a number of other features. See the documentation on CTAN. See also \hrulefill & \dotfill for producing a line, for such things as a signature.

`\overline{text}`

  Put a horizontal line over text. Works inside math mode, and outside. For example, `\overline{x+y}`. Note that this differs from the command `\bar` (see Math accents).

`\underbrace{math}`

  Put a brace under math. For example, this `(1-\underbrace{1/2)+(1/2}-1/3)` emphasizes the telescoping part. Attach text to the brace by using subscript, `_`, or superscript, `^`, as here.

      \begin{displaymath}
        1+1/2+\underbrace{1/3+1/4}_{>1/2}+
             \underbrace{1/5+1/6+1/7+1/8}_{>1/2}+\cdots
      \end{displaymath}

  The superscript appears on top of the expression, and so can look unconnected to the underbrace.

`\overbrace{math}`

  Put a brace over math, as with `\overbrace{x+x+\cdots+x}^{\mbox{\(k\) times}}`. See also `\underbrace`.

The package `mathtools` adds an over- and underbrace, as well as some improvements on the braces. See the documentation on CTAN.

### Spacing in math mode

When typesetting mathematics, LaTeX puts in spacing according to the normal rules for mathematics texts. If you enter `y=m x` then LaTeX ignores the space and in the output the m is next to the x, as y=mx.

But LaTeX’s rules sometimes need tweaking. For example, in an integral the tradition is to put a small extra space between the `f(x)` and the `dx`, here done with the `\,` command.

    \int_0^1 f(x)\,dx

LaTeX provides the commands that follow for use in math mode. Many of these spacing definitions are expressed in terms of the math unit mu. It is defined as 1/18em, where the em is taken from the current math symbols family (see Units of length). Thus, a `\thickspace` is something like 5/18 times the width of a ‘`M`’.

`\;`

  Synonym: `\thickspace`. Normally `5.0mu plus 5.0mu`. Math mode only.

`\:`
`\>`

  Synonym: `\medspace`. Normally `4.0mu plus 2.0mu minus 4.0mu`. Math mode only.

`\,`

  Synonym: `\thinspace`. Normally `3mu`, which is 1/6em. Can be used in both math mode and text mode (see \thinspace & \negthinspace).

  This space is widely used, for instance between the function and the infinitesimal in an integral `\int f(x)\,dx` and, if an author does this, before punctuation in a displayed equation.

      The antiderivative is
      \begin{equation}
        3x^{-1/2}+3^{1/2}\,.
      \end{equation}

`\!`

  A negative thin space. Normally `-3mu`. The `\!` command is math mode only but the `\negthinspace` command is available for text mode (see \thinspace & \negthinspace).

`\quad`

  This is 18mu, that is, 1em. This is often used for space surrounding equations or expressions, for instance for the space between two equations inside a `displaymath` environment. It is available in both text and math mode.

`\qquad`

  A length of 2 quads, that is, 36mu = 2em. It is available in both text and math mode.

#### `\smash`

Synopsis:

    \smash{subformula}

Typeset subformula as if its height and depth were zero.

In this example the exponential is so tall that without the `\smash` command LaTeX would separate its line from the line above it, and the uneven line spacing might be unsightly.

    To compute the tetration $\smash{2^{2^{2^2}}}$,
    evaluate from the top down, as $2^{2^4}=2^{16}=65536$.

(Because of the `\smash` the printed expression could run into the line above so you may want to wait until the final version of the document to make such adjustments.)

This pictures the effect of `\smash` by using `\fbox` to surround the box that LaTeX will put on the line. The `\blackbar` command makes a bar extending from 10 points below the baseline to 20 points above.

    \newcommand{\blackbar}{\rule[-10pt]{5pt}{30pt}}
    \fbox{\blackbar}
    \fbox{\smash{\blackbar}}

The first box that LaTeX places is 20 points high and 10 points deep. But the second box is treated by LaTeX as having zero height and zero depth, despite that the ink printed on the page still extends well above and below the line.

The `\smash` command appears often in mathematics to adjust the size of an element that surrounds a subformula. Here the first radical extends below the baseline while the second lies just on the baseline.

    \begin{equation}
    \sqrt{\sum_{0\leq k< n} f(k)}
    \sqrt{\vphantom{\sum}\smash{\sum_{0\leq k< n}} f(k)}
    \end{equation}

Note the use of `\vphantom` to give the `\sqrt` command an argument with the height of the `\sum` (see \phantom & \vphantom & \hphantom).

While most often used in mathematics, the `\smash` command can appear in other contexts. However, it doesn’t change into horizontal mode. So if it starts a paragraph then you should first put a `\leavevmode`, as in the bottom line below.

    xxx xxx xxx

    \smash{yyy}  % no paragraph indent

    \leavevmode\smash{zzz}  % usual paragraph indent

The package `mathtools` has operators that provide even finer control over smashing a subformula box.

#### `\phantom` & `\vphantom` & `\hphantom`

Synopsis:

    \phantom{subformula}

or

    \vphantom{subformula}

or

    \hphantom{subformula}

The `\phantom` command creates a box with the same height, depth, and width as subformula, but empty. That is, this command causes LaTeX to typeset the box but not its ink. The `\vphantom` variant also produces an invisible box with the same height and depth as subformula, but it has width zero. And `\hphantom` makes a box with the same width as subformula but with height and depth zero.

Without the `\vphantom` in this example, the top bars of the two square roots would be at different heights.

    \( \sqrt{\vphantom{a^3}a}\cdot\sqrt{a^3} \)

The `\vphantom{a^3}` causes the first `\sqrt` to have inside it a box of the same height as the second `\sqrt`, so LaTeX makes the bars align.

These commands often are combined with `\smash`. See \smash for another example of the use of `\vphantom`.

The three phantom commands appear often but note that LaTeX provides a suite of other commands to work with box sizes that may be more convenient, including `\makebox` (see \mbox & \makebox) as well as `\settodepth` (see \settodepth), `\settoheight` (see \settoheight), and `\settowidth` (see \settowidth). In addition, the `mathtools` package has many commands that offer fine-grained control over spacing.

All three commands produce an ordinary box, without any special mathematics status. So to do something like attaching a superscript you should give it such a status, for example with the `\operatorname` command from the package `amsmath`.

While most often used in mathematics, these three can appear in other contexts. However, they don’t cause LaTeX to change into horizontal mode. So if one of these starts a paragraph then you should prefix it with `\leavevmode`.

### Math miscellany

LaTeX contains a wide variety of mathematics facilities. Here are some that don’t fit into other categories.

#### Colon character `:` & `\colon`

Synopsis, one of:

    :
    \colon

In mathematics, the colon character, `:`, is a relation.

    With side ratios \( 3:4 \) and \( 4:5 \), the triangle is right.

Ordinary LaTeX defines `\colon` to produce the colon character with the spacing appropriate for punctuation, as in set-builder notation `\{x\colon 0\leq x<1\}`.

But the widely-used `amsmath` package defines `\colon` for use in the definition of functions `f\colon D\to C`. So if you want the colon character as a punctuation then use `\mathpunct{:}`.

#### `\*`

Synopsis:

    \*

A multiplication symbol that allows a line break. If there is a break then LaTeX puts a `\times` symbol, ×, before that break.

In `\( A_1\* A_2\* A_3\* A_4 \)`, if there is no line break then LaTeX outputs it as though it were `\( A_1 A_2 A_3 A_4 \)`. If a line break does happen, for example between the two middle ones, then LaTeX sets it like `\( A_1 A_2 \times \)`, followed by the break, followed by `\( A_3 A_4 \)`.

#### `\frac`

Synopsis:

    \frac{numerator}{denominator}

Produces the fraction. Used as: `\begin{displaymath} \frac{1}{\sqrt{2\pi\sigma}} \end{displaymath}`. In inline math mode it comes out small; see the discussion of `\displaystyle` (see Math formulas).

#### `\left` & `\right`

Synopsis:

    \left delimiter1 ... \right delimiter2

Make matching parentheses, braces, or other delimiters. The delimiters are sized according to the math they enclose. This makes a unit vector surrounded by appropriate-height parentheses.

    \begin{equation}
      \left(\begin{array}{c}
        1   \\
        0   \\
      \end{array}\right)

Every `\left` must have a matching `\right`. Leaving out the `\left(` in the above gets ‘`Extra \right`’. Leaving off the `\right)` gets ‘`You can't use `\eqno' in math mode`’.

However, the two delimiters delimiter1 and delimiter2 need not match. A common case is that you want an unmatched brace, as below. Use a period, ‘`.`’, as a null delimiter.

    \begin{equation}
      f(n)=\left\{\begin{array}{ll}
                    1             &\mbox{--if \(n=0\)} \\
                    f(n-1)+3n^2   &\mbox{--else}
           \end{array}\right.
    \end{equation}

Note that to get a curly brace as a delimiter you must prefix it with a backslash, `\{`.

#### `\sqrt`

Synopsis, one of:

    \sqrt{arg}
    \sqrt[root-number]{arg}

The square root, or optionally other roots, of arg. The optional argument root-number gives the root, i.e., enter the cube root of `x+y` as `\sqrt[3]{x+y}`. The radical grows with the size of arg (as the height of the radical grows, the angle on the leftmost part gets steeper, until for a large enough `arg`, it is vertical).

LaTeX has a separate `\surd` character (see Math symbols).

#### `\stackrel`

Synopsis, one of:

    \stackrel{text}{relation}

Put text above relation. To put a function name above an arrow enter `\stackrel{f}{\longrightarrow}`.