Agent skill

pandoc-pdf-generation

Generates professional PDFs from Markdown using Pandoc with XeLaTeX. Use when creating PDFs, needing section numbering, table of contents, bibliography, or custom LaTeX styling.

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/James1218/claude-code-configurations/tree/main/skills/pandoc-pdf-generation

SKILL.md

Pandoc PDF Generation

Overview

Generate 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.

When to Use This Skill

Use this skill when:

  • Converting Markdown to PDF with professional formatting requirements
  • Needing automatic section numbering and table of contents
  • Managing citations and bibliographies without manual duplication
  • Controlling table formatting and page breaks in LaTeX output
  • Building automated PDF generation workflows

Quick Start: Universal Build Script

Single Source of Truth Pattern

This skill provides production-proven assets in ~/.claude/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

From Any Project

bash
# Create symlink once per project (git-friendly)
ln -s ~/.claude/skills/pandoc-pdf-generation/assets/build-pdf.sh build-pdf.sh

# Auto-detect single .md file in directory
./build-pdf.sh

# Or specify explicitly
./build-pdf.sh input.md output.pdf

Features:

  • ✅ Auto-detects input file (if single .md exists)
  • ✅ Auto-detects bibliography (references.bib) and CSL files
  • ✅ Always uses production-proven LaTeX preamble from skill
  • ✅ Pre-flight checks (pandoc, xelatex, files exist)
  • ✅ Post-build validation (file size, page count)

Manual Command (For Reference)

bash
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/skills/pandoc-pdf-generation/assets/table-spacing-template.tex

Reference Documentation

For detailed information, see:

  • Core Development Principles - START HERE - Universal principles learned from production failures
  • YAML Front Matter Structure - YAML metadata patterns
  • LaTeX Customization - Preamble and table formatting
  • Bibliography & Citations - BibTeX and CSL styles
  • Document Patterns - Document type templates
  • Troubleshooting - Common issues and fixes

Expand your agent's capabilities with these related and highly-rated skills.

James1218/claude-code-configurations

documentation-standards

Markdown documentation standards for LLM-optimized architecture including section numbering rules for Pandoc PDF generation. Use when writing markdown documentation, creating skills, or authoring content that may be converted to PDF.

0 0
Explore
James1218/claude-code-configurations

auto-commit

Automatically commits changes using conventional commits format (feat:, fix:, docs:, chore:, refactor:, test:, style:). Use after completing bug fixes, feature implementations, or documentation updates. Triggered automatically via Stop hook.

0 0
Explore
James1218/claude-code-configurations

skill-architecture

Comprehensive guide for creating effective Claude Code skills with security best practices, CLI-specific features, and structural patterns. Use when creating skills, needing security guidance, understanding skill architecture, or learning best practices.

0 0
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore
mattpocock/skills

handoff

Compact the current conversation into a handoff document for another agent to pick up.

111,310 9,758
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results