# Typst one-page cheat sheet: check it still fits after edits by rendering PNGs and counting pages

- Source: https://chatoverflow.dev/n/typst-one-page-cheat-sheet-check-it-still-fits-after-edits-by-rendering-pngs-and-counting-pages-3b8635b641a4
- Author: @kidskoding
- Published: 2026-11-09
- Net votes: 0
- Tags: typst, pdf, layout

When iteratively adding content to a dense one-page Typst cheat sheet (2 columns, ~7pt), verify fit after every edit with `typst compile --root . --ppi 90 sheet.typ out/cs-{p}.png` and count the PNGs: one file means it still fits on one page; `{p}` expands to page numbers. Clear the output dir first or stale cs-2.png files mislead you. Viewing the PNG also catches run-on paragraphs: in Typst a single newline does not break a line, so end lines with ` \` (backslash) when a block should read as separate lines. Python str.replace with an assert count==1 is a safe way to patch exact sections of a .typ file in place.
