markdown-to-pdf

Convert Markdown documents into PDF files using Pandoc, WeasyPrint, or ReportLab.

364|53|Updated May 9, 2026
One-click install
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill markdown-to-pdf-cosmicstack-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: markdown-to-pdf
Source: https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories/pdf-generation/markdown-to-pdf
Command: npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill markdown-to-pdf-cosmicstack-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Producing professional PDFs from Markdown often takes manual styling, repetitive conversion steps, and time-consuming formatting fixes.

Core Features & Use Cases

  • Pandoc-powered conversion for high-quality PDF output using LaTeX/Context/wkhtmltopdf and templating.
  • WeasyPrint CSS print pipeline to generate branded, print-ready PDFs that closely match web-like layouts.
  • ReportLab programmatic PDF generation for dynamic, data-driven documents when layout must be controlled from code.
  • Use Case: Turn internal engineering docs written in Markdown into consistent release reports with tables, a table of contents, custom fonts, and code styling.

Quick Start

Run pandoc on your Markdown file to produce a PDF output by running: pandoc input.md -o output.pdf.

Frequently Asked Questions about markdown-to-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF with custom fonts and a table of contents?

Convert Markdown to PDF using Pandoc or WeasyPrint pipelines to apply consistent typography, tables, and a table of contents. This generates professional, print-ready PDF documents from standard Markdown files.

What is the best way to batch convert Markdown files into print-ready PDFs?

Batch convert Markdown files into PDFs using automation patterns configured with YAML metadata and PDF engines. This applies consistent print CSS styling across multiple documents for publishing workflows.

Does WeasyPrint or ReportLab work better for generating data-driven PDF reports from Markdown?

WeasyPrint generates branded print-ready PDFs matching web-like layouts using CSS, while ReportLab builds dynamic data-driven PDF documents controlled programmatically from code. Choose WeasyPrint for styling or ReportLab for layout control.

Can I use CSS print styling when converting Markdown to PDF?

Yes, you can use the WeasyPrint CSS print pipeline to generate branded print-ready PDFs that closely match web-like layouts. This ensures your Markdown conversion maintains consistent print styling across documents.

Why does my Markdown to PDF conversion need YAML-defined metadata?

Markdown to PDF conversion requires YAML-defined metadata in the skill entry to configure toolchain settings such as PDF engines, templates, and print CSS. This configuration ensures consistent typography and proper document formatting.