any2pdf
Convert Markdown to publication-quality PDF with reportlab — CJK/Latin mixed text, themes, cover pages, watermarks, callouts, formulas, and interactive theme selection
npx skills add cosmicstack-labs/mercury-agent-skills --skill any2pdf --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# any2pdf — Markdown to Professionally Typeset PDF > **Credits.** This skill is adapted from [`lovstudio/any2pdf`](https://github.com/lovstudio/any2pdf) by **lovstudio**, distributed under the MIT license. The original repository ships the Python implementation (`md2pdf.py`), preview gallery, and reference theme JSONs. This document is the Mercury-compatible `SKILL.md` adaptation; the runtime code and design credit belong entirely to the original author. > > - Upstream: https://github.com/lovstudio/any2pdf > - License: MIT (see upstream `LICENSE`) > - Author: lovstudio > - Curator (this entry): cosmicstack-labs This skill converts any Markdown file into a publication-quality PDF using Python's `reportlab`. It was developed through extensive iteration on real Chinese technical reports and solves several hard problems that naive MD→PDF converters get wrong — CJK/Latin mixed text wrapping, canvas CJK rendering on cover/headers/footers, code-block whitespace preservation, and mixed-font fallbacks across macOS, Linux, and Windows. --- ## When to Use Trigger this skill whenever the user: - Wants to convert `.md` → `.pdf` - Has a markdown report or document and wants professional typesett
- When to Use
- Where the Runtime Lives
- Quick Start
- Pre-Conversion Options (MANDATORY)
- Suggested Prompt Template (English)
- Mapping User Choices to CLI Args
- Theme Name Mapping
- Handling AI-Generated Frontispiece
- Architecture
- Hard-Won Lessons
- CJK Characters Rendering as □
- Code Blocks Losing Line Breaks
- CJK/Latin Word Wrapping
- Canvas Text with CJK (Cover / Footer)
mercury skills install pdf-generation/any2pdf Option A: clone alongside (recommended for development) git clone https://github.com/lovstudio/any2pdf.git The script is at: any2pdf/lovstudio-any2pdf/scripts/md2pdf.py Option B: install via the upstream's own installer npx skills add lovstudio/any2pdf -g -y python <path-to>/md2pdf.py \ pip install reportlab Optional — render display formulas as images instead of styled text: pip install matplotlib
What does the any2pdf skill do?
Convert Markdown to publication-quality PDF with reportlab — CJK/Latin mixed text, themes, cover pages, watermarks, callouts, formulas, and interactive theme selection
How do I install it?
Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill any2pdf --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.