Markdown to PDF

Converting Markdown to professional PDFs using Pandoc, WeasyPrint, ReportLab, and related tools

492 stars 68 forksDocuments & Office Files

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add cosmicstack-labs/mercury-agent-skills --skill markdown-to-pdf
Manual install
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/pdf-generation/markdown-to-pdf ~/.claude/skills/markdown-to-pdf

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Markdown to PDF Conversion

Convert Markdown documents into polished, production-ready PDFs. This skill covers the major toolchains — Pandoc, WeasyPrint, ReportLab — plus CSS print styling, template systems, and batch conversion workflows.

---

## Toolchain Overview

| Tool | Approach | Best For | Output Quality |
|------|----------|----------|----------------|
| **Pandoc** | Markdown → PDF via LaTeX/Context/Wkhtmltopdf | Books, papers, reports | High |
| **WeasyPrint** | Markdown → HTML → PDF via CSS print | Web-like documents, branded PDFs | High |
| **ReportLab** | Programmatic PDF generation via Python | Dynamic, data-driven PDFs | Very High |
| **md-to-pdf** | Node.js CLI for quick markdown → PDF | Simple documents, quick output | Medium |
| **Puppeteer/Playwright** | Markdown → HTML → Headless browser → PDF | Pixel-perfect web-to-PDF | Very High |

---

## 1. Pandoc Workflows

Pandoc is the Swiss Army knife of document conversion. It reads Markdown and outputs PDF via an intermediate engine (default: LaTeX).

### Basic Conversion

```bash
# Simple markdown to PDF (uses pdflatex)
pandoc input.md -o output.pdf

# With metadata file
pandoc input.md --metadata-file=metadata.yaml -o output.pdf

# Specify output engine
pandoc input.md --pdf-engine=xelatex -o output.pdf

# Using wkhtmltopdf instead of LaTeX
pandoc input.md --pdf-engine=wkhtmltopdf -o output.pdf
```

### Advanced Pandoc with Templates
Read the full skill on GitHub

Details

Skill name
markdown-to-pdf
Path
categories/pdf-generation/markdown-to-pdf/SKILL.md
License
MIT
Repo updated
25 August 2026

FAQ

What does the Markdown to PDF skill do?

Converting Markdown to professional PDFs using Pandoc, WeasyPrint, ReportLab, and related tools

How do I install the Markdown to PDF skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill markdown-to-pdf. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Markdown to PDF popular?

It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.

Related skills

Browse the most popular Claude skills, all documents & office files skills, or write your own with the skills generator.