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

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated
General

neo

Browse websites, read web pages, interact with web apps, call website APIs, and automate web tasks. Use Neo when: user asks to check a website, read a web page, post on social media (Twitter/X), interact with any web app, look up information on a specific site, scrape data from websites, automate browser tasks, or when you need to call any website's API. Keywords: website, web page, browse, URL, http, API, twitter, tweet, post, scrape, web app, open site, check site, read page, social media, online service.

Archived SourceRecently Updated
General

image-gen

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

Archived SourceRecently Updated