Skip to main content

Functions, Symbols, and Special Characters

Basic Syntax​

TypeLaTeX SourceRendered Example
Inline Math$...$......
Display Math\[...\]...\displaystyle ...
Superscripts and Subscripts\hat{x}{10}x^10\hat{x}{10}
Superscripts and Subscriptsa_{ij}aija_{ij}
Fractions/Radicals\frac{a}{b}ab\frac{a}{b}
Fractions/Radicals\sqrt[n]{x}xn\sqrt[n]{x}
Automatically Sized Delimiters\left((\left(\right.
Automatically Sized Delimiters\right))\left.\right)
Display-Style Inline Fraction\dfrac{a}{b}ab\dfrac{a}{b}
Upright Characters\mathrm{e}e\mathrm{e}

Equation Numbering​

In LaTeX, you can use the \tag command to assign custom equation numbers. The following examples demonstrate how to add custom equation numbers in LaTeX:

Unnumbered Equations​

Use $$ ... $$ or the [equation*] environment to create unnumbered equations.

% Unnumbered Equations

$$

\dot{V}(x) \leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}}

$$

Rendered output:

V˙(x)≤−k1V(x)mn−k2V(x)rs\dot{V}(x) \leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}}

Numbered Equations​

Use the \tag{} command to assign a custom equation number, for example \tag{1.1}


% Equation with Custom Numbering

$$

\dot{V}(x) \leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}} \tag{1.1}

$$

Rendered output:

V˙(x)≤−k1V(x)mn−k2V(x)rs(1.1)\dot{V}(x) \leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}} \tag{1.1}

Custom Numbering for Multiline Equations​

In the align environment, you can assign a custom equation number to each line individually.


% Custom Numbering for Multiline Equations

\begin{align}

\dot{V}(x) &\leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}} \tag{1.2} \\

&\leq -k_1 V(x)^{\frac{m}{n}} \quad \text{(neglecting the sublinear term)} \tag{1.3}

\end{align}

\end{document}

Rendered output:

V˙(x)≤−k1V(x)mn−k2V(x)rs≤−k1V(x)mn(neglecting the sublinear term)\begin{align} \dot{V}(x) &\leq -k_1 V(x)^{\frac{m}{n}} - k_2 V(x)^{\frac{r}{s}} \tag{1.2} \\ &\leq -k_1 V(x)^{\frac{m}{n}} \quad \text{(neglecting the sublinear term)} \tag{1.3} \end{align}

Notes:

  • The \tag{} command overrides the equation number generated automatically by LaTeX.
  • To reference custom equation numbers within equations, use \label{} together with \ref{}.

Accents / Diacritical Marks​

LaTeX SourceRendered Example
\dot{a}a˙\dot{a}
\ddot{a}a¨\ddot{a}
\acute{a}aˊ\acute{a}
\grave{a}aˋ\grave{a}
\check{a}aˇ\check{a}
\breve{a}a˘\breve{a}
\tilde{a}a~\tilde{a}
\bar{a}aˉ\bar{a}
\hat{a}a^\hat{a}
\widehat{a}a^\widehat{a}
\vec{a}a⃗\vec{a}

Standard Functions​

Exponential Functions​

LaTeX SourceRendered Example
\exp_a b = a^{b}exp⁡ab=ab\exp_a b = a^{b}
\exp b = e^{b}exp⁡b=eb\exp b = e^{b}
10^{m}10m10^{m}

Logarithms​

LaTeX SourceRendered Example
\ln cln⁡c\ln c
\lg d = \log elg⁡d=log⁡e\lg d = \log e
\log_{10} flog⁡10f\log_{10} f

Trigonometric Functions​

LaTeX SourceRendered Example
\sin asin⁡a\sin a
\cos bcos⁡b\cos b
\tan ctan⁡c\tan c
\cot dcot⁡d\cot d
\sec esec⁡e\sec e
\csc fcsc⁡f\csc f
\arcsin aarcsin⁡a\arcsin a
\arccos barccos⁡b\arccos b
\arctan carctan⁡c\arctan c
\arccot darccot⁡d\operatorname{arccot} d
\arcsec earcsec⁡e\operatorname{arcsec} e
\arccsc farccsc⁡f\operatorname{arccsc} f
\sinh asinh⁡a\sinh a
\cosh bcosh⁡b\cosh b
\tanh ctanh⁡c\tanh c
\coth dcoth⁡d\coth d
\operatorname{sh}ksh⁡k\operatorname{sh}k
\operatorname{ch}lch⁡l\operatorname{ch}l
\operatorname{th}mth⁡m\operatorname{th}m
\operatorname{coth}ncoth⁡n\operatorname{coth}n
\operatorname{argsh}oargsh⁡o\operatorname{argsh}o
\operatorname{argch}pargch⁡p\operatorname{argch}p
\operatorname{argth}qargth⁡q\operatorname{argth}q

Sign Function and Absolute Value​

LaTeX SourceRendered Example
\operatorname{sgn} rsgn⁡r\operatorname{sgn} r
\left\vert s \right\vert∣s∣\left\vert s \right\vert

Maximum and Minimum​

LaTeX SourceRendered Example
\min(x,y)min⁡(x,y)\min(x,y)
\max(x,y)max⁡(x,y)\max(x,y)

Bounds and Limits​

LaTeX SourceRendered Example
\min xmin⁡x\min x
\max ymax⁡y\max y
\inf sinf⁡s\inf s
\sup tsup⁡t\sup t
\lim ulim⁡u\lim u
\liminf vlim inf⁡v\liminf v
\limsup wlim sup⁡w\limsup w
\lim_{n \to \infty} \frac{1}{n(n+1)}lim⁡n→∞1n(n+1)\displaystyle\lim_{n \to \infty} \frac{1}{n(n+1)}
\dim pdim⁡p\dim p
\deg qdeg⁡q\deg q
\det mdet⁡m\det m
\ker\phiker⁡ϕ\ker\phi

Projections​

LaTeX SourceRendered Example
\Pr jPr⁡j\Pr j
\hom lhom⁡l\hom l
\lVert z \rVert∥z∥\lVert z \rVert
\arg zarg⁡z\arg z

Differentials and Derivatives​

LaTeX SourceRendered Example
dtdtdt
\mathrm{d}tdt\mathrm{d}t
\partial t∂t\partial t
\nabla\psi∇ψ\nabla\psi
dy/dxdy/dxdy/dx
\mathrm{d}y/\mathrm{d}xdy/dx\mathrm{d}y/\mathrm{d}x
\frac{dy}{dx}dydx\frac{dy}{dx}
\frac{\mathrm{d}y}{\mathrm{d}x}dydx\frac{\mathrm{d}y}{\mathrm{d}x}
\frac{\partial^2}{\partial x_1\partial x_2}y∂2∂x1∂x2y\frac{\partial^2}{\partial x_1\partial x_2}y
\prime′\prime
\backprime‵\backprime
f^\primef′f^\prime
f'f′f'
f''f′′f''
f^{(3)}f(3)f^{(3)}
\dot yy˙\dot y
\ddot yy¨\ddot y

