How to export Markdown to a good-looking PDF on the Mac
Checked November 2026 against the official help pages linked below. Coffee isn't affiliated with Obsidian, Typora or iA Writer.
For a quick PDF, open the file in any app that shows Markdown as a formatted page, and use File, then Print, then Save as PDF. For one that looks designed, with real margins, page numbers and a title page, use an editor with PDF templates, or Pandoc if you're happy in Terminal.
What makes a PDF look good
Before picking a tool, know what you're after, because it's a short list:
- Margins wide enough that lines of text aren't too long to read
- Headings that never sit alone at the bottom of a page
- Page numbers, once there's more than a page or two
- Tables and images that fit the page width
- No Markdown left showing, including front matter at the top of the file
Print to PDF
Every Mac can save anything printable as a PDF: File, Print, then the PDF menu at the bottom of the dialog. It's free and takes seconds. What you get depends on how the app you printed from lays out a page, and you usually have little say in that.
Pandoc
Pandoc is free and scriptable, and it's what to use if you make the same kind of document often. The basic command is short:
pandoc notes.md -o notes.pdf
That goes through LaTeX by default, so you need a LaTeX engine installed, and it looks like a LaTeX paper. To style it with CSS instead, go through HTML:
pandoc notes.md -t html --pdf-engine=weasyprint -o notes.pdf
Its manual also lists Typst and others as engines. The results can be excellent, but expect an evening of setup the first time.
Editors with PDF export
Most Markdown editors can do this, and they differ in how much control you have.
| App | PDF options | Control over the look |
|---|---|---|
| Obsidian | Page size, margin preset, landscape, downscale. Desktop only | CSS snippets. Exports always use light styling |
| Typora | Paper size, margins, headers and footers with page numbers | Uses your theme, with custom CSS for print |
| iA Writer | Page size, title page, headers and footers with page numbers | Built-in templates, or your own in HTML, CSS and JavaScript |
| Coffee | A4 or Letter, title page, page numbers always on | Three templates, nothing to customise |
Obsidian's help page doesn't mention page numbers. Community plugins such as Better Export PDF add them.
If you want a look of your own, Typora and iA Writer let you build one and Coffee doesn't.
In Coffee
Press ⌘E, choose a template, and export. There's no styling to do, and that's the whole idea. Here are the three templates:
Four days in May. Stay near the river, walk everywhere, and leave one whole afternoon with no plan.
Alfama is steep and lovely. Baixa is flat and easy. Take the tram at least once, and sit on the left.
☑ Book the flights
☐ Find a place near Alfama
☐ Ask Ana about the tram
- Clean is the default, with centred page numbers.
- Letterhead puts your name from Settings and today's date above a thin rule on the first page.
- Minimal has narrower margins and moves the page number to the corner.
You can add a title page with the note's title, your name and the date. Pages are A4 or Letter. Coffee lays out the PDF itself rather than printing a web view, so it can keep a heading with at least two lines of what follows it. Tables, task lists, quotes, callouts, code blocks and highlights come through, and table columns follow their alignment colons. Footnotes move to the end with superscript numbers, $$ maths blocks are drawn as formulas, and Mermaid flowcharts, pie charts and sequence diagrams are drawn as charts. Front matter is left out, and so are HTML comments, unless they're inside code.
Some limits to know about:
- No custom fonts or CSS. If you need your company's typeface, this isn't the tool.
- Images on the web are left out. Only images stored with the note make it into the PDF.
- Table columns are all the same width. A table with one long column and several short ones won't look its best.
- Answers from the calculator are included beside their lines, unless calculations are off.
- Links are coloured, but they aren't clickable in the PDF. Spell out any address the reader needs.
- Formatting inside table cells isn't applied. Bold or a link in a cell prints as its Markdown, so keep cells plain.
Coffee also exports Word, EPUB, HTML, Markdown and plain text.
Tips that work in any app
- Use one top-level heading. Start the document with a single
#, then use##for sections. Most tools build their layout from this. - Keep tables narrow. If a table has more than five or so columns, it's probably going to be cramped on a portrait page.
- Check images first. Make sure they're stored locally, and at a size that won't print blurry.
- Read the last page. A single line left on its own page is the most common flaw, and cutting a few words usually fixes it.