md2pdf

Convert markdown files to professionally formatted PDF documents using pandoc.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "md2pdf" with this command: npx skills add stanleyhsu/hello-mcp/stanleyhsu-hello-mcp-md2pdf

md2pdf

Convert markdown files to professionally formatted PDF documents using pandoc.

Instructions

When the user asks to convert a markdown file to PDF, follow these steps:

Verify pandoc is installed

  • Run pandoc --version to check if pandoc is available

  • If not installed, provide installation instructions for the user's platform:

  • macOS: brew install pandoc

  • Linux: sudo apt-get install pandoc or sudo yum install pandoc

  • Windows: Download from https://pandoc.org/installing.html

Check for PDF engine

  • Pandoc requires a PDF engine (LaTeX). Check if available with pdflatex --version

  • If not installed:

  • macOS: brew install --cask mactex-no-gui (smaller) or brew install --cask mactex (full)

  • Linux: sudo apt-get install texlive-latex-base texlive-fonts-recommended

  • Alternative: Use wkhtmltopdf as PDF engine

Convert the markdown file

  • Basic conversion: pandoc input.md -o output.pdf

  • With options for better formatting: pandoc input.md -o output.pdf
    --pdf-engine=pdflatex
    -V geometry:margin=1in
    -V fontsize=11pt
    --highlight-style=tango

Common options

  • --toc : Add table of contents

  • --toc-depth=2 : Set TOC depth

  • -V geometry:margin=1in : Set page margins

  • -V fontsize=11pt : Set font size (10pt, 11pt, 12pt)

  • --highlight-style=tango : Syntax highlighting for code blocks

  • -V colorlinks=true : Enable colored links in PDF

  • --metadata title="Document Title" : Set PDF title

  • --metadata author="Author Name" : Set PDF author

Verify output

  • Confirm the PDF was created successfully

  • Report the output file path to the user

Examples

Example 1: Basic conversion

User: Convert README.md to PDF Assistant: I'll convert README.md to PDF using pandoc.

[Runs: pandoc README.md -o README.pdf]

Successfully converted README.md to README.pdf

Example 2: Conversion with formatting options

User: Convert CLAUDE.md to PDF with a table of contents Assistant: I'll convert CLAUDE.md to PDF with a table of contents and formatting.

[Runs: pandoc CLAUDE.md -o CLAUDE.pdf --toc -V geometry:margin=1in -V fontsize=11pt]

Successfully converted CLAUDE.md to CLAUDE.pdf with table of contents

Example 3: Converting with custom output name

User: Convert docs/guide.md to a PDF called user-guide.pdf Assistant: I'll convert docs/guide.md to user-guide.pdf

[Runs: pandoc docs/guide.md -o user-guide.pdf -V geometry:margin=1in --highlight-style=tango]

Successfully converted docs/guide.md to user-guide.pdf

Example 4: Batch conversion

User: Convert all markdown files in the docs/ folder to PDF Assistant: I'll convert all markdown files in docs/ to PDF

[Runs: for file in docs/*.md; do pandoc "$file" -o "${file%.md}.pdf"; done]

Successfully converted:

  • docs/guide.md → docs/guide.pdf
  • docs/api.md → docs/api.pdf
  • docs/tutorial.md → docs/tutorial.pdf

Troubleshooting

  • If pandoc is not installed, guide the user to install it first

  • If PDF engine is missing, suggest installing LaTeX or using an alternative engine

  • For large documents, add --pdf-engine-opt=-shell-escape if needed

  • If images are not rendering, ensure image paths are correct and accessible

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

md2pdf

No summary provided by upstream source.

Repository SourceNeeds Review
General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated
General

explainer

Create explainer videos with narration and AI-generated visuals. Triggers on: "解说视频", "explainer video", "explain this as a video", "tutorial video", "introduce X (video)", "解释一下XX(视频形式)".

Archived SourceRecently Updated
General

asr

Transcribe audio files to text using local speech recognition. Triggers on: "转录", "transcribe", "语音转文字", "ASR", "识别音频", "把这段音频转成文字".

Archived SourceRecently Updated