markdown-to-pdf

markdown-to-pdf is a skill for Claude Code, Codex from cosmicstack-labs/mercury-agent-skills. It costs 25 tokens per session (7,731 once invoked), scanned A, original, MIT.

A document-conversion toolkit that turns Markdown files into PDFs using tools such as Pandoc, WeasyPrint, ReportLab, and browser-based converters. It also covers print styling, templates, and batch conversion.

In plain words
What is it for?
Use it for reports, papers, books, branded documents, and repeated Markdown-to-PDF conversions.
Why use it?
It helps you produce consistent PDFs without manually recreating Markdown documents in a page-layout tool.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for reports, papers, books, branded documents, and repeated Markdown-to-PDF conversions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cosmicstack-labs/mercury-agent-skills --skill markdown-to-pdf
Clone the repo
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for markdown-to-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf/github.svg)](https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf)
Your own site
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for markdown-to-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/markdown-to-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,731 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.07731
Opus 5.5 $0.00010 $0.03092
Sonnet 5.5 $0.00005 $0.01546
Haiku 4.5 $0.00003 $0.00773

Measured 3mo ago against content hash db838600d0b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

markdown-to-pdf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

categories/pdf-generation/markdown-to-pdf/SKILL.md · 1,096 lines

How it starts

The opening of the file, as written. The whole thing — 1,096 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Markdown to PDF Conversion

Convert Markdown documents into polished, production-ready PDFs. This skill covers the major toolchains — Pandoc, WeasyPrint, ReportLab — plus CSS print styling, template systems, and batch conversion workflows.


Toolchain Overview

Tool Approach Best For Output Quality
Pandoc Markdown → PDF via LaTeX/Context/Wkhtmltopdf Books, papers, reports High
WeasyPrint Markdown → HTML → PDF via CSS print Web-like documents, branded PDFs High
ReportLab Programmatic PDF generation via Python Dynamic, data-driven PDFs Very High
md-to-pdf Node.js CLI for quick markdown → PDF Simple documents, quick output Medium
Puppeteer/Playwright Markdown → HTML → Headless browser → PDF Pixel-perfect web-to-PDF Very High

1. Pandoc Workflows

Pandoc is the Swiss Army knife of document conversion. It reads Markdown and outputs PDF via an intermediate engine (default: LaTeX).

Basic Conversion

# Simple markdown to PDF (uses pdflatex)
pandoc input.md -o output.pdf

# With metadata file
pandoc input.md --metadata-file=metadata.yaml -o output.pdf

# Specify output engine
pandoc input.md --pdf-engine=xelatex -o output.pdf

# Using wkhtmltopdf instead of LaTeX
pandoc input.md --pdf-engine=wkhtmltopdf -o output.pdf

Advanced Pandoc with Templates

# Custom LaTeX template
pandoc input.md \
  --template=custom-template.tex \
  --pdf-engine=xelatex \
  --toc \
  --number-sections \
  -o output.pdf

# With bibliography
pandoc input.md \
  --bibliography=references.bib \
  --csl=ieee.csl \
  --citeproc \
  -o output.pdf

# Custom font and margins
pandoc input.md \
  -V geometry:"top=2cm, bottom=2cm, left=2.5cm, right=2.5cm" \
  -V mainfont="Times New Roman" \
  -V fontsize=12pt \
  -o output.pdf

Metadata YAML for Pandoc

# metadata.yaml
---
title: "Technical Report on Distributed Systems"
author:
  - "Jane Doe"
  - "John Smith"
date: "2025-01-15"
subtitle: "Performance Analysis of Event-Driven Architectures"
abstract: |
  This report analyzes the performance characteristics of event-driven
  architectures in distributed systems, comparing Apache Kafka, RabbitMQ,
  and AWS SQS across latency, throughput, and fault tolerance metrics.
keywords: [distributed-systems, event-driven, kafka, rabbitmq, performance]
lang: en-US
geometry:
  - top=25mm
  - bottom=25mm
  - left=30mm
  - right=25mm
fontsize: 11pt
mainfont: "DejaVu Serif"
monofont: "DejaVu Sans Mono"
toc: true
toc-depth: 3
numbersections: true
linestretch: 1.5
---

Read the full file on GitHub · 1,096 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 1,096 lines · 25 tokens per session scan A db838600d0b5

Subscribe to this mod's changes

markdown-to-pdf is a skill published in the GitHub repository cosmicstack-labs/mercury-agent-skills (496 stars, last pushed 3mo ago), licensed MIT. It adds 25 tokens to every session and 7,731 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

markdown-to-pdf compared with skills from other repositories

markdown-to-pdf next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
markdown-to-pdfcosmicstack-labs/mercury-agent-skillsSkill4963mo agoMITA25Claude Code, Codex
pdfagentscope-ai/QwenPawSkill38kyesterdayApache-2.0A95Claude Code, Codex
huashu-md-to-pdfalchaincyf/huashu-skillsSkill2.4k4d agoMITA83Claude Code, Codex
pptx-postersforyourhealth111-pixel/Vibe-SkillsSkill3.9k24d agoApache-2.0A66Claude Code
report-generatorforyourhealth111-pixel/Vibe-SkillsSkill3.9k24d agoApache-2.0A24Claude Code
pdfforyourhealth111-pixel/Vibe-SkillsSkill3.9k24d agoApache-2.0A29Claude Code, Codex
adobe-document-reviewadobe/skillsSkill343todayApache-2.0A162Claude Code