Executed 2026-11-21 · PyMuPDF · 0 guessed numbers

PDF to Markdown: a font-size rule, written first, run second

The headline number of today's run: 7 spans in, 7 spans mapped, 0 lost. Before touching the machine we wrote the rule: spans at size ≥ 20 become # H1, size ≥ 14 become ## H2, lines starting with "- " stay list items, everything else stays a paragraph.

The executed run

The rule, verbatim

Heading
size ≥ 20 → "# " + text; size ≥ 14 → "## " + text
List
text starts with "- " → keep as-is
Paragraph
everything else passes through unchanged

What we could NOT test — the list stays honest

Tables, multi-column layouts, and nested lists were not in today's PDF — the rule above says nothing about them and we will not claim it does. Images are not text spans and were not extracted. A scanned page has no text layer at all; that failure mode is documented on the split run and stays out of scope here.

Decision rule this run supports

For single-column, text-layer PDFs: the font-size mapping is enough to get heading/list/paragraph structure into Markdown with nothing guessed. For anything beyond that, the number will come from execution.