After more than half a year, I picked up LaTeX again to write algorithm homework and found that I had forgotten a ridiculous number of symbols. So I wrote this tutorial to record common LaTeX mathematical symbols and environments for future reference.

LaTeX Tutorial

1. Basic Syntax

1.1 Document Structure

1
2
3
4
5
6
7
\documentclass{article}  % Document type
\usepackage{amsmath} % Math package
\usepackage{amssymb} % Math symbol package

\begin{document}
% Document content
\end{document}

1.2 Text Formatting

1
2
3
4
\textbf{bold text}        % Bold
\textit{italic text} % Italic
\underline{underline} % Underline
\texttt{monospace text} % Typewriter font

2. Math Mode

2.1 Inline and Display Formulas

1
2
3
4
Inline formula: $E = mc^2$
Display formula: $$E = mc^2$$
Or:
\[ E = mc^2 \]

2.2 equation Environment

1
2
3
4
5
6
7
8
\begin{equation}
E = mc^2
\end{equation}

% Without numbering
\begin{equation*}
E = mc^2
\end{equation*}

3. Common Mathematical Symbols

3.1 Greek Letters

Lowercase letters:

1
2
3
4
5
6
7
8
\alpha    α       \beta     β       \gamma    γ
\delta δ \epsilon ε \zeta ζ
\eta η \theta θ \iota ι
\kappa κ \lambda λ \mu μ
\nu ν \xi ξ \pi π
\rho ρ \sigma σ \tau τ
\upsilon υ \phi φ \chi χ
\psi ψ \omega ω

Uppercase letters:

1
2
3
4
\Gamma    Γ       \Delta    Δ       \Theta    Θ
\Lambda Λ \Xi Ξ \Pi Π
\Sigma Σ \Upsilon Υ \Phi Φ
\Psi Ψ \Omega Ω

3.2 Operators

Basic operations:

1
2
3
+         plus    -         minus   \times    ×
\div ÷ \pm ± \mp
\cdot · \ast * \star

Relational operators:

1
2
3
4
5
6
=         =       \neq      ≠       <         <
> > \leq\geq
\ll\gg\approx
\equiv\sim\simeq
\propto\in\notin
\subset\subseteq\supset

Logical symbols:

1
2
3
\land\lor\neg      ¬
\implies\iff\forall
\exists\nexists\emptyset

3.3 Superscripts and Subscripts

1
2
3
4
5
x^2              % Superscript
x_i % Subscript
x^{2y} % Multi-character superscript
x_{ij} % Multi-character subscript
x_i^2 % Superscript and subscript together

3.4 Fractions and Roots

1
2
3
4
5
\frac{a}{b}      % Fraction
\dfrac{a}{b} % Display-style fraction
\tfrac{a}{b} % Text-style fraction
\sqrt{x} % Square root
\sqrt[n]{x} % n-th root

3.5 Summation, Integrals, and Limits

1
2
3
4
5
6
7
\sum_{i=1}^{n}          % Summation
\prod_{i=1}^{n} % Product
\int_{a}^{b} % Integral
\iint % Double integral
\iiint % Triple integral
\oint % Contour integral
\lim_{x \to \infty} % Limit

3.6 Brackets

1
2
3
4
5
6
()                       % Parentheses
[] % Square brackets
\{\} % Braces
\langle \rangle % Angle brackets
\lfloor \rfloor % Floor
\lceil \rceil % Ceiling

Automatic sizing:

1
2
3
\left( \frac{a}{b} \right)
\left[ \frac{a}{b} \right]
\left\{ \frac{a}{b} \right\}

4. Matrices

4.1 Basic Matrices

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Matrix without brackets
\begin{matrix}
a & b \\
c & d
\end{matrix}

% Parenthesized matrix
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}

% Square-bracket matrix
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}

% Brace matrix
\begin{Bmatrix}
a & b \\
c & d
\end{Bmatrix}

% Single-vertical-line matrix
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}

% Double-vertical-line matrix
\begin{Vmatrix}
a & b \\
c & d
\end{Vmatrix}

4.2 Ellipses

1
2
3
4
\dots    % Low ellipsis
\cdots % Centered ellipsis
\vdots % Vertical ellipsis
\ddots % Diagonal ellipsis

5. Multi-Line Formulas

5.1 align Environment

1
2
3
4
5
\begin{align}
x &= a + b \\
y &= c + d \\
z &= e + f
\end{align}

5.2 cases Environment

1
2
3
4
f(x) = \begin{cases}
x^2 & \text{if } x \geq 0 \\
-x & \text{if } x < 0
\end{cases}

5.3 split Environment

1
2
3
4
5
6
\begin{equation}
\begin{split}
f(x) &= (x+1)^2 \\
&= x^2 + 2x + 1
\end{split}
\end{equation}

6. Special Symbols

6.1 Arrows

1
2
3
4
5
6
7
\rightarrow\leftarrow
\Rightarrow\Leftarrow
\leftrightarrow\Leftrightarrow
\uparrow\downarrow
\Uparrow\Downarrow
\mapsto\longmapsto
\longrightarrow\Longrightarrow

6.2 Other Common Symbols

1
2
3
4
5
6
7
8
\infty\partial
\nabla\hbar
\prime\ldots
\cdots\vdots
\ddots\angle
\degree ° \circ
\bullet\cap
\cup\triangle

6.3 Fonts

1
2
3
4
5
6
7
8
\mathbb{R}          % Blackboard bold
\mathcal{A} % Calligraphic
\mathfrak{A} % Fraktur
\mathbf{A} % Bold
\mathrm{A} % Roman
\mathit{A} % Italic
\mathsf{A} % Sans-serif
\mathtt{A} % Typewriter

7. Spacing Control

1
2
3
4
5
6
7
a\ b              % Normal space
a\,b % Small space
a\:b % Medium space
a\;b % Large space
a\quad b % 1em space
a\qquad b % 2em space
a\!b % Negative space

8. Text Comments

1
2
\text{text content}           % Insert text inside a formula
\mbox{text content} % Text box

9. Accents

1
2
3
4
\hat{a}      â       \bar{a}      ā
\tilde{a} ã \dot{a} ȧ
\ddot{a} ä \vec{a} ā⃗
\widehat{ab} \widetilde{ab}

10. Common Theorem Environments

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\newtheorem{definition}{Definition}

\begin{theorem}
Theorem content
\end{theorem}

\begin{proof}
Proof content
\end{proof}

11. Common Tips

11.1 Alignment

1
2
3
4
\begin{aligned}
&\text{left aligned} \\
&\text{content}
\end{aligned}

11.2 Numbering Control

1
2
3
\tag{1}              % Manual tag
\notag % Remove numbering
\nonumber % Remove numbering

11.3 Colors

1
2
3
\usepackage{xcolor}
\textcolor{red}{red text}
\colorbox{yellow}{yellow background}

12. Best Practices

  1. Matching brackets: use \left and \right to automatically adjust bracket size.
  2. Long formulas: use align or split to break lines.
  3. Matrices: choose an appropriate bracket type.
  4. Spacing: use \,, \quad, and similar commands to adjust spacing.
  5. Text: use \text{} to insert text in formulas.
  6. Symbols: define macros for complex symbols to simplify input.
1
2
3
% Custom command examples
\newcommand{\R}{\mathbb{R}}
\newcommand{\norm}[1]{\left\| #1 \right\|}

References