Skip to content

Generate — PDF

/generate pdf is the “print this page” of the artifact system. Point it at a wiki file or a folder and get a quick, shareable PDF — none of the book ceremony, same provenance contract.

flowchart LR
Start([/generate pdf path]) --> Resolve
Resolve["Resolve path<br/>(file OR folder)"] --> Sort
Sort["Filename-order<br/>sort"] --> Hash
Hash["source-hash<br/>(shared helper)"] --> Bundle
Bundle["Bundle markdown<br/>resolve wikilinks"] --> Render
Render["Pandoc → PDF<br/>(article class)"] --> Done([PDF + sidecar])
classDef engine fill:#5bbcd6,stroke:#2e6c7c,color:#0b0f14
classDef output fill:#7dcea0,stroke:#2d6a4f,color:#0b0f14
class Resolve,Sort,Hash,Bundle,Render engine
class Done output
/generate pdf <path> [--vault <name>] [--toc] [--template <name>] [--recursive]

<path> is:

FormMeaningExample
FileA single .md pagewiki/concepts/attention.md
FolderAll .md in that folder (non-recursive)concepts/rag/
Folder + --recursiveDescend into subfoldersconcepts/ --recursive

Single page:

Terminal window
/generate pdf wiki/concepts/attention.md --vault llm-wiki-research
# → vaults/llm-wiki-research/artifacts/pdf/attention-2026-04-17.pdf

A folder of related pages:

Terminal window
/generate pdf concepts/rag/ --vault llm-wiki-research
# → vaults/llm-wiki-research/artifacts/pdf/rag-2026-04-17.pdf

With TOC (opt-in):

Terminal window
/generate pdf concepts/ --vault llm-wiki-research --recursive --toc

When To Use /generate pdf vs /generate book

Section titled “When To Use /generate pdf vs /generate book”
ScenarioUse
Print one page for someonepdf
”Here’s everything we know about X”book
Folder of closely-related pagespdf (folder mode)
Multi-topic compilationbook
Needs title page + TOCbook
No ceremony, just shippdf

The two handlers share the same install logic, same source-hash helper, same wikilink resolution, same sidecar schema. They differ only in scope, document class, and output folder.

✅ PDF generated
Input: wiki/concepts/attention.md
Pages: 1
Source hash: 2dd9ed4a003f
Output: vaults/llm-wiki-research/artifacts/pdf/attention-2026-04-17.pdf
Sidecar: vaults/llm-wiki-research/artifacts/pdf/attention-2026-04-17.meta.yaml
Open with: open vaults/llm-wiki-research/artifacts/pdf/attention-2026-04-17.pdf

Sidecar schema is identical to generate-book — see Artifact conventions.

Same as generate-book:

ToolInstallPurpose
pandocbrew install pandocMarkdown → LaTeX / HTML
XeLaTeXbrew install --cask basictexPDF engine (HTML fallback if absent)

These are lazy-installed on first invocation. The shared helpers live under .claude/skills/generate/lib/ so both PDF handlers install exactly once per machine.

Override the print template:

Terminal window
pandoc -D latex > print.tex
# edit — e.g. simplify margins, change font
mv print.tex .claude/skills/generate-pdf/templates/print.tex

The handler picks it up automatically on the next invocation.

Same as /generate book:

  • Mermaid diagrams survive as fenced code blocks (Phase 2B renders them).
  • Wikilinks render as italic inline text, not clickable anchors.
  • Cross-vault references aren’t resolved.