Markdown Math Formulas
LaTeX Math Formulas Basics
In Markdown, math formulas are expressed via LaTeX syntax. LaTeX is a powerful typesetting system, especially suited for documents containing complex math formulas.
Basic syntax structure
- Command: starts with a backslash
\, such as\alpha,\sum - Parameters: uses curly braces
{}to enclose, such as\frac{a}{b} - Subscript: When using
_, such asx_1 - Superscript: When using
^, such asx^2 - Grouping: uses curly braces to group multiple characters, such as
x_{i+1}
Common LaTeX commands
\alpha, \beta, \gamma % 希腊字母
\sum, \prod, \int % 求和、乘积、积分
\frac{分子}{分母} % 分数
\sqrt{表达式} % 平方根
\sqrt[n]{表达式} % n次根
Inline and block-level formulas
Inline formula
Inline formulas use a single dollar sign $ to enclose, and the formula is embedded in the text, for example: the variable $x = 5$ and the function $f(x) = x^2 + 2x + 1$ in the text.
文本中的变量 $x = 5$ 和函数 $f(x) = x^2 + 2x + 1$。

Block-level formulas
Block-level formulas use double dollar signs $$ to enclose, and the formula appears on its own line, centered:
E = mc^2
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$E = mc^2$$
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$

Multi-line formulas
Use align The environment creates multi-line aligned formulas:
\begin{align}
f(x) &= ax^2 + bx + c \
f'(x) &= 2ax + b \
f''(x) &= 2a
\end{align}
$$
\begin{align}
f(x) &= ax^2 + bx + c \\
f'(x) &= 2ax + b \\
f''(x) &= 2a
\end{align}
$$

Common mathematical symbols
Basic arithmetic symbols
- Addition, subtraction, multiplication, division:
+,-,\times,\div - Fractions:
\frac{a}{b}→ $\frac{a}{b}$ - Square roots:
\sqrt{x},\sqrt[n]{x}→ $\sqrt{x}$, $\sqrt[n]{x}$ - Exponent:
x^2,e^{i\pi}→ $x^2$, $e^{i\pi}$
Comparison symbols
- Equal to:
=,\neq,\equiv→ $=$, $\neq$, $\equiv$ - Greater/Less than:
<,>,\leq,\geq→ $<$, $>$, $\leq$, $\geq$ - Approximately equal to:
\approx,\sim→ $\approx$, $\sim$
Set symbols
- Element of:
\in,\notin→ $\in$, $\notin$ - Contains:
\subset,\supset→ $\subset$, $\supset$ - Intersection/Union:
\cap,\cup→ $\cap$, $\cup$ - Empty set:
\emptyset→ $\emptyset$
Greek Letters
Common Greek letters and their LaTeX notation:
| Lowercase | Uppercase | LaTeX | Lowercase | Uppercase | LaTeX |
|---|---|---|---|---|---|
| α | Α | \alpha |
ν | Ν | \nu |
| β | Β | \beta |
ο | Ο | o |
| γ | Γ | \gamma |
π | Π | \pi |
| δ | Δ | \delta |
ρ | Ρ | \rho |
| ε | Ε | \epsilon |
σ | Σ | \sigma |
| θ | Θ | \theta |
τ | Τ | \tau |
| λ | Λ | \lambda |
φ | Φ | \phi |
| μ | Μ | \mu |
ω | Ω | \omega |
Special functions and symbols
- Trigonometric functions:
\sin,\cos,\tan - Logarithm:
\log,\ln - Limit:
\lim_{x \to 0} - Summation:
\sum_{i=1}^{n} - Integral:
\int_{a}^{b} - Infinity:
\infty
Matrix representation
Use matrix Environment:
\begin{pmatrix}
a & b \
c & d
\end{pmatrix}
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$

Matrices with different bracket types:
pmatrixRound brackets (parentheses): $\begin{pmatrix} a & b \ c & d \end{pmatrix}$bmatrixSquare brackets: $\begin{bmatrix} a & b \ c & d \end{bmatrix}$vmatrixDeterminant: $\begin{vmatrix} a & b \ c & d \end{vmatrix}$