A LaTeX template for compact three-column cheat sheets on landscape A4
Preview · Quick start · Usage · PDF
- 📐 Three columns on landscape A4 with 0.5 cm margins; the number of columns is an option
- 🎨 Color-coded heading boxes for sections, subsections and subsubsections
- 🧮 Math macros for boxed formulas, matrices, norms, absolute values, floor and ceiling
- 📋 A
symbolstable that fills the column width, for symbol–meaning lists - ⚙️ Compiles with pdfLaTeX (recommended) and LuaLaTeX, locally or on Overleaf
- 🤖 GitHub Actions builds the PDF on every push and attaches it to releases
Note
Created in 2020 on Overleaf and updated in 2026 (v2): the layout moved into cheatsheet.sty, the heading boxes
fit the column width, lists and tables are compact, and the deprecated commath package is replaced by mathtools.
The example content is a German summary of common math notation.
| Path | Content |
|---|---|
cheatsheet.sty |
Layout, colors, heading boxes and math macros |
cheatsheet.tex |
Example cheat sheet (math notation, in German) |
.latexmkrc |
latexmk settings (pdfLaTeX, cheatsheet.tex as default file) |
.github/workflows/build.yml |
Builds the PDF and attaches it to releases |
docs/preview.png |
Rendered example, shown above |
- Download
cheatsheet.styandcheatsheet.tex(or the repository as ZIP). - In Overleaf, choose New Project → Upload Project and upload both files (or the ZIP).
- Keep the compiler at pdfLaTeX and edit
cheatsheet.tex.
You need a TeX distribution with latexmk, e.g. TeX Live or
MacTeX. A full installation contains every package the template uses.
-
Clone the repository:
git clone git@github.com:HuberNicolas/cheatsheet-template.git
-
Build the PDF (
.latexmkrcselects pdfLaTeX andcheatsheet.tex):latexmk
-
Rebuild on every save while you edit:
latexmk -pvc
-
Remove the build files:
latexmk -c
Without a local TeX installation, build with the official TeX Live image (several GB):
docker run --rm -v "$PWD":/w -w /w texlive/texlive:latest latexmkA minimal cheat sheet:
\documentclass[fontsize=10pt]{scrartcl}
\usepackage[columns=3]{cheatsheet}
\usepackage[english]{babel}
\title{Linear Algebra}
\author{Your Name}
\date{\today}
\begin{document}
\begin{cheatsheet}
\maketitle
\section{Matrices}
\subsection{Determinant}
\eqbox{\det\matp{a & b \\ c & d} = ad - bc}
\subsubsection{Symbols}
\begin{symbols}
A^T & transpose \\
A^{-1} & inverse \\
\end{symbols}
\end{cheatsheet}
\end{document}| Command / environment | Result |
|---|---|
\begin{cheatsheet} … \end{cheatsheet} |
Multi-column body; columns are filled one after another |
\maketitle |
Compact title banner at the top of the first column |
\section, \subsection, \subsubsection |
Heading boxes in three shades of blue, unnumbered |
\begin{symbols} … \end{symbols} |
Two-column table: symbol (math mode) and meaning (text) |
\eqbox{…} |
Formula in a colored box (display style) |
\matp{…}, \matb{…}, \mat{…} |
Matrix with round, square or no brackets |
\abs{x}, \norm{x}, \floor{x}, \ceil{x} |
Paired delimiters; the starred form (\abs*{…}) scales |
\vect{v} |
Bold vector |
\dif |
Upright d for integrals: \int f(x) \dif x |
\defn, \bem |
Markers for definitions and remarks (Def.:, Bem.:) |
| What | Where |
|---|---|
| Number of columns | Package option: \usepackage[columns=4]{cheatsheet} |
| Font size | Class option: \documentclass[fontsize=9pt]{scrartcl} |
| Colors | \definecolor{cs-…} lines in cheatsheet.sty, or redefine them after loading the package |
| Margins, paper | geometry line in cheatsheet.sty |
| Heading spacing | \RedeclareSectionCommand lines in cheatsheet.sty |
| Language | babel option in your .tex file (ngerman, english, …) |
build.yml compiles cheatsheet.tex with
xu-cheng/latex-action on every push and pull request and uploads the PDF
as a workflow artifact. Pushing a tag v* also attaches the PDF to a GitHub release.
MIT © 2020 Nicolas Huber.
Nicolas Huber · GitHub
