md-to-pdf
Markdown to PDF
Converts markdown files to beautifully formatted PDFs using crossnote (same engine as mcp-printer).
Features
- Mermaid diagrams — Flowcharts, sequence diagrams, etc.
- Math equations — KaTeX rendering
- Syntax highlighting — GitHub theme
- Page numbers — Automatic footer with page X / Y
- GitHub-light theme — Clean, print-optimized styling
Usage
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs input.md # Creates input.pdf
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs input.md output.pdf # Custom output name
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs input.md --open # Open after creating
Options
| Flag | Description |
|---|---|
--open, -O |
Open the PDF after creating |
-o FILE |
Specify output filename |
Requirements
- Chrome or Chromium — Auto-detected on macOS/Linux
- Node.js — For running the script
- Dependencies — Run
npm installin the skill directory once
How It Works
- Uses crossnote (Markdown Preview Enhanced engine)
- Injects page numbering config into front-matter
- Renders via Chrome/Puppeteer
- Supports Mermaid, math, code highlighting out of the box
Examples
# Quick conversion
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs README.md
# Spec document for sharing
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs spec.md spec-v2.pdf --open
# Multiple files
for f in docs/*.md; do ~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs "$f"; done
Mermaid Example
Include in your markdown:
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Do something]
B -->|No| D[Do something else]
```
The diagram will render as a graphic in the PDF.
Printing
If the user wants to print the PDF, use the /print skill after generating.
Workflow decision:
| User intent | Action |
|---|---|
| "Convert to PDF" | Keep the PDF |
| "Print this markdown" | Generate PDF → print with /print → delete PDF |
| "Create a PDF and print it" | Keep the PDF, also print |
When printing is the goal (not the PDF itself), delete the PDF after printing:
# Generate, print, cleanup
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs doc.md
~/.claude/skills/print/scripts/print doc.pdf
rm doc.pdf
The /print skill handles double-sided and b&w defaults automatically.
Alias (Optional)
Add to your shell profile:
alias md-to-pdf='~/.claude/skills/md-to-pdf/scripts/md-to-pdf.cjs'
More from steveclarke/dotfiles
bruno-endpoint-creation
Create Bruno REST API endpoint configurations with proper authentication, environment setup, and documentation. Use when setting up API testing with Bruno, creating new endpoints, or configuring collection-level authentication. Triggers on "create Bruno endpoint", "Bruno API testing", "set up Bruno collection".
68monthly-invoice-summary
Generate client-friendly monthly invoice summaries by analyzing Git commits and time sheet notes. Synthesizes technical work into business-focused bullet points suitable for client invoicing. Use when preparing monthly billing or project status reports. Triggers on "invoice summary", "monthly billing", "summarize work for client".
47ruby-cli
Build and maintain Ruby CLI tools using Thor and Zeitwerk. Use when creating new Ruby CLI gems, adding commands, editing CLI code, refactoring, or enhancing existing CLI tools. Triggers on "Ruby CLI", "Thor CLI", "command-line tool in Ruby", or when working on files in a Thor/Zeitwerk CLI codebase.
47humanizer
|
47bash-script-writing
Write clean, modular, production-ready bash scripts with proper error handling and maintainable structure. Use when creating new shell scripts, refactoring existing bash code, or when user asks for bash/shell scripting help with terms like "write a script", "bash script", "shell script", or "automate with bash".
46feature-vision
Creates vision documents through focused discovery phases, building each section systematically. Produces a vision.md covering problem statement, proposed solution, user experience, and scope boundaries following the established feature development process.
46