LaTex

// latex cheat sheet

Quick reference for writing math in Blogger posts. Wrap display math in $$...$$ and inline math in \(...\)

Display math (centered, own line): $$your equation here$$
Inline math (inside a sentence): \(your equation here\)

Set Theory

\in∈ — element ofx \in A
\notin∉ — not element ofx \notin A
\subset⊂ — proper subsetA \subset B
\subseteq⊆ — subset or equalA \subseteq B
\supset⊃ — proper supersetA \supset B
\cup∪ — unionA \cup B
\cap∩ — intersectionA \cap B
\setminus∖ — set differenceA \setminus B
\emptyset∅ — empty set\emptyset
\mathcal{P}(A)𝒫(A) — power set\mathcal{P}(A)
|A|cardinality|A| = 5
\times× — Cartesian productA \times B

Set Builder Notation

$$A = \{x \in \mathbb{Z} : 0 \leq x^3 < 100\}$$

Number Sets

\mathbb{N}ℕ — natural numbers
\mathbb{Z}ℤ — integers
\mathbb{Q}ℚ — rationals
\mathbb{R}ℝ — reals
\mathbb{C}ℂ — complex numbers
\mathbb{Z}^+ℤ⁺ — positive integers

Logic & Propositional Calculus

\land∧ — and (conjunction)p \land q
\lor∨ — or (disjunction)p \lor q
\lnot¬ — not (negation)\lnot p
\implies⟹ — impliesp \implies q
\iff⟺ — if and only ifp \iff q
\oplus⊕ — exclusive or (XOR)p \oplus q
\forall∀ — for all\forall x \in A
\exists∃ — there exists\exists x \in A
\nexists∄ — there does not exist\nexists x
\top⊤ — tautology / true
\bot⊥ — contradiction / false

Relations & Ordering

\leq≤ — less than or equalx \leq y
\geq≥ — greater than or equalx \geq y
\neq≠ — not equalx \neq y
\equiv≡ — equivalent / congruenta \equiv b \pmod{n}
\approx≈ — approximately equal
\sim∼ — similar / relateda \sim b
\mid∣ — dividesa \mid b
\nmid∤ — does not dividea \nmid b

Proof & Reasoning

\therefore∴ — therefore
\because∵ — because
\square□ — QED / end of proof
\blacksquare■ — QED (filled)
\contradiction↯ — contradiction

Functions & Algebra

\frac{a}{b}fraction\frac{x+1}{x-1}
\sqrt{x}square root\sqrt{x^2+y^2}
\sqrt[n]{x}nth root\sqrt[3]{8}
x^{n}superscript / exponentx^{n+1}
x_{n}subscripta_{n}
\lfloor x \rfloor⌊x⌋ — floor
\lceil x \rceil⌈x⌉ — ceiling
\bmodmod operatora \bmod n
\pmod{n}modulo (in parens)a \equiv b \pmod{n}

Summation & Products

\sum_{i=0}^{n}summation\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
\prod_{i=0}^{n}product\prod_{i=1}^{n} i = n!
n!factorial
\binom{n}{k}binomial coefficient C(n,k)\binom{n}{k} = \frac{n!}{k!(n-k)!}

Matrices & Vectors

2×2 matrix:
$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$

System of equations:
$$\begin{cases} 2x + y = 5 \\ x - y = 1 \end{cases}$$

Spacing (inside equations)

\;thick space
\,thin space
\quadlarge space
\qquadextra large space
\text{and}regular text inside mathx \in A \text{ and } x > 0

Ready-to-Use Examples

Divisibility definition:
$$a \mid b \iff \exists k \in \mathbb{Z} : b = ka$$

Modular arithmetic:
$$a \equiv b \pmod{n} \iff n \mid (a - b)$$

Set intersection:
$$A \cap B = \{x : x \in A \land x \in B\}$$

Summation formula:
$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$

Binomial coefficient:
$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$

Proof by contradiction opener (inline):
Assume \(p\) is prime and \(p \mid ab\) but \(p \nmid a\) and \(p \nmid b\).

0 comments