LaTeX Cheat Sheet
The essentials: a document is \documentclass{article} plus \begin{document} … \end{document}; \section{} makes headings; \textbf{} and \textit{} style text; math goes between $ … $ inline or \[ … \] on its own line; ^ and _ make superscripts and subscripts; \frac{a}{b} is a fraction. The table below has the rest.
Most-used commands
- Text mode, no math preview
\documentclass{article}First line of every document (article, report, book, beamer).
- Text mode, no math preview
\usepackage{amsmath}Load a package in the preamble; amsmath for most math.
- Text mode, no math preview
\section{Title} \subsection{Title}Numbered headings;
\section*without a number. - Text mode, no math preview
\textbf{bold} \textit{italic} \underline{text}Bold, italic, underlined text.
- Text mode, no math preview
\begin{itemize} \item ... \end{itemize}Bullet list; enumerate for numbers.
- Text mode, no math preview
\\ and a blank lineLine break; new paragraph.
- Text mode, no math preview
$x^2$ and \[ x^2 \]Inline and display math.
x^{2}\ x_{i}Superscript and subscript.
\frac{a}{b}Fraction.
\sqrt{x}\ \sqrt[3]{x}Square and nth root.
\sum_{i=1}^{n}\ \prod_{i=1}^{n}Sum and product with limits.
\int_{a}^{b} f(x)\,dxIntegral with a thin space before dx.
\lim_{x \to 0}Limit.
\alpha\ \beta\ \pi\ \theta\ \OmegaGreek letters; capitalize the name for capitals.
\le\ \ge\ \neq\ \approx\ \equivRelations.
\in\ \subset\ \cup\ \cap\ \emptysetSet symbols.
\to\ \Rightarrow\ \iffArrows and logic.
\infty\ \partial\ \nabla\ \pmCommon symbols.
\begin{pmatrix} a & b \\ c & d \end{pmatrix}Matrix with parentheses (bmatrix for brackets).
\left( \frac{a}{b} \right)Brackets sized to the content.
\mathbb{R}\ \mathcal{F}\ \mathbf{v}Blackboard, calligraphic, bold letters.
\text{if } x > 0Normal text inside math.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
LaTeX cheat sheet examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Quadratic formula
LaTeXx = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}Gaussian integral
LaTeX\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}Sum of a series
LaTeX\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}Piecewise function
LaTeXf(x) = \begin{cases} x^2 & x \ge 0 \\ -x & x < 0 \end{cases}Matrix
LaTeXA = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}Aligned steps
LaTeX\begin{aligned} (a+b)^2 &= a^2 + 2ab + b^2 \\ (a-b)^2 &= a^2 - 2ab + b^2 \end{aligned}
In a LaTeX document
These commands work in the text of a .tex document (Overleaf, TeX Live, MiKTeX), not inside math. The box on the right shows what the compiled PDF looks like.
Minimal document
LaTeX\documentclass{article} \usepackage{amsmath} \title{My Notes} \author{Your Name} \begin{document} \maketitle \section{Introduction} Inline math $a^2 + b^2 = c^2$ and a display: \[ E = mc^2 \] \end{document}
How to use this sheet
Each line of the table is the short form; every topic has its own page in the LaTeX reference with variants, mistakes and how it behaves in Overleaf, MathJax and Word. Paste any formula from the table into the editor on this page to see it rendered.
To print the sheet, use your browser's print command; the table and examples print in order.
The five rules that prevent most errors
Math commands only work in math mode. Braces group: x^{10}, not x^10. Special characters # $ % & _ { } ~ ^ \ must be escaped in text. Every \begin{…} needs its \end{…}. Packages go in the preamble, before \begin{document}.
Common mistakes
Without braces only the first character is raised.
Instead ofx^10Writex^{10}%starts a comment; the rest of the line disappears.Instead of50% of casesWrite50\% of casesMath commands outside math mode stop with "Missing $ inserted".
Instead of\alpha + \beta (in text)Write$\alpha + \beta$
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
Everything on this sheet compiles in Overleaf with
\usepackage{amsmath}and\usepackage{amssymb}in the preamble.MathJax and KaTeX
The math rows work in MathJax and KaTeX (Notion, Obsidian, Jupyter, GitHub). Document commands such as
\sectionand lists do not.Microsoft Word
Word for Microsoft 365 accepts most math rows in LaTeX input mode (Equation › LaTeX). Copy for Word in the editor here pastes them as editable equations.
Already have the whole document?
Move complete papers between PDF, Word and LaTeX without retyping; every equation stays editable.
- PDF to LaTeXTurn a paper or textbook PDF into a .tex project with every equation.10 credits per page
- Word to LaTeXA .docx with Word equations becomes LaTeX ready for Overleaf.10 credits per page
- LaTeX to WordA whole .tex file becomes a .docx whose equations open in Word.5 credits per file
Single printed formulas are free: 3 a day without an account, 6 with a free account. New accounts get 30 credits to try handwriting, pages and documents; failed conversions return their credits. See plans and credit prices.
LaTeX cheat sheet in LaTeX: questions
- What are the most important LaTeX commands?
\documentclass,\usepackage,\section,\textbf,itemize, and in math^,_,\frac,\sqrt,\sumand\int.- Is there a printable LaTeX cheat sheet?
- Print this page from your browser; the table and examples print in order.
- Where can I find all LaTeX symbols?
- The LaTeX symbols page lists relations, operators, arrows, Greek letters and more with their commands.
Related LaTeX reference
- LaTeX SymbolsThe most-used math symbols in one table: relations, operators, sets, logic, arrows, Greek letters and accents, each with its command.
- How to Use LaTeXFrom zero to a compiled document: where to write, the minimal file, text, math, lists, tables, images and reading errors.
- Math Mode in LaTeXInline math with $…$ or \(…\), displayed math with \[…\], numbered equation environments, references and \text inside formulas.
- How to Add a Hyperlink in LaTeXhyperref's \href for linked text, \url for printed addresses, internal links to sections and figures, and link colors.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX