Math Typesetting in Latex

This article is about the math typesetting using Latex.

Examples

Act only on the next character. Use curly braces {...} to affect several characters.

Special Characters

1
2
\# \$ \% \{ \} \_ \\
\backslash

Short Ones

  • $a^2$ a^2
  • $a_2$ a_2
  • $\sqrt{a}$ \sqrt{a}
  • $\sqrt[n]{a}$ \sqrt[n]{a}
  • $\vec{a}$ \vec{a}
  • $37^\circ$ 37^\circ
  • $\overrightarrow{AB}$ \overrightarrow{AB}
  • $\mathrm{d}x$ \mathrm{d}x
  • $\mathbf{\mu,M}$ \mathbf{\mu,M}
  • $\boldsymbol{\mu,M}$ \boldsymbol{\mu,M}

Large Ones

Sum, integral and product operator

1
2
3
4
5
\sum_{i=1}^n \qquad
\int_{-\infty}^\infty \qquad
\prod \qquad
\iint \qquad
\oint \qquad

Delimiter of auto size, use a pair of \left and \right. If the right is not necessary, use \right.

1
2
\left( \frac{1}{1+x} \right) \qquad
\left\{ \frac{x}{y} \right.

To specify the size manually, use

1
2
3
4
\big|
\Big|
\bigg|
\Bigg|

To group multiple equations, use align environment

1
2
3
4
5
6
\left\{
\begin{align}
a+b &= x\\
c+d &= y
\end{align}
\right.

To add a matrix, we may use environment array

1
2
3
4
5
6
7
8
\mathbf{X} =
\left[
\begin{array}{ccc}
x_{11} & x_{12} & \ldots \\
x_{21} & x_{22} & \ldots \\
\vdots & \vdots & \ddots
\end{array}
\right]

or we may use environment matrix

1
2
3
4
5
6
7
8
\mathbf{X} =
\left[
\begin{matrix}
x_{11} & x_{12} & \ldots \\
x_{21} & x_{22} & \ldots \\
\vdots & \vdots & \ddots
\end{matrix}
\right]

we can draw a table as

1
2
3
4
5
6
\begin{array}{c|cc}
n & x & y \\
\hline
1 & a & b \\
2 & c & d
\end{array}

Space

1
2
3
4
5
a \, b \\
a \; b \\
a \ b \\ % the same as \;
a \quad b \\
a \qquad b

Symbol

Math Mode Accents

Math Mode Accents

Greeks Letters

Greeks Letters

Binary Relations

Binary Relations

Binary Operators

Binary Operators

Big Operators

Big Operators

Arrows

Arrows

Arrows as Accents

Arrows as Accents

Delimiters

Delimiters 1

Delimiters 2

Others

Others

Fonts

Fonts

Reference

  1. Tobias Oetiker. A short introduction to LATEX 2e. Available at: https://www.ctan.org/tex-archive/info/lshort
0%