Convert Markdown to PDF on your Macand keep the diagrams.
Open the .md file in DotMD and choose File → Export as PDF…. The PDF looks like the rendered page, with Mermaid diagrams and formulas drawn.
macOS 14 or later. Reading is free; editing and reviews are one payment.
Quick answer
In DotMD, open the Markdown file and choose File → Export as PDF…. The PDF is paginated and looks like the rendered page in the light theme, with tables, code, Mermaid diagrams and KaTeX formulas drawn. Export, Copy as Rich Text and printing are part of DotMD Editor ($14.99 once); reading is free.
How to convert a .md file to PDF on a Mac
-
Open the file
Press ⌘O and choose the .md file, or drag it onto DotMD.
-
Choose Export as PDF…
Choose File → Export as PDF…, or use the ⇪ menu in the reading toolbar. DotMD suggests the file's name and folder; save the PDF.
-
Check the result
The PDF is split into pages and looks like the page in the light theme, whichever theme you read in. Diagrams and formulas are drawn before the PDF is made.
What ends up in the PDF
Headings, lists, tables, code with syntax colours, callouts, the properties block, Mermaid diagrams and KaTeX formulas all appear. To write them with a live preview first, see the editor and Mermaid diagrams.
HTML, rich text and print
- Export as HTML… saves one HTML file with the page's styles and code colours. Diagrams and formulas load their scripts from the internet when the file is opened.
- Copy as Rich Text copies formatted text to paste into Pages, Mail, Notes or Google Docs.
- Copy HTML Source copies the HTML of the content alone, for a blog or a CMS.
- Print… (⌘P) opens the system print dialog with the same page as the PDF.
What is free and what is not
Reading Markdown is free. Export, Copy as Rich Text, Copy HTML Source and printing are part of DotMD Editor, $14.99 once; DotMD Reviewer ($39.99 once, or $24.99 for Editor owners) includes them. The version you download from getdotmd.com has a free 3-day trial of all features.
Questions about Markdown to PDF on a Mac
How do I convert Markdown to PDF on a Mac?
Open the file in DotMD and choose File → Export as PDF…, then save the PDF.
Does the PDF include Mermaid diagrams and math?
Yes. DotMD draws the diagrams and formulas before it makes the PDF, and the PDF has the page's tables, code and callouts too.
Is exporting to PDF free?
Reading is free. Export as PDF is part of DotMD Editor, $14.99 once. The version from getdotmd.com has a free 3-day trial of all features.
Can I paste Markdown into Pages or Google Docs instead?
Yes. Copy as Rich Text copies the formatted page, ready to paste into Pages, Mail, Notes or Google Docs.