Beautiful math on
$\LaTeX$ in less than 10 minutes

# Arithmetic

## Basic Operators

Basic operators work as expected
1 + 2 - 3 = 0
$1 + 2 - 3 = 0$
Division can be done as follows
1/2 = 1 \div 2 = \frac{1}{2}
$1/2 = 1 \div 2 = \frac{1}{2}$
To typeset bigger fractions, use
\dfrac{1}{2}
$\dfrac{1}{2}$
Or use \displaystyle.
\displaystyle \frac{1}{3}
$\displaystyle \frac{1}{3}$
Multiplication
2 \cdot 3 = 2 \times 3
$2 \cdot 3 = 2 \times 3$
Avoid using * for multiplication
2 * 3
$2 * 3$
Repeated decimals can be denoted by a bar
\frac{1}{3} = 0.\bar 3
$\frac{1}{3} = 0.\bar 3$

## Exponents and Indexes

Exponents can by typeset with a caret
2^3 = 8
$2^3 = 8$
Use braces to group exponents …
2^{10}
$2^{10}$
… to avoid
2^10
$2^10$
Subscripts, like indices, can by typeset as follows
a_n = 2 \cdot a_{n-1}
$a_n = 2 \cdot a_{n-1}$

## Square Roots

A square root can be typeset with
\sqrt{16} = 4
$\sqrt{16} = 4$
To take the $n^\text{th}$ root, use
\sqrt[3]{27} = 3
$\sqrt[3]{27} = 3$
\pm becomes a plus-minus.
x^2 = 4 \implies x = \pm \sqrt{4}
$x^2 = 4 \implies x = \pm \sqrt{4}$
Braces can be omitted if the argument is only 1 symbol
\sqrt 2
$\sqrt 2$

## Delimiters

