Skip to main content

LaTeX Syntax Quick Reference

· 5 min read
Zephyr
Engineer

title

Cover Image: Automatically generated by GPT-4 after reading the text


Every time you need it, it's always a hassle to find, so we decided to write a LaTeX syntax quick reference table.

CategoryDescriptionSyntaxOutput
Text StylesBold\textbf{AB}AB\textbf{AB}
Italic\textit{AB}AB\textit{AB}
Underline\underline{AB}AB\underline{AB}
Overline\overline{AB}AB\overline{AB}
Typewriter Font\texttt{AB}AB\texttt{AB}
Math StructuresFraction\frac{A}{B}AB\frac{A}{B}
Fraction (displayed)\dfrac{a}{b}ab\dfrac{a}{b}
Fraction (inline)\tfrac{a}{b}ab\tfrac{a}{b}
Fraction (old style){A \over B}AB\frac{A}{B}
Binomial Coefficient\binom{n}{k}(nk)\binom{n}{k}
Binomial Coefficient (old style){n \choose k}(nk)\binom{n}{k}
Square Root\sqrt{x}x\sqrt{x}
n-th Root\sqrt[n]{x}xn\sqrt[n]{x}
Exponentiationa^baba^b
Subscripta_baba_b
Integral\int_a^b x^2 \mathrm{d} xabx2dx\int_a^b x^2 \mathrm{d} x
Summation\sum_{n=1}^\infty \frac{1}{n}n=11n\sum_{n=1}^\infty \frac{1}{n}
Limit\lim_{x \to \infty} \frac{1}{x}limx1x\lim_{x \to \infty} \frac{1}{x}
Product\prod_{i=1}^n ii=1ni\prod_{i=1}^n i
Math SymbolsSine\sin{\theta}sinθ\sin{\theta}
Cosine\cos{\theta}cosθ\cos{\theta}
Plus-Minus\pm±\pm
Multiplication\times×\times
Division\div÷\div
Subset\subseteq\subseteq
Superset\supseteq\supseteq
Implies\implies    \implies
Implied By\impliedby    \impliedby
If and Only If\iff    \iff
Intersection\cap\cap
Union\cup\cup
Logical AND\land\land
Logical OR\lor\lor
Logical NOT\neg¬\neg
Not Equal To\neq\neq
Approximately Equal To\approx\approx
Special SymbolsGreek Letter α\alphaα\alpha
Greek Letter β\betaβ\beta
Greek Letter γ\gammaγ\gamma
Angle\angle\angle
Triangle\triangle\triangle
Square\square\square
Real Part\Re\Re
Imaginary Part\Im\Im
Imaginary Unit i\imathı\imath
Imaginary Unit j\jmathȷ\jmath
Greek Letter ε\epsilonϵ\epsilon
Greek Letter φ\phiϕ\phi
Variant Greek Letter φ\varphiφ\varphi
Matrices and VectorsMatrix (parentheses)\begin{pmatrix} a & b \\ c & d \end{pmatrix}(abcd)\begin{pmatrix} a & b\\ c & d \end{pmatrix}
Matrix (no parentheses)\begin{matrix} x & y \\ z & w \end{matrix}xyzw\begin{matrix} x & y \\ z & w \end{matrix}
Vector\vec{v}v\vec{v}
Identity Matrix\mathbf{I}I\mathbf{I}
Zero Matrix\mathbf{0}0\mathbf{0}
MiscellaneousAngle\angle\angle
Triangle\triangle\triangle
Square\square\square
Space\quad\quad
Proportional To\propto\propto
Because\because\because
Therefore\therefore\therefore
Integer Set\mathbb{Z}Z\mathbb{Z}
Probability Set\mathbb{P}P\mathbb{P}
Real Number Set\mathbb{R}R\mathbb{R}
Complex Number Set\mathbb{C}C\mathbb{C}
Imaginary Space\Im\Im
Real Space\Re\Re
Empty Set\emptyset\emptyset
Empty Set (nicer)\varnothing\varnothing
Belongs To\in\in
Not Belongs To\not\in∉\not\in
Greek Letter χ\chiχ\chi
Counterclockwise Circle Arrow\circlearrowleft\circlearrowleft
Clockwise Circle Arrow\circlearrowright\circlearrowright
Counterclockwise Curved Arrow\curvearrowleft\curvearrowleft
Clockwise Curved Arrow\curvearrowright\curvearrowright
Planck Constant\hbar\hbar
Natural Logarithm\lnln\ln
Constant π\piπ\pi
Set Symbol \cup\cup\cup
Set Symbol \cap\cap\cap
FormattingFunction Colorf(x) = a{\color{red}{x}} + bf(x)=ax+bf(x) = a{\color{red}{x}} + b
Colored Box\colorbox{#eeeeee}{Color Box}Color Box\colorbox{#eeeeee}{Color Box}
Calligraphic Font{\cal ABCDE12345abced}ABCDE12345abced{\cal ABCDE12345abced}
Boxed Text\fbox{boxed text}boxed text\fbox{boxed text}
Display Style Boxed Text\boxed{boxed\ text}boxed text\boxed{boxed\ text}
Fraktur Font{\frak ABCDE12345abcde}ABCDE12345abcde{\frak ABCDE12345abcde}
Italic{\it abefg12345}\ abcdefg12345abefg12345 abcdefg12345{\it abefg12345}\ abcdefg12345
Minimize\min\limits_{n}minn\min\limits_{n}
Bold Greek Letter\boldsymbol{\alpha}α\boldsymbol{\alpha}