Letterlike Symbols and Constants​

LaTeX SourceRendered Example
\infty∞\infty
\alephℵ\aleph
\complement∁\complement
\backepsilon∍\backepsilon
\ethð\eth
\FinvℲ\Finv
\hbarℏ\hbar
\Imℑ\Im
\imathı\imath
\jmathȷ\jmath
\Bbbkk\Bbbk
\ellℓ\ell
\mho℧\mho
\wp℘\wp
\Reℜ\Re
\circledSⓈ\circledS

Modular Arithmetic​

LaTeX SourceRendered Example
s_k \equiv 0 \pmod{m}sk≡0(modm)s_k \equiv 0 \pmod{m}
a \bmod ba mod ba \bmod b
\gcd(m, n), \operatorname{lcm}(m, n)gcd⁡(m,n),lcm⁡(m,n)\gcd(m, n), \operatorname{lcm}(m, n)
\mid, \nmid, \shortmid, \nshortmid∣,∤,∣,∤\mid, \nmid, \shortmid, \nshortmid

Radicals​

LaTeX SourceRendered Example
\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}√,2,n,x3+y323\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}

Operators​

LaTeX SourceRendered Example
+, -, \pm, \mp, \dotplus+,−,±,∓,∔+, -, \pm, \mp, \dotplus
\times, \div, \divideontimes, /, \backslash×,÷,⋇,/,\\times, \div, \divideontimes, /, \backslash
\cdot, * \ast, \star, \circ, \bullet⋅,∗∗,⋆,∘,∙\cdot, * \ast, \star, \circ, \bullet
\boxplus, \boxminus, \boxtimes, \boxdot⊞,⊟,⊠,⊡\boxplus, \boxminus, \boxtimes, \boxdot
\oplus, \ominus, \otimes, \oslash, \odot⊕,⊖,⊗,⊘,⊙\oplus, \ominus, \otimes, \oslash, \odot
\circleddash, \circledcirc, \circledast⊝,⊚,⊛\circleddash, \circledcirc, \circledast
\bigoplus, \bigotimes, \bigodot⨁,⨂,⨀\bigoplus, \bigotimes, \bigodot

Sets​

LaTeX SourceRendered Example
\{ \}, \O \empty \emptyset, \varnothing{},Ø∅∅,∅\{ \}, \text{\O} \empty \emptyset, \varnothing
\in, \notin \not\in, \ni, \not\ni∈,∉∉,∋,∌\in, \notin \not\in, \ni, \not\ni
\cap, \Cap, \sqcap, \bigcap∩,⋒,⊓,⋂\cap, \Cap, \sqcap, \bigcap
\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus∪,⋓,⊔,⋃,⨆,⊎,⨄\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus
\setminus, \smallsetminus, \times∖,∖,×\setminus, \smallsetminus, \times
\subset, \Subset, \sqsubset⊂,⋐,⊏\subset, \Subset, \sqsubset
\supset, \Supset, \sqsupset⊃,⋑,⊐\supset, \Supset, \sqsupset
\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq⊆,⊈,⊊,⊊,⊑\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq
\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq⊇,⊉,⊋,⊋,⊒\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq
\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq⫅,⊈,⫋,⫋\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq
\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq⫆,⊉,⫌,⫌\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq

Relation Symbols​

LaTeX SourceRendered Example
=, \ne, \neq, \equiv, \not\equiv=,≠,≠,≡,≢=, \ne, \neq, \equiv, \not\equiv
\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, :=≐,≑,=def,:=\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, :=
\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong∼,≁,∽,∼,≃,⋍,≂,≅,≆\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong
\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto≈,≈,≊,≍,∝,∝\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto
<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot<,≮,≪,≪̸,⋘,⋘̸,⋖<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot
>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot>,≯,≫,≫̸,⋙,⋙̸,⋗>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot
\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq≤,≤,⪇,≦,≰,≰,≨,≨\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq
\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq≥,≥,⪈,≧,≱,≱,≩,≩\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq
\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless≶,⋚,⪋,≷,⋛,⪌\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless
\leqslant, \nleqslant, \eqslantless⩽,≰,⪕\leqslant, \nleqslant, \eqslantless
\geqslant, \ngeqslant, \eqslantgtr⩾,≱,⪖\geqslant, \ngeqslant, \eqslantgtr
\lesssim, \lnsim, \lessapprox, \lnapprox≲,⋦,⪅,⪉\lesssim, \lnsim, \lessapprox, \lnapprox
\gtrsim, \gnsim, \gtrapprox, \gnapprox≳,⋧,⪆,⪊\gtrsim, \gnsim, \gtrapprox, \gnapprox
\prec, \nprec, \preceq, \npreceq, \precneqq≺,⊀,⪯,⋠,⪵\prec, \nprec, \preceq, \npreceq, \precneqq
\succ, \nsucc, \succeq, \nsucceq, \succneqq≻,⊁,⪰,⋡,⪶\succ, \nsucc, \succeq, \nsucceq, \succneqq
\preccurlyeq, \curlyeqprec≼,⋞\preccurlyeq, \curlyeqprec
\succcurlyeq, \curlyeqsucc≽,⋟\succcurlyeq, \curlyeqsucc
\precsim, \precnsim, \precapprox, \precnapprox≾,⋨,⪷,⪹\precsim, \precnsim, \precapprox, \precnapprox
\succsim, \succnsim, \succapprox, \succnapprox≿,⋩,⪸,⪺\succsim, \succnsim, \succapprox, \succnapprox

Geometric Symbols​

LaTeX SourceRendered Example
\parallel, \nparallel, \shortparallel, \nshortparallel∥,∦,∥,∦\parallel, \nparallel, \shortparallel, \nshortparallel
\perp, \angle, \sphericalangle, \measuredangle, 45^\circ⊥,∠,∢,∡,45∘\perp, \angle, \sphericalangle, \measuredangle, 45^\circ
\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar□,■,⋄,◊◊,⧫,★\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar
\bigcirc, \triangle, \bigtriangleup, \bigtriangledown◯,△,△,▽\bigcirc, \triangle, \bigtriangleup, \bigtriangledown
\vartriangle, \triangledown△,▽\vartriangle, \triangledown
\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright▲,▼,◀,▶\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright

Logical Symbols​

LaTeX SourceRendered Example
\forall, \exists, \nexists∀,∃,∄\forall, \exists, \nexists
\therefore, \because, \And∴,∵,&\therefore, \because, \And
\lor \lor \vee, \curlyvee, \bigvee∨,∨,∨,⋎,⋁\lor, \lor, \vee, \curlyvee, \bigvee
\land \land \wedge, \curlywedge, \bigwedge∧,∧,∧,⋏,⋀\land, \land, \wedge, \curlywedge, \bigwedge
\bar{q}, \bar{abc}, \overline{q}, \overline{abc},qˉ,abcˉ,q‾,abc‾,\bar{q}, \bar{abc}, \overline{q}, \overline{abc},
\lnot \neg, \not\operatorname{R}, \bot, \top¬,¬,̸R⁡,⊥,⊤\lnot, \neg, \not\operatorname{R}, \bot, \top
\vdash \dashv, \vDash, \models⊢,⊣,⊨,⊨\vdash, \dashv, \vDash, \models
\Vdash \nvDash \nVdash \nvdash \nVDash⊩,⊭,⊮,⊬,⊯\Vdash, \nvDash, \nVdash, \nvdash, \nVDash
\ulcorner \urcorner \llcorner \lrcorner⌜⌝⌞⌟\ulcorner \urcorner \llcorner \lrcorner

