Apr 24, 2026 3.2 KB x-latex v2
1\documentclass[12pt]{article}
2\usepackage{amsmath, amssymb, amsthm}
3\usepackage{microtype}
4
5\newtheorem{theorem}{Theorem}[section]
6\newtheorem{lemma}[theorem]{Lemma}
7\newtheorem{corollary}[theorem]{Corollary}
8\newtheorem{definition}{Definition}[section]
9
10\title{Mathematics in LaTeX}
11\author{sublimated}
12\date{}
13
14\begin{document}
15\maketitle
16
17\section{Inline and Display Math}
18
19Inline math: the quadratic formula gives $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
20
21Display math (unnumbered):
22\[ e^{i\pi} + 1 = 0 \]
23
24Display math (numbered):
25\begin{equation}
26 \label{eq:euler}
27 e^{i\theta} = \cos\theta + i\sin\theta
28\end{equation}
29
30Reference: Equation~\eqref{eq:euler} is Euler's formula.
31
32\section{Fractions and Roots}
33
34Nested fractions: $\frac{1}{1 + \frac{1}{1 + \frac{1}{x}}}$.
35
36Display fraction:
37\[ \frac{\partial^2 u}{\partial t^2} = c^2 \nabla^2 u \]
38
39Roots: $\sqrt{2}$, $\sqrt[3]{8} = 2$, $\sqrt[n]{x^n} = |x|$.
40
41\section{Sums, Products, Integrals}
42
43\[ \sum_{k=1}^{n} k = \frac{n(n+1)}{2} \]
44
45\[ \prod_{i=1}^{n} x_i = x_1 \cdot x_2 \cdots x_n \]
46
47\[ \int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2} \]
48
49\[ \oint_{\partial\Omega} \mathbf{F} \cdot d\mathbf{s} = \iint_\Omega (\nabla \times \mathbf{F}) \cdot d\mathbf{A} \]
50
51\section{Matrices}
52
53\[
54A = \begin{pmatrix}
55 a_{11} & a_{12} & a_{13} \\
56 a_{21} & a_{22} & a_{23} \\
57 a_{31} & a_{32} & a_{33}
58\end{pmatrix}
59\]
60
61Determinant notation:
62\[
63\det(A) = \begin{vmatrix}
64 1 & 2 \\
65 3 & 4
66\end{vmatrix} = -2
67\]
68
69\section{Aligned Equations}
70
71\begin{align}
72 \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \label{eq:gauss} \\
73 \nabla \cdot \mathbf{B} &= 0 \label{eq:nomonopole} \\
74 \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \label{eq:faraday} \\
75 \nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \label{eq:ampere}
76\end{align}
77
78Maxwell's equations: \eqref{eq:gauss}--\eqref{eq:ampere}.
79
80\section{Cases}
81
82\[
83|x| = \begin{cases}
84 x & \text{if } x \geq 0, \\
85 -x & \text{if } x < 0.
86\end{cases}
87\]
88
89\section{Theorems and Proofs}
90
91\begin{definition}
92 A function $f: \mathbb{R} \to \mathbb{R}$ is \emph{continuous} at $c$ if
93 $\lim_{x \to c} f(x) = f(c)$.
94\end{definition}
95
96\begin{theorem}[Intermediate Value Theorem]
97 \label{thm:ivt}
98 If $f$ is continuous on $[a, b]$ and $y$ is between $f(a)$ and $f(b)$,
99 then there exists $c \in (a, b)$ such that $f(c) = y$.
100\end{theorem}
101
102\begin{proof}
103 Let $S = \{x \in [a,b] : f(x) \leq y\}$. Since $S$ is bounded above by $b$
104 and non-empty ($a \in S$), let $c = \sup S$. By continuity of $f$ at $c$,
105 we have $f(c) = y$.
106\end{proof}
107
108\begin{lemma}
109 Every convergent sequence is bounded.
110\end{lemma}
111
112\begin{corollary}
113 If $f$ is continuous on $[a,b]$ and $f(a) < 0 < f(b)$, then $f$ has a zero in $(a,b)$.
114\end{corollary}
115
116\section{Greek and Symbols}
117
118Lowercase: $\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \lambda, \mu, \pi, \sigma, \phi, \omega$.
119
120Uppercase: $\Gamma, \Delta, \Theta, \Lambda, \Pi, \Sigma, \Phi, \Omega$.
121
122Operators: $\times, \div, \pm, \mp, \cdot, \circ, \otimes, \oplus$.
123
124Relations: $\leq, \geq, \neq, \approx, \equiv, \sim, \propto, \in, \subset, \subseteq$.
125
126Arrows: $\to, \leftarrow, \Rightarrow, \Leftrightarrow, \mapsto, \hookrightarrow$.
127
128\end{document}