| type | skill |
| lifecycle | stable |
| inheritance | inheritable |
| name | book-publishing |
| description | Markdown-to-PDF pipeline via Pandoc and LuaLaTeX with emoji rendering, dual output, and print-ready formatting |
| tier | extended |
| applyTo | **/*book*,**/*publish*,**/*pdf*,**/*pandoc* |
| metadata | {"inheritance":"inheritable"} |
| currency | 2026-04-22T00:00:00.000Z |
Book Publishing
End-to-end book production pipeline: Markdown → Pandoc → LuaLaTeX → dual PDF (print + digital).
Staleness Watch: See EXTERNAL-API-REGISTRY.md for source URLs and recheck cadence
Scope: Inheritable skill. Covers the complete pipeline for producing professional-quality PDF books from Markdown source, including emoji handling, dual format output, and print-ready configuration.
Pipeline Architecture
Markdown Source
↓
Pandoc (--pdf-engine=lualatex)
↓
LuaLaTeX Engine
↓
├── Print PDF (twoside, crop marks, ISBN)
└── Digital PDF (oneside, hyperlinks, bookmarks)
Key Dependencies
| Tool | Version | Purpose |
|---|
| Pandoc | 3.x+ | Markdown → LaTeX conversion |
| LuaLaTeX | TeX Live 2024+ | PDF rendering (Unicode-native) |
| Twemoji | Latest | Cross-platform emoji rendering |
needspace package | LaTeX | Orphan/widow prevention |
Why LuaLaTeX: Native Unicode support (XeLaTeX works but LuaLaTeX handles emoji processing more reliably with Lua filters).
Emoji Handling (Critical)
The ZWJ Problem
Zero Width Joiner (ZWJ) sequences combine multiple emoji into one glyph. Sort order is critical:
| Emoji | Codepoints | Length |
|---|
| 👨👩👧👦 | U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 | 7 |
| 👨👩👧 | U+1F468 U+200D U+1F469 U+200D U+1F467 | 5 |
| 👨👩 | U+1F468 U+200D U+1F469 | 3 |
| 👨 | U+1F468 | 1 |
CRITICAL RULE: The emoji replacement map MUST be sorted by length descending (longest sequences first). If you process 👨 before 👨👩👧👦, the family emoji gets partially replaced and corrupts the output.
Emoji Map File