Arrows​

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

Special Symbols​

Ellipses: Two types of ellipses are commonly used in mathematical formulas. \ldots produces dots aligned with the text baseline, while \cdots produces dots aligned with the mathematical axis.

LaTeX SourceRendered Example
\amalg \% \dagger \ddagger \ldots \cdots⨿,%,†,‡,…,⋯\amalg, \%, \dagger, \ddagger, \ldots, \cdots
\smile \frown \wr \triangleleft \triangleright⌣,⌢,≀,◃,▹\smile, \frown, \wr, \triangleleft, \triangleright
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp♢,♡,♣,♠,⅁,♭,♮,♯\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp

Miscellaneous​

LaTeX SourceRendered Example
\diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes╱,╲,⋅,⋉,⋊,⋋,⋌\diagup, \diagdown, \centerdot, \ltimes, \rtimes, \leftthreetimes, \rightthreetimes
\eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq≖,≗,≜,≏,≎,≑,≓,≒\eqcirc, \circeq, \triangleq, \bumpeq, \Bumpeq, \doteqdot, \risingdotseq, \fallingdotseq
\intercal \barwedge \veebar \doublebarwedge \between \pitchfork⊺,⊼,⊻,⩞,≬,⋔\intercal, \barwedge, \veebar, \doublebarwedge, \between, \pitchfork
\vartriangleleft \ntriangleleft \vartriangleright \ntriangleright⊲,⋪,⊳,⋫\vartriangleleft, \ntriangleleft, \vartriangleright, \ntriangleright
\trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq⊴,⋬,⊵,⋭\trianglelefteq, \ntrianglelefteq, \trianglerighteq, \ntrianglerighteq

Superscripts, Subscripts, Integrals, and More​

Function|Syntax|Output ^ denotes a superscript, and _ denotes a subscript. If a superscript or subscript contains more than one character, enclose the characters in {} to group them. Superscripts and subscripts can be nested or used together.

FunctionLaTeX SourceRendered Example
Superscripta^2a2a^2
Subscripta_2a2a_2
Groupinga^{2+2}a2+2a^{2+2}
Groupinga_{i,j}ai,ja_{i,j}
Combined Superscripts and Subscriptsx_2^3x23x_2^3
Prescripts{}_1^2\!X_3^412 ⁣X34{}_1^2\!X_3^4
Derivative (HTML)x'x′x'
Derivative (PNG)x^\primex′x^\prime
Derivative (Incorrect)x\primex′x\prime
Dot Notation for Derivatives\dot{x}x˙\dot{x}
Dot Notation for Derivatives\ddot{y}y¨\ddot{y}
Vector\vec{c}(single letter only)c⃗\vec{c}
Vector\overleftarrow{a b}ab←\overleftarrow{a b}
Vector\overrightarrow{c d}cd→\overrightarrow{c d}
Vector\overleftrightarrow{a b}ab↔\overleftrightarrow{a b}
Vector\widehat{e f g}efg^\widehat{e f g}
Overarc\overset{\frown}{AB}AB⌢\overset{\frown}{AB}
Overline\overline{h i j}hij‾\overline{h i j}
Underline\underline{k l m}klm‾\underline{k l m}
Summation\sum_{k=1}^N k^2∑k=1Nk2\displaystyle\sum_{k=1}^N k^2
Summation\begin{matrix} \sum_{k=1}^N k^2 \end{matrix}∑k=1Nk2\begin{matrix} \displaystyle\sum_{k=1}^N k^2 \end{matrix}
Product\prod_{i=1}^N x_i∏i=1Nxi\prod_{i=1}^N x_i
Product\begin{matrix} \prod_{i=1}^N x_i \end{matrix}∏i=1Nxi\begin{matrix} \displaystyle\prod_{i=1}^N x_i \end{matrix}
Coproduct\coprod_{i=1}^N x_i∐i=1Nxi\coprod_{i=1}^N x_i
Coproduct\begin{matrix} \coprod_{i=1}^N x_i\end{matrix}∐i=1Nxi\begin{matrix} \displaystyle\coprod_{i=1}^N x_i\end{matrix}
Limit\lim_{n \to \infty}x_nlim⁡n→∞xn\displaystyle\lim_{n \to \infty}x_n
Limit\begin{matrix} \lim_{n \to \infty}x_n \end{matrix}lim⁡n→∞xn\begin{matrix} \displaystyle\lim_{n \to \infty}x_n \end{matrix}
Integral\int_{-N}^{N} e^x\, \mathrm{d}x∫−NNex dx\displaystyle\int_{-N}^{N} e^x\, \mathrm{d}x
Integral\begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix}∫−NNex dx\begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix}
Double Integral\iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y∬DW dx dy\iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y
Triple Integral\iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z∭EV dx dy dz\iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z
Closed Contour and Surface Integrals\oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y∮Cx3 dx+4y2 dy\oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y
Intersection\bigcap_{i=1}^{n} p⋂i=1np\displaystyle\bigcap_{i=1}^{n} p
Union\bigcup_{i=1}^{k} p⋃i=1kp\displaystyle\bigcup_{i=1}^{k} p

Fractions​

Use the \frac{numerator}{denominator} command to create a fraction. Fractions can be nested. For a simple fraction, enter \frac ab to quickly produce ab\frac ab. For a complex fractional expression, you can also use numerator \over denominator to create a single-level fraction.

FunctionLaTeX SourceRendered Example
Fraction\frac{2}{4}=0.524=0.5\frac{2}{4}=0.5
Small Fraction\tfrac{2}{4} = 0.524=0.5\tfrac{2}{4} = 0.5
Continued Fraction (Large Nested Fraction)\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a2c+2d+24=a\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a
Large Non-Nested Fraction\dfrac{2}{4} = 0.5 \quad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a24=0.52c+2d+24=a\dfrac{2}{4} = 0.5 \quad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a
Binomial Coefficient\dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}(nr)=(nn−r)=Cnr=Cnn−r\dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
Small Binomial Coefficient\tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}(nr)=(nn−r)=Cnr=Cnn−r\tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
Large Binomial Coefficient\binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}(nr)=(nn−r)=Cnr=Cnn−r\binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}

Avoid using \frac in base-e exponential functions, limits, and integrals: it can make the expression look awkward and may introduce ambiguity. For this reason, it is rarely used in these contexts in professional mathematical typesetting. Write these fractions horizontally, using a slash / instead of a fraction bar.

