Agent skill

Md To PDF

by Mathews-Tom in Mathews-Tom/armory

Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting.

MITAuto-check passedDocuments & Office

Install Md To PDF

skills CLI
$ npx skills add Mathews-Tom/armory --skill md-to-pdf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mathews-Tom/armory md-to-pdf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/md-to-pdf .claude/skills/md-to-pdf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
md-to-pdf
GitHub stars
329
Token cost
~2.4k tokens
SKILL.md length
579 words
Files
8 (incl. scripts)
Skills in repo
80
Repo updated
First seen
Licence
MIT

At a glance

Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting.

  • Works in 4 steps: Determine the input file path (uploaded… → Run setup check if this is the first use… → Execute conversion → …
  • : convert markdown to pdf
  • SKILL.md covers Architecture, Supported Features, Prerequisites and Usage, plus 4 more sections
  • Runs JavaScript, Python and Shell scripts from its folder; calls python3, bash and npm

What it does

Md To PDF is an agent skill from Mathews-Tom/armory. Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting. Triggers on: "convert markdown to pdf", "make a pdf from this md", "export markdown as pdf", "pdf from markdown with equations".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts (for example `README.md`, `evals/cases.yaml` and `scripts/katex_render.js`).

It sits in Documents & Office, covering PDF, LaTeX and Markdown. It works with LaTeX and Pandoc. The repository describes itself as: Curated, production-grade skills for AI coding agents. Battle-tested workflows for developers who use AI seriously. The licence is MIT.

When your agent uses it

  • : convert markdown to pdf
  • Make a pdf from this md
  • Export markdown as pdf
  • Pdf from markdown with equations

Example prompts

  • “convert markdown to pdf”
  • “make a pdf from this md”
  • “export markdown as pdf”
  • “/md-to-pdf”

Requirements

  • Python 3
  • Node.js
  • A Bash shell

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Determine the input file path (uploaded file or user-specified path)
  2. Run setup check if this is the first use in the session
  3. Execute conversion
  4. Present the output file to the user

What it can do on your machine

Read from SKILL.md and the folder at commit 4594fb7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (JavaScript, Python and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • bash
    • npm
    • playwright
    • apt
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Md To PDF loads about 2.4k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 579 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Mathews-Tom/armory at commit 4594fb7, republished under its MIT licence (© Mathews-Tom). 579 words, ~2,449 tokens.

Download SKILL.mdSave it as .claude/skills/md-to-pdf/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
md-to-pdf
description
Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting. Triggers on: "convert markdown to pdf", "make a pdf from this md", "export markdown as pdf", "pdf from markdown with equations".
license
MIT. See LICENSE.txt for complete terms.
metadata.version
1.2.2
metadata.category
visualization
metadata.tags
pdf, markdown, mermaid, latex
metadata.difficulty
intermediate

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

text
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

FeatureRendering EngineNotes
Mermaid diagramsmmdc (mermaid-cli) via Puppeteerflowchart, 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
Tablespandoc + CSSFull GFM pipe-table support with professional styling
Code blockspandoc + CSSSyntax highlighting via pandoc, monospace styling
Imagespandoc + PlaywrightLocal file:// and remote https:// images
LinkspandocRendered as styled text
Lists / blockquotespandocOrdered, unordered, nested, blockquotes
YAML frontmatterpandoctitle used as PDF title metadata
Footnotespandoc + CSS[^1] syntax, rendered at page bottom
Definition listspandoc + CSSTerm / definition pairs
Strikethroughpandoc~~deleted~~ syntax
Horizontal rulespandoc + CSS--- rendered as styled separators

Prerequisites

Run the setup checker before first use:

bash
bash <SKILL_DIR>/scripts/setup.sh

This validates that all required tools are present and working. The standard Claude computer-use environment has everything pre-installed. For other environments, the required stack is:

DependencyPurposeInstall
pandocMarkdown → HTMLapt install pandoc
mmdc (@mermaid-js/mermaid-cli)Mermaid → SVGnpm install -g @mermaid-js/mermaid-cli
katex (npm)LaTeX → HTMLnpm install -g katex
playwright (Python)HTML → PDFpip install playwright && playwright install chromium
Chrome/ChromiumBrowser engineInstalled by Playwright or Puppeteer

Usage

Basic
bash
python3 <SKILL_DIR>/scripts/md_to_pdf.py <input.md> <output.pdf>
Full Options
bash
python3 <SKILL_DIR>/scripts/md_to_pdf.py <input.md> <output.pdf> [OPTIONS]
ParameterDefaultDescription
input(required)Path to input Markdown file
output(required)Path to output PDF file
--formatA4Page size: A4, Letter, Legal, A3
--margin0.75inMargins — single value (uniform) or top,right,bottom,left
--no-mermaidfalseSkip Mermaid rendering (keeps raw code blocks)
--no-mathfalseSkip KaTeX math rendering
--css(none)Path to additional custom CSS file to layer on top
--landscapefalseLandscape orientation
--header-footerfalseShow page numbers in footer (page / total)
Examples
bash
# Standard A4 conversion
python3 scripts/md_to_pdf.py report.md report.pdf

# US Letter, landscape, with page numbers
python3 scripts/md_to_pdf.py report.md report.pdf --format Letter --landscape --header-footer

# Custom margins and extra CSS
python3 scripts/md_to_pdf.py report.md report.pdf --margin "1in,0.75in,1in,0.75in" --css brand.css

# Plain mode (skip Mermaid + math for speed)
python3 scripts/md_to_pdf.py report.md report.pdf --no-mermaid --no-math

Workflow for Claude

When a user asks to convert Markdown to PDF:

  1. Determine the input file path (uploaded file or user-specified path)
  2. Run setup check if this is the first use in the session:
    bash
    bash <SKILL_DIR>/scripts/setup.sh
  3. Execute conversion:
    bash
    python3 <SKILL_DIR>/scripts/md_to_pdf.py /path/to/input.md /path/to/output.pdf [OPTIONS]
  4. Present the output file to the user
Show full SKILL.md (230 more words)Show less
Handling Failures
SymptomLikely CauseFix
"mmdc FAILED" in Mermaid stepInvalid Mermaid syntaxCheck diagram syntax; mmdc stderr has the parse error
Raw LaTeX visible in PDFKaTeX couldn't parse expressionCheck LaTeX syntax; KaTeX falls back gracefully
"No Chrome binary found"Puppeteer/Playwright Chromium missingRun playwright install chromium
Blank/missing diagramsSVG too large or complexTry --no-mermaid and render diagrams separately

Customization

Custom CSS

Pass --css path/to/custom.css to inject styles after the defaults. Your rules take precedence.

Example — dark theme override:

css
body {
  background: #1a1a2e;
  color: #e0e0e0;
}
h1,
h2,
h3 {
  color: #e0e0e0;
  border-color: #444;
}
table th {
  background: #2a2a4a;
}
pre {
  background: #0d0d1a;
  border-color: #333;
}
Mermaid Theming

Set the MERMAID_CONFIG environment variable to a JSON config file:

bash
MERMAID_CONFIG=/path/to/.mermaidrc python3 scripts/md_to_pdf.py input.md output.pdf

Example .mermaidrc:

json
{
  "theme": "neutral",
  "themeVariables": {
    "primaryColor": "#e1f5fe",
    "lineColor": "#333"
  }
}

Limitations

  • Mermaid diagram rendering requires either network access for CDN-based mmdc or a local @mermaid-js/mermaid-cli install. Offline environments must use --no-mermaid and render diagrams separately.
  • Large documents (100+ pages or many high-resolution images) may hit Playwright's memory limits. Split into multiple input files and merge the resulting PDFs.
  • Custom CSS may not render identically across PDF viewers — layout is determined by Chromium at render time; Acrobat Reader, Preview, and browsers can display the same PDF differently.
  • Page breaks require explicit CSS markers (page-break-before: always or break-before: page) or manual <div style="page-break-before: always"> in the source. Pandoc does not infer page breaks from heading structure.
  • KaTeX coverage is broad but not complete — obscure LaTeX macros or packages not in KaTeX's supported set will fail to render and fall back to raw LaTeX.

File Structure

text
md-to-pdf/
├── SKILL.md                    # This file — skill documentation
├── LICENSE.txt                 # MIT license
├── README.md                   # Distribution / standalone usage docs
├── scripts/
│   ├── md_to_pdf.py            # Main conversion pipeline (Python)
│   ├── katex_render.js         # Server-side KaTeX math renderer (Node.js)
│   └── setup.sh                # Dependency checker / installer
└── tests/
    └── test_document.md        # Comprehensive test covering all features

© Mathews-Tom, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts) in skills/md-to-pdf of Mathews-Tom/armory.

  • SKILL.md
  • LICENSE.txt
  • README.md
  • evals/cases.yaml
  • scripts/katex_render.js
  • scripts/md_to_pdf.py
  • scripts/setup.sh
  • tests/test_document.md

Open the folder on GitHubat commit 4594fb7

Compare with similar skills

Md To PDF next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Md To PDF compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Md To PDF this skillMathews-Tom/armory329—~2.4kAutomated safety check: PassMIT
Md To PDF Academicwentorai/research-plugins2981 repos~1.8kAutomated safety check: NotesMIT
MineruNebutra/MinerU-Skill123—~504Automated safety check: PassMIT
Lecture To Mdysyecust/lecture-to-notes273—~3.9kAutomated safety check: PassCustom licence
Pandic OfficeTeam-Commonly/commonly1.4k—~642Automated safety check: PassApache-2.0
Chinese Copyright Applicationokooo5km/Skills4U183—~2.8kAutomated safety check: NotesMIT

Similar skills

  • Md To PDF Academic

    wentorai/research-plugins

    Convert Markdown to publication-quality PDF with LaTeX math rendering

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Documents & OfficeAuto-check: notes
  • Mineru

    Nebutra/MinerU-Skill

    An AI-Native skill for parsing PDF / Office / image files into Markdown with MinerU — a fast, zero-config document parser for AI agents.

    123 GitHub stars~504 tokensUpdated 17 days ago
    Documents & OfficeAuto-check passed
  • Lecture To Md

    ysyecust/lecture-to-notes

    把课堂视频(本地或 B 站/YouTube)、文字稿、课件三者(任意组合)整理成一份详细的中文 Markdown 课堂笔记,输出按课程标题命名的 {titlename}.md(首行为 文档标题)+ 相对路径图片。Markdown 工作流,与上游 lecture-to-notes 的 LaTeX/PDF 输出并行存在;上游 skill 完全不动。触发词:markdown 笔记、md 笔记、视频转…

    273 GitHub stars~3.9k tokensUpdated 8 days ago
    Documents & OfficeAuto-check passed
  • Pandic Office

    Team-Commonly/commonly

    Convert Markdown to PDF (or DOCX/EPUB/HTML) using the pandoc CLI.

    1.4k GitHub stars~642 tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • 中国软件著作权申请材料生成工具。申请表直接输出 Markdown 提交,源程序/用户手册/设计说明书三份生成 LaTeX 并编译为 PDF。自动分析项目代码,生成四份材料(前后各30页共60页源程序、含页眉页脚的用户手册和设计说明书、Markdown…

    183 GitHub stars~2.8k tokensUpdated 4 days ago
    Documents & OfficeAuto-check: notes
  • Marker

    benchflow-ai/skillsbench

    Convert PDF documents to Markdown using markersingle. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~520 tokensUpdated 2 mo ago
    Documents & OfficeAuto-check passed

More from Mathews-Tom/armory

All 80 skills in this repo
  • Architecture Reviewer

    Mathews-Tom/armory

    Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports.

    329 GitHub stars~4.6k tokensUpdated 5 days ago
    Auto-check passed
  • Concept To Image

    Mathews-Tom/armory

    Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG.

    329 GitHub stars~2.6k tokensUpdated 5 days ago
    Auto-check passed
  • Watch

    Mathews-Tom/armory

    A skill your agent uses when analyzing an existing video URL or local recording: "watch this video", "analyze youtube video", "summarize this video", "youtube transcript", "find this moment", "what…

    329 GitHub stars~2.8k tokensUpdated 5 days ago
    Auto-check passed
  • Code Refiner

    Mathews-Tom/armory

    Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.

    329 GitHub stars~3.1k tokensUpdated 5 days ago
    Auto-check passed
  • Concept To Video

    Mathews-Tom/armory

    Turn concepts into animated explainer videos using Manim (Python) with MP4/GIF output, audio overlay, multi-scene composition.

    329 GitHub stars~4.9k tokensUpdated 5 days ago
    Auto-check passed
  • Decision Map

    Mathews-Tom/armory

    Maps the unresolved architecture, policy, and scope decisions that must be answered before planning can start: one durable decision ticket per question on the issue tracker, typed and blocker-linked…

    329 GitHub stars~2.7k tokensUpdated 5 days ago
    Auto-check passed

Works with

Questions about Md To PDF

What does Md To PDF do?

Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting. Md To PDF is an agent skill from Mathews-Tom/armory. Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting.

When should I use Md To PDF?

Md To PDF fits situations like: : convert markdown to pdf; make a pdf from this md; export markdown as pdf; pdf from markdown with equations.

How do I install Md To PDF in Claude Code?

Run `npx skills add Mathews-Tom/armory --skill md-to-pdf -a claude-code`. Or copy the skill folder (skills/md-to-pdf in Mathews-Tom/armory) into .claude/skills/md-to-pdf in your project. Claude Code loads it when a task matches its description.

How do I install Md To PDF in Codex?

Run `npx skills add Mathews-Tom/armory --skill md-to-pdf -a codex`. Or copy the skill folder (skills/md-to-pdf in Mathews-Tom/armory) into .agents/skills/md-to-pdf in your project. Codex loads it when a task matches its description.

Can I use Md To PDF in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mathews-Tom/armory --skill md-to-pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/md-to-pdf, .gemini/skills/md-to-pdf, .github/skills/md-to-pdf and .opencode/skills/md-to-pdf in your project.

What does Md To PDF need to run?

Going by SKILL.md and its folder, Md To PDF needs JavaScript, Python and a shell for the scripts in its folder and the command-line tools its instructions call (python3, bash, npm, playwright, apt and pip). Our summary lists: Python 3; Node.js; A Bash shell.

Does Md To PDF access the network?

SKILL.md contains no URLs. Its commands use npm and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Md To PDF safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Md To PDF use?

Md To PDF is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Md To PDF use?

About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Md To PDF?

Skills that share tags, products or a category with Md To PDF: Md To PDF Academic (wentorai/research-plugins, 298 stars), Mineru (Nebutra/MinerU-Skill, 123 stars), Lecture To Md (ysyecust/lecture-to-notes, 273 stars) and Pandic Office (Team-Commonly/commonly, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Md To PDF?

Mathews-Tom (a GitHub user) maintains it in Mathews-Tom/armory, which has 329 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on October 6, 2026.

Source: Mathews-Tom/armory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.