Back to tool

How to Make a Good-Looking PDF from Markdown

Turn Markdown into a tidy, print-ready PDF with highlighted code. Practical tips on styling and print page breaks.

Consistent styling: define uniform fonts and spacing for headings, paragraphs, lists, tables and blockquotes in CSS — only then does the exported PDF look tidy.

Code highlighting: apply syntax highlighting to fenced code blocks for much better readability. This tool ships with GitHub-style highlighting built in.

Page breaks: keep headings with the content that follows, and avoid breaking inside code blocks, tables or images, so nothing gets cut in half across pages.

In the browser print dialog choose "Save as PDF" and set the margins (1.5–2 cm works well) to get a clean, selectable PDF.

Related reading