\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\
\int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\
\end{array}

Rendered output:

BadBettereiπ2eiπ2eiπ/2∫−π2π2sin⁡x dx∫−π/2π/2sin⁡x dx\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ e^{i\frac{\pi}{2}} \quad e^{\frac{i\pi}{2}} & e^{i\pi/2} \\ \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\ \end{array}

Note: In exponents and integrals, professional typesetting recommends using a slash / instead of \frac for a more concise and visually balanced formula.

Matrices, Piecewise Expressions, and Systems of Equations

Syntax:

\begin{type}
formula content
\end{type}

The type can be a matrix environment (matrix pmatrix bmatrix Bmatrix vmatrix Vmatrix), a piecewise expression (cases), multiline aligned equations (aligned), or an array (array).

Within the formula, insert & in each row to specify alignment points, and use \\ at the end of each row to start a new line.

Matrices without Delimiters​

\begin{matrix}
x & y \\
z & v
\end{matrix}

Rendered output:

xyzv\begin{matrix} x & y \\ z & v \end{matrix}

Matrices with Delimiters​

\begin{vmatrix}
x & y \\
z & v
\end{vmatrix}

Rendered output:

∣xyzv∣\begin{vmatrix} x & y \\ z & v \end{vmatrix}
\begin{Vmatrix}
x & y \\
z & v
\end{Vmatrix}

Rendered output:

∥xyzv∥\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}

Use \cdots, \ddots, and \vdots to insert ellipses.

\begin{bmatrix}
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\end{bmatrix}

Rendered output:

[0⋯0⋮⋱⋮0⋯0]\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix}
\begin{Bmatrix}
x & y \\
z & v
\end{Bmatrix}

Rendered output:

{xyzv}\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}
\begin{pmatrix}
x & y \\
z & v
\end{pmatrix}

Rendered output:

(xyzv)\begin{pmatrix} x & y \\ z & v \end{pmatrix}

Piecewise Expressions​

f(n) =
\begin{cases}
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
\end{cases}

Rendered output:

f(n)={n/2,if n is even3n+1,if n is oddf(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases}

Multiline Equations and Congruences​

To arrange a sequence of equations in a neatly aligned, centered column, use \begin{aligned}...\end{aligned}.

\begin{aligned}
f(x) &= (m+n)^2 \\
&= m^2+2mn+n^2
\end{aligned}

Rendered output:

f(x)=(m+n)2=m2+2mn+n2\begin{aligned} f(x) &= (m+n)^2 \\ &= m^2+2mn+n^2 \end{aligned}
\begin{aligned}
3^{6n+3}+4^{6n+3}
&\equiv (3^3)^{2n+1}+(4^3)^{2n+1}\\
&\equiv 27^{2n+1}+64^{2n+1}\\
&\equiv 27^{2n+1}+(-27)^{2n+1}\\
&\equiv 27^{2n+1}-27^{2n+1}\\
&\equiv 0 \pmod{91}\\
\end{aligned}

Rendered output:

36n+3+46n+3≡(33)2n+1+(43)2n+1≡272n+1+642n+1≡272n+1+(−27)2n+1≡272n+1−272n+1≡0(mod91)\begin{aligned} 3^{6n+3}+4^{6n+3} &\equiv (3^3)^{2n+1}+(4^3)^{2n+1}\\ &\equiv 27^{2n+1}+64^{2n+1}\\ &\equiv 27^{2n+1}+(-27)^{2n+1}\\ &\equiv 27^{2n+1}-27^{2n+1}\\ &\equiv 0 \pmod{91}\\ \end{aligned}
\begin{alignedat}{3}
f(x) &= (m-n)^2 \\
f(x) &= (-m+n)^2 \\
&= m^2-2mn+n^2
\end{alignedat}

Rendered output:

f(x)=(m−n)2f(x)=(−m+n)2=m2−2mn+n2\begin{alignedat}{3} f(x) &= (m-n)^2 \\ f(x) &= (-m+n)^2 \\ &= m^2-2mn+n^2 \end{alignedat}

Systems of Equations​

\begin{cases}
\begin{split}
p &= P(y=1|\mathbf{x})=
\frac{1}{1+e^{-\theta^T\mathbf{X}}}\\
1-p &= P(y=0|\mathbf{x})=1-P(y=1|\mathbf{x})=
\frac{1}{1+e^{\theta^T\mathbf{X}}}
\end{split}
\end{cases}

Rendered output:

{p=P(y=1∣x)=11+e−θTX1−p=P(y=0∣x)=1−P(y=1∣x)=11+eθTX\begin{cases} \begin{split} p &= P(y=1|\mathbf{x})= \frac{1}{1+e^{-\theta^T\mathbf{X}}}\\ 1-p &= P(y=0|\mathbf{x})=1-P(y=1|\mathbf{x})= \frac{1}{1+e^{\theta^T\mathbf{X}}} \end{split} \end{cases}

Note that LaTeX environments can be nested. The example above uses \begin{cases} \end{cases} to enclose \begin{split} \end{split}. You can also combine formulas with text, for example:

\text{Decision Boundary}=
\begin{cases}
1\quad \text{if }\ \hat{y}>0.5\\
0\quad \text{otherwise}
\end{cases}

Rendered output:

Decision Boundary={1if  y^>0.50otherwise\text{Decision Boundary}= \begin{cases} 1\quad \text{if }\ \hat{y}>0.5\\ 0\quad \text{otherwise} \end{cases}

Example

\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}

Rendered output:

{3x+5y+z7x−2y+4z−6x+3y+2z\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}

or

\left\{\begin{aligned}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{aligned}\right.

Rendered output:

{3x+5y+z7x−2y+4z−6x+3y+2z\left\{\begin{aligned} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{aligned}\right.

Arrays and Tables

A formatted table is generally easier to read than plain or typeset text alone. Arrays and tables begin with \begin{array}, followed by a specification of the number of columns and their text alignment. The specifiers c, l, and r indicate centered, left-aligned, and right-aligned columns, respectively. To insert a vertical rule, add | to the column specification; to insert a horizontal rule, add \hline before the next row. As with matrices, separate entries within each row using &, end each row with \\, and close the array with \end{array}.

\begin{array}{c|lcr}
n & \text{Left-aligned} & \text{Centered} & \text{Right-aligned} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}

Rendered output:

nLeft-alignedCenteredRight-aligned10.2411252−1189−83−2020001+10i\begin{array}{c|lcr} n & \text{Left-aligned} & \text{Centered} & \text{Right-aligned} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array}
\begin{array}{lcl}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}

Rendered output:

z=af(x,y,z)=x+y+z\begin{array}{lcl} z & = & a \\ f(x,y,z) & = & x + y + z \end{array}
\begin{array}{lcr}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}

Rendered output:

z=af(x,y,z)=x+y+z\begin{array}{lcr} z & = & a \\ f(x,y,z) & = & x + y + z \end{array}
\begin{array}{ccc}
a & b & S \\
\hline
0&0&1\\
0&1&1\\
1&0&1\\
1&1&0
\end{array}

Rendered output:

abS001011101110\begin{array}{ccc} a & b & S \\ \hline 0&0&1\\ 0&1&1\\ 1&0&1\\ 1&1&0 \end{array}

Nested Arrays or Tables​

Multiple arrays or tables can be nested to form a group of arrays or tables. Declare the $$ delimiters before using nested arrays or tables.

% outer vertical array of arrays (outer vertical table)
\begin{array}{c}
% inner horizontal array of arrays (inner horizontal table)
\begin{array}{cc}
% inner array of minimum values (inner array of minimum values)
\begin{array}{c|cccc}
\text{min} & 0 & 1 & 2 & 3\\
\hline
0 & 0 & 0 & 0 & 0\\
1 & 0 & 1 & 1 & 1\\
2 & 0 & 1 & 2 & 2\\
3 & 0 & 1 & 2 & 3
\end{array}
&
% inner array of maximum values (inner array of maximum values)
\begin{array}{c|cccc}
\text{max}&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 1 & 2 & 3\\
2 & 2 & 2 & 2 & 3\\
3 & 3 & 3 & 3 & 3
\end{array}
\end{array}
\\ % End of the first inner row of tables
% inner array of delta values (second inner row: delta values)
\begin{array}{c|cccc}
\Delta&0&1&2&3\\
\hline
0 & 0 & 1 & 2 & 3\\
1 & 1 & 0 & 1 & 2\\
2 & 2 & 1 & 0 & 1\\
3 & 3 & 2 & 1 & 0
\end{array}
\end{array}

Rendered output:

min012300000101112012230123max012300123111232222333333Δ012300123110122210133210\begin{array}{c} \begin{array}{cc} \begin{array}{c|cccc} \text{min} & 0 & 1 & 2 & 3\\ \hline 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 1 & 1 & 1\\ 2 & 0 & 1 & 2 & 2\\ 3 & 0 & 1 & 2 & 3 \end{array} & \begin{array}{c|cccc} \text{max}&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 1 & 2 & 3\\ 2 & 2 & 2 & 2 & 3\\ 3 & 3 & 3 & 3 & 3 \end{array} \end{array} \\ \begin{array}{c|cccc} \Delta&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 0 & 1 & 2\\ 2 & 2 & 1 & 0 & 1\\ 3 & 3 & 2 & 1 & 0 \end{array} \end{array}

Matrices with Separators Using Arrays​

& separates entries, and \\ starts a new line

\left[
\begin{array}{cc|c}
1&2&3\\
4&5&6
\end{array}
\right]

Rendered output:

[123456]\left[ \begin{array}{cc|c} 1&2&3\\ 4&5&6 \end{array} \right]

Fonts

To change the font of selected characters in a formula, use {\font {characters to format}}, replacing \font with an appropriate font command from the table below. Mathematical formulas generally use italic type by default.

Greek Letters​

CategorySourceRendered Output
Uppercase Greek Letters 1\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \ThetaABΓΔEZHΘ\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta
Uppercase Greek Letters 2\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \PiIKΛMNΞOΠ\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi
Uppercase Greek Letters 3\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \OmegaPΣTΥΦXΨΩ\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega
Lowercase Greek Letters 1\alpha \beta \gamma \delta \epsilon \zeta \eta \thetaαβγδϵζηθ\alpha \beta \gamma \delta \epsilon \zeta \eta \theta
Lowercase Greek Letters 2\iota \kappa \lambda \mu \nu \omicron \xi \piικλμνοξπ\iota \kappa \lambda \mu \nu \omicron \xi \pi
Lowercase Greek Letters 3\rho \sigma \tau \upsilon \phi \chi \psi \omegaρστυϕχψω\rho \sigma \tau \upsilon \phi \chi \psi \omega
Variant Greek Letters 1\varepsilon \digamma \varkappa \varpiεϝϰϖ\varepsilon \digamma \varkappa \varpi
Variant Greek Letters 2\varrho \varsigma \vartheta \varphiϱςϑφ\varrho \varsigma \vartheta \varphi

Hebrew Symbols​

SourceRendered Output
\aleph \beth \gimel \dalethℵℶℷℸ\aleph \beth \gimel \daleth

Font Command Shorthands​

InputDescriptionOutputInputDescriptionOutput
\rmRomanSample\mathrm{Sample}\calCalligraphicSAMPLE\mathcal{SAMPLE}
\itItalicSample\mathit{Sample}\BbbBlackboard BoldSAMPLE\mathbb{SAMPLE}
\bfBoldSample\mathbf{Sample}\mathitMath ItalicSAMPLE\mathit{SAMPLE}
\sfSans SerifSample\mathsf{Sample}\scrScriptSAMPLE\mathscr{SAMPLE}
\ttTypewriterSample\mathtt{Sample}\frakFrakturSample\mathfrak{Sample}

All Fonts​

Blackboard Bold \mathbb{}​

SourceRendered Output
\mathbb{ABCDEFGHI}ABCDEFGHI\mathbb{ABCDEFGHI}
\mathbb{JKLMNOPQR}JKLMNOPQR\mathbb{JKLMNOPQR}
\mathbb{STUVWXYZ}STUVWXYZ\mathbb{STUVWXYZ}

Bold \mathbf{}​

SourceRendered Output
\mathbf{ABCDEFGHI}ABCDEFGHI\mathbf{ABCDEFGHI}
\mathbf{JKLMNOPQR}JKLMNOPQR\mathbf{JKLMNOPQR}
\mathbf{STUVWXYZ}STUVWXYZ\mathbf{STUVWXYZ}
\mathbf{abcdefghijklm}abcdefghijklm\mathbf{abcdefghijklm}
\mathbf{nopqrstuvwxyz}nopqrstuvwxyz\mathbf{nopqrstuvwxyz}
\mathbf{0123456789}0123456789\mathbf{0123456789}

Bold Greek Letters \boldsymbol{}​

SourceRendered Output
\boldsymbol{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}ABΓΔEZHΘ\boldsymbol{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}
\boldsymbol{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}IKΛMNΞΠP\boldsymbol{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}
\boldsymbol{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}ΣTΥΦXΨΩ\boldsymbol{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}
\boldsymbol{\alpha \beta \gamma \delta \epsilon \zeta \eta \theta}αβγδϵζηθ\boldsymbol{\alpha \beta \gamma \delta \epsilon \zeta \eta \theta}
\boldsymbol{\iota \kappa \lambda \mu \nu \omicron \xi \pi}ικλμνοξπ\boldsymbol{\iota \kappa \lambda \mu \nu \omicron \xi \pi}
\boldsymbol{\sigma \tau \upsilon \phi \chi \psi \omega}στυϕχψω\boldsymbol{\sigma \tau \upsilon \phi \chi \psi \omega}
\boldsymbol{\varepsilon \digamma \varkappa \varpi}εϝϰϖ\boldsymbol{\varepsilon \digamma \varkappa \varpi}
\boldsymbol{\varrho \varsigma \vartheta \varphi}ϱςϑφ\boldsymbol{\varrho \varsigma \vartheta \varphi}

Italic (Default for Latin Letters)\mathit{}​

SourceRendered Output
\mathit{0123456789}0123456789\mathit{0123456789}

Italic Greek Letters (Default for Lowercase Letters)\mathit{}​

SourceRendered Output
\mathit{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}ABΓΔEZHΘ\mathit{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}
\mathit{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}IKΛMNΞΠP\mathit{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}
\mathit{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}ΣTΥΦXΨΩ\mathit{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}

Roman \mathrm{}​

SourceRendered Output
\mathrm{ABCDEFGHI}ABCDEFGHI\mathrm{ABCDEFGHI}
\mathrm{JKLMNOPQR}JKLMNOPQR\mathrm{JKLMNOPQR}
\mathrm{STUVWXYZ}STUVWXYZ\mathrm{STUVWXYZ}
\mathrm{abcdefghijklm}abcdefghijklm\mathrm{abcdefghijklm}
\mathrm{nopqrstuvwxyz}nopqrstuvwxyz\mathrm{nopqrstuvwxyz}
\mathrm{0123456789}0123456789\mathrm{0123456789}

Sans Serif \mathsf{}​

SourceRendered Output
\mathsf{ABCDEFGHI}ABCDEFGHI\mathsf{ABCDEFGHI}
\mathsf{JKLMNOPQR}JKLMNOPQR\mathsf{JKLMNOPQR}
\mathsf{STUVWXYZ}STUVWXYZ\mathsf{STUVWXYZ}
\mathsf{abcdefghijklm}abcdefghijklm\mathsf{abcdefghijklm}
\mathsf{nopqrstuvwxyz}nopqrstuvwxyz\mathsf{nopqrstuvwxyz}
\mathsf{0123456789}0123456789\mathsf{0123456789}

Sans Serif Greek Letters (Uppercase Only)\mathsf{}​

SourceRendered Output
\mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}ABΓΔEZHΘ\mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}
\mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}IKΛMNΞΠP\mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}
\mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}ΣTΥΦXΨΩ\mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}