For large parentheses, use \left and \right
\left( \dfrac{1}{x} \right)
$\left( \dfrac{1}{x} \right)$
… to avoid the following
(\dfrac{1}{x})
$(\dfrac{1}{x})$
This can also be used with |, [, …
\left| \frac{x + 1}{x - 1} \right|
$\left| \frac{x + 1}{x - 1} \right|$
Floor can be obtained with \lfloor and \rfloor
\left\lfloor \frac{1}{2} \right\rfloor
$\left\lfloor \frac{1}{2} \right\rfloor$
\| becomes a double bar
\left\| \frac{z}{a} \right\|
$\left\| \frac{z}{a} \right\|$
Angle brackets can be typeset as follows
\langle x^2 + 1 \rangle
$\langle x^2 + 1 \rangle$
To make them automatically grow, use
\left< \dfrac{1}{2} \right>
$\left< \dfrac{1}{2} \right>$

# Text, Style and Spacing

## Text

Use \text
\text{Area 1}
$\text{Area 1}$
… to avoid the following
Area 1
$Area 1$
This can be useful for ordinals
5^\text{th}
$5^\text{th}$

## Style

From small …
\tiny 2
\scriptsize 2
\small 2
\normalsize 2
\large 2
$\tiny 2 \scriptsize 2 \small 2 \normalsize 2 \large 2$
… to big
\Large 2
\LARGE 2
\huge 2
\Huge 2
$\Large 2 \LARGE 2 \huge 2 \Huge 2$
\huge
\color{green}{\ddot \smile}
$\huge \color{green}{\ddot \smile}$
HTML colors are valid too
\huge
\color{#0f0}{\checkmark}
$\huge \color{#0f0}{\checkmark}$

## Spacing

\  adds a space with the width of a space
\blacksquare \ \blacksquare
$\blacksquare \ \blacksquare$
\quad and \qquad are bigger spaces
\blacksquare \quad
\blacksquare
$\blacksquare \quad \blacksquare \qquad \blacksquare$
\: and \, are small spaces
\blacksquare \:
\blacksquare \,
\blacksquare
$\blacksquare \: \blacksquare \, \blacksquare$
Small spaces are useful to group digits
54\,321
$54\,321$

# Equalities

(In)equalities
1 + 1 = 2 \ne 3 \approx \pi
$1 + 1 = 2 \ne 3 \approx \pi$
A = b \cdot h \tag 1
$A = b \cdot h \tag 1$
Using tag* will remove the parentheses
A = b \cdot h \tag* 2
$A = b \cdot h \tag* 2$
To center an equation without a tag, the following works
A = b \cdot h \tag*{}
$A = b \cdot h \tag*{}$
\lt stands for less than
3 \lt x \le 4
$3 \lt x \le 4$
\gt stands for greater than
x \gt 3
$x \gt 3$
\ge stands for greater than or equal to
x \ge 3
$x \ge 3$
\not can be used to negate anything, but is often ugly
x \not\gt 4
$x \not\gt 4$
$T$ is proportional to $p$
T \propto p \text{ or } T \sim p
$T \propto p \text{ or } T \sim p$

## Alignment of Equal Signs

Align equal signs as follows
\begin{align}
2 + 2 &= 4 \\
2     &= 4 - 2
\end{align}
\begin{align} 2 + 2 &= 4 \\ 2 &= 4 - 2 \end{align}
You can also give a tag to a line
\begin{align}
2 + 2 &= 4     \tag 1 \\
2     &= 4 - 2        \\
2     &= 2     \tag a
\end{align}
\begin{align} 2 + 2 &= 4 \tag 1 \\ 2 &= 4 - 2 \\ 2 &= 2 \tag a \end{align}
To give some more explanation, add some text
\begin{align}
2 + 2 &= 4                             \tag 1 \\
2     &= 4 - 2 && \text{subtracting 2}        \\
2     &= 2                             \tag a
\end{align}
\begin{align} 2 + 2 &= 4 \tag 1 \\ 2 &= 4 - 2 && \text{subtracting 2} \\ 2 &= 2 \tag a \end{align}
System of equations
S = \left\{
\begin{align}
a + b     &= 4\\
a \cdot b &= 4
\end{align}
\right.
S = \left\{ \begin{align} a + b &= 4\\ a \cdot b &= 4 \end{align} \right.

## Annotating Equalities

Overset can be used to stack symbols
2 \overset{?}{=} 3
$2 \overset{?}{=} 3$
Arrows are sometimes too short
\overset{\text{some text}}{\rightarrow}
$\overset{\text{some text}}{\rightarrow}$
Use \xrightarrow instead
\xrightarrow{\text{some text}}
$\xrightarrow{\text{some text}}$
Underbrace and overbrace in action
(\cos x + \sin x)^2 =
\underbrace{\cos^2 x + \sin^2 x}_{1} +
\overbrace{2 \sin x \cos x}^{\sin 2x}
$(\cos x + \sin x)^2 = \underbrace{\cos^2 x + \sin^2 x}_{1} + \overbrace{2 \sin x \cos x}^{\sin 2x}$

## Modulo

If $\text{mod}$ is used as a binary operator
7 \bmod 4 = 3
$7 \bmod 4 = 3$
If it's used after an equation
7 \equiv 3 \pmod 4
$7 \equiv 3 \pmod 4$
Without parentheses
7 \equiv 3 \mod 4
$7 \equiv 3 \mod 4$

# Geometry

## Angles

Use \angle to denote an angle
\angle A = 90^\circ
$\angle A = 90^\circ$
\hat and \widehat are another possibility
\hat A = \widehat{BAC} = 90^\circ
$\hat A = \widehat{BAC} = 90^\circ$
\angle A = \frac{\pi}{2} \text{ radians}
$\angle A = \frac{\pi}{2} \text{ radians}$

## Greek Letters

Some Greek letters
\alpha \beta \gamma \delta
$\alpha \beta \gamma \delta$
Greek uppercase letters
\Gamma \Delta \Theta \Xi \Lambda
$\Gamma \Delta \Theta \Xi \Lambda$
Phi and epsilon have variants
\phi, \varphi \quad \epsilon, \varepsilon
$\phi, \varphi \quad \epsilon, \varepsilon$
Likewise for theta, kappa …
\theta, \vartheta \quad \kappa, \varkappa
$\theta, \vartheta \quad \kappa, \varkappa$
… pi and rho
\pi, \varpi \quad \rho, \varrho
$\pi, \varpi \quad \rho, \varrho$

## Other Symbols

Useful shapes
\triangle, \square, \bigcirc
$\triangle, \square, \bigcirc$
Perpendicular
AB \perp BC
$AB \perp BC$
Parallel
AB \parallel CD
$AB \parallel CD$
Similarity
\triangle ABC \sim \triangle CEF
$\triangle ABC \sim \triangle CEF$
Congruence
\triangle ABC \cong \triangle CEF
$\triangle ABC \cong \triangle CEF$

# Functions

## Standard Functions

Write standard functions with a backslash
\log x
$\log x$
Not doing so gives bad results
log x
$log x$
Lots of functions are available …
\exp x, \sin x, \arccos x, \cosh x, \max x
$\exp x, \sin x, \arccos x, \cosh x, \max x$

## Introducing Functions

Some functions aren't available.
Use operatorname
\operatorname{arccosh} x
$\operatorname{arccosh} x$
Another way of defining a function
\begin{align}
f\colon \mathbb R &\to \mathbb R^+\\
x                 &\mapsto x^2
\end{align}
\begin{align} f\colon \mathbb R &\to \mathbb R^+\\ x &\mapsto x^2 \end{align}
Piecewise functions
f(x) = \begin{cases}
x   & \text{if $x \gt 0$}\\
x^2 & \text{else}
\end{cases}
$f(x) = \begin{cases} x & \text{if x \gt 0}\\ x^2 & \text{else} \end{cases}$

## Operations with Functions

Derivative
f'(x) = \frac{df}{dx}
$f'(x) = \frac{df}{dx}$
Composition
(f \circ g)(x) = f(g(x))
$(f \circ g)(x) = f(g(x))$
Inverse
f^{-1}(x)
$f^{-1}(x)$

# Sums and Series

## Summation and Products

Typesetting sums is easy
\sum_{n=1}^\infty x^n
$\sum_{n=1}^\infty x^n$
\displaystyle makes it breathe some more
\displaystyle \sum_{n=1}^\infty x^n
$\displaystyle \sum_{n=1}^\infty x^n$
\limits maintains the small style, but shifts
the limits to the bottom of the sum
\sum\limits_{n=1}^\infty x^n
$\sum\limits_{n=1}^\infty x^n$
Products can be typeset in a similar fashion
\displaystyle \prod_{n=1}^\infty x^n
$\displaystyle \prod_{n=1}^\infty x^n$

## Continuation Dots

Never use … to make dots
1 + 2 - 3 + 4 ...
$1 + 2 - 3 + 4 ...$
\ldots gives low dots
1, 2, \ldots, 10
$1, 2, \ldots, 10$
\cdots gives centered dots
f(x) = x + x^2 + x^3 + \cdots
$f(x) = x + x^2 + x^3 + \cdots$
Vertical and diagonal dots are useful in matrices
\begin{pmatrix}
1 & 1 & \cdots & 1 \\
0 & 1 & \cdots & 1 \\
0 & 0 & \ddots & \vdots \\
0 & 0 & 0      & 1
\end{pmatrix}
$\begin{pmatrix} 1 & 1 & \cdots & 1 \\ 0 & 1 & \cdots & 1 \\ 0 & 0 & \ddots & \vdots \\ 0 & 0 & 0 & 1 \end{pmatrix}$

# Infinity

The inf(ini)ty symbol
\infty
$\infty$
Cardinal infinity
|\mathbb N| = \aleph_0
$|\mathbb N| = \aleph_0$
Ordinal infinity
\omega^\omega = \text{big}
$\omega^\omega = \text{big}$
Complex infinity
\tilde\infty
$\tilde\infty$

# Logic

Logical or, logical and
a \lor b \land c
$a \lor b \land c$
Negation
\bar{c} \equiv \lnot c
$\bar{c} \equiv \lnot c$
True and false
\top \land \bot \equiv \bot
$\top \land \bot \equiv \bot$
Implications
(a \implies b) \iff (b \impliedby a)
$(a \implies b) \iff (b \impliedby a)$
Quantifiers
\forall A, \exists B : A \lt B
$\forall A, \exists B : A \lt B$

# Sets

## Braces

{} don't work, as they group objects
{1, 2, 3}
${1, 2, 3}$
Escape them with a backslash
\{1, 2, 3\}
$\{1, 2, 3\}$
Use \mathbb to get double stroked letters
\mathbb{N} = \{0, 1, 2, 3, \ldots \}
$\mathbb{N} = \{0, 1, 2, 3, \ldots \}$
\mid inserts a vertical bar
\{n^2 \mid n \in \mathbb{N}\}
$\{n^2 \mid n \in \mathbb{N}\}$

## Cup and Cap

Unify and intersect
A \cup B = C \cap D
$A \cup B = C \cap D$
Element of a set
x \in A
$x \in A$
Superset and subset are self-explanatory
A \subset B \iff B \supset A
$A \subset B \iff B \supset A$
Add eq to get
A \subseteq B
$A \subseteq B$
To subtract a set, write
\mathbb N_0 = \mathbb N \setminus \{0\}
$\mathbb N_0 = \mathbb N \setminus \{0\}$

## Others

Empty set
\emptyset = \varnothing
$\emptyset = \varnothing$
Powerset
\mathcal P \{1, 2\} = \{\{\}, \{1\}, \{2\}, \{1,2\} \}
$\mathcal P \{1, 2\} = \{\{\}, \{1\}, \{2\}, \{1,2\} \}$

# Combinatorics

Factorial
4! = 4 \cdot 3 \cdot 2 \cdot 1
$4! = 4 \cdot 3 \cdot 2 \cdot 1$
Binomial notation
{n \choose r} = \binom{n}{r} = \frac{n!}{(n-r)!r!}
${n \choose r} = \binom{n}{r} = \frac{n!}{(n-r)!r!}$
Other ways
{}^n\text{C}_r = {}_n\text{C}_r = \text{C}_r^n
${}^n\text{C}_r = {}_n\text{C}_r = \text{C}_r^n$

# Complex Numbers

The complex set
a + ib \in \mathbb C
$a + ib \in \mathbb C$
The real part
\Re \left( e^{ix} \right) = \cos x
$\Re \left( e^{ix} \right) = \cos x$
The imaginary part
\Im \left( e^{ix} \right) = \sin x
$\Im \left( e^{ix} \right) = \sin x$
The conjugate of a number
\overline z = \Re (z) - i \Im (z)
$\overline z = \Re (z) - i \Im (z)$
The magnitude
|z| = \| z \|
$|z| = \| z \|$
The argument
\arg z
$\arg z$

# Calculus

## Limits

Limits can be typeset with a subscript
\lim_{x \to \infty} x^2 = \infty
$\lim_{x \to \infty} x^2 = \infty$
Displaystyle makes it breathe more
\displaystyle\lim_{x \to \infty} x^2 = \infty
$\displaystyle\lim_{x \to \infty} x^2 = \infty$

## Derivatives

Typeset derivatives using fractions
\dfrac{dy}{dx}
$\dfrac{dy}{dx}$
If you want $\mathrm d$ to be upright, use
\dfrac{\mathrm dy}{\mathrm dx}
$\dfrac{\mathrm dy}{\mathrm dx}$
Derivative at a point
\left. \dfrac{dy}{dx} \right|_{x=0}
$\left. \dfrac{dy}{dx} \right|_{x=0}$
Partial derivatives
\dfrac{\partial f(x,y)}{\partial x} = f_x
$\dfrac{\partial f(x,y)}{\partial x} = f_x$
Difference quotients
\dfrac{\Delta y}{\Delta x}
$\dfrac{\Delta y}{\Delta x}$
Derivates w.r.t. time
\dot x, \ddot x
$\dot x, \ddot x$

## Integrals

Here, \, adds a small space
\int x \, dx = \frac{x^2}{2}
$\int x \, dx = \frac{x^2}{2}$
For an upright $\mathrm d$, use
\int x \, \mathrm dx = \frac{x^2}{2}
$\int x \, \mathrm dx = \frac{x^2}{2}$
Never use consecutive \ints
\int \int x^2 + y^2 \,dx \,dy
$\int \int x^2 + y^2 \,dx \,dy$
Use \iint instead
\iint x^2 + y^2 \,dx \, dy
$\iint x^2 + y^2 \,dx \, dy$
Lower and upper bounds
\int_a^b x \, dx
$\int_a^b x \, dx$
Displaystyle makes it breathe more
\displaystyle\int_a^b x \, dx
$\displaystyle\int_a^b x \, dx$
Evaluating integrals. \left. is an invisible bracket
\displaystyle
\int_0^1 x \, dx = \left. \frac{x^2}{2} \right|_0^1
$\displaystyle \int_0^1 x \, dx = \left. \frac{x^2}{2} \right|_0^1$
Closed path integral
\displaystyle
\oint_C \mathbf F \cdot d \mathbf r
$\displaystyle \oint_C \mathbf F \cdot d \mathbf r$
\limits places the boundaries under the integral sign
\displaystyle\oint\limits_C \mathbf F \cdot d \mathbf r
$\displaystyle\oint\limits_C \mathbf F \cdot d \mathbf r$

# Vectors

Choose one of the following
\mathbf{u} = \vec u
$\mathbf{u} = \vec u$
Use \imath and \jmath for unit vectors …
\hat \imath, \hat \jmath, \hat k
$\hat \imath, \hat \jmath, \hat k$
… to avoid
\hat i, \hat j, \hat k
$\hat i, \hat j, \hat k$
Take the cross product with \times
\vec u \times \vec v
$\vec u \times \vec v$
Take the dot product with \cdot
\vec u \cdot \vec v
$\vec u \cdot \vec v$
Angle brackets can be used
\vec u = \left< u_x, u_y, u_z \right>
$\vec u = \left< u_x, u_y, u_z \right>$
The nabla operator
\nabla f = \operatorname{grad} f
$\nabla f = \operatorname{grad} f$
Divergence of a vector field
\nabla \cdot \mathbf F
= \operatorname{div} \mathbf F
$\nabla \cdot \mathbf F = \operatorname{div} \mathbf F$
For repeated use, add this once …
\DeclareMathOperator{\div}{div}
\div \mathbf F
$\DeclareMathOperator{\div}{div} \div \mathbf F$
… and use it as many times as you want.
\div \mathbf A = \div \mathbf B
$\div \mathbf A = \div \mathbf B$
Curl of a vector field
\nabla \times \mathbf F
= \operatorname{curl} \mathbf F
$\nabla \times \mathbf F = \operatorname{curl} \mathbf F$

# Matrices

Make a matrix with parentheses
\begin{pmatrix}
0 & 1\\
1 & 1
\end{pmatrix}
$\begin{pmatrix} 0 & 1\\ 1 & 1 \end{pmatrix}$
Make a matrix with brackets
\begin{bmatrix}
0 & 1\\
1 & 1
\end{bmatrix}
$\begin{bmatrix} 0 & 1\\ 1 & 1 \end{bmatrix}$
\operatorname{adj} A
$\operatorname{adj} A$
Transposing a matrix
A^\top \text{ or } A^\intercal
$A^\top \text{ or } A^\intercal$
The determinant
\det A = \begin{vmatrix}
0 & 1\\
1 & 1
\end{vmatrix} = -1
$\det A = \begin{vmatrix} 0 & 1\\ 1 & 1 \end{vmatrix} = -1$
Add some centered, vertical and diagonal dots
\begin{bmatrix}
1      & 0      & \cdots & 0     \\
0      & 1      & \cdots & 0     \\
\vdots & \vdots & \ddots & \vdots\\
0      & 0      & \cdots & 1     \\
\end{bmatrix}
$\begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1 \\ \end{bmatrix}$