pandoc-pdf-generation

terrylica/cc-skills · updated May 29, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/terrylica/cc-skills --skill pandoc-pdf-generation
0 commentsdiscussion
summary

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

skill.md

Pandoc PDF Generation

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

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_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

From Any Project

/usr/bin/env bash << 'DETECT_EOF'
# 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
DETECT_EOF

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:

  • ✅ 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)
  • ✅ Code blocks stay on same page (no splitting across pages)
  • ✅ Lua filter to hide <details> blocks from PDF output

Landscape PDF (Quick Command)

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

Manual Command (With LaTeX Preamble)

/usr/bin/env bash << 'SKILL_SCRIPT_EOF'
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
SKILL_SCRIPT_EOF

ASCII Diagrams: Always Use graph-easy

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:

  • Proper boxart character alignment
  • Consistent spacing
  • Reproducible output
# 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.


Hiding Content for PDF Output

Use --hide-details to remove <details> blocks from PDF output. This is useful when:

  • graph-easy source blocks: Keep source in markdown for diagram regeneration, but hide from printed PDFs
  • Technical implementation notes: Show in web/markdown view, hide from printed handouts
  • Collapsible sections: HTML <details> tags don't render as collapsible in PDF

Usage:

./build-pdf.sh --hide-details document.md

Markdown pattern:

## My Section

```diagram
┌─────┐     ┌─────┐
│ Box │ ──> │ Box │
└─────┘     └─────┘
```
[Box] -> [Box]

With --hide-details, the entire <details> block is stripped from PDF output while remaining visible in markdown/HTML.


Verification Checklist

Before considering a PDF "done", verify:

Pre-Generation:

  • No manual section numbering in markdown (use --number-sections)
  • All ASCII diagrams generated via itp:graph-easy skill
  • Annotations are outside code blocks, not inside

Post-Generation:

  • Open PDF and visually inspect each page
  • Verify diagrams don't break across pages
  • Check section numbering is correct (no "1. 1. Title" duplication)
  • Confirm bullet lists render as bullets, not inline dashes

Pre-Print:

  • Get user approval before printing
  • Confirm orientation preference (landscape/portrait)
  • Confirm duplex preference (one-sided/two-sided)

Printing Workflow

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.


Reference Documentation

For detailed information, see:


Troubleshooting

Issue Cause Solution
Font not found DejaVu Sans not installed brew install font-dejavu
xelatex not found MacTeX not installed brew install --cask mactex
Table breaks across pages Missing longtable package Include table-spacing-template.tex preamble
Double section numbers Manual numbering in markdown Remove manual numbers, use --number-sections only
ASCII diagram misaligned Manual ASCII art Use graph-easy skill for all diagrams
Bullet list renders as dashes Markdown formatting issue Check for proper blank lines before lists
Bibliography not rendering Missing references.bib Create .bib file or remove --bibliography flag
PDF file size too large Embedded fonts Use --pdf-engine-opt=-dEmbedAllFonts=false

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

how to use pandoc-pdf-generation

How to use pandoc-pdf-generation on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add pandoc-pdf-generation
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/terrylica/cc-skills --skill pandoc-pdf-generation

The skills CLI fetches pandoc-pdf-generation from GitHub repository terrylica/cc-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/pandoc-pdf-generation

Reload or restart Cursor to activate pandoc-pdf-generation. Access the skill through slash commands (e.g., /pandoc-pdf-generation) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.530 reviews
  • Benjamin Okafor· Dec 12, 2024

    Solid pick for teams standardizing on skills: pandoc-pdf-generation is focused, and the summary matches what you get after install.

  • Tariq Ghosh· Dec 4, 2024

    pandoc-pdf-generation has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Olivia Jain· Nov 27, 2024

    pandoc-pdf-generation is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Alexander Desai· Nov 23, 2024

    pandoc-pdf-generation fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Arya Gupta· Nov 3, 2024

    We added pandoc-pdf-generation from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Arya Shah· Oct 22, 2024

    pandoc-pdf-generation fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Dev Gupta· Oct 18, 2024

    Keeps context tight: pandoc-pdf-generation is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chen Thomas· Oct 14, 2024

    We added pandoc-pdf-generation from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Alexander Sanchez· Sep 5, 2024

    pandoc-pdf-generation reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Sakshi Patil· Sep 1, 2024

    Registry listing for pandoc-pdf-generation matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 30

1 / 3