Basic Latex Usage
-
Simple Inline Equations:
Output:Here are some inline equations:markdown
Here are some inline equations: - Area of a circle: $A = \pi r^2$ - Quadratic formula: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ - Einstein's famous equation: $E = mc^2$- Area of a circle:
- Quadratic formula:
- Einstein's famous equation:
-
Basic Block Equations:
Output:The Gaussian integral:markdown
The Gaussian integral: $$ \int_{-\infty}^\infty e^{-x^2} dx = \sqrt{\pi} $$
Advanced Mathematical Expressions
-
Matrix Operations:
Output:markdown
$$ \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix} $$ -
Multi-line Equations with Alignment:
Output:markdown
$$ \begin{align} (x + y)^3 &= (x + y)(x + y)^2 \\ &= (x + y)(x^2 + 2xy + y^2) \\ &= x^3 + 3x^2y + 3xy^2 + y^3 \end{align} $$
Other examples
markdown
$$
A \cap (B \cup C) = (A \cap B) \cup (A \cap C)
$$markdown
$$
\forall x \in \mathbb{R}, \exists y : y > x
$$markdown
$$
P(A|B) = \frac{P(B|A)P(A)}{P(B)}
$$markdown
$$
\frac{d}{dx}\left[\int_a^x f(t)dt\right] = f(x)
$$markdown
$$
\sum_{n=0}^{\infty} x^n = \frac{1}{1-x}, |x| < 1
$$markdown
$$
\lim_{x \to 0} \frac{\sin x}{x} = 1
$$markdown
The most beautiful equation in mathematics:
$$
e^{i\pi} + 1 = 0
$$markdown
$$
\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} \quad \text{(Riemann zeta function)}
$$markdown
$$
\Gamma(z) = \int_0^{\infty} t^{z-1}e^{-t}dt \quad \text{(Gamma function)}
$$markdown
$$
\vartheta(z) = \sum_{n=-\infty}^{\infty} e^{-\pi n^2 z} \quad \text{(Theta function)}
$$Spacing in LaTeX
| Feature | Notation | Output |
|---|---|---|
| Negative space | $a \! b$ | |
| Small space | $a \, b$ | |
| Medium space | $a \; b$ | |
| Large space | $a \quad b$ | |
| Extra large space | $a \qquad b$ |