Script / Calligraphic \mathcal{}​

SourceRendered Output
\mathcal{ABCDEFGHI}ABCDEFGHI\mathcal{ABCDEFGHI}
\mathcal{JKLMNOPQR}JKLMNOPQR\mathcal{JKLMNOPQR}
\mathcal{STUVWXYZ}STUVWXYZ\mathcal{STUVWXYZ}

Fraktur \mathfrak{}​

SourceRendered Output
\mathfrak{ABCDEFGHI}ABCDEFGHI\mathfrak{ABCDEFGHI}
\mathfrak{JKLMNOPQR}JKLMNOPQR\mathfrak{JKLMNOPQR}
\mathfrak{STUVWXYZ}STUVWXYZ\mathfrak{STUVWXYZ}
\mathfrak{abcdefghijklm}abcdefghijklm\mathfrak{abcdefghijklm}
\mathfrak{nopqrstuvwxyz}nopqrstuvwxyz\mathfrak{nopqrstuvwxyz}
\mathfrak{0123456789}0123456789\mathfrak{0123456789}

Lowercase Script \mathscr{}​

SourceRendered Output
\mathscr{abcdefghijklm}abcdefghijklm\mathscr{abcdefghijklm}

Mixed Fonts​

FeatureSyntaxRendered Output
Italic Characters (Spaces Ignored)x y zxyzx y z
Upright Characters\text{x y z}x y z\text{x y z}
Mixed Italic and Upright Text (Poor)\text{if} n \text{is even}ifnis even\text{if} n \text{is even}
Mixed Italic and Upright Text (Good)\text{if } n\text{ is even}if n is even\text{if } n\text{ is even}
Mixed Italic and Upright Text (Alternative: \ Forces a Space)\text{if}\ n \text{is even}if nis even\text{if}\ n \text{is even}

Explanatory Text​

Use \text{text} to add explanatory text (the text is not interpreted as a mathematical formula and is not italicized). You can still insert formulas inside \text{text} using $formula$.

  • Example:
f(n)= \begin{cases}
n/2, & \text{if } n \text{ is even} \\
3n+1, & \text{if }n \text{ is odd}
\end{cases}

Rendered output:

f(n)={n/2,if n is even3n+1,if n is oddf(n)= \begin{cases} n/2, & \text{if } n \text{ is even} \\ 3n+1, & \text{if }n \text{ is odd} \end{cases}

Delimiters​

(), [], and | represent the symbols themselves. Use \{ \} to display {}.

FunctionSyntaxOutput
Short Delimiters\frac{1}{2}12\frac{1}{2}
Tall Delimiters\left(\frac{1}{2} \right)(12)\left(\frac{1}{2} \right)
Round Brackets (Parentheses)\left( \frac{a}{b} \right)(ab)\left( \frac{a}{b} \right)
Square Brackets\left[ \frac{a}{b} \right][ab]\left[ \frac{a}{b} \right]
Curly Braces\left\{ \frac{a}{b} \right\}{ab}\left\{ \frac{a}{b} \right\}
Angle Brackets\left \langle \frac{a}{b} \right \rangle⟨ab⟩\left \langle \frac{a}{b} \right \rangle
Single Vertical Bars (Absolute Value)\left\vert \frac{a}{b} \right\vert∣ab∣\left\vert \frac{a}{b} \right\vert
Double Vertical Bars (Norm)\left\Vert \frac{a}{b} \right\Vert∥ab∥\left\Vert \frac{a}{b} \right\Vert
Floor Function\left \lfloor \frac{a}{b} \right \rfloor⌊ab⌋\left \lfloor \frac{a}{b} \right \rfloor
Ceiling Function\left \lceil \frac{c}{d} \right \rceil⌈cd⌉\left \lceil \frac{c}{d} \right \rceil
Slash and Backslash\left / \frac{a}{b} \right \backslash/ab\\left / \frac{a}{b} \right \backslash
Up and Down Arrows\left \uparrow \frac{a}{b} \right \downarrow↑ab↓\left \uparrow \frac{a}{b} \right \downarrow
Double-Line Up and Down Arrows (Automatically Sized Delimiters)\left \Uparrow \frac{a}{b} \right \Downarrow⇑ab⇓\left \Uparrow \frac{a}{b} \right \Downarrow
Single-Line and Double-Line Bidirectional Vertical Arrows\left \updownarrow \frac{a}{b} \right \Updownarrow↕ab⇕\left \updownarrow \frac{a}{b} \right \Updownarrow
Mixed Delimiters\left[ 0,1 \right)[0,1)\left[ 0,1 \right)
Mixed Delimiters\left \langle \psi \right |⟨ψ∣\left \langle \psi \right \vert
Overbrace\overbrace{1+2+\cdots+100}1+2+⋯+100⏞\overbrace{1+2+\cdots+100}
Overbrace\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}50501+2+⋯+100⏞\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}
Underbrace\underbrace{a+b+\cdots+z}a+b+⋯+z⏟\underbrace{a+b+\cdots+z}
Underbrace\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}a+b+⋯+z⏟26\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}

