LaTeX Syntax Reference
The LaTeX you need for everyday math and papers, one topic per page. Each card shows the key command and what it draws; open a page for variants, copyable examples, common mistakes and how Overleaf, MathJax and Word differ.
Symbols
Relations, operators, sets, logic, arrows, Greek letters and accents: the command for each symbol and its variants.
- Greater Than or Equal to in LaTeX
x \geq yGreater than or equal to (\geq), less than or equal to (\leq), plain < and >, much less than, slanted and negated forms. - How to Write an Arrow in LaTeX
\rightarrowRight, left, double, long, maps-to and labeled arrows (\to, \Rightarrow, \xrightarrow), plus arrows in text mode. - LaTeX Symbols
\leqThe most-used math symbols in one table: relations, operators, sets, logic, arrows, Greek letters and accents, each with its command. - Plus Minus Sign in LaTeX
\pmThe ± sign with \pm, the minus-plus ∓ with \mp, ± in running text, and uncertainties such as 5.0 ± 0.1. - Infinity in LaTeX
\inftyThe ∞ symbol with \infty: negative infinity, intervals, limits to infinity, infinite sums and integrals. - Union in LaTeX
\cupThe ∪ symbol with \cup, indexed unions with \bigcup_{i=1}^{n}, and disjoint unions (\sqcup, \uplus). - Degree Symbol in LaTeX
90^\circThe ° sign four ways: ^\circ in math, \textdegree in text, \degree (gensymb) and siunitx for angles and °C. - Not Equal in LaTeX
\neqThe ≠ sign with \neq or \ne, and other negated relations: not equivalent, not an element of, not a subset. - Empty Set in LaTeX
\emptysetThe empty set with \emptyset or the rounder \varnothing (amssymb), plus \{\} and common set statements. - How to Write Percent in LaTeX
\%Why % hides the rest of the line, how to print it with \%, and how to format percentages with siunitx. - Intersection in LaTeX
\capThe ∩ symbol with \cap, indexed intersections with \bigcap, and how to size and space them. - Proportional Symbol in LaTeX
\proptoThe ∝ sign with \propto, the thinner \varpropto, "approximately proportional", and when authors use \sim instead. - Greek Letters in LaTeX
\alphaEvery lowercase and uppercase Greek letter with its command, the var- forms, and bold or upright Greek. - And Symbol and Logic Symbols in LaTeX
\landLogical and (\land), or, not, implies, iff, for all and there exists, and how to print a literal & instead. - Tilde (~) in LaTeX
Fig.~1Why ~ prints a space, how to get a visible tilde in text, the \tilde and \widetilde accents, and \sim in math. - Real Number Symbol in LaTeX
\mathbb{R}Blackboard bold number sets with \mathbb: ℝ, ℕ, ℤ, ℚ, ℂ, ℝⁿ, and why \R does not work out of the box. - Multiplication Symbol in LaTeX
a \times b\times, \cdot, \ast and \div, when each is used, and how to write scientific notation and products. - Approximately Equal in LaTeX
\approx\approx for ≈, plus \sim, \simeq, \cong and \equiv, with what each symbol means. - Dot Product in LaTeX
\mathbf{u} \cdot \mathbf{v}\cdot between vectors, bold or arrow notation, ⟨u, v⟩ with \langle and \rangle, and the usual dot product formulas. - Subset in LaTeX
A \subset B\subset, \subseteq, \subsetneq, the superset forms and the negated "not a subset" symbols. - Dot in LaTeX
a \cdot b\cdot, \ldots, \cdots, \vdots, \ddots, \dot{x} and \bullet, and which dot fits which context. - Hat in LaTeX
\hat{x}\hat and \widehat accents, hats with subscripts, dotless i and j, and how to print the ^ character itself. - Element of Symbol (∈) in LaTeX
x \in A\in for ∈, \notin for ∉, \ni for ∋, and how ∈ differs from the Greek letter epsilon. - Gradient in LaTeX
\nablaThe nabla symbol \nabla for gradient, divergence and curl, the Laplacian, the gradient as a vector of partials, and grad as an operator name. - Transpose Symbol in LaTeX
A^TA^T, A^\top, A^\intercal and A^\mathsf{T} compared, plus inverse transpose and conjugate transpose. - Indicator Function in LaTeX
\mathbb{1}_{A}The double-struck 1: why \mathbb{1} breaks in pdfLaTeX, \mathds{1} and \mathbbm{1} as fixes, and notation that also works on the web. - Cross Product in LaTeX
\mathbf{a} \times \mathbf{b}\times between vectors, the i, j, k determinant with vmatrix, dotless-i unit vectors and the magnitude formula. - How to Type a Backslash in LaTeX
\backslashThe \ character in text (\textbackslash), in math (\backslash), in code (\verb) and as set minus (\setminus). - Angstrom Symbol in LaTeX
\mathring{A}Å in text (\AA), in formulas (\mathring{A} or \text{\AA}) and as a unit with siunitx (\qty{1.5}{\angstrom}). - Divides and Does Not Divide in LaTeX
a \nmid ba ∣ b with \mid, a ∤ b with \nmid (amssymb), and why | from the keyboard is spaced wrongly. - Accents in LaTeX
\hat{x}\;\bar{x}\;\tilde{x}Text accents (é ü ñ ç å) with \' \" \~ \c \r, math accents (\hat \bar \tilde \dot \vec) and when to just type UTF-8. - Tensor Product in LaTeX
V \otimes W⊗ with \otimes, ⨂ with \bigotimes and its limits, ⊕ with \oplus, and tensor powers V^{\otimes n}. - How to Write an Ampersand in LaTeX
\&Print & with \&; & on its own is the column separator in tables, matrices and aligned equations. - How to Write a Bar in LaTeX
\bar{x}x̄ with \bar, long bars with \overline, and the vertical bar | with \vert or \mid. - Congruent Symbol in LaTeX
\cong≅ with \cong for geometry and isomorphism, ≡ with \equiv and \pmod for modular arithmetic, and \ncong / \not\equiv. - Perpendicular Symbol in LaTeX
\perp⊥ with \perp, ∥ with \parallel, \not\perp and \nparallel, and the orthogonal complement W^\perp. - How to Write Mod in LaTeX
a \bmod na mod b with \bmod, (mod n) after a congruence with \pmod, and the \mod and \pod variants. - Therefore Symbol in LaTeX
\therefore∴ with \therefore, ∵ with \because, both from amssymb, plus \implies for logical steps. - Checkmark in LaTeX
\checkmark✓ with \checkmark, ✓ and ✗ from pifont (\ding{51}, \ding{55}), and checklists in tables and lists.
Math structures and environments
Fractions, scripts, roots, sums, integrals, matrices, cases and aligned equations: how to build the formula around the symbols.
- Matrix in LaTeX
\begin{matrix} a & b \\ c & d \end{matrix}pmatrix, bmatrix, vmatrix and friends: rows with \\, columns with &, plus 2x2, 3x3, augmented and n×n examples. - How to Make a LaTeX Table
\begin{tabular}{l c r} … \end{tabular}The tabular environment: column alignment, borders, merged cells, booktabs rules, captions, plus array for tables inside math. - How to Write a Fraction in LaTeX
\frac{a}{b}\frac{numerator}{denominator}, \dfrac and \tfrac for size, continued fractions with \cfrac, slanted fractions and the a/b form. - How to Write a Subscript in LaTeX
x_1_ for subscripts and ^ for superscripts, braces for more than one character, text indices, both at once and scripts in text mode. - Piecewise Function in LaTeX
\begin{cases} a & \text{if } x > 0 \\ b & \text{otherwise} \end{cases}The cases environment: one line per piece, & before each condition, \text for words, dcases and rcases variants. - How to Write a Multiline Equation in LaTeX
\begin{align} a &= b \\ c &= d \end{align}align and align* for aligned lines, aligned inside $$ … $$, split, gather and multline for long formulas and systems of equations. - Integral in LaTeX
\int f(x) \, dx\int with lower and upper limits, \iint and \iiint, contour integrals, evaluation bars and the thin space before dx. - Absolute Value in LaTeX
|x||x|, \lvert x \rvert, bars that stretch with \left| \right|, double bars for norms, and an \abs macro with mathtools. - Summation in LaTeX
\sum_{i=1}^{n} a_i\sum with limits, why inline sums put the limits beside the sigma, \limits and \displaystyle, and multi-line conditions with \substack. - Partial Derivative in LaTeX
\partialThe ∂ symbol (\partial) inside \frac for first, second and mixed partials, subscript notation, evaluation bars and shortcut macros. - Vector in LaTeX
\vec{v}\vec{v} and \overrightarrow{AB}, bold vectors with \mathbf and \boldsymbol, unit vectors, column and row vectors, and norms. - Limit in LaTeX
\lim_{x \to a} f(x)\lim_{x \to a}, one-sided limits, limits at infinity, limsup and liminf, and how to keep the condition under lim in running text. - Floor Function in LaTeX
\lfloor x \rfloor\lfloor x \rfloor and \lceil x \rceil, stretching them with \left and \right, and \floor / \ceil macros with mathtools. - Square Root in LaTeX
\sqrt{x}\sqrt{x} for square roots, \sqrt[n]{x} for cube and nth roots, nested radicals, and \vphantom to even out root heights. - Derivative in LaTeX
\frac{dy}{dx}dy/dx with \frac, f'(x) and f''(x), nth derivatives, \dot and \ddot for time derivatives, and what to do about \dv. - Binomial Coefficients (Choose) in LaTeX
\binom{n}{k}\binom{n}{k} for n choose k, the older {n \choose k}, \dbinom and \tbinom sizes, and multinomial and combination notation. - How to Write a Norm in LaTeX
\lVert x \rVert‖x‖ with \lVert … \rVert or \|, auto-sizing with \left/\right, subscripted norms and a reusable \norm macro. - How to Add Space in LaTeX Equations
a \quad bThe math spacing commands from \! to \qquad with their widths, \hspace, \text{ } and \phantom. - Brackets in LaTeX
\left( \frac{a}{b} \right)Round, square, curly and angle brackets, and how to size them with \left … \right, \middle and \big … \Bigg.
Text and formatting
Bold, italics, underline, lists, links and math mode: the commands for the text around your equations.
- Bullet Points in LaTeX
\begin{itemize} \item First \item Second \end{itemize}itemize for bullet points, enumerate for numbered lists, description for terms, plus nesting, custom bullets and spacing. - How to Bold in LaTeX
\textbf{bold text}\textbf for bold text, \mathbf for upright bold math, \boldsymbol or \bm for bold italic and Greek symbols. - LaTeX Underline: Text and Math
\underline{text}\underline for short text and formulas, ulem's \uline and soul's \ul for text that breaks across lines, plus double and wavy lines. - Italics in LaTeX
\textit{italic text}\textit and \emph for italic text, \itshape for longer passages, and upright vs italic letters in math mode. - How to Add a Hyperlink in LaTeX
\href{https://example.com}{link text}hyperref's \href for linked text, \url for printed addresses, internal links to sections and figures, and link colors. - Math Mode in LaTeX
\( a^2 + b^2 \)Inline math with $…$ or \(…\), displayed math with \[…\], numbered equation environments, references and \text inside formulas. - LaTeX Cheat Sheet
\frac{a}{b},\ x^2,\ \sumThe commands people look up most, on one page: document, text, lists, math basics and symbols, each with a preview. - How to Use LaTeX
\LaTeXFrom zero to a compiled document: where to write, the minimal file, text, math, lists, tables, images and reading errors. - How to Start a New Page in LaTeX
\text{p. } 1 \to \text{p. } 2\newpage, \clearpage, \cleardoublepage and \pagebreak compared, floats, blank pages and breaks inside long equations. - How to Insert an Image in LaTeX
\text{Figure 1: } y = x^2graphicx, \includegraphics with width, figure placement, captions, labels and side-by-side images. - How to Write Code in LaTeX
\verb|print(x)|Inline code with \verb, code blocks with verbatim, listings and minted, line numbers, colors and code from files. - How to Cite in LaTeX
[1]\ [2, 3]A .bib file, \cite{key}, BibTeX or biblatex, citation styles, citing websites and fixing [?]. - How to Start a New Line in LaTeX
a \\ b\\ and \newline for a line break, a blank line for a new paragraph, \\[length] for extra space, and breaks inside equations. - How to Add a Footnote in LaTeX
\text{word}^{1}\footnote basics, symbol marks, footnotes in tables and minipages, and notes on equations. - How to Change Text Color in LaTeX
\textcolor{red}{x}xcolor's \textcolor and \color, named and custom colors, highlighted boxes and colored parts of equations. - How to Change Font Size in LaTeX
{\large A}\,{\Large A}\,{\Huge A}Document size (10/11/12pt), the ten size commands with point values, exact sizes with \fontsize, and math sizes. - Quotation Marks in LaTeX
\text{“quote”}Opening and closing quotes with backquotes and apostrophes, csquotes \enquote, block quotations and quotes in math.
Write it, or convert it from a picture
Test any command in the free equation editor, or paste a screenshot of a formula and get its LaTeX.