agentleFS
WeAIClubWeAIClub/md-to-pdf/SKILL.md

md-to-pdf

Skill0 starsChanged 3 months agoMITView on GitHub

Convert a Markdown file into a beautifully typeset PDF via a pandoc → Typst pipeline. Ships with claude-white themes (warm white page, terracotta accents, serif typography). Trigger when the user says "turn this md into a pdf", "export X.md as pdf", "make X.md printable", or any request to produce a nicely formatted PDF from a Markdown file. Requires pandoc and typst installed. Fonts are bundled inside the skill directory — no system font installation needed.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write theme.typ: translate color tokens / typography / components into Typst #set + #show rules

    line 75
  2. Distinctive:

    Write README.md: record typography table and key decisions

    line 76
  3. Distinctive:

    If either binary is missing the script exits with a clear error (no silent fallback).

    line 97
  4. Distinctive:

    Keep one canonical checkout and link both Codex and Claude Code to it:

    line 101

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

md-to-pdf

Convert Markdown into beautifully typeset PDFs. Use this skill whenever the user wants a polished PDF out of a Markdown source.

Usage

./scripts/md_to_pdf.sh <input.md> <output.pdf> [theme]

Arguments:

  • input.md: path to the Markdown file (absolute or relative)
  • output.pdf: destination PDF path
  • theme: theme name, defaults to claude-white. Available: claude-white (recommended), claude-white-bold

On success, the script prints [OK] /absolute/path.pdf.

Architecture

md-to-pdf/
├── SKILL.md                           # this file
├── scripts/
│   └── md_to_pdf.sh                   # main pipeline: pandoc → sed → typst compile
├── themes/
│   ├── claude-white/              # default theme (recommended)
│   │   ├── DESIGN.md                  # design reference
│   │   ├── README.md                  # theme notes (typography, color tokens)
│   │   └── theme.typ                  # Typst template (show / set / color tokens)
│   └── claude-white-bold/         # variant with stronger synthetic bold
│       ├── DESIGN.md
│       ├── README.md
│       └── theme.typ
└── fonts/                             # bundled fonts loaded via typst --font-path

Pipeline

  1. pandoc input.md --to typst → body.typ (Typst body fragment, no template)
  2. perl replaces columns: N, with columns: (1fr,)*N, so Markdown tables span the page width
  3. cat theme.typ body.typ > run.typ (must concatenate, not #include — #include isolates scope and the body would lose access to #let horizontalrule and other theme definitions)
  4. typst compile --font-path <skill>/fonts run.typ output.pdf

Markdown elements styled by the theme

Markdownpandoc outputtheme.typ
# H1= ...centered, 24pt bold
## H2 / ### H3 / #### H4== / === / ====bold, decreasing size, warming color
**bold**#strong[...]bold weight (or stroked synthetic bold in the -bold variant)
*italic*#emph[...]italic style
`code``code`peach background + terracotta text
```lang ```raw blockivory background, rounded corners
> quote#quote(block: true)[...]warm-sand background, terracotta left bar
- item / + item- ... / + ...untouched
[link](url)#link(...)[...]terracotta + underline
---#horizontalrulethin warm-gray rule (defined via #let horizontalrule = ...)
table#figure(align(center)[#table(...)], kind: table)1fr equal columns, 0.4pt warm borders, 1.2pt terracotta header underline

Adding a new theme

To add a new theme (e.g. vercel / notion / mintlify):

  1. Create themes/<name>/
  2. Optionally add DESIGN.md (design reference to translate from)
  3. Write theme.typ: translate color tokens / typography / components into Typst #set + #show rules
  4. Write README.md: record typography table and key decisions
  5. Run: ./scripts/md_to_pdf.sh input.md output.pdf <name>

theme.typ must include:

  • all #let color tokens
  • #set page(...) (with fill + footer)
  • #set text(...) (font stack + size + color)
  • #set par(...) (leading + justify)
  • #show heading.where(level: N): ... for each heading level
  • #show strong / emph / link: ...
  • #show raw.where(block: false/true): ... (inline / block code)
  • #show quote.where(block: true): ...
  • #set table(...) + #set table.hline(...) + #show figure.where(kind: table): ...
  • #let horizontalrule = ... (pandoc emits #horizontalrule, which Typst does not provide built-in)

Dependencies

  • pandoc ≥ 3.2 — on PATH (tested with 3.9.0.2). The Typst writer was added in pandoc 3.2.
  • typst — on PATH (tested with 0.14.2)
  • fonts — bundled under fonts/; the script passes them via typst compile --font-path

If either binary is missing the script exits with a clear error (no silent fallback).

Installing this skill

Keep one canonical checkout and link both Codex and Claude Code to it:

git clone https://github.com/WeAIClub/md-to-pdf ~/Documents/Projects/md-to-pdf
bash ~/Documents/Projects/md-to-pdf/scripts/setup_new_mac.sh

The setup script creates ~/.agents/skills/md-to-pdf and ~/.claude/skills/md-to-pdf symlinks. Restart the agent after installation. Do not maintain copied Skill directories; they drift from the repository.

Known limitations

  • pandoc's Typst writer does not support every Markdown extension (comments, custom block containers, etc.)
  • The bundled serif font has no native 700-weight glyphs, so Typst synthesizes bold from the 500-weight — it reads slightly lighter than a true bold. Use the -bold variant for stronger emphasis (stroke-based synthetic bold).
  • Tables have no manual column-width control (uniform 1fr). For custom ratios, edit the intermediate body.typ manually.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.