Use \left and \right to create automatically sized (parentheses), [square brackets], and {braces}. If only one delimiter is needed, use \left. or \right. for the other side.

FunctionSyntaxOutput
Left Delimiter Only\left\{\frac{a}{b} \right.{ab\left\{\frac{a}{b} \right.
Right Delimiter Only\left. \frac{a}{b} \right\}ab}\left. \frac{a}{b} \right\}

Note: Use \big, \Big, \bigg, \Bigg to control delimiter sizes, as in the following code \Bigg ( \bigg [ \Big \langle \big \| \frac{a}{b} \big \| \Big \rangle \bigg ] \Bigg )

Rendered output: ([⟨∥ab∥⟩])\Bigg ( \bigg [ \Big \langle \big \| \frac{a}{b} \big \| \Big \rangle \bigg ] \Bigg )

Spacing​

KaTeX handles most spacing automatically, but sometimes manual control is needed.

FunctionSyntaxOutputDescription
Two Quad SpacesA\qquad BABA\qquad BTwo M-widths
Quad SpaceA\quad BABA\quad BOne M-width
Large SpaceA\ BA BA\ B1/3 M-width
Medium SpaceA\;BA  BA\;B2/7 M-width
Small SpaceA\,BA BA\,B1/6 M-width
Negative Thin Space\alpha\!\betaα ⁣β\alpha\!\betaMinus 1/6 M-width
No Space\alpha\betaαβ\alpha\beta0

Text Colors in LaTeX

Use \color{color}{text} to change the color of specific text. Text coloring requires browser support; if the browser does not support the specified color, the text is rendered in black.

Colors Supported by Older Browsers​

InputOutputInputOutput
blacktext\color{black}{text}greytext\color{grey}{text}
silvertext\color{silver}{text}whitetext\color{white}{text}
maroontext\color{maroon}{text}redtext\color{red}{text}
yellowtext\color{yellow}{text}limetext\color{lime}{text}
olivetext\color{olive}{text}greentext\color{green}{text}
tealtext\color{teal}{text}aquatext\color{aqua}{text}
bluetext\color{blue}{text}navytext\color{navy}{text}
purpletext\color{purple}{text}fuchsiatext\color{fuchsia}{text}

Custom RGB Colors​

In newer browsers, you can customize text colors using hexadecimal color values.

Syntax:

