Use when writing markdown intended for PDF output, creating PDFs from markdown, or printing PDFs. Invoke EARLY when authoring markdown for PDF to prevent mistakes (manual heading numbers, manual ASCII diagrams, inline annotations). Also use for PDF generation with Pandoc/XeLaTeX, section numbering, table of contents, bibliography, landscape/portrait orientation, printing (one-sided, duplex, simplex, lpr), fixing diagrams breaking across pages, code block page breaks, or double numbering issues. Triggers on - markdown for PDF, write document for printing, create printable doc, pandoc, xelatex, print PDF, PDF generation.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/build-pdf-example.shassets/build-pdf.shassets/hide-details-for-pdf.luaassets/table-spacing-template.texreferences/bibliography-citations.mdreferences/core-principles.mdreferences/document-patterns.mdreferences/latex-parameters.mdreferences/markdown-for-pdf.mdreferences/troubleshooting-pandoc.mdreferences/yaml-structure.mdGenerate professional PDF documents from Markdown using Pandoc with the XeLaTeX engine. This skill covers automatic section numbering, table of contents, bibliography management, LaTeX customization, and common troubleshooting patterns learned through production use.
Use this skill when:
This skill provides production-proven assets in ${CLAUDE_PLUGIN_ROOT}/skills/pandoc-pdf-generation/assets/:
table-spacing-template.tex - Production-tuned LaTeX preamble (booktabs, colortbl, ToC fixes)build-pdf.sh - Universal auto-detecting build script# Create symlink once per project (git-friendly)
ln -s ${CLAUDE_PLUGIN_ROOT}/skills/pandoc-pdf-generation/assets/build-pdf.sh build-pdf.sh
# Auto-detect single .md file in directory (landscape default)
./build-pdf.sh
# Portrait mode
./build-pdf.sh --portrait document.md
# Monospace font for ASCII diagrams
./build-pdf.sh --monospace diagrams.md
# Explicit input/output
./build-pdf.sh input.md output.pdf
Options:
| Flag | Description |
|---|---|
--landscape | Landscape orientation (default) |
--portrait | Portrait orientation |
--monospace | Use DejaVu Sans Mono - ideal for ASCII diagrams |
--hide-details | Hide <details> blocks (e.g., graph-easy source) from PDF |
-h, --help | Show help message |
Features:
references.bib) and CSL files<details> blocks from PDF outputFor landscape PDFs with blue hyperlinks (no build-pdf.sh dependency):
pandoc file.md -o file.pdf \
--pdf-engine=xelatex \
-V geometry:a4paper,landscape \
-V geometry:margin=1in \
-V fontsize=11pt \
-V mainfont="DejaVu Sans" \
-V colorlinks=true \
-V linkcolor=blue \
-V urlcolor=blue \
--toc --toc-depth=2 \
--number-sections
Use landscape for: Wide data tables, comparison matrices, technical docs with code blocks.
pandoc document.md \
-o document.pdf \
--pdf-engine=xelatex \
--toc \
--toc-depth=3 \
--number-sections \
-V geometry:margin=1in \
-V mainfont="DejaVu Sans" \
-H ${CLAUDE_PLUGIN_ROOT}/skills/pandoc-pdf-generation/assets/table-spacing-template.tex
CRITICAL: Never manually type ASCII diagrams. Always use the itp:graph-easy skill.
Manual ASCII art causes alignment issues in PDFs. The graph-easy skill ensures:
# Invoke the skill for general diagrams
Skill(itp:graph-easy)
# For ADR architecture diagrams
Skill(itp:adr-graph-easy-architect)
Also important: Keep annotations OUTSIDE code blocks. Don't add inline comments like # contains: file1, file2 inside diagram code blocks - they break alignment.
Use --hide-details to remove <details> blocks from PDF output. This is useful when:
<details> tags don't render as collapsible in PDFUsage:
./build-pdf.sh --hide-details document.md
Markdown pattern:
## My Section
```diagram
┌─────┐ ┌─────┐
│ Box │ ──> │ Box │
└─────┘ └─────┘
```
<details>
<summary>graph-easy source</summary>
[Box] -> [Box]
</details>
```
With --hide-details, the entire <details> block is stripped from PDF output while remaining visible in markdown/HTML.
Before considering a PDF "done", verify:
Pre-Generation:
--number-sections)itp:graph-easy skillPost-Generation:
Pre-Print:
Always let the user review the PDF before printing.
Open for review:
open output.pdf
Print one-sided (simplex):
lpr -P "PRINTER_NAME" -o Duplex=None output.pdf
Print two-sided (duplex):
lpr -P "PRINTER_NAME" -o Duplex=DuplexNoTumble output.pdf # Long-edge binding
lpr -P "PRINTER_NAME" -o Duplex=DuplexTumble output.pdf # Short-edge binding
Find printer name:
lpstat -p -d
Never print without user approval - this wastes paper if issues exist.
For detailed information, see: