md2pdf-export

Convert Markdown files to PDF and page images via headless Chrome.

850|114|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/wentorai/Research-Claw --skill md2pdf-export
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: md2pdf-export
Source: https://github.com/wentorai/Research-Claw/tree/main/skills/md2pdf-export
Command: npx skills add https://github.com/wentorai/Research-Claw --skill md2pdf-export

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gray-matter, katex, markdown-it, markdown-it-anchor, markdown-it-footnote, markdown-it-highlightjs, markdown-it-texmath, markdown-it-toc-done-right, puppeteer, fs, path, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill removes the hassle of manually formatting and exporting Markdown so you can reliably generate print-ready documents (PDF) and high-quality page images (PNG/JPEG) that look like a real Markdown preview.

Core Features & Use Cases

  • Markdown → WYSIWYG HTML rendering: Converts Markdown into a fully styled HTML document that matches a Markdown Preview Enhanced-style pipeline.
  • Headless Chrome export (PDF/PNG/JPEG): Uses Puppeteer to export the rendered HTML into PDF or screenshots with consistent layout and typography.
  • Math, code highlighting, and structured content: Supports KaTeX math rendering, syntax highlighting, footnotes, and table-of-contents generation.
  • Front-matter configuration: Lets you control rendering, paper settings, margins, themes, header/footer templates, and screenshot parameters directly inside the Markdown file.
  • Use Case: Turn lab notes or a draft paper written in Markdown into a publication-ready PDF with the correct page size, margins, and optional header/footer page numbers.

Quick Start

Tell the Skill to export your Markdown file to a PDF using headless Chrome rendering for WYSIWYG output, for example by running the converter on your input file.

Frequently Asked Questions about md2pdf-export

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

FAQPage Schema
How do I convert Markdown to PDF with code highlighting and math rendering?

You can convert Markdown to PDF with math and code highlighting by rendering the file to standalone HTML using Markdown-it plugins and KaTeX. Puppeteer then exports the styled HTML via headless Chrome to produce a print-ready PDF.

Can I control PDF margins, headers, and footers directly in a Markdown file?

You can control PDF margins, headers, and footers using YAML front-matter overrides within the Markdown file. This directly configures Puppeteer's paper settings, themes, and export behavior for deterministic local rendering.

What is the best way to generate publication-ready PDFs from Markdown sources?

Generating publication-ready PDFs from Markdown sources is best achieved through a deterministic local rendering pipeline. This Skill converts Markdown to WYSIWYG HTML with syntax highlighting and TOC, then exports via headless Chrome for consistent typography.

Does headless Chrome export support generating page images alongside PDF?

Headless Chrome export supports generating page images alongside PDF files. Using Puppeteer, the rendering pipeline outputs high-quality PNG and JPEG screenshots from the standalone HTML in addition to standard print-ready documents.

Why use Puppeteer for Markdown to PDF conversion instead of standard parsers?

Using Puppeteer for Markdown to PDF conversion ensures WYSIWYG output that matches a real Markdown preview. Standard parsers lack accurate print layout, whereas headless Chrome provides deterministic rendering with configurable page sizes, margins, and header templates.