\color{#rgb}{text}

Here, r, g, and b each take a value from 0-9 or a-f.

Example:

\begin{array}{|rrrrrrrr|}\hline
\verb+#000+ & \color{#000}{text} & & &
\verb+#00F+ & \color{#00F}{text} & & \\
& & \verb+#0F0+ & \color{#0F0}{text} &
& & \verb+#0FF+ & \color{#0FF}{text}\\
\verb+#F00+ & \color{#F00}{text} & & &
\verb+#F0F+ & \color{#F0F}{text} & & \\
& & \verb+#FF0+ & \color{#FF0}{text} &
& & \verb+#FFF+ & \color{#FFF}{text}\\
\hline
\end{array}

Rendered output:

#000text#00Ftext#0F0text#0FFtext#F00text#F0Ftext#FF0text#FFFtext\begin{array}{|rrrrrrrr|}\hline \verb+#000+ & \color{#000}{text} & & & \verb+#00F+ & \color{#00F}{text} & & \\ & & \verb+#0F0+ & \color{#0F0}{text} & & & \verb+#0FF+ & \color{#0FF}{text}\\ \verb+#F00+ & \color{#F00}{text} & & & \verb+#F0F+ & \color{#F0F}{text} & & \\ & & \verb+#FF0+ & \color{#FF0}{text} & & & \verb+#FFF+ & \color{#FFF}{text}\\ \hline \end{array}

Example:

\begin{array}{|rrrrrrrr|}
\hline
\verb+#000+ & \color{#000}{text} & \verb+#005+ & \color{#005}{text} & \verb+#00A+ & \color{#00A}{text} & \verb+#00F+ & \color{#00F}{text} \\
\verb+#500+ & \color{#500}{text} & \verb+#505+ & \color{#505}{text} & \verb+#50A+ & \color{#50A}{text} & \verb+#50F+ & \color{#50F}{text} \\
\verb+#A00+ & \color{#A00}{text} & \verb+#A05+ & \color{#A05}{text} & \verb+#A0A+ & \color{#A0A}{text} & \verb+#A0F+ & \color{#A0F}{text} \\
\verb+#F00+ & \color{#F00}{text} & \verb+#F05+ & \color{#F05}{text} & \verb+#F0A+ & \color{#F0A}{text} & \verb+#F0F+ & \color{#F0F}{text} \\
\hline
\verb+#080+ & \color{#080}{text} & \verb+#085+ & \color{#085}{text} & \verb+#08A+ & \color{#08A}{text} & \verb+#08F+ & \color{#08F}{text} \\
\verb+#580+ & \color{#580}{text} & \verb+#585+ & \color{#585}{text} & \verb+#58A+ & \color{#58A}{text} & \verb+#58F+ & \color{#58F}{text} \\
\verb+#A80+ & \color{#A80}{text} & \verb+#A85+ & \color{#A85}{text} & \verb+#A8A+ & \color{#A8A}{text} & \verb+#A8F+ & \color{#A8F}{text} \\
\verb+#F80+ & \color{#F80}{text} & \verb+#F85+ & \color{#F85}{text} & \verb+#F8A+ & \color{#F8A}{text} & \verb+#F8F+ & \color{#F8F}{text} \\
\hline
\verb+#0F0+ & \color{#0F0}{text} & \verb+#0F5+ & \color{#0F5}{text} & \verb+#0FA+ & \color{#0FA}{text} & \verb+#0FF+ & \color{#0FF}{text} \\
\verb+#5F0+ & \color{#5F0}{text} & \verb+#5F5+ & \color{#5F5}{text} & \verb+#5FA+ & \color{#5FA}{text} & \verb+#5FF+ & \color{#5FF}{text} \\
\verb+#AF0+ & \color{#AF0}{text} & \verb+#AF5+ & \color{#AF5}{text} & \verb+#AFA+ & \color{#AFA}{text} & \verb+#AFF+ & \color{#AFF}{text} \\
\verb+#FF0+ & \color{#FF0}{text} & \verb+#FF5+ & \color{#FF5}{text} & \verb+#FFA+ & \color{#FFA}{text} & \verb+#FFF+ & \color{#FFF}{text} \\
\hline
\end{array}

Rendered output:

#000text#005text#00Atext#00Ftext#500text#505text#50Atext#50Ftext#A00text#A05text#A0Atext#A0Ftext#F00text#F05text#F0Atext#F0Ftext#080text#085text#08Atext#08Ftext#580text#585text#58Atext#58Ftext#A80text#A85text#A8Atext#A8Ftext#F80text#F85text#F8Atext#F8Ftext#0F0text#0F5text#0FAtext#0FFtext#5F0text#5F5text#5FAtext#5FFtext#AF0text#AF5text#AFAtext#AFFtext#FF0text#FF5text#FFAtext#FFFtext\begin{array}{|rrrrrrrr|}\hline \verb+#000+ & \color{#000}{text} & \verb+#005+ & \color{#005}{text} & \verb+#00A+ & \color{#00A}{text} & \verb+#00F+ & \color{#00F}{text} \\ \verb+#500+ & \color{#500}{text} & \verb+#505+ & \color{#505}{text} & \verb+#50A+ & \color{#50A}{text} & \verb+#50F+ & \color{#50F}{text} \\ \verb+#A00+ & \color{#A00}{text} & \verb+#A05+ & \color{#A05}{text} & \verb+#A0A+ & \color{#A0A}{text} & \verb+#A0F+ & \color{#A0F}{text} \\ \verb+#F00+ & \color{#F00}{text} & \verb+#F05+ & \color{#F05}{text} & \verb+#F0A+ & \color{#F0A}{text} & \verb+#F0F+ & \color{#F0F}{text} \\ \hline \verb+#080+ & \color{#080}{text} & \verb+#085+ & \color{#085}{text} & \verb+#08A+ & \color{#08A}{text} & \verb+#08F+ & \color{#08F}{text} \\ \verb+#580+ & \color{#580}{text} & \verb+#585+ & \color{#585}{text} & \verb+#58A+ & \color{#58A}{text} & \verb+#58F+ & \color{#58F}{text} \\ \verb+#A80+ & \color{#A80}{text} & \verb+#A85+ & \color{#A85}{text} & \verb+#A8A+ & \color{#A8A}{text} & \verb+#A8F+ & \color{#A8F}{text} \\ \verb+#F80+ & \color{#F80}{text} & \verb+#F85+ & \color{#F85}{text} & \verb+#F8A+ & \color{#F8A}{text} & \verb+#F8F+ & \color{#F8F}{text} \\ \hline \verb+#0F0+ & \color{#0F0}{text} & \verb+#0F5+ & \color{#0F5}{text} & \verb+#0FA+ & \color{#0FA}{text} & \verb+#0FF+ & \color{#0FF}{text} \\ \verb+#5F0+ & \color{#5F0}{text} & \verb+#5F5+ & \color{#5F5}{text} & \verb+#5FA+ & \color{#5FA}{text} & \verb+#5FF+ & \color{#5FF}{text} \\ \verb+#AF0+ & \color{#AF0}{text} & \verb+#AF5+ & \color{#AF5}{text} & \verb+#AFA+ & \color{#AFA}{text} & \verb+#AFF+ & \color{#AFF}{text} \\ \verb+#FF0+ & \color{#FF0}{text} & \verb+#FF5+ & \color{#FF5}{text} & \verb+#FFA+ & \color{#FFA}{text} & \verb+#FFF+ & \color{#FFF}{text} \\ \hline \end{array}

Supported Color Palette​

ColorColorColorColor
Apricot\color{Apricot}{Apricot}Aquamarine\color{Aquamarine}{Aquamarine}Bittersweet\color{Bittersweet}{Bittersweet}Black\color{Black}{Black}
Blue\color{Blue}{Blue}BlueGreen\color{BlueGreen}{BlueGreen}BlueViolet\color{BlueViolet}{BlueViolet}BrickRed\color{BrickRed}{BrickRed}
Brown\color{Brown}{Brown}BurntOrange\color{BurntOrange}{BurntOrange}CadetBlue\color{CadetBlue}{CadetBlue}CarnationPink\color{CarnationPink}{CarnationPink}
Cerulean\color{Cerulean}{Cerulean}CornflowerBlue\color{CornflowerBlue}{CornflowerBlue}Cyan\color{Cyan}{Cyan}Dandelion\color{Dandelion}{Dandelion}
DarkOrchid\color{DarkOrchid}{DarkOrchid}Emerald\color{Emerald}{Emerald}ForestGreen\color{ForestGreen}{ForestGreen}Fuchsia\color{Fuchsia}{Fuchsia}
Goldenrod\color{Goldenrod}{Goldenrod}Gray\color{Gray}{Gray}Green\color{Green}{Green}GreenYellow\color{GreenYellow}{GreenYellow}
JungleGreen\color{JungleGreen}{JungleGreen}Lavender\color{Lavender}{Lavender}LimeGreen\color{LimeGreen}{LimeGreen}Magenta\color{Magenta}{Magenta}
Mahogany\color{Mahogany}{Mahogany}Maroon\color{Maroon}{Maroon}Melon\color{Melon}{Melon}MidnightBlue\color{MidnightBlue}{MidnightBlue}
Mulberry\color{Mulberry}{Mulberry}NavyBlue\color{NavyBlue}{NavyBlue}OliveGreen\color{OliveGreen}{OliveGreen}Orange\color{Orange}{Orange}
OrangeRed\color{OrangeRed}{OrangeRed}Orchid\color{Orchid}{Orchid}Peach\color{Peach}{Peach}Periwinkle\color{Periwinkle}{Periwinkle}
PineGreen\color{PineGreen}{PineGreen}Plum\color{Plum}{Plum}ProcessBlue\color{ProcessBlue}{ProcessBlue}Purple\color{Purple}{Purple}
RawSienna\color{RawSienna}{RawSienna}Red\color{Red}{Red}RedOrange\color{RedOrange}{RedOrange}RedViolet\color{RedViolet}{RedViolet}
Rhodamine\color{Rhodamine}{Rhodamine}RoyalBlue\color{RoyalBlue}{RoyalBlue}RoyalPurple\color{RoyalPurple}{RoyalPurple}RubineRed\color{RubineRed}{RubineRed}
Salmon\color{Salmon}{Salmon}SeaGreen\color{SeaGreen}{SeaGreen}Sepia\color{Sepia}{Sepia}SkyBlue\color{SkyBlue}{SkyBlue}
SpringGreen\color{SpringGreen}{SpringGreen}Tan\color{Tan}{Tan}TealBlue\color{TealBlue}{TealBlue}Thistle\color{Thistle}{Thistle}
Turquoise\color{Turquoise}{Turquoise}Violet\color{Violet}{Violet}VioletRed\color{VioletRed}{VioletRed}WildStrawberry\color{WildStrawberry}{WildStrawberry}
Yellow\color{Yellow}{Yellow}YellowGreen\color{YellowGreen}{YellowGreen}YellowOrange\color{YellowOrange}{YellowOrange}

Note: Color names must begin with an uppercase letter, for example \color{OliveGreen}{text}.

Examples​

{\color{Blue}x^2}+{\color{Brown}2x} - {\color{OliveGreen}1} x2+2x−1{\color{Blue}x^2}+{\color{Brown}2x} - {\color{OliveGreen}1}

x_{\color{Maroon}1,2}=\frac{-b\pm\sqrt{{\color{Maroon}b^2-4ac}}}{2a} x1,2=−b±b2−4ac2ax_{\color{Maroon}{1,2}}=\dfrac{-b\pm\sqrt{\color{Maroon}{b^2-4ac}}}{2a}