Agent skill · Code Review & Quality

any2pdf

Convert Markdown to publication-quality PDF with reportlab — CJK/Latin mixed text, themes, cover pages, watermarks, callouts, formulas, and interactive theme selection

Cosmic Stack3,294★ · 2 repos on radarProfile →
claude-codeMIT
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill any2pdf --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 13 KB
Bundled scripts: none
Version: 1.1.0
Declared author: lovstudio
Path: categories/pdf-generation/any2pdf/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 364
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to Use
  2. Where the Runtime Lives
  3. Quick Start
  4. Pre-Conversion Options (MANDATORY)
  5. Suggested Prompt Template (English)
  6. Mapping User Choices to CLI Args
  7. Theme Name Mapping
  8. Handling AI-Generated Frontispiece
  9. Architecture
  10. Hard-Won Lessons
  11. CJK Characters Rendering as □
  12. Code Blocks Losing Line Breaks
  13. CJK/Latin Word Wrapping
  14. Canvas Text with CJK (Cover / Footer)
Commands it runs
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
More from mercury-agent-skills
All skills →
About this skill
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.

Keep going