A compact LaTeX cheatsheet template for clean, multi-column exam notes.
It can be compiled in any LaTeX environment that supports XeLaTeX, such as TeX Live, MiKTeX, MacTeX, VS Code with LaTeX Workshop, TeXstudio, or Overleaf.
stardust_cheatsheet_template/
├── main.tex # Main file. Main content file.
├── stardust-cheatsheet.sty # Style file. Controls layout, colors, boxes, and commands.
├── figs/ # Optional figures used by the example.
│ └── avatar.jpg # Square avatar placeholder for \colimage.
├── preview.pdf # Example output.
└── README.md # Usage guide.
Install a LaTeX distribution first:
- Windows: MiKTeX or TeX Live
- macOS: MacTeX
- Linux: TeX Live
Then compile with XeLaTeX:
xelatex main.texA more convenient command is:
latexmk -xelatex main.texThis automatically runs XeLaTeX enough times to resolve references and layout updates.
- Upload all files to a new Overleaf project.
- Open
main.tex. - Set the compiler to XeLaTeX.
- Recompile.
Most users only need to edit main.tex.
The style and layout are already defined in stardust-cheatsheet.sty, so you do not need to touch the style file unless you want to redesign the template.
\cheatsection{Big section}
\topic{Topic}
\subtopic{Subtopic}
\Definition{Term}{Explanation}
\Formula{Formula name}{a^2+b^2=c^2}
\Remember{Important reminder}
\Warning{Common mistake}
\Example{Example name}{Example content}
\begin{compactitem} ... \end{compactitem}
\begin{compactenum} ... \end{compactenum}
\begin{cheatbox}{Box title} ... \end{cheatbox}
\begin{cheattablex}{lY} ... \end{cheattablex}
\colimage{figs/avatar.jpg}For \Formula{Name}{...}, write the formula directly without outer $...$; the template will enter math mode automatically.
The template also includes small inline helpers: \term{...}, \key{...}, \code{...}, \hl{...}, and math alphabet shortcuts \mc{F}, \mbb{R}, \mscr{L}, \mfrak{g}.
At the beginning of main.tex, the title area is optional:
\cheattitle{Selected Topics in Modern Mathematical Methods}
\cheatsubtitle{Disintegration · LAN · Martingales · Variational Analysis}
\cheatauthor{Your Name}
\cheatdate{A4 Landscape}If you comment out all four lines, the PDF will not show a title bar. This is useful when every bit of vertical space matters.
The number of columns and font size are also optional:
\cheatcolumns{5} % use 4 if the text feels too dense
\cheatfont{5.5}{6.1} % {font size}{line spacing}; use {6}{6.7} for readabilityIf these two lines are commented out, the template will use the default setting: 5 columns, font size 5.5, line spacing 6.1.
Suggested compact setting:
\cheatcolumns{5}
\cheatfont{5.5}{6.1}Suggested readable setting:
\cheatcolumns{4}
\cheatfont{6}{6.7}The included example demonstrates most available layout commands in one filled A4 landscape page, including dense theorem statements, proof patterns, compact tables, Chinese-English mixed text, math alphabet commands, and a square avatar image.
The color palette uses low-saturation blue-green, sand, sage, and plum tones. It is designed to look softer on screen and remain printable.
Tables should usually be placed inside cheatbox with \tightcenter{...}. The template avoids negative vertical spacing around tables, so table rules should not overlap the following section. For wide tables, use the cheattablex helper described below.
Put figures in a folder named figs, then write:
\colimage{figs/avatar.jpg}The demo uses a square figs/avatar.jpg. You can replace this file with your own square avatar without editing the LaTeX command. For best results, use a 1:1 image such as 512×512 or 1024×1024.
Write the content first, then tune the density.
If the sheet looks too crowded, reduce the column number or increase the font size.
If a formula is too long, split it into multiple shorter lines instead of forcing it into one line.
This template is designed for XeLaTeX.
Using pdfLaTeX may cause font or CJK-related issues, especially when the document contains Chinese text.
The template supports Chinese by default through ctex and the Fandol font set, so the following content can be written directly in main.tex:
\cheatsection{随机过程}
\Definition{鞅}{若 $\mathbb E[M_t\mid\mathcal F_s]=M_s$,则 $(M_t)$ 是关于 $(\mathcal F_t)$ 的鞅。}If you want to use a local Chinese font, add this near the top of main.tex:
\cheatcjkfont{Noto Serif CJK SC}If the font is not installed, the template will keep the default CJK font and issue a warning instead of failing immediately.
For very narrow columns, ordinary tabular may become too wide. You can use cheattablex with the flexible Y column:
\begin{cheattablex}{lY}
\toprule
Term & Explanation \\
\midrule
Contiguity & Transfers vanishing-probability events between local experiments. \\
\bottomrule
\end{cheattablex}