md-to-pdf

md-to-pdf is a skill for Claude Code from Mathews-Tom/armory. It costs 60 tokens per session (2,153 once invoked), scanned A, original, MIT.

A converter that turns Markdown files into styled PDF documents, including diagrams, mathematical formulas, tables, and highlighted code.

In plain words
What is it for?
Use it to export Markdown reports, technical documentation, or papers containing Mermaid diagrams, LaTeX or KaTeX equations, tables, and code blocks.
Why use it?
It removes the need to manually format these elements or assemble several separate tools when producing a polished PDF.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the armory plugin — 85 skills shipped together

Good fit Use it to export Markdown reports, technical documentation, or papers containing Mermaid diagrams, LaTeX or KaTeX equations, tables, and code blocks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mathews-tom/armory/md-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 Mathews-Tom/armory --skill md-to-pdf
Clone the repo
git clone --depth 1 https://github.com/Mathews-Tom/armory

Made for: Claude Code.

Or install armory, the plugin that ships this one along with the rest of its 85 skills.

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 md-to-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/mathews-tom/armory/md-to-pdf/github.svg)](https://agentmods.dev/skills/mathews-tom/armory/md-to-pdf)
Your own site
<a href="https://agentmods.dev/skills/mathews-tom/armory/md-to-pdf"><img src="https://agentmods.dev/badge/skills/mathews-tom/armory/md-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 md-to-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/mathews-tom/armory/md-to-pdf"><img src="https://agentmods.dev/badge/skills/mathews-tom/armory/md-to-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,153 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.00060 $0.02153
Opus 5 $0.00030 $0.01077
Sonnet 5 $0.00012 $0.00431
Haiku 4.5 $0.00006 $0.00215

Measured 9d ago against content hash c52beb1323d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

md-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 9d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/katex_render.js, scripts/md_to_pdf.py, scripts/setup.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/md-to-pdf/SKILL.md · 211 lines

How it starts

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

Markdown to PDF Converter

Converts Markdown files to professionally styled PDFs with full rendering of Mermaid diagrams, LaTeX math (via KaTeX), tables, syntax-highlighted code blocks, and all standard Markdown features.

Architecture

Input .md file
     │
     ├─ Step 1: Extract ```mermaid blocks → render to SVG via mmdc (Mermaid CLI + Puppeteer)
     │          Replace mermaid code blocks with inline <svg> in the markdown source
     │
     ├─ Step 2: pandoc converts modified markdown → standalone HTML5
     │          (--katex flag preserves raw LaTeX in <span class="math ..."> elements)
     │
     ├─ Step 3: Node.js KaTeX server-side rendering
     │          Replaces math spans with fully rendered KaTeX HTML (no client-side JS needed)
     │
     ├─ Step 4: CSS injection
     │          KaTeX stylesheet (with local font paths) + professional document styles + optional custom CSS
     │
     └─ Step 5: Playwright (headless Chromium) prints final HTML → PDF
                 ↓
           Output .pdf file

Supported Features

Feature Rendering Engine Notes
Mermaid diagrams mmdc (mermaid-cli) via Puppeteer flowchart, sequence, class, state, ER, gantt, pie, git, mindmap, etc.
LaTeX math (inline) KaTeX server-side $E=mc^2$ syntax
LaTeX math (display) KaTeX server-side $$\int f(x) dx$$ syntax
Tables pandoc + CSS Full GFM pipe-table support with professional styling
Code blocks pandoc + CSS Syntax highlighting via pandoc, monospace styling
Images pandoc + Playwright Local file:// and remote https:// images
Links pandoc Rendered as styled text
Lists / blockquotes pandoc Ordered, unordered, nested, blockquotes
YAML frontmatter pandoc title used as PDF title metadata
Footnotes pandoc + CSS [^1] syntax, rendered at page bottom
Definition lists pandoc + CSS Term / definition pairs
Strikethrough pandoc ~~deleted~~ syntax
Horizontal rules pandoc + CSS --- rendered as styled separators

Read the full file on GitHub · 211 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 211 lines · 60 tokens per session scan A c52beb1323d1

Subscribe to this mod's changes

md-to-pdf is a skill published in the GitHub repository Mathews-Tom/armory (316 stars, last pushed 3d ago), licensed MIT. It adds 60 tokens to every session and 2,153 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

invoice

A printable invoice page — sender + recipient block, line items table, tax breakdown, totals, and payment instructions. Use when the brief mentions "invoice", "bill", "billing statement", or "发票".

nexu-io/open-design · 46 tokens

pdf

A set of instructions for working with PDF files, which are documents designed to preserve their layout across devices.

agentscope-ai/QwenPaw · 95 tokens

chat-complex-documents

Chat with and search your complex documents — ask questions, extract tables and fields, and get answers grounded in the source. Connects the hosted Unstructured Transform MCP server to parse, structure, and enrich PDFs, Word/Excel/PowerPoint, images, scanned files, emails, and 60+ other formats into clean, AI-ready…

vellum-ai/vellum-assistant · 90 tokens

markdown-converter

Convert binary documents (PDF, DOCX, XLSX, PPTX, HTML, EPUB, images) to clean LLM-friendly Markdown using Microsoft's markitdown Python tool. Use when a user attaches a binary file and you need to read its contents.

Team-Commonly/commonly · 57 tokens

pandic-office

Convert Markdown to PDF (or DOCX/EPUB/HTML) using the pandoc CLI. Use when asked to produce a PDF report, brief, summary, or any document where the input is Markdown and the output should be a polished, paginated file.

Team-Commonly/commonly · 59 tokens

pdf

Manipulate PDF files — extract text, count pages, render thumbnails, merge or split documents. Use for PDF-specific operations that don't fit markdown-converter (general read) or pandic-office (write from markdown).

Team-Commonly/commonly · 49 tokens