Turn a markdown file into a publication-quality PDF — cover page, clickable table of contents with page numbers, running headers, page numbers, curly quotes, syntax-highlighted code, optional DRAFT watermark. Use when asked to "make a PDF", "export to PDF", "turn this markdown into a PDF", or "generate a document".
Ships in sejas-ai-code-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
uv run --quiet --with weasyprint --with markdown --with pygments \
~/.claude/skills/make-pdf/md2pdf.py INPUT.md
Writes INPUT.pdf next to the input and prints the path. Then open it, or read it
back with the Read tool to check the result before handing it over.
| Flag | Effect |
|---|---|
-o OUT.pdf | Output path (default: input path with .pdf) |
--title / --subtitle / --author | Override the cover; otherwise taken from YAML front matter, then the first # H1, then the filename |
--draft | Diagonal DRAFT watermark on every page |
--no-cover | Skip the cover page |
--no-toc | Skip the table of contents |
Front matter (title, subtitle/description, author, date) is consumed for the
cover and stripped from the body. A leading # H1 that repeats the title is dropped so
the cover doesn't say it twice.
uv and Homebrew pango. WeasyPrint links against pango at runtime; without
it the import fails with a libgobject/libpango load error — fix with brew install pango.
uv run --with builds a cached ephemeral env, so nothing is installed globally and the
first run takes ~10s, later ones ~2s.counter(page), and
the TOC's page numbers are @page margin boxes and target-counter(). Chrome ignores
both, so a Chrome-based pipeline silently drops exactly the features that make the
output look printed.STYLESHEET string at the top of md2pdf.py. For a
different look, edit it there — there is no theme system and no config file.For a note out of the Obsidian vault, wikilinks ([[slug]]) pass through as literal text —
strip or expand them first if the PDF is going to someone outside the vault.
What SKILL.md sets; muted values are Claude Code's defaults
/sejas-ai-code-skills:make-pdffrom sejas-ai-code-skills
sejas-ai-code-skills@cascade-code-general-misc-3 is listed by joshuarweaver/cascade-code-general-misc-3 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin sejas-ai-code-skills40 skills in this plugin
/ai-prsList all open PRs targeting the Studio AI command with draft status, approval state, and requested reviewers/ai-radarUse when Antonio wants to catch up on frontier AI — "what's new in AI", "AI radar", "what is karpathy working on", "AI trends", "research digest", "what should I learn next", "where to invest learning time", or /ai-radar./blog-postThis skill should be used when the user asks to "write a blog post", "draft a blog post", "create a blog post", "write an article about", or wants to produce a markdown blog post on any topic. Outputs to ~/claude.nosync/posts/.