LaTeX Commands

MathLive supports over 800 LaTeX commands.

To enter a LaTeX command press the ESC key or \ to enter LaTeX editing mode. Press ESC to exit LaTeX editing mode. You can examine the LaTeX code for an expression by selecting it, then pressing ESC.

Text Mode, Math Mode and Math Style

Math Mode

When in Math Mode, the content is laid out using typesetting rules specific to math. For example, variables are displayed in italics, an appropriate amount of space is inserted around some letters such as “f” to improve their legibility and white spaces are ignored.

In Math Mode, the layout and size of some math elements is adjusted based on the context in which they are used. For example, superscripts and subscripts are displayed in a smaller font.

To override the default math style, use the following commands:

Math Style
\displaystyle \displaystyle \sum_{i=0}^n \frac{a_i}{1+x}
$$\displaystyle \sum_{i=0}^n \frac{a_i}{1+x} $$
For equations in their own paragraph
\textstyle \textstyle \sum_{i=0}^n \frac{a_i}{1+x}
$$\textstyle \sum_{i=0}^n \frac{a_i}{1+x} $$
Confusingly, for inline math, not for text mode
\scriptstyle \scriptstyle \sum_{i=0}^n \frac{a_i}{1+x}
$$\scriptstyle \sum_{i=0}^n \frac{a_i}{1+x} $$
For subscripts and superscripts
\scriptscriptstyle \scriptscriptstyle \sum_{i=0}^n \frac{a_i}{1+x}
$$\scriptscriptstyle \sum_{i=0}^n \frac{a_i}{1+x} $$
For subscripts and superscripts of subscripts and superscripts

Text Mode

To include some textual comments, use the \text{} command to switch to Text Mode.

Math Mode Text Mode
$$if and only if x > 0$$ $$\text{if and only if } x > 0$$
if and only if x > 0 \text{if and only if } x > 0

The \text{} command will use the font defined by the font-family attribute of the enclosing mathfield. The size of the text will adjust depending on the current math style (smaller in superscript/subscript).


The \textrm{} command works like \text{} but will use a serif (roman) font.

\textrm{Don Knuth}_\textrm{Don Knuth}
\[ \textrm{Don Knuth}_\textrm{Don Knuth} \]

The \mbox{} command uses the same font as \text but its size does not account for the current math style.

\mbox{Don Knuth}_\mbox{Don Knuth}
\[ \mbox{Don Knuth}_\mbox{Don Knuth} \]

The \textnormal{} command works like \text{}. But it’s longer to type.

\textnormal{Don Knuth}_\textnormal{Don Knuth}
\[ \textnormal{Don Knuth}_\textnormal{Don Knuth} \]

When in Text Mode, use $...$ to switch back to Math Mode, Text Style (inline math) or \\[...\\] to switch to Math Mode, Display Style.

Fractions and Binomials

  • $$\frac{\unicode{"2B1A}}{\unicode{"2B1A}}$$ \frac{}{}
  • $$\dfrac{\unicode{"2B1A}}{\unicode{"2B1A}}$$ \dfrac{}{}
  • $$\tfrac{\unicode{"2B1A}}{\unicode{"2B1A}} $$ \tfrac{}{}

The \dfrac command typesets its numerator and denominator in Display Style. The \tfrac command uses Text Style (inline math).

  • $$\cfrac[l]{1}{x+1} $$ \cfrac[l]{1}{x+1}
  • $$\cfrac[r]{1}{x+1} $$ \cfrac[r]{1}{x+1}

The \cfrac (continuous fraction) command has an optional argument, [l] or [r], that controls if the numerator is left-aligned or right-aligned.

  • $$\pdiff{\unicode{"2B1A}}{\unicode{"2B1A}} $$ \pdiff{}{}

  • $$\binom{\unicode{"2B1A}}{\unicode{"2B1A}} $$ \binom{}{}
  • $$\dbinom{\unicode{"2B1A}}{\unicode{"2B1A}} $$ \dbinom{}{}
  • $$\tbinom{\unicode{"2B1A}}{\unicode{"2B1A}} $$ \tbinom{}{}
The following commands are supported but their usage is generally discouraged when creating modern LaTeX content.
  • $$a \over b $$ a \over b
  • $$a \atop b $$ a \atop b
  • $$n \choose k $$ n \choose k
  • $${\unicode{"2B1A} \overwithdelims\lbrace\rbrace \unicode{"2B1A}} $$ \overwithdelims\lbrace\rbrace
  • $${\unicode{"2B1A} \atopwithdelims\lbrace\rbrace \unicode{"2B1A}} $$ \atopwithdelims\lbrace\rbrace

Binary Operators

Some binary operators can also be used as a unary operator: +, -, etc… Their spacing is adjusted accordingly. For example in \( -1-2 \) there is less space between - and 1 than there is between - and 2.

  • $$+ $$ +
  • $$- $$ -
  • $$\pm $$ \pm
  • $$\mp $$ \mp
  • $$* $$ *
  • $$\cdot $$ \cdot
  • $$\times $$ \times
  • $$a / b $$ a / b
  • $$\nicefrac{3}{4}$$ \nicefrac{3}{4} (macro)
  • $$\div $$ \div
  • $$\divides $$ \divides
  • $$\sqrt{\unicode{"2B1A}} $$ \sqrt{}
  • $$\sqrt[\unicode{"2B1A}]{\unicode{"2B1A}} $$ \sqrt[]{}
  • $$\surd $$ \surd{}
  • $$\ltimes $$ \ltimes
  • $$\rtimes $$ \rtimes
  • $$\leftthreetimes $$ \leftthreetimes
  • $$\rightthreetimes $$ \rightthreetimes
  • $$\intercal $$ \intercal
  • $$\dotplus $$ \dotplus
  • $$\doublebarwedge $$ \doublebarwedge
  • $$\divideontimes $$ \divideontimes

  • $$\boxminus $$ \boxminus
  • $$\boxplus $$ \boxplus
  • $$\boxtimes $$ \boxtimes
  • $$\boxdot $$ \boxdot

  • $$\ominus $$ \ominus
  • $$\oplus $$ \oplus
  • $$\otimes $$ \otimes
  • $$\odot $$ \odot
  • $$\circ $$ \circ
  • $$\centerdot $$ \centerdot
  • $$\bullet $$ \bullet
  • $$\circleddash $$ \circleddash
  • $$\circledast $$ \circledast
  • $$\circledcirc $$ \circledcirc
  • $$\oslash $$ \oslash

  • $$\ast $$ \ast
  • $$\star $$ \star

Functions

  • $$\exp $$ \exp

  • $$\ln $$ \ln

  • $$\log $$ \log

  • $$\lg $$ \lg

  • $$\lb $$ \lb

  • $$\ker $$ \ker

  • $$\det $$ \det

  • $$\arg $$ \arg

  • $$\argmin $$ \argmin
  • $$\argmax $$ \argmax
  • $$\plim $$ \plim
  • $$\injlim $$ \injlim
  • $$\projlim $$ \projlim
  • $$\varlimsup $$ \varlimsup
  • $$\varliminf $$ \varliminf
  • $$\varinjlim $$ \varinjlim
  • $$\varprojlim $$ \varprojlim

Trigonometry

  • $$\degree $$ \degree
  • $$\arccos $$ \arccos
  • $$\arcsin $$ \arcsin
  • $$\arctan $$ \arctan
  • $$\arctg $$ \arctg
  • $$\arcctg $$ \arcctg
  • $$\ch $$ \ch
  • $$\cos $$ \cos
  • $$\cosh $$ \cosh
  • $$\cot $$ \cot
  • $$\coth $$ \coth
  • $$\ctg $$ \ctg
  • $$\cth $$ \cth
  • $$\cotg $$ \cotg
  • $$\csc $$ \csc
  • $$\cosec $$ \cosec
  • $$\sec $$ \sec
  • $$\sh $$ \sh
  • $$\sin $$ \sin
  • $$\sinh $$ \sinh
  • $$\tan $$ \tan
  • $$\tanh $$ \tanh
  • $$\tg $$ \tg
  • $$\th $$ \th

Bounds

  • $$\max $$ \max
  • $$\min $$ \min
  • $$\sup $$ \sup
  • $$\inf $$ \inf
  • $$\lim $$ \lim
  • $$\liminf $$ \liminf
  • $$\limsup $$ \limsup
  • $$\dim $$ \dim

Projections

  • $$\Pr $$ \Pr
  • $$\hom $$ \hom

Modulo

  • $$n \pmod{3} $$ n \pmod{3}
  • $$n \mod{3} $$ n \mod{3}
  • $$n \bmod 3 $$ n \bmod 3

Custom Functions

Use \operatorname{} to define a custom function: it will be display in upright font and will have the appropriate spacing.

\operatorname{argth}(\theta)
\[ \operatorname{argth}(\theta) \]

Unicode

Command
\unicode{} The argument is a Unicode codepoint expressed as a number. To use a hexadecimal number, start the argument with x or " and use uppercase A-F for hexadecimal digits.
  • \(\unicode{10775} \) \unicode{10775}
  • \(\unicode{"2A17} \) \unicode{"2A17}
  • \(\unicode{x2A17} \) \unicode{x2A17}
\char The argument is also a Unicode codepoint, but the {} delimiters are optional when using ".
  • \(\char"2A17 \) \char"2A17
^^
^^^^
Followed by 2 or 4 hexadecimal digits with lowercase a-f to specify a Unicode codepoint.
  • \(^^4a \) ^^4a
  • \(^^^^2a17 \) ^^^^2a17

The codepoint of the Unicode character ⨗ U+2A17 INTEGRAL WITH LEFTWARDS ARROW WITH HOOK is 10775 in decimal, 2A1716 in hexadecimal. The codepoint of the letter J is 004A16 in hexadecimal. Learn more about Mathematical Operators and Symbols in Unicode on Wikipedia.

Large Operators

Large operators display their limits above and below or adjacent to the operator, depending on the math style (Display Style or Text Style) and on the operator.

The position of the limits can be controlled with \limits, \nolimits or \displaylimits after the operator. The \limits command forces the display of the limits above and below the operator, \nolimits forces the display of the limits adjacent to the operator, and \displaylimits uses an automatic position, based on the operator and current math style.

\limits \nolimits \displaylimits
$$\sum_{i=0}^n\limits $$ $$\sum_{i=0}^n\nolimits $$ $$\sum_{i=0}^n\displaylimits $$
\sum_{i=0}^n\limits \sum_{i=0}^n\nolimits \sum_{i=0}^n\displaylimits
$$\int_0^\infty\limits $$ $$\int_0^\infty\nolimits $$ $$\int_0^\infty\displaylimits $$
\int_0^\infty\limits \int_0^\infty\nolimits \int_0^\infty\displaylimits

In Display Style, the \intop and \ointop commands display their limits above and below by default, while the \int command display its limit adjacent.

  • $$\sum_{n=0}^\infty $$ \sum
  • $$\prod_{n=0}^\infty $$ \prod
  • $$\coprod_{n=0}^\infty $$ \coprod
  • $$\int_0^\infty $$ \int
  • $$\intop_0^\infty $$ \intop
  • $$\iint_0^\infty $$ \iint – Double integral
  • $$\iiint_0^\infty $$ \iiint – Tripe integral
  • $$\oint_C $$ \oint – Contour integral
  • $$\smallint $$ \smallint – Always displayed small
  • $$\bigcup $$ \bigcup
  • $$\bigcap $$ \bigcap
  • $$\bigvee $$ \bigvee
  • $$\bigwedge $$ \bigwedge
  • $$\biguplus $$ \biguplus
  • $$\bigotimes $$ \bigotimes
  • $$\bigoplus $$ \bigoplus
  • $$\bigodot $$ \bigodot
  • $$\bigsqcup $$ \bigsqcup

  • $$\oiint $$ \oiint – Surface integral
  • $$\oiiint $$ \oiiint – Volume integral
  • $$\intclockwise $$ \intclockwise
  • $$\varointclockwise $$ \varointclockwise
  • $$\ointctrclockwise $$ \ointctrclockwise
  • $$\intctrclockwise $$ \intctrclockwise
  • $$\Cap $$ \Cap
  • $$\Cup $$ \Cup
  • $$\doublecap $$ \doublecap
  • $$\doublecup $$ \doublecup
  • $$\sqcup $$ \sqcup
  • $$\sqcap $$ \sqcap
  • $$\uplus $$ \uplus
  • $$\wr $$ \wr
  • $$\amalg $$ \amalg

Logic

Quantifiers

  • $$\forall $$ \forall
  • $$\exists $$ \exists
  • $$\nexists $$ \nexists

Unary/Binary Operators

  • $$\land $$ \land
  • $$\wedge $$ \wedge
  • $$\lor $$ \lor
  • $$\vee $$ \vee
  • $$\barwedge $$ \barwedge
  • $$\veebar $$ \veebar
  • $$\nor $$ \nor
  • $$\curlywedge $$ \curlywedge
  • $$\curlyvee $$ \curlyvee
  • $$\lnot $$ \lnot
  • $$\neg $$ \neg

Relational Operators

  • $$\to $$ \to
  • $$\gets $$ \gets
  • $$\implies $$ \implies
  • $$\impliedby $$ \impliedby
  • $$\biconditional $$ \biconditional
  • $$\therefore $$ \therefore
  • $$\because $$ \because
  • $$\leftrightarrow $$ \leftrightarrow
  • $$\Leftrightarrow $$ \Leftrightarrow
  • $$\roundimplies $$ \roundimplies
  • $$\models $$ \models
  • $$\vdash $$ \vdash
  • $$\dashv $$ \dashv

Arrows

$$\rightarrow $$ \rightarrow $$\leftarrow $$ \leftarrow
$$\twoheadrightarrow $$ \twoheadrightarrow $$\twoheadleftarrow $$ \twoheadleftarrow
$$\rightarrowtail $$ \rightarrowtail $$\leftarrowtail $$ \leftarrowtail
$$\dashrightarrow $$ \dashrightarrow $$\dashleftarrow $$ \dashleftarrow
$$\longrightarrow $$ \longrightarrow $$\longleftarrow $$ \longleftarrow $$\longleftrightarrow $$ \longleftrightarrow
$$\Rightarrow $$ \Rightarrow $$\Leftarrow $$ \Leftarrow
$$\Longrightarrow $$ \Longrightarrow $$\Longleftarrow $$ \Longleftarrow $$\Longleftrightarrow $$ \Longleftrightarrow
$$\mapsto $$ \mapsto $$\longmapsto $$ \longmapsto $$\multimap $$ \multimap
$$\uparrow $$ \uparrow $$\downarrow $$ \downarrow $$\updownarrow $$ \updownarrow
$$\Uparrow $$ \Uparrow $$\Downarrow $$ \Downarrow $$\Updownarrow $$ \Updownarrow
$$\rightharpoonup $$ \rightharpoonup $$\leftharpoonup $$ \leftharpoonup
$$\rightharpoondown $$ \rightharpoondown $$\leftharpoondown $$ \leftharpoondown
$$\rightleftharpoons $$ \rightleftharpoons $$\leftrightharpoons $$ \leftrightharpoons
$$\searrow $$ \searrow $$\nearrow $$ \nearrow
$$\swarrow $$ \swarrow $$\nwarrow $$ \nwarrow
$$\Rrightarrow $$ \Rrightarrow $$\Lleftarrow $$ \Lleftarrow
$$\leftrightarrows $$ \leftrightarrows $$\rightleftarrows $$ \rightleftarrows
$$\curvearrowright $$ \curvearrowright $$\curvearrowleft $$ \curvearrowleft
$$\hookrightarrow $$ \hookrightarrow $$\hookleftarrow $$ \hookleftarrow
$$\looparrowright $$ \looparrowright $$\looparrowleft $$ \looparrowleft
$$\circlearrowright $$ \circlearrowright $$\circlearrowleft $$ \circlearrowleft
$$\rightrightarrows $$ \rightrightarrows $$\leftleftarrows $$ \leftleftarrows
$$\upuparrows $$ \upuparrows $$\downdownarrows $$ \downdownarrows
$$\Rsh $$ \Rsh $$\Lsh $$ \Lsh
$$\upharpoonright $$ \upharpoonright $$\upharpoonleft $$ \upharpoonleft
$$\downharpoonright $$ \downharpoonright $$\downharpoonleft $$ \downharpoonleft
$$\restriction $$ \restriction
$$\rightsquigarrow $$ \rightsquigarrow $$\leftrightsquigarrow $$ \leftrightsquigarrow
$$\leadsto $$ \leadsto

Negated Arrows

$$\nrightarrow $$ \nrightarrow $$\nleftarrow $$ \nleftarrow $$\nleftrightarrow $$ \nleftrightarrow
$$\nRightarrow $$ \nRightarrow $$\nLeftarrow $$ \nLeftarrow $$\nLeftrightarrow $$ \nLeftrightarrow

Extensible Arrows

The width of the arrow commands above is fixed. The width of the commands below is determined by the length of the content above and below the arrows, which is specified as an argument (and optional argument):

\xrightarrow[\text{long text below}]{}
\[ \xrightarrow[\text{long text below}]{} \]
\xrightarrow{\text{long text above}}
\[ \xrightarrow{\text{long text above}} \]
\xrightarrow[\text{and below}]{\text{long text above}}
\[ \xrightarrow[\text{and below}]{\text{long text above}} \]
$$\xlongequal[below]{above} $$ \xlongequal[]{}
$$\xrightarrow[below]{above} $$ \xrightarrow[]{} $$\xleftarrow[below]{above} $$ \xleftarrow[]{}
$$\xleftrightarrow[below]{above} $$ \xleftrightarrow[]{}
$$\xtwoheadrightarrow[below]{above} $$ \xtwoheadrightarrow[]{} $$\xtwoheadleftarrow[below]{above} $$ \xtwoheadleftarrow[]{}
$$\xRightarrow[below]{above} $$ \xRightarrow[]{} $$\xLeftarrow[below]{above} $$ \xLeftarrow[]{}
$$\xrightharpoonup[below]{above} $$ \xrightharpoonup[]{} $$\xleftharpoonup[below]{above} $$ \xleftharpoonup[]{}
$$\xrightharpoondown[below]{above} $$ \xrightharpoondown[]{} $$\xleftharpoondown[below]{above} $$ \xleftharpoondown[]{}
$$\xrightleftharpoons[below]{above} $$ \xrightleftharpoons[]{} $$\xLeftrightarrow[below]{above} $$ \xLeftrightarrow[]{}
$$\xleftrightharpoons[below]{above} $$ \xleftrightharpoons[]{}
$$\xhookrightarrow[below]{above} $$ \xhookrightarrow[]{} $$\xhookleftarrow[below]{above} $$ \xhookleftarrow[]{}
$$\xmapsto[below]{above} $$ \xmapsto[]{}
$$\xtofrom[below]{above} $$ \xtofrom[]{}

Accents

Regular accents have a fixed width and do not stretch. For example, compare:

  • $$\vec{ABC}$$ \vec{ABC}

and

  • $$\overrightarrow{ABC}$$ \overrightarrow{ABC}.
The following commands are supported for compatibility with existing content, but their use is generally discouraged when creating new LaTeX content if there is an equivalent Unicode character available.

For example use é rather than \'{e}.

  • $$\acute{\unicode{"2B1A}} $$ \acute{}
  • $$\grave{\unicode{"2B1A}} $$ \grave{}
  • $$\dot{\unicode{"2B1A}} $$ \dot{}
  • $$\ddot{\unicode{"2B1A}} $$ \ddot{}
  • $$\mathring{\unicode{"2B1A}} $$ \mathring{}
  • $$\tilde{\unicode{"2B1A}} $$ \tilde{}
  • $$\bar{\unicode{"2B1A}} $$ \bar{}
  • $$\breve{\unicode{"2B1A}} $$ \breve{}
  • $$\check{\unicode{"2B1A}} $$ \check{}
  • $$\hat{\unicode{"2B1A}} $$ \hat{}
  • $$\vec{\unicode{"2B1A}} $$ \vec{}
  • $$\^{e} $$ \^{e}
  • $$\`{e} $$ `{e}
  • $$\'{e} $$ \'{e}
  • $$\"{a} $$ \"{a}
  • $$\={a} $$ \={a}
  • $$\c{c} $$ \c{c}
  • $$\~{n} $$ \~{n}

Extensible Accents

  • $$\overline{ABC} $$ \overline{}
  • $$\overgroup{ABC} $$ \overgroup{}
  • $$\overbrace{ABC} $$ \overbrace{}
  • $$\overlinesegment{ABC} $$ \overlinesegment{}
  • $$\overrightarrow{ABC} $$ \overrightarrow{}
  • $$\overleftarrow{ABC} $$ \overleftarrow{}
  • $$\overleftrightarrow{ABC} $$ \overleftrightarrow{}
  • $$\overarc{ABC} $$ \overarc{}
  • $$\overparen{ABC} $$ \overparen{}
  • $$\wideparen{ABC} $$ \wideparen{}
  • $$\widetilde{ABC} $$ \widetilde{}
  • $$\widehat{ABC} $$ \widehat{}
  • $$\widecheck{ABC} $$ \widecheck{}
  • $$\Overrightarrow{ABC} $$ \Overrightarrow{}
  • $$\overleftharpoon{ABC} $$ \overleftharpoon{}
  • $$\overrightharpoon{ABC} $$ \overrightharpoon{}

  • $$\underline{ABC} $$ \underline{}
  • $$\undergroup{ABC} $$ \undergroup{}
  • $$\underbrace{ABC} $$ \underbrace{}
  • $$\underlinesegment{ABC} $$ \underlinesegment{}
  • $$\underrightarrow{ABC} $$ \underrightarrow{}
  • $$\underleftarrow{ABC} $$ \underleftarrow{}
  • $$\underleftrightarrow{ABC} $$ \underleftrightarrow{}
  • $$\underarc{ABC} $$ \underarc{}
  • $$\underparen{ABC} $$ \underparen{}
  • $$\utilde{ABC} $$ \utilde{}

Relational Operators

To display a vertical “stack” of two symbols as a relational operator, use the \stackrel command: $$a\stackrel{?}{=}b $$ a\stackrel{?}{=}b.

  • $$= $$ =
  • $$< $$ <
  • $$\lt $$ \lt
  • $$> $$ >
  • $$\gt $$ \gt
  • $$\le $$ \le
  • $$\leq $$ \leq
  • $$\ge $$ \ge
  • $$\geq $$ \geq
  • $$\shortparallel $$ \shortparallel
  • $$\leqslant $$ \leqslant
  • $$\geqslant $$ \geqslant
  • $$\gtrsim $$ \gtrsim
  • $$\approxeq $$ \approxeq
  • $$\thickapprox $$ \thickapprox
  • $$\lessapprox $$ \lessapprox
  • $$\gtrapprox $$ \gtrapprox
  • $$\precapprox $$ \precapprox
  • $$\succapprox $$ \succapprox
  • $$\thicksim $$ \thicksim
  • $$\succsim $$ \succsim
  • $$\precsim $$ \precsim
  • $$\backsim $$ \backsim
  • $$\eqsim $$ \eqsim
  • $$\backsimeq $$ \backsimeq
  • $$\lesssim $$ \lesssim
  • $$\smallsmile $$ \smallsmile
  • $$\smallfrown $$ \smallfrown
  • $$\leqq $$ \leqq
  • $$\eqslantless $$ \eqslantless
  • $$\lll $$ \lll
  • $$\lessgtr $$ \lessgtr
  • $$\lesseqgtr $$ \lesseqgtr
  • $$\lesseqqgtr $$ \lesseqqgtr
  • $$\risingdotseq $$ \risingdotseq
  • $$\fallingdotseq $$ \fallingdotseq
  • $$\preccurlyeq $$ \preccurlyeq
  • $$\curlyeqprec $$ \curlyeqprec
  • $$\vDash $$ \vDash
  • $$\Vvdash $$ \Vvdash
  • $$\bumpeq $$ \bumpeq
  • $$\Bumpeq $$ \Bumpeq
  • $$\geqq $$ \geqq
  • $$\eqslantgtr $$ \eqslantgtr
  • $$\ggg $$ \ggg
  • $$\gtrless $$ \gtrless
  • $$\gtreqless $$ \gtreqless
  • $$\gtreqqless $$ \gtreqqless
  • $$\succcurlyeq $$ \succcurlyeq
  • $$\curlyeqsucc $$ \curlyeqsucc
  • $$\Vdash $$ \Vdash
  • $$\shortmid $$ \shortmid
  • $$\between $$ \between
  • $$\pitchfork $$ \pitchfork
  • $$\varpropto $$ \varpropto
  • $$\llless $$ \llless
  • $$\gggtr $$ \gggtr
  • $$\doteqdot $$ \doteqdot
  • $$\Doteq $$ \Doteq
  • $$\eqcirc $$ \eqcirc
  • $$\circeq $$ \circeq
  • $$\lhd $$ \lhd
  • $$\rhd $$ \rhd
  • $$\lessdot $$ \lessdot
  • $$\gtrdot $$ \gtrdot
  • $$\ll $$ \ll
  • $$\gg $$ \gg
  • $$\coloneq $$ \coloneq
  • $$\measeq $$ \measeq
  • $$\eqdef $$ \eqdef
  • $$\questeq $$ \questeq
  • $$\cong $$ \cong
  • $$\equiv $$ \equiv
  • $$\prec $$ \prec
  • $$\preceq $$ \preceq
  • $$\succ $$ \succ
  • $$\succeq $$ \succeq
  • $$\perp $$ \perp
  • $$\propto $$ \propto
  • $$\smile $$ \smile
  • $$\frown $$ \frown
  • $$\sim $$ \sim
  • $$\doteq $$ \doteq
  • $$\bowtie $$ \bowtie
  • $$\Join $$ \Join
  • $$\asymp $$ \asymp
  • $$\approx $$ \approx
  • $$\parallel $$ \parallel
  • $$\simeq $$ \simeq
  • $$\ratio $$ \ratio
  • $$\coloncolon $$ \coloncolon
  • $$\colonequals $$ \colonequals
  • $$\coloncolonequals $$ \coloncolonequals
  • $$\equalscolon $$ \equalscolon
  • $$\equalscoloncolon $$ \equalscoloncolon
  • $$\colonminus $$ \colonminus
  • $$\coloncolonminus $$ \coloncolonminus
  • $$\minuscolon $$ \minuscolon
  • $$\minuscoloncolon $$ \minuscoloncolon
  • $$\coloncolonapprox $$ \coloncolonapprox
  • $$\coloncolonsim $$ \coloncolonsim
  • $$\simcolon $$ \simcolon
  • $$\simcoloncolon $$ \simcoloncolon
  • $$\approxcoloncolon $$ \approxcoloncolon
  • $$\notni $$ \notni
  • $$\limsup $$ \limsup
  • $$\liminf $$ \liminf
  • $$\ordinarycolon $$ \ordinarycolon
  • $$\vcentcolon $$ \vcentcolon
  • $$\dblcolon $$ \dblcolon
  • $$\coloneqq $$ \coloneqq
  • $$\Coloneqq $$ \Coloneqq
  • $$\coloneq $$ \coloneq
  • $$\Coloneq $$ \Coloneq
  • $$\eqqcolon $$ \eqqcolon
  • $$\Eqqcolon $$ \Eqqcolon
  • $$\eqcolon $$ \eqcolon
  • $$\Eqcolon $$ \Eqcolon
  • $$\colonapprox $$ \colonapprox
  • $$\Colonapprox $$ \Colonapprox
  • $$\colonsim $$ \colonsim
  • $$\Colonsim $$ \Colonsim

Negated Relational Operators

To negate other relational operators, use the \not command, e.g. \( \not\equiv \) \not\equiv.

  • $$\ne $$ \ne
  • $$\neq $$ \neq
  • $$\not{=} $$ \not=
  • $$\not $$ \not{}
  • $$\nless $$ \nless
  • $$\nleq $$ \nleq
  • $$\lneq $$ \lneq
  • $$\lneqq $$ \lneqq
  • $$\nleqq $$ \nleqq
  • $$\nleqslant $$ \nleqslant
  • $$\ngeq $$ \ngeq
  • $$\lvertneqq $$ \lvertneqq
  • $$\lnsim $$ \lnsim
  • $$\lnapprox $$ \lnapprox
  • $$\nprec $$ \nprec
  • $$\npreceq $$ \npreceq
  • $$\precnsim $$ \precnsim
  • $$\precnapprox $$ \precnapprox
  • $$\nsim $$ \nsim
  • $$\nshortmid $$ \nshortmid
  • $$\nmid $$ \nmid
  • $$\nvdash $$ \nvdash
  • $$\nvDash $$ \nvDash
  • $$\ngtr $$ \ngtr
  • $$\ngeqslant $$ \ngeqslant
  • $$\ngeqq $$ \ngeqq
  • $$\gneq $$ \gneq
  • $$\gneqq $$ \gneqq
  • $$\gvertneqq $$ \gvertneqq
  • $$\gnsim $$ \gnsim
  • $$\gnapprox $$ \gnapprox
  • $$\nsucc $$ \nsucc
  • $$\nsucceq $$ \nsucceq
  • $$\succnsim $$ \succnsim
  • $$\succnapprox $$ \succnapprox
  • $$\ncong $$ \ncong
  • $$\nshortparallel $$ \nshortparallel
  • $$\nparallel $$ \nparallel
  • $$\nVDash $$ \nVDash
  • $$\nVdash $$ \nVdash
  • $$\precneqq $$ \precneqq
  • $$\succneqq $$ \succneqq
  • $$\unlhd $$ \unlhd
  • $$\unrhd $$ \unrhd

Sets

  • $$\emptyset $$ \emptyset
  • $$\varnothing $$ \varnothing
  • $$\N $$ \N
  • $$\R $$ \R
  • $$\Q $$ \Q
  • $$\C $$ \C
  • $$\Z $$ \Z
  • $$\P $$ \P
  • $$\doubleStruckCapitalN $$ \doubleStruckCapitalN (macro)
  • $$\doubleStruckCapitalR $$ \doubleStruckCapitalR (macro)
  • $$\doubleStruckCapitalQ $$ \doubleStruckCapitalQ (macro)
  • $$\doubleStruckCapitalZ $$ \doubleStruckCapitalZ (macro)
  • $$\doubleStruckCapitalP $$ \doubleStruckCapitalP (macro)

Set Operators

  • $$\cap $$ \cap
  • $$\cup $$ \cup
  • $$\setminus $$ \setminus
  • $$\smallsetminus $$ \smallsetminus
  • $$\complement $$ \complement

Relational Set Operators

  • $$\nsupseteqq $$ \nsupseteqq
  • $$\supsetneq $$ \supsetneq
  • $$\varsupsetneq $$ \varsupsetneq
  • $$\supsetneqq $$ \supsetneqq
  • $$\varsupsetneqq $$ \varsupsetneqq
  • $$\nsubseteqq $$ \nsubseteqq
  • $$\subseteqq $$ \subseteqq
  • $$\Subset $$ \Subset
  • $$\sqsubset $$ \sqsubset
  • $$\supseteqq $$ \supseteqq
  • $$\Supset $$ \Supset
  • $$\sqsupset $$ \sqsupset
  • $$\sqsubseteq $$ \sqsubseteq
  • $$\sqsupseteq $$ \sqsupseteq
  • $$\in $$ \in
  • $$\notin $$ \notin
  • $$\ni $$ \ni
  • $$\owns $$ \owns
  • $$\backepsilon $$ \backepsilon
  • $$\subset $$ \subset
  • $$\supset $$ \supset
  • $$\subseteq $$ \subseteq
  • $$\supseteq $$ \supseteq
  • $$\subsetneq $$ \subsetneq
  • $$\varsubsetneq $$ \varsubsetneq
  • $$\subsetneqq $$ \subsetneqq
  • $$\varsubsetneqq $$ \varsubsetneqq
  • $$\nsubset $$ \nsubset
  • $$\nsupset $$ \nsupset
  • $$\nsubseteq $$ \nsubseteq
  • $$\nsupseteq $$ \nsupseteq

Greek

  • $$\alpha $$ \alpha
  • $$\beta $$ \beta
  • $$\gamma $$ \gamma
  • $$\delta $$ \delta
  • $$\epsilon $$ \epsilon
  • $$\varepsilon $$ \varepsilon
  • $$\zeta $$ \zeta
  • $$\eta $$ \eta
  • $$\theta $$ \theta
  • $$\vartheta $$ \vartheta
  • $$\iota $$ \iota
  • $$\kappa $$ \kappa
  • $$\varkappa $$ \varkappa
  • $$\lambda $$ \lambda
  • $$\mu $$ \mu
  • $$\nu $$ \nu
  • $$\xi $$ \xi
  • $$\omicron $$ \omicron
  • $$\pi $$ \pi
  • $$\varpi $$ \varpi
  • $$\rho $$ \rho
  • $$\varrho $$ \varrho
  • $$\sigma $$ \sigma
  • $$\varsigma $$ \varsigma
  • $$\tau $$ \tau
  • $$\phi $$ \phi
  • $$\varphi $$ \varphi
  • $$\upsilon $$ \upsilon
  • $$\chi $$ \chi
  • $$\psi $$ \psi
  • $$\omega $$ \omega
  • $$\digamma $$ \digamma

  • $$ \Alpha $$ \Alpha
  • $$ \Beta $$ \Beta
  • $$ \Gamma $$ \Gamma
  • $$\varGamma $$ \varGamma
  • $$\Delta $$ \Delta
  • $$\varDelta $$ \varDelta
  • $$\Epsilon $$ \Epsilon
  • $$\Zeta $$ \Zeta
  • $$\Eta $$ \Eta
  • $$\Theta $$ \Theta
  • $$\varTheta $$ \varTheta
  • $$\Iota $$ \Iota
  • $$\Kappa $$ \Kappa
  • $$\Lambda $$ \Lambda
  • $$\varLambda $$ \varLambda
  • $$\Mu $$ \Mu
  • $$\Nu $$ \Nu
  • $$\Xi $$ \Xi
  • $$\varXi $$ \varXi
  • $$\Omicron $$ \Omicron
  • $$\Pi $$ \Pi
  • $$\varPi $$ \varPi
  • $$\Rho $$ \rho
  • $$\Sigma $$ \Sigma
  • $$\varSigma $$ \varSigma
  • $$\Tau $$ \Tau
  • $$\Phi $$ \Phi
  • $$\varPhi $$ \varPhi
  • $$\Upsilon $$ \Upsilon
  • $$\varUpsilon $$ \varUpsilon
  • $$\Chi $$ \Chi
  • $$\Psi $$ \Psi
  • $$\varPsi $$ \varPsi
  • $$\Omega $$ \Omega
  • $$\varOmega $$ \varOmega

Hebrew

  • $$\aleph $$ \aleph
  • $$\beth $$ \beth
  • $$\gimel $$ \gimel
  • $$\daleth $$ \daleth

Letterlike Symbols

  • $$@ $$ @
  • $$\mid $$ \mid
  • $$\top $$ \top
  • $$\bot $$ \bot
  • $$\nabla $$ \nabla
  • $$\partial $$ \partial
  • $$\ell $$ \ell
  • $$\hbar $$ \hbar
  • $$\pounds $$ \pounds
  • $$\euro $$ \euro
  • $$\And $$ \And
  • $$$ $$ \$
  • $$% $$ \%
  • $$\differencedelta $$ \differencedelta
  • $$\wp $$ \wp
  • $$\hslash $$ \hslash
  • $$\Finv $$ \Finv
  • $$\Game $$ \Game
  • $$\eth $$ \eth
  • $$\mho $$ \mho
  • $$\Bbbk $$ \Bbbk
  • $$\yen $$ \yen
  • $$\imath $$ \imath
  • $$\jmath $$ \jmath
  • $$\degree $$ \degree
  • $$\Re $$ \Re
  • $$\Im $$ \Im

Delimiters

A delimiter, also called a fence, is a symbol used to group some symbols, for example parentheses, brackets, braces, etc…

To grow delimiters based on their content, use \left...\right.

Regular delimiters \left...\right
$$\lbrace x | \frac{x}{2} > 0\rbrace $$ $$\left\lbrace x \middle| \frac{x}{2} > 0\right\rbrace $$
\lbrace x \| \frac{x}{2} > 0\rbrace \left\lbrace x \middle\| \frac{x}{2} > 0\right\rbrace

The left and right delimiters do not have to match:

  • \(\displaystyle \left\lparen \frac1x \right\rbrack\) \left\lparen \frac1x \right\rbrack

To omit a delimiter, use .:

  • \(\displaystyle \left\lparen \frac1x \right.\) \left\lparen \frac1x \right.

The argument to \left, \right and \middle can be one of the following commands.

  • $$\lparen $$ \lparen
  • $$\rparen $$ \rparen
  • $$\lbrace $$ \lbrace
  • $$\rbrace $$ \rbrace
  • $$\langle $$ \langle
  • $$\rangle $$ \rangle
  • $$\lfloor $$ \lfloor
  • $$\rfloor $$ \rfloor
  • $$\lceil $$ \lceil
  • $$\rceil $$ \rceil
  • $$\vert $$ \vert
  • $$\lvert $$ \lvert
  • $$\rvert $$ \rvert
  • $$| $$ \|
  • $$\Vert $$ \Vert
  • $$\mVert $$ \mVert
  • $$\lVert $$ \lVert
  • $$\rVert $$ \rVert
  • $$\lbrack $$ \lbrack
  • $$\rbrack $$ \rbrack
  • $$\{ $$ \{
  • $$\} $$ \}
  • $$( $$ (
  • $$) $$ )
  • $$[ $$ [
  • $$] $$ ]
  • $$\ulcorner $$ \ulcorner
  • $$\urcorner $$ \urcorner
  • $$\llcorner $$ \llcorner
  • $$\lrcorner $$ \lrcorner
  • $$\lgroup $$ \lgroup
  • $$\rgroup $$ \rgroup
  • $$\lmoustache $$ \lmoustache
  • $$\rmoustache $$ \rmoustache
  • $$\mvert $$ \mvert

Punctuation

  • $$. $$ .
  • $$? $$ ?
  • $$! $$ !
  • $$: $$ :
  • $$\Colon $$ \Colon
  • $$\colon $$ \colon
  • $$, $$ ,
  • $$; $$ ;
  • $$" $$ "

Dots

  • $$\cdotp $$ \cdotp
  • $$\ldotp $$ \ldotp
  • $$\vdots $$ \vdots
  • $$\cdots $$ \cdots
  • $$\ddots $$ \ddots
  • $$\ldots $$ \ldots
  • $$\mathellipsis $$ \mathellipsis

Shapes

  • $$\diamond $$ \diamond
  • $$\Diamond $$ \Diamond
  • $$\lozenge $$ \lozenge
  • $$\blacklozenge $$ \blacklozenge

  • $$\square $$ \square
  • $$\Box $$ \Box
  • $$\blacksquare $$ \blacksquare

  • $$\bigcirc $$ \bigcirc
  • $$\circledS $$ \circledS
  • $$\circledR $$ \circledR

  • $$\triangleleft $$ \triangleleft
  • $$\triangleright $$ \triangleright
  • $$\triangle $$ \triangle
  • $$\triangledown $$ \triangledown

  • $$\blacktriangleleft $$ \blacktriangleleft
  • $$\blacktriangleright $$ \blacktriangleright
  • $$\blacktriangle $$ \blacktriangle
  • $$\blacktriangledown $$ \blacktriangledown

  • $$\vartriangle $$ \vartriangle
  • $$\vartriangleleft $$ \vartriangleleft
  • $$\vartriangleright $$ \vartriangleright

  • $$\triangleq $$ \triangleq
  • $$\trianglelefteq $$ \trianglelefteq
  • $$\trianglerighteq $$ \trianglerighteq
  • $$\ntriangleleft $$ \ntriangleleft
  • $$\ntriangleright $$ \ntriangleright
  • $$\ntrianglelefteq $$ \ntrianglelefteq
  • $$\ntrianglerighteq $$ \ntrianglerighteq

  • $$\bigtriangleup $$ \bigtriangleup
  • $$\bigtriangledown $$ \bigtriangledown

  • $$\dagger $$ \dagger
  • $$\dag $$ \dag
  • $$\ddag $$ \ddag
  • $$\ddagger $$ \ddagger
  • $$\maltese $$ \maltese

St Mary’s Road Symbols for Theoretical Computer Science

  • $$\mapsfrom $$ \mapsfrom
  • $$\Mapsfrom $$ \Mapsfrom
  • $$\MapsTo $$ \MapsTo
  • $$\Yup $$ \Yup
  • $$\lightning $$ \lightning
  • $$\leftarrowtriangle $$ \leftarrowtriangle
  • $$\rightarrowtriangle $$ \rightarrowtriangle
  • $$\leftrightarrowtriangle $$ \leftrightarrowtriangle
  • $$\boxdot $$ \boxdot
  • $$\bigtriangleup $$ \bigtriangleup
  • $$\bigtriangledown $$ \bigtriangledown
  • $$\boxbar $$ \boxbar
  • $$\Lbag $$ \Lbag
  • $$\Rbag $$ \Rbag
  • $$\llbracket $$ \llbracket
  • $$\rrbracket $$ \rrbracket
  • $$\longmapsfrom $$ \longmapsfrom
  • $$\Longmapsfrom $$ \Longmapsfrom
  • $$\Longmapsto $$ \Longmapsto
  • $$\boxslash $$ \boxslash
  • $$\boxbslash $$ \boxbslash
  • $$\boxast $$ \boxast
  • $$\boxcircle $$ \boxcircle
  • $$\boxbox $$ \boxbox
  • $$\fatsemi $$ \fatsemi
  • $$\leftslice $$ \leftslice
  • $$\rightslice $$ \rightslice
  • $$\interleave $$ \interleave
  • $$\biginterleave $$ \biginterleave
  • $$\sslash $$ \sslash
  • $$\talloblong $$ \talloblong

Layout

These commands change the amount of space around a symbol: \mathop{} treats its argument as if it was a large operator, \mathrel{} a relational operator, \mathbin{} a binary operator, \mathopen{} and \mathclose{} an opening and closing delimiter, respectively, \mathpunct{} a punctuation, \mathinner{} a fraction, and \mathord{} an ordinary symbol

  • $$x\mathop{+}0+1 $$ x\mathop{+}0+1
  • $$x=\mathbin{arg}=0 $$ \mathbin{}
  • $$x=\mathrel{arg}=0 $$ \mathrel{}
  • $$x=\mathopen{arg}=0 $$ \mathopen{}
  • $$x=\mathclose{arg}=0 $$ \mathclose{}
  • $$x=\mathpunct{arg}=0 $$ \mathpunct{}
  • $$x=\mathinner{arg}=0 $$ \mathinner{}
  • $$x=\mathord{arg}=0 $$ \mathord{}

  • $$\overset{arg}{x=0} $$ \overset{}{}
  • $$\underset{arg}{x=0} $$ \underset{}{}
  • $$\overunderset{arg}{x=0}{y=1} $$ \overunderset{arg}{x=0}{y=1}
  • $$\stackrel{arg}{x=0} $$ \stackrel[]{}{}
  • $$\stackbin{arg}{x=0} $$ \stackbin[]{}{}
  • $$\rlap{/}0 $$ \rlap{}
  • $$o\llap{/} $$ \llap{}
  • $$o\mathllap{/} $$ \mathllap{}
  • $$\mathrlap{/}0 $$ \mathrlap{}

Spacing

  • $$\unicode{"203A}\hspace{1em}\unicode{"2039} $$ \hspace{}
  • $$\unicode{"203A}\hspace*{1em}\unicode{"2039} $$ \hspace*{}
  • $$\unicode{"203A}!\unicode{"2039} $$ \!
  • $$\unicode{"203A},\unicode{"2039} $$ \,
  • $$\unicode{"203A}:\unicode{"2039} $$ \:
  • $$\unicode{"203A};\unicode{"2039} $$ \;
  • $$\unicode{"203A}\enskip\unicode{"2039} $$ \enskip
  • $$\unicode{"203A}\enspace\unicode{"2039} $$ \enspace
  • $$\unicode{"203A}\quad\unicode{"2039} $$ \quad
  • $$\unicode{"203A}\qquad\unicode{"2039} $$ \qquad

Decorations

$$\textcolor{blue}{x+1=0}$$ \textcolor{blue}{x+1=0} Recommended over \color
$${\color{blue}x+1=0}} $$ {\color{blue} x+1=0}}
$$\colorbox{yellow}{\[ax^2+bx+c\]} $$ \colorbox{yellow}{\[ax^2+bx+c\]} The argument is in Text Mode. Use \[...\] to switch to math mode.
$$\fcolorbox{#cd0030}{#ffd400}{\unicode{"2B1A}} $$ \fcolorbox{}{}{}
$$\boxed{1+\frac{1}{x}} $$ \boxed{1+\frac{1}{x}}
$$\bbox[#ffd400, solid 2px #ffd400]{\unicode{"2B1A}} $$ \bbox[]{} See MathJax BBox documentation
$$\rule{2em}{1em} $$ \rule[]{2em}{1em} The arguments are the width and height. The optional argument is an offset from the baseline.

Notations

\enclose

The \enclose command is very flexible. It accepts three arguments, two of which are required:

\enclose{<notation>}[<style>]{<body>}
  • <notation> a list of whitespace-delimited values:
$$\enclose{box}{x=0} $$ box
$$\enclose{roundedbox}{x=0} $$ roundedbox
$$\enclose{circle}{x=0} $$ circle
$$\enclose{top}{x=0} $$ top
$$\enclose{left}{x=0} $$ left
$$\enclose{bottom}{x=0} $$ bottom
$$\enclose{right}{x=0} $$ right
$$\enclose{horizontalstrike}{x=0} $$ horizontalstrike
$$\enclose{verticalstrike}{x=0} $$ verticalstrike
$$\enclose{updiagonalstrike}{x=0} $$ updiagonalstrike
$$\enclose{downdiagonalstrike}{x=0} $$ downdiagonalstrike
$$\enclose{updiagonalarrow}{x=0} $$ updiagonalarrow
$$\enclose{phasorangle}{x=0} $$ phasorangle
$$\enclose{radical}{x=0} $$ radical
$$\enclose{longdiv}{x=0} $$ longdiv
$$\enclose{actuarial}{x=0} $$ actuarial
$$\enclose{madruwb}{x=0} $$ madruwb

They can be combined:

  • \( \displaystyle \enclose{roundedbox updiagonalstrike}{x=0} \) roundedbox, updiagonalstrike
  • <style> an optional list of comma separated key-value pairs including:
    • mathbackground="<color>" background color of the expression
    • mathcolor="<color>" color of the notation, for example red or #cd0030 or rgba(205, 0, 11, .4).
    • padding="<dimension>" "auto" or an amount of padding around the content
    • shadow="<shadow>": "auto" or "none" or a CSS box-shadow expression for example, "0 0 2px rgba(0, 0, 0, 0.5)".
    • in addition the style property can include a stroke style expression that follows the shorthand syntax of the CSS border property, for example "2px solid red".
  • <body> a math expression that is “enclosed” by the specified notations

\enclose is a LaTeX extension introduced by MathJax that follows the <menclose> definition of MathML.

  • $$\enclose{updiagonalstrike roundedbox}[1px solid red, mathbackground=“#fbc0bd”]{x=0} $$ \enclose{updiagonalstrike roundedbox}[1px solid red, mathbackground="#fbc0bd"]{x=0}
  • $$\enclose{circle}[mathbackground=“#fbc0bd”]{\frac1x}$$ \enclose{circle}[mathbackground="#fbc0bd"]{\frac1x}
  • $$\enclose{roundedbox}[1px dotted #cd0030]{\frac{x^2+y^2}{\sqrt{x^2+y^2}}}$$ \enclose{roundedbox}[1px dotted #cd0030]{\frac{x^2+y^2}{\sqrt{x^2+y^2}}}

\cancel, \bcancel and \xcancel

Command… is a shorthand for…
$$\cancel{\unicode{"2B1A}} $$ \cancel{body} \enclose{updiagonalstrike}{body}
$$\bcancel{\unicode{"2B1A}} $$ \bcancel{body} \enclose{downdiagonalstrike}{body}
$$\xcancel{\unicode{"2B1A}} $$ \xcancel{body} \enclose{updiagonalstrike downdiagonalstrike}{body}

The \cancel, \bcancel and \xcancel commands are part of the “cancel” LaTeX package.

Shortcuts

Some commands are shortcuts for common notations:

Command… is a shorthand for…
$$\angl{body} $$ \angl{body} \enclose{actuarial}{body}
$$\angln $$ \angln \enclose{actuarial}{n}
$$\anglr $$ \anglr \enclose{actuarial}{r}
$$\anglk $$ \anglk \enclose{actuarial}{k}

Colors

To change the foreground color, use the \textcolor{}{} command.

To change the background, use the \colorbox{}{} command.

The first argument of these commands is a color specified as:

  • one of red, orange, yellow, lime, green, teal, blue, indigo,
  • purple, magenta, black, dark-grey, grey, light-grey, `white.
  • a RGB color using the standard CSS format (#d7170b or rgb(240, 20, 10))
  • one of the 68 colors from dvips color name (CadetBlue). Note that these names are case-sensitive.
  • one of the 10 Mathematica color from ColorData[97, "ColorList"] (M0 to M9)
  • a color defined using the syntax from the xcolor package, for example: Blue!20!Black!30!Green
  • if the color is prefixed with a -, the complementary color is used

The following color names are recommended:

These colors have been carefully selected for a balanced representation of the range of hues on the color circle, with similar lightness and intensity. They will map to different color values than the dvips colors of the same name.

To have proper legibility based on usage, these color names will map to different values when used as a foreground color and a background color. To use a specific color value, use a RGB color instead.

For best portability between versions of TeX, limit yourself to this subset of DVIPS colors: White, Black, Gray, Red, Orange, Yellow, LimeGreen, Green, TealBlue, Blue, Violet, Purple and Magenta. Those names are case-sensitive.

Font Styling

  • $$\text{\selectfont} $$ \selectfont

Bold

  • $$\text{\fontseries{b}Don Knuth} $$ \fontseries{}
  • $$\boldsymbol{Don Knuth} $$ \boldsymbol{}
  • $$\text{\bfseries Don Knuth} $$ \bfseries
  • $$\text{\mdseries Don Knuth} $$ \mdseries
  • $$\bm{Don Knuth} $$ \bm{}
  • $$\bold{Don Knuth} $$ \bold{}
  • $$\textbf{Don Knuth} $$ \textbf{}
  • $$\textmd{Don Knuth} $$ \textmd{}
  • $$\mathbf{Don Knuth} $$ \mathbf{}
  • $$\mathbfit $$ \mathbfit{}

Italic

  • $$\text{\upshape Don Knuth} $$ \upshape
  • $$\text{\slshape Don Knuth} $$ \slshape
  • $$\textup{Don Knuth} $$ \textup{}
  • $$\textsl{Don Knuth} $$ \textsl{}
  • $$\textit{Don Knuth} $$ \textit{}
  • $$\mathit{Don Knuth} $$ \mathit{}

Font Family

Typewriter / Monospace

  • $$\text{\fontfamily{cmtt}Don Knuth} $$ \fontfamily{}
  • $$\texttt{Don Knuth} $$ \texttt{}
  • $$\mathtt{Don Knuth} $$ \mathtt{}
  • $${\ttfamily Don Knuth} $$ \ttfamily

Sans-Serif

  • $$\textsf{Don Knuth} $$ \textsf{}
  • $$\mathsf{Don Knuth} $$ \mathsf{}
  • $${\sffamily Don Knuth} $$ \sffamily

Math Variants

  • $$\mathfrak{ABCdef} $$ \mathfrak{ABCdef} – Fraktur
  • $$\mathcal{ABC} $$ \mathcal{ABCdef} – Caligraphic
  • $$\mathscr{ABCdef} $$ \mathscr{ABCdef} – Script
  • $$\mathbb{Don Knuth} $$ \mathbb{} – Blackboard
  • $$\Bbb{ABCdef} $$ \Bbb{}
  • $${\rmfamily Don Knuth} $$ \rmfamily
  • $${\frak Don Knuth} $$ {\frak}

MathJax HTML Extension

MathLive support some commands from the MathJax HTML extension.

\class

\class{custom-class}{x+1}
\[ \class{custom-class}{x+1} \]

When used in a <math-field> component, the class names should refer to a stylesheet defined with a <style> tag inside the <math-field> element.

<math-field>
  <style>
    #custom-class { 
      box-shadow: 0 0 10px #000; border-radius: 8px; padding: 8px;
    }
  </style>

  \class{custom-class}{\frac{1}{x+1}}

</math-field>

\cssId{custom-class}{Don Knuth}
\[ \cssId{custom-class}{Don Knuth} \]

\htmlData

The argument of this command is a comma-delimited list of key/value pairs, e.g. \htmlData{foo=green,bar=blue}{x=0}. A corresponding data-foo and data-bar DOM attribute is generated to the rendered DOM.

\htmlData{foo=green,bar=blue}{ \text{Don Knuth} }
\[ \htmlData{foo=green,bar=blue}{ \text{Don Knuth} } \]

Other Extensions

\error

The argument of this command is a string that will be rendered in red.

\error{\text{Don Knuth}}
\[ \error{\text{Don Knuth}} \]

\texttip

The first argument is a math expression to display, the second argument is the text to display on hover.

\mathtip{\text{Don Knuth}}{\text{Knuth is the author of TeX}}
\[ \mathtip{\text{Don Knuth}}{\text{Knuth is the author of TeX}} \]

\mathtip

The first argument is a math expression to display, the second argument is the a math expression to display on hover.

\mathtip{e^{i\pi}}{-1}
\[ \mathtip{e^{i\pi}}{-1} \]

Others

  • $$\text{\fontshape{sc}Don Knuth} $$ \fontshape{} Small Caps
  • $$\text{\scshape Don Knuth} $$ \scshape
  • $$\textsc{Don Knuth} $$ \textsc{}
  • $$\textrm{Don Knuth} $$ \textrm{}
  • $$\mathrm{Don Knuth} $$ \mathrm{}
  • $$\text{Don {\em{Knuth}}} $$ \em{} – Emphasis
  • $$\text{Don \emph{Knuth} }$$ \emph{} – Emphasis

Deprecated

The following commands are supported for compatibility with existing content, but their use is generally discouraged when creating new LaTeX content

$${\bf Don Knuth} $$ {\bf Don Knuth} Use \textbf{} or \bfseries instead.
$${\it Don Knuth} $$ {\it Don Knuth} Use \textit{} or \itshape instead.

Sizing

In LaTeX using the sizing commands below may not always achieve the expected result. In MathLive, the sizing commands are applied consistently to text and math mode.

These size are relative to the font-size property of the mathfield.

$$\tiny{e^{i\pi}+1=0} $$ \tiny
$$\scriptsize{e^{i\pi}+1=0} $$ \scriptsize
$$\footnotesize{e^{i\pi}+1=0} $$ \footnotesize
$$\small{e^{i\pi}+1=0} $$ \small
$$\normalsize{e^{i\pi}+1=0} $$ \normalsize
$$\large{e^{i\pi}+1=0} $$ \large
$$\Large{e^{i\pi}+1=0} $$ \Large
$$\LARGE{e^{i\pi}+1=0} $$ \LARGE
$$\huge{e^{i\pi}+1=0} $$ \huge
$$\Huge{e^{i\pi}+1=0} $$ \Huge

The size of delimiters can be controlled manually with the commands below. The \left...\right... commands calculate automatically the size of the delimiters based on the content.

The command must be followed by a delimiter, for example ( or \lbrace or \lbrack. If the command is used on its own, nothing is displayed.

$$\bigl( \bigm| \bigr) $$ \bigl( \bigm\| \bigr)
$$\Bigl( \Bigm| \Bigr) $$ \Bigl( \Bigm\| \Bigr)
$$\biggl( \biggm| \biggr) $$ \biggl( \biggm\| \biggr)
$$\Biggl( \Biggm| \Biggr) $$ \Biggl( \Biggm\| \Biggr)

Various

  • $$/ $$ /

  • $$\sharp $$ \sharp

  • $$\flat $$ \flat

  • $$\natural $$ \natural

  • $$# $$ \#

  • $$& $$ \&

  • $$\clubsuit $$ \clubsuit

  • $$\heartsuit $$ \heartsuit

  • $$\spadesuit $$ \spadesuit

  • $$\diamondsuit $$ \diamondsuit

  • $$\backslash $$ \backslash

  • $$\infty $$ \infty

  • $$\prime $$ \prime

  • $$\doubleprime $$ \doubleprime

  • $$\angle $$ \angle

  • $$_ $$ \_

  • $$\checkmark $$ \checkmark

  • $$\diagup $$ \diagup

  • $$\measuredangle $$ \measuredangle

  • $$\sphericalangle $$ \sphericalangle

  • $$\backprime $$ \backprime

  • $$\backdoubleprime $$ \backdoubleprime

  • $$/ $$ \/

  • $$| $$ |

  • $$’ $$ '

  • $$\originalof $$ \originalof

  • $$\laplace $$ \laplace

  • $$\imageof $$ \imageof

  • $$\Laplace $$ \Laplace

  • $$− $$

  • $$` $$ ```

  • $$~ $$ ~

  • $$\space $$ \space

  • $$\smash $$ \smash[]{}

  • $$\vphantom $$ \vphantom{}

  • $$\hphantom $$ \hphantom{}

  • $$\phantom $$ \phantom{}

MediaWiki (texvc.sty package)

MathLive supports the commands used by MediaWiki pages, except for the deprecated ones.

  • $$ \darr $$ \darr
  • $$ \dArr $$ \dArr
  • $$ \Darr $$ \Darr
  • $$ \lang $$ \lang
  • $$ \rang $$ \rang
  • $$ \uarr $$ \uarr
  • $$ \uArr $$ \uArr
  • $$ \Uarr $$ \Uarr
  • $$ \N $$ \N
  • $$ \R $$ \R
  • $$ \Z $$ \Z
  • $$ \alef $$ \alef
  • $$ \alefsym $$ \alefsym
  • $$ \Alpha $$ \Alpha
  • $$ \Beta $$ \Beta
  • $$ \bull $$ \bull
  • $$ \Chi $$ \Chi
  • $$ \clubs $$ \clubs
  • $$ \cnums $$ \cnums
  • $$ \Complex $$ \Complex
  • $$ \Dagger $$ \Dagger
  • $$ \diamonds $$ \diamonds
  • $$ \empty $$ \empty
  • $$ \Epsilon $$ \Epsilon
  • $$ \Eta $$ \Eta
  • $$ \exist $$ \exist
  • $$ \harr $$ \harr
  • $$ \hArr $$ \hArr
  • $$ \Harr $$ \Harr
  • $$ \hearts $$ \hearts
  • $$ \image $$ \image
  • $$ \infin $$ \infin
  • $$ \Iota $$ \Iota
  • $$ \isin $$ \isin
  • $$ \Kappa $$ \Kappa
  • $$ \larr $$ \larr
  • $$ \lArr $$ \lArr
  • $$ \Larr $$ \Larr
  • $$ \lrarr $$ \lrarr
  • $$ \lrArr $$ \lrArr
  • $$ \Lrarr $$ \Lrarr
  • $$ \Mu $$ \Mu
  • $$ \natnums $$ \natnums
  • $$ \Nu $$ \Nu
  • $$ \Omicron $$ \Omicron
  • $$ \plusmn $$ \plusmn
  • $$ \rarr $$ \rarr
  • $$ \rArr $$ \rArr
  • $$ \Rarr $$ \Rarr
  • $$ \real $$ \real
  • $$ \reals $$ \reals
  • $$ \Reals $$ \Reals
  • $$ \Rho $$ \Rho
  • $$ \sdot $$ \sdot
  • $$ \sect $$ \sect
  • $$ \spades $$ \spades
  • $$ \sub $$ \sub
  • $$ \sube $$ \sube
  • $$ \supe $$ \supe
  • $$ \Tau $$ \Tau
  • $$ \thetasym $$ \thetasym
  • $$ \weierp $$ \weierp
  • $$ \Zeta $$ \Zeta

Physics

Braket Notation

MathLive supports the braket package

  • $$\bra{\Psi} $$ \bra{\Psi} (macro)
  • $$\ket{\Psi} $$ \ket{\Psi} (macro)
  • $$\braket{ab} $$ \braket{} (macro)
  • $$\Bra{ab} $$ \Bra{} (macro)
  • $$\Ket{ab} $$ \Ket{} (macro)
  • $$\Braket{ab} $$ \Braket{} (macro)

Chemistry (mhchem package)

MathLive supports the mhchem package.

Chemical Formulae

  • $$\ce{H2O} $$ \ce{H2O}
  • $$\ce{Sb2O3} $$ \ce{Sb2O3}

Charges

  • $$\ce{[AgCl2]-} $$ \ce{[AgCl2]-}
  • $$\ce{Y^99+} $$ \ce{Y^99+}
  • $$\ce{Y^{99+}} $$ \ce{Y^{99+}}
  • $$\ce{H+} $$ \ce{H+}
  • $$\ce{CrO4^2-} $$ \ce{CrO4^2-}

Stoichiometric numbers

  • $$\ce{2 H2O} $$ \ce{2 H2O}
  • $$\ce{2H2O} $$ \ce{2H2O}
  • $$\ce{0.5 H2O} $$ \ce{0.5 H2O}
  • $$\ce{1/2 H2O} $$ \ce{1/2 H2O}
  • $$\ce{(1/2) H2O} $$ \ce{(1/2) H2O}
  • $$\ce{$n$ H2O} $$ \ce{$n$ H2O}

Isotopes

  • $$\ce{^{227}_{90}Th+} $$ \ce{^{227}_{90}Th+}
  • $$\ce{^227_90Th+} $$ \ce{^227_90Th+}
  • $$\ce{^{0}_{-1}n^{-}} $$ \ce{^{0}_{-1}n^{-}}
  • $$\ce{^0_-1n-} $$ \ce{^0_-1n-}
  • $$\ce{H{}^3HO} $$ \ce{H{}^3HO}
  • $$\ce{H^3HO} $$ \ce{H^3HO}

Complex Examples

\ce{CO2 + C -> 2 CO}
\[ \ce{CO2 + C -> 2 CO} \]
\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}
\[ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} \]
\ce{$K = \ce{\frac{[Hg^2+][Hg]}{[Hg2^2+]}}$}
\[ \ce{$K = \ce{\frac{[Hg^2+][Hg]}{[Hg2^2+]}}$} \]
\ce{Hg^2+ ->[I-] $\underset{\mathrm{red}}{\ce{HgI2}}$ ->[I-] $\underset{\mathrm{red}}{\ce{[Hg^{II}I4]^2-}}$}
\[ \ce{Hg^2+ ->[I-] $\underset{\mathrm{red}}{\ce{HgI2}}$ ->[I-] $\underset{\mathrm{red}}{\ce{[Hg^{II}I4]^2-}}$} \]

Macros

  • $$\iff $$ \iff
  • $$\set{ab} $$ \set{}
  • $$\rd $$ \rd
  • $$\rD $$ \rD
  • $$\scriptCapitalE $$ \scriptCapitalE
  • $$\scriptCapitalH $$ \scriptCapitalH
  • $$\scriptCapitalL $$ \scriptCapitalL
  • $$\gothicCapitalC $$ \gothicCapitalC
  • $$\gothicCapitalH $$ \gothicCapitalH
  • $$\gothicCapitalI $$ \gothicCapitalI
  • $$\gothicCapitalR $$ \gothicCapitalR
  • $$\imaginaryI $$ \imaginaryI
  • $$\imaginaryJ $$ \imaginaryJ
  • $$\exponentialE $$ \exponentialE
  • $$\differentialD $$ \differentialD
  • $$\capitalDifferentialD $$ \capitalDifferentialD
\Set{ x\in\mathbf{R}^2 | 0<{|x|}<5 }
\[ \Set{ x\in\mathbf{R}^2 | 0<{|x|}<5 } \]

Environments / Matrixes

Environements are used to typeset a set of related items, for examples cells in a matrix, or multi-line equations.

Each row in a tabular environment is separated by a \\ command.

Each column is separated by a &.

Matrixes

array

A simple table with no delimiters.

$$\begin{array}{lc}a + 1 & b + 1 \\\\ c & \frac{1}{d}\end{array} $$
\begin{array}{lc}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{array}

The {lc} argument specifies how many columns there are and how they should be formated:

  • l: left-aligned
  • c: centered
  • r: right-aligned

To add a vertical line separating columns, add | character in the column format:

$$\begin{array}{l|c}a + 1 & b + 1 \\\\ c & \frac{1}{d}\end{array} $$
\begin{array}{l|c}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{array}

To add a double vertical line separating columns, add two | characters in the column format:

$$\begin{array}{l||c}a + 1 & b + 1 \\\\ c & \frac{1}{d}\end{array} $$
\begin{array}{l||c}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{array}

To add a dashed vertical line between two columns, use ::

$$\begin{array}{l:c}a + 1 & b + 1 \\\\ c & \frac{1}{d}\end{array} $$
\begin{array}{l:c}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{array}

matrix

The matrix environment is very similar to array, but it does not have an argument to specify the format of the columns.

$$\begin{matrix}a + 1 & b + 1 \\\\ c & \frac{1}{d} \end{matrix}$$
\begin{matrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{matrix}

To specify the format of the columns, use the starred version and an optional argument. This applies to all the other matrix environments.

$$\begin{matrix*}[l|r]a + 1 & b + 1 \\\\ c & \frac{1}{d} \end{matrix*}$$
\begin{matrix*}[l|r]
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{matrix*}

pmatrix

A matrix with parentheses as delimiters.

$$\begin{pmatrix}a & b \\\\ c & \frac{1}{d}\end{pmatrix}$$
\begin{pmatrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{pmatrix}

bmatrix

A matrix with square brackets as delimiters.

$$\begin{bmatrix}a & b \\\\ c & \frac{1}{d}\end{bmatrix}$$
\begin{bmatrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{bmatrix}

Bmatrix

A matrix with braces (curly brackets) as delimiters.

$$\begin{Bmatrix}a & b \\\\ c & \frac{1}{d}\end{Bmatrix}$$
\begin{Bmatrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{Bmatrix}

vmatrix

A matrix with single bars as delimiters.

$$\begin{vmatrix}a & b \\\\ c & \frac{1}{d}\end{vmatrix}$$
\begin{vmatrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{vmatrix}

Vmatrix

A matrix with double bars as delimiters.

$$\begin{Vmatrix}a & b \\\\ c & \frac{1}{d}\end{Vmatrix}$$
\begin{Vmatrix}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{Vmatrix}

matrix*

An array, a matrix without delimiters.

$$\begin{matrix*}a & b \\\\ c & \frac{1}{d}\end{matrix*}$$
\begin{matrix*}
  a + 1   &   b  + 1 \\
  c       &   \frac{1}{d}
\end{matrix*}

smallmatrix

A matrix typeset in a way that may be suitable on the same line as text.

$$\begin{smallmatrix}a & b \\\\ c & \frac{1}{d}\end{smallmatrix}$$
\begin{smallmatrix} a & b \\ c & \frac{1}{d} \end{smallmatrix}

Other Environments

cases, dcases and rcases

Use these environments to write piecewise functions:

$$f(n) = \begin{cases} 1 & \text{if } n = 0 \\\\ f(n-1) + f(n-2) & \text{if } n \ge 2 \end{cases} $$
f(n) = \begin{cases}
  1 & \text{if } n = 0  \\ 
  f(n-1) + f(n-2) & \text{if } n \ge 2
\end{cases}

To typeset the content in Display style, use dcases instead:

$$f(n) = \begin{dcases} 1 & \text{if } n = 0 \\\\ f(n-1) + f(n-2) & \text{if } n \ge 2 \end{dcases} $$
f(n) = \begin{dcases}
  1 & \text{if } n = 0  \\ 
  f(n-1) + f(n-2) & \text{if } n \ge 2
\end{dcases}

To display the brace on the right, use rcases.

$$\begin{rcases} 1 & \text{if } n = 0 \\\\ f(n-1) + f(n-2) & \text{if } n \ge 2 \end{rcases} = f(n) $$
\begin{rcases}
  1 & \text{if } n = 0  \\ 
  f(n-1) + f(n-2) & \text{if } n \ge 2
\end{rcases} = f(n)

gather

Consecutive equations without alignment

$$\begin{gather} 3(a-x) = 3.5x + a - 1 \\\\ 3a - 3x = 3.5x + a - 1 \\\\ a = \frac{13}{4}x - \frac{1}{2} \end{gather} $$
  \​begin{gather}
    3(a-x) = 3.5x + a - 1 \\
    3a - 3x = 3.5x + a - 1 \\
    a = \frac{13}{4}x - \frac{1}{2}
  \end{gather}

multline

The first line is left aligned, the last line is right aligned, and all the intermediate lines are centered.

$$\begin{multline} 3(a-x) = 3.5x + a - 1 \\\\ 3a - 3x = 3.5x + a - 1 \\\\ a = \frac{13}{4}x - \frac{1}{2} \end{multline} $$
  \​begin{multline}
    3(a-x) = 3.5x + a - 1 \\
    3a - 3x = 3.5x + a - 1 \\
    a = \frac{13}{4}x - \frac{1}{2}
  \end{multline}

align

$$\begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \end{align}$$
\begin{align}
  f(x)  & = (a+b)^2 \\
        & = a^2+2ab+b^2 \\
\end{align}

Others

$$\begin{math}x+\frac12\end{math}$$
\begin{math}
  x+\frac12
\end{math}
$$\begin{displaymath}x+\frac12\end{displaymath}$$
\begin{displaymath}
  x+\frac12
\end{displaymath}
$$\begin{equation}x+\frac12\end{equation} $$
\​begin{equation}
  x+\frac12
\end{equation}
$$\begin{subequations}x+\frac12\end{subequations} $$
\​begin{subequations}
  x+\frac12
\end{subequations}
$$\begin{eqnarray}a & b \\ c & \frac{1}{d}\end{eqnarray} $$
 \​begin{eqnarray}...\end{eqnarray}
--

Avoid, use align instead

$$\begin{center}\text{first}\end{center}$$
 \begin{center}
   \text{first}
 \end{center}

These environments do not form a math environment by themselves but can be used as building blocks for more elaborate structures:

$$\begin{gathered}3(a-x) = 3.5x + a - 1 \\\\ 3a - 3x = 3.5x + a - 1 \\\\ a = \frac{13}{4}x - \frac{1}{2}\end{gathered} $$
  \​begin{gathered}...\end{gathered}
$$\begin{split}3(a-x) = 3.5x + a - 1 \\\\ 3a - 3x = 3.5x + a - 1 \\\\ a = \frac{13}{4}x - \frac{1}{2}\end{split} $$
  \​begin{split}...\end{split}
$$\begin{aligned}3(a-x) = 3.5x + a - 1 \\\\ 3a - 3x = 3.5x + a - 1 \\\\ a = \frac{13}{4}x - \frac{1}{2}\end{aligned} $$
  \​begin{aligned}...\end{aligned}

TeX Registers

The math typesetting is influenced by some “constants” that are stored in “registers”. Those registers can be set globally on a mathfield using the registers option.

Register Purpose
arrayrulewidth Width of separator lines in array environments
arraycolsep Amount of space between separator lines
arraystretch Stretch factor between rows in an environment
delimitershortfall
doublerulesep Amount of space between adjacent separator lines
jot Vertical space between the lines for all math expressions which allow multiple lines
fboxrule Default width of the border with commands such as \boxed or \fbox
fboxsep Default padding between a box and its content
medmuskip Amount of space around a binary operator. See also thinmuskip, thickmuskip.
nulldelimiterspace Horizontal space of an empty delimiter
thickmuskip Amount of space around a relational operator. See also medmuskip, thinmuskip.
thinmuskip Amount of space around math punctuation. See also medmuskip, thickmuskip.

TeX Primitives

The commands below are TeX primitives. Most are only useful when writing TeX packages or macros.

Command
% Anything after a % character and an end of line character is interpreted as a comment and ignored
\limits
\nolimits
\relax
\noexpand
\obeyspaces In Math Mode, spaces are normally ignored. Using this command spaces will be preserved even in Math Mode.
\bgroup
\egroup
Begin/End group, synonym for open/close brace
\string
\csname
\endcsname
Turn the next tokens, until \endcsname, into a command
\ensuremath{} If in Math Mode, does nothing. Otherwise, switch to Math Mode.