Repository avatar
Other Tools
v2.0.1
active

markdown-pdf-export

io.github.matinfo/markdown-pdf-export

Export Markdown files to PDF with Chromium: highlighting, KaTeX math, TOC, headers/footers.

Documentation

Markdown PDF Export

npm version npm downloads CI License: MIT

Turn Markdown files into clean PDFs from VS Code, Zed, Cursor, Claude or any AI assistant, or from the command line.

Full documentation: https://matinfo.github.io/markdown-pdf-export/

Studio: page style, fonts, paper, header and footer on the left, a live preview of the PDF on the right

Get started

You need:

  • Node.js 20 or newer (it comes with npx).
  • Google Chrome or Microsoft Edge. No Chromium browser? Run npx -y markdown-pdf-export install-browser once (about 200 MB).

Then run this line in a terminal:

npx -y markdown-pdf-export studio

Studio opens in your browser. Pick a page style, fonts, paper size, header and footer, and watch the real PDF update as you go. Click Save, then Add to my editor, and you are ready to export.

There is nothing to install first: npx downloads the package on first use and reuses it after. Prefer the terminal? Run npx -y markdown-pdf-export with no arguments for a small menu.

More: Get started · Studio · Design online, no install

Export a file

WhereHow
Your editorRun the task Markdown: Export to PDF on the open file
AI assistantAsk: "Export this file to PDF"
Terminalnpx -y markdown-pdf-export report.md

The PDF is saved next to the Markdown file. To add the task or the assistant tool by hand, run npx -y markdown-pdf-export setup, or see Editors.

What you get

  • Five page styles: Clean, Report, Academic, Compact and Technical.
  • Headers and footers with the title, page numbers, the date and your logo.
  • Coloured code blocks, with a choice of colour themes.
  • Maths with KaTeX: $inline$ and $$display$$.
  • A contents list from a [[toc]] marker, with links to each heading.
  • Settings for one document in its front matter.
  • One settings file used by every editor, the assistant and the terminal.

Go further

Help

Check the browser and your settings in one step:

npx -y markdown-pdf-export doctor

You can also ask the assistant: "Run doctor_markdown_pdf". For common problems, see Help.

Contributing

See CONTRIBUTING.md for development setup, tests and how the project is built.

Licence

MIT. See LICENSE.

NPM
markdown-pdf-export
Install Command
npm install markdown-pdf-export