markdown-to-pdf

Convert markdown files to styled PDFs using pandoc and WeasyPrint with CSS.

3|1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ever-just/agentskills --skill markdown-to-pdf-ever-just
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: markdown-to-pdf
Source: https://github.com/ever-just/agentskills/tree/main/skills/white-paper-writing/blastum-markdown-to-pdf
Command: npx skills add https://github.com/ever-just/agentskills --skill markdown-to-pdf-ever-just

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, weasyprint, and includes scripts (resource) and assets (resource) components.

What problem does it solve? Turning markdown documents into polished, print-ready PDFs usually requires manual toolchain setup and styling work. This Skill provides a ready-made pipeline that converts markdown to HTML via pandoc and renders it to PDF with WeasyPrint, applying consistent CSS styling automatically. ## Core Features & Use Cases - Styled PDF Export: Converts markdown to PDF through a pandoc → HTML → WeasyPrint pipeline with a default professional stylesheet. - Mobile-Optimized Output: A --mobile flag switches to an A6 page size and compact typography for PDFs meant to be read on phones. - Custom Styling: Accepts an optional custom CSS file to override the default look. - Use Case: You have written a white paper in markdown and need to distribute it as a branded PDF for desktop readers and a compact version for mobile readers, without touching a word processor. ## Quick Start Convert my markdown file report.md into a styled PDF named report.pdf using the markdown-to-pdf skill.

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 pandoc and WeasyPrint?▼

Run the md_to_pdf.sh script with an input markdown file and output PDF path. It converts markdown to HTML with pandoc, then renders the HTML to PDF with WeasyPrint using a default or custom CSS file.

How to create a mobile-friendly PDF from markdown?▼

Pass the --mobile or -m flag to the conversion script. It applies a mobile stylesheet with A6 page size, compact margins, and smaller typography suited for reading on phone screens.

Can I use custom CSS when converting markdown to PDF?▼

Yes, pass a CSS file path as the third argument to the script. The stylesheet is linked into the pandoc-generated HTML, and WeasyPrint applies it during PDF rendering, overriding the default styles.

What dependencies are required for markdown to PDF conversion?▼

You need pandoc installed via a package manager like Homebrew and WeasyPrint installed via pipx. Both are external command-line tools; the script itself is a bash wrapper with no additional libraries.

Why does WeasyPrint show warnings during PDF generation?▼

WeasyPrint emits warnings for CSS properties it does not support, such as gap and overflow-x in some contexts. The script filters out these Ignored warnings, and the default CSS already overrides unsupported pandoc defaults.