← ClaudeAtlas

markdown-to-pdflisted

Use when exporting Markdown reports to PDF, especially when Mermaid diagrams render blank, oversized, lose color, tables overflow, a TOC or PDF outline is needed, or Chrome/Puppeteer adds unwanted page headers and footers.
quickcall-dev/skills · ★ 1 · Data & Documents · score 78
Install: claude install-skill quickcall-dev/skills
# Rendering Markdown PDF ## Overview Markdown to PDF with Mermaid is a visual export task, not a plain file conversion. Render diagrams, style them consistently, disable print headers, then verify the PDF pages visually. ## When to Use Use for: - Markdown docs containing Mermaid diagrams - PDF export where diagrams are blank, oversized, clipped, or colorless - Chrome/Puppeteer exports with unwanted page headers/footers - report/document exports where tables and diagrams must stay readable Do not use for plain text Markdown without diagrams. ## Core Workflow 1. **Preflight** - Count Mermaid blocks in source. - Create a temp build dir. - Never edit source Markdown. 2. **Render Mermaid explicitly** - Use `mmdc` or browser-side Mermaid. - Apply a theme config with colors, font, and white background. - Set Mermaid `flowchart.htmlLabels=false` for PDF exports. Chrome PDF can drop `foreignObject` labels, causing blank boxes. - Wrap each diagram in a controlled container. 3. **Build HTML with print CSS** - Set `@page { margin: 0.55in; }`. - Add a designed Table of Contents near the top for long documents. Generate it from headings in the temporary build, not by editing source Markdown. Links are preferred when supported. - Add PDF outline/bookmarks for Preview/sidebar navigation. This is separate from visible TOC content. Use document headings, usually title + major sections. - Do not leave the TOC as raw Markdown bullets with awkward hyperli