{"id":"11baef81-8143-4376-9c41-917505630e81","shortId":"a9bssU","kind":"skill","title":"lovstudio-any2pdf","tagline":"Convert Markdown documents to professionally typeset PDF files. Primary engine: reportlab (cover pages, frontispiece, back cover, bookmarks). Fallback engine: pandoc + XeLaTeX (better table handling, LaTeX-quality typesetting). Handles CJK/Latin mixed text, fenced code blocks, ta","description":"# any2pdf — Markdown to Professional PDF\n\nThis skill converts any Markdown file into a publication-quality PDF using Python's\nreportlab library. It was developed through extensive iteration on real Chinese\ntechnical reports and solves several hard problems that naive MD→PDF converters\nget wrong.\n\n## When to Use\n\n- User wants to convert `.md` → `.pdf`\n- User has a markdown report/document and wants professional typesetting\n- Document contains CJK characters (Chinese/Japanese/Korean) mixed with Latin text\n- Document has fenced code blocks, markdown tables, or nested lists\n- Document has local/remote images, Obsidian callouts, emoji, or math formulas\n- User wants a cover page, table of contents, or watermark in their PDF\n\n## Quick Start\n\n```bash\npython md2pdf/scripts/md2pdf.py \\\n  --input report.md \\\n  --output report.pdf \\\n  --title \"My Report\" \\\n  --author \"Author Name\" \\\n  --theme warm-academic\n```\n\nAll parameters except `--input` are optional — sensible defaults are applied.\n\n## Pre-Conversion Options (MANDATORY)\n\n**IMPORTANT: You MUST use the `AskUserQuestion` tool to ask these questions BEFORE\nrunning the conversion. Do NOT list options as plain text — use the tool so the user\ngets a proper interactive prompt. Ask all options in a SINGLE `AskUserQuestion` call.**\n\nUse `AskUserQuestion` with the following template. The tone should be friendly and\nconcise — like a design assistant, not a config form:\n\n```\n开始转 PDF！先帮你确认几个选项 👇\n\n━━━ 📐 设计风格 ━━━\n a) 暖学术    — 陶土色调，温润典雅，适合人文/社科报告\n b) 经典论文  — 棕色调，灵感源自 LaTeX classicthesis，适合学术论文\n c) Tufte     — 极简留白，深红点缀，适合数据叙事/技术写作\n d) 期刊蓝    — 藏蓝严谨，灵感源自 IEEE，适合正式发表风格\n e) 精装书    — 咖啡色调，书卷气，适合长篇专著/技术书\n f) 中国红    — 朱红配暖纸，适合中文正式报告/白皮书\n g) 水墨      — 纯灰黑，素雅克制，适合文学/设计类内容\n h) GitHub    — 蓝白极简，程序员熟悉的风格\n i) Nord 冰霜 — 蓝灰北欧风，清爽现代\n j) 海洋      — 青绿色调，清新自然\n k) LaTeX 清爽 — pandoc+XeLaTeX 原生排版，无封面无装饰，干净学术风（需装 pandoc+texlive）\n l) 咨询深蓝  — 深海军蓝色块 + 白底 + 大写左对齐标题，麦肯锡 / BCG / Deloitte 研究报告风格\n\n━━━ 🖼 扉页图片（封面之后的全页插图） ━━━\n 1) 跳过\n 2) 我提供本地图片路径\n 3) AI 根据内容自动生成一张\n\n━━━ 💧 水印 ━━━\n 1) 不加\n 2) 自定义文字（如 \"DRAFT\"、\"内部资料\"）\n    可选调整：字号(默认52)、透明度(0-1)、角度(默认35°)、间距\n\n━━━ 📇 封底物料（名片/二维码/品牌） ━━━\n 1) 跳过\n 2) 我提供图片\n 3) 纯文字信息\n\n示例回复：\"a, 扉页跳过, 水印:仅供学习参考, 封底图片:/path/qr.png\"\n直接说人话就行，不用记编号 😄\n```\n\n### Mapping User Choices to CLI Args\n\n| Choice | CLI arg |\n|--------|---------|\n| Design style a-k | `--theme` with value from table below (k uses pandoc engine) |\n| Frontispiece local | `--frontispiece <path>` |\n| Frontispiece AI | Generate image first, then `--frontispiece /tmp/frontispiece.png` |\n| Watermark text | `--watermark \"文字\"` |\n| Watermark style | `--wm-size 30 --wm-opacity 0.1 --wm-angle 45` (all optional) |\n| Image as cover | `--image-cover true` (requires `--frontispiece`) |\n| Back cover image | `--banner <path>` |\n| Back cover text | `--disclaimer \"声明\"` and/or `--copyright \"© 信息\"` |\n\n### Theme Name Mapping\n\n| Choice | `--theme` value | Inspiration |\n|--------|----------------|-------------|\n| a) 暖学术 | `warm-academic` | Lovstudio design system |\n| b) 经典论文 | `classic-thesis` | LaTeX classicthesis |\n| c) Tufte | `tufte` | Edward Tufte's books |\n| d) 期刊蓝 | `ieee-journal` | IEEE journal format |\n| e) 精装书 | `elegant-book` | LaTeX ElegantBook |\n| f) 中国红 | `chinese-red` | Chinese formal documents |\n| g) 水墨 | `ink-wash` | 水墨画 / ink wash painting |\n| h) GitHub | `github-light` | GitHub Markdown style |\n| i) Nord | `nord-frost` | Nord color scheme |\n| j) 海洋 | `ocean-breeze` | — |\n| k) LaTeX 清爽 | `latex-clean` | pandoc+XeLaTeX 原生排版，无封面 |\n| l) 咨询深蓝 | `consulting-navy` | McKinsey / BCG / Deloitte deep-research report |\n\n### Handling AI-Generated Frontispiece\n\nIf user chose AI generation: read the document title + first paragraphs, use an\nimage generation tool to create a themed illustration matching the chosen design\nstyle, show for approval, then pass via `--frontispiece /path/to/image.png`\n\n## Architecture\n\n```\nMarkdown → Preprocess (split merged headings) → Parse (code-fence-aware) → Story (reportlab flowables) → PDF build\n```\n\nKey components:\n1. **Font system**: Palatino (Latin body), Songti SC (CJK body), Menlo (code) on macOS; auto-fallback on Linux\n2. **CJK wrapper**: `_font_wrap()` wraps CJK character runs in `<font>` tags for automatic font switching\n3. **Mixed text renderer**: `_draw_mixed()` handles CJK/Latin mixed text on canvas (cover, headers, footers)\n4. **Code block handler**: `esc_code()` preserves indentation, mid-line alignment, and line breaks in reportlab Paragraphs\n5. **Smart table widths**: Proportional column widths based on content length, with 18mm minimum\n6. **Bookmark system**: `ChapterMark` flowable creates PDF sidebar bookmarks + named anchors\n7. **Heading preprocessor**: `_preprocess_md()` splits merged headings like `# Part## Chapter` into separate lines\n8. **Image handler**: local, relative, `file://`, and remote markdown images are scaled into the body frame with fallback text on errors\n9. **Callout renderer**: Obsidian-style `> [!NOTE]` blocks render as themed boxed callouts\n10. **Formula renderer**: display formulas use optional matplotlib mathtext images, with styled text fallback\n11. **Emoji fallback**: emoji are rendered as cached Twemoji PNGs when available, or with a local emoji font fallback\n\n## Hard-Won Lessons\n\n### CJK Characters Rendering as □\n\nreportlab's `Paragraph` only uses the font in ParagraphStyle. If `fontName=\"Mono\"` but\ntext contains Chinese, they render as □. **Fix**: Always apply `_font_wrap()` to ALL text\nthat might contain CJK, including code blocks.\n\n### Code Blocks Losing Line Breaks\n\nreportlab treats `\\n` as whitespace. **Fix**: `esc_code()` converts `\\n` → `<br/>` and\nall spaces → `&nbsp;`, preserving indentation and mid-line alignment before `_font_wrap()`.\n\n### CJK/Latin Word Wrapping\n\nDefault reportlab breaks lines only at spaces, causing ugly splits like \"Claude\\nCode\".\n**Fix**: Set `wordWrap='CJK'` on body/bullet styles to allow breaks at CJK character boundaries.\n\n### Canvas Text with CJK (Cover/Footer)\n\n`drawString()` / `drawCentredString()` with a Latin font can't render 年/月/日 etc.\n**Fix**: Use `_draw_mixed()` for ALL user-content canvas text (dates, stats, disclaimers).\n\n### Images Silently Dropped (Relative Paths)\n\n`![alt](charts/chart_01.png)` in a markdown file used to get skipped without warning\nbecause the image path was resolved against the current working directory, not the\nmarkdown's directory. **Fix**: `main()` now passes `input_dir` (the .md's directory)\ninto the builder, and the image handler resolves relative paths against it. Missing\nimages now also emit a `WARN: image not found: ...` to stderr instead of silently\ndropping.\n\n### Multi-Line Image References (pandoc `--wrap=auto`)\n\nWhen feeding pandoc's output into md2pdf, pandoc's default `--wrap=auto` (72 cols)\nwraps long `![alt text very long](path.png)` across multiple lines, which defeated\nthe single-line image regex. **Fix**: `_preprocess_md()` now collapses multi-line\nimage references into one line (outside code fences) before parsing.\n\n**Pipeline tip:** If you're piping HTML → markdown via pandoc, use\n`pandoc --wrap=none input.html -o output.md` to avoid wrap-related parsing issues\nfor images and tables alike.\n\n## Input Format\n\nThis skill takes **Markdown files only** as input. If you have HTML, DOCX, or\nother formats, convert them to markdown first (e.g. `pandoc --wrap=none`).\nEmbedded HTML blocks in markdown are passed through as text — pre-process any\nvisual content (charts, complex tables) into plain markdown tables or image\nreferences before invoking md2pdf.\n\n## Configuration Reference\n\nMost options can also be set in top-of-file YAML-style frontmatter. Explicit CLI\narguments take precedence over frontmatter values.\n\n| Argument | Frontmatter Key | Default | Description |\n|----------|----------------|---------|-------------|\n| `--input` | — | (required) | Path to markdown file |\n| `--output` | — | `output.pdf` | Output PDF path |\n| `--title` | `title` | From first H1 | Document title for cover page |\n| `--subtitle` | `subtitle` | `\"\"` | Subtitle text |\n| `--author` | `author` | `\"\"` | Author name |\n| `--date` | `date` | Today | Date string |\n| `--version` | `version` | `\"\"` | Version string for cover |\n| `--watermark` | `watermark` | `\"\"` | Watermark text (empty = none) |\n| `--theme` | `theme` | `warm-academic` | Color theme name |\n| `--theme-file` | — | `\"\"` | Custom theme JSON file path |\n| `--cover` | `cover` | `true` | Generate cover page |\n| `--toc` | `toc` | `true` | Generate table of contents |\n| `--page-size` | `page-size` | `A4` | Page size (A4 or Letter) |\n| `--frontispiece` | `frontispiece` | `\"\"` | Full-page image after cover |\n| `--banner` | `banner` | bundled `assets/backcover-banner.jpg` | Back cover banner image (pass `none` to disable) |\n| `--header-title` | `header-title` | `\"\"` | Report title in page header |\n| `--footer-left` | `footer-left` | author | Brand/author in footer |\n| `--stats-line` | `stats-line` | `\"\"` | Stats on cover |\n| `--stats-line2` | `stats-line2` | `\"\"` | Second stats line |\n| `--edition-line` | `edition-line` | `\"\"` | Edition line at cover bottom |\n| `--disclaimer` | `disclaimer` | `\"\"` | Back cover disclaimer |\n| `--copyright` | `copyright` | `\"\"` | Back cover copyright |\n| `--code-max-lines` | `code-max-lines` | `30` | Max lines per code block |\n| `--image-cover` | `image-cover` | `false` | Use frontispiece as full-bleed cover (page 1), text cover becomes page 2 |\n| `--heading-top-spacer` | `heading-top-spacer` | `5` | Top spacer before H1/H2 chapter titles in mm |\n| `--wm-size` | `wm-size` | auto (half page width) | Watermark font size; auto-scales so text width ≈ 50% of page width |\n| `--wm-opacity` | `wm-opacity` | `0.1` | Watermark opacity (0.0–1.0) |\n| `--wm-angle` | `wm-angle` | `35` | Watermark rotation angle in degrees |\n| `--wm-spacing-x` | `wm-spacing-x` | `9999` | Watermark horizontal spacing in pt (≥2000 = single centered per page) |\n| `--wm-spacing-y` | `wm-spacing-y` | `9999` | Watermark vertical spacing in pt (≥2000 = single centered per page) |\n\n## Themes\n\nAvailable: `warm-academic`, `nord-frost`, `github-light`, `solarized-light`,\n`paper-classic`, `ocean-breeze`, `consulting-navy`.\n\nEach theme defines: page background, ink color, accent color, faded text, border, code background, watermark tint.\n\n## Fallback: pandoc + XeLaTeX\n\nWhen reportlab fails (e.g. wide/complex tables cause infinite loops in table width\ncalculation), fall back to pandoc with XeLaTeX. This produces high-quality CJK PDFs\nwith proper table handling.\n\n### When to use pandoc engine\n\n- User chose `latex-clean` theme (k) — pandoc is the primary engine, not a fallback\n- Document has many wide multi-column tables (reportlab's table layout may hang)\n- Document needs LaTeX-quality typesetting (justified text, hyphenation)\n- reportlab md2pdf.py hangs or crashes on the input\n\n### Basic command\n\n    pandoc input.md -o output.pdf \\\n      --pdf-engine=xelatex \\\n      -V CJKmainfont=\"Songti SC\" -V mainfont=\"Palatino\" -V monofont=\"Menlo\" \\\n      -V geometry:margin=2.5cm -V fontsize=11pt \\\n      --toc -V toc-title=\"目录\" -V documentclass=article\n\n### Adding watermark + headers/footers\n\n    pandoc input.md -o output.pdf \\\n      --pdf-engine=xelatex \\\n      -V CJKmainfont=\"Songti SC\" -V mainfont=\"Palatino\" -V monofont=\"Menlo\" \\\n      -V geometry:margin=2.5cm -V fontsize=11pt \\\n      -V colorlinks=true -V linkcolor=red -V toccolor=red -V urlcolor=red \\\n      --toc -V toc-title=\"目录\" -V documentclass=article \\\n      -V header-includes='\n    \\usepackage{fancyhdr}\n    \\pagestyle{fancy}\n    \\fancyhf{}\n    \\fancyhead[L]{\\small 页眉左侧文字}\n    \\fancyhead[R]{\\small 页眉右侧文字}\n    \\fancyfoot[C]{\\thepage}\n    \\usepackage{draftwatermark}\n    \\SetWatermarkText{水印文字}\n    \\SetWatermarkScale{0.5}\n    \\SetWatermarkColor[gray]{0.9}\n    '\n\n### Pandoc theme presets\n\nEach preset defines a complete set of pandoc `-V` flags. Use the full command from\n\"Adding watermark + headers/footers\" above, replacing the color/link flags per preset.\n\n| Theme | linkcolor | toccolor | urlcolor | Watermark color | Notes |\n|-------|-----------|----------|----------|-----------------|-------|\n| chinese-red | `red` | `red` | `red` | `[gray]{0.9}` | 朱红正式，适合政企报告、白皮书 |\n| warm-academic | `brown` | `brown` | `brown` | `[gray]{0.9}` | 陶土色调，温润学术风 |\n| classic-thesis | `brown` | `brown` | `brown` | `[gray]{0.85}` | LaTeX classicthesis 灵感 |\n| ieee-journal | `blue` | `blue` | `blue` | `[gray]{0.9}` | 藏蓝严谨，期刊风格 |\n| github-light | `blue` | `blue` | `blue` | `[gray]{0.92}` | 极简蓝白，程序员友好 |\n| ink-wash | `black` | `black` | `black` | `[gray]{0.92}` | 水墨素雅，文学/设计类 |\n| nord-frost | `teal` | `teal` | `teal` | `[gray]{0.9}` | 北欧冰霜蓝灰 |\n| consulting-navy | `blue` | `blue` | `blue` | `[gray]{0.88}` | 咨询深蓝，研究报告风 |\n\n#### chinese-red 完整示例（本次一滕项目实际使用）\n\n    pandoc input.md -o output.pdf \\\n      --pdf-engine=xelatex \\\n      -V CJKmainfont=\"Songti SC\" -V mainfont=\"Palatino\" -V monofont=\"Menlo\" \\\n      -V geometry:margin=2.5cm -V fontsize=11pt \\\n      -V colorlinks=true -V linkcolor=red -V toccolor=red -V urlcolor=red \\\n      --toc -V toc-title=\"目录\" -V documentclass=article \\\n      -V header-includes='\n    \\usepackage{fancyhdr}\n    \\pagestyle{fancy}\n    \\fancyhf{}\n    \\fancyhead[L]{\\small 报告标题 | 品牌名}\n    \\fancyhead[R]{\\small 商业机密}\n    \\fancyfoot[C]{\\thepage}\n    \\usepackage{draftwatermark}\n    \\SetWatermarkText{商业机密}\n    \\SetWatermarkScale{0.5}\n    \\SetWatermarkColor[gray]{0.9}\n    '\n\n#### latex-clean 完整示例（最简洁的 LaTeX 学术风格）\n\n选择 `latex-clean` 时，**跳过 reportlab**，直接使用 pandoc 生成。特点：无封面、无扉页、\n无装饰色块，纯 LaTeX 排版 + 点线 TOC 引导符，适合内容为王的学术/技术文档。\n\n    pandoc input.md -o output.pdf \\\n      --pdf-engine=xelatex \\\n      -V CJKmainfont=\"Songti SC\" -V mainfont=\"Palatino\" -V monofont=\"Menlo\" \\\n      -V geometry:margin=2.5cm -V fontsize=11pt \\\n      -V colorlinks=true -V linkcolor=brown -V toccolor=brown -V urlcolor=brown \\\n      --toc -V toc-title=\"目录\" -V documentclass=article\n\n如需添加页眉页脚或水印，参考上方 \"Adding watermark + headers/footers\" 追加 `-V header-includes`。\n\n### Known limitations (pandoc fallback)\n\n- No cover page (pandoc article class has no built-in cover — use `--include-before-body` with a LaTeX snippet if needed)\n- Frontispiece/back cover not supported (use md2pdf.py for these)\n- `→` `★` `☆` symbols may warn in Palatino — they render via CJK font fallback, safe to ignore\n- ASCII art diagrams render as code blocks (same as md2pdf.py)\n\n### Dependencies (pandoc fallback)\n\nRequires `pandoc` and a TeX distribution with XeLaTeX:\n\n    brew install pandoc\n    brew install --cask mactex-no-gui   # or basictex\n\n## Dependencies\n\n```bash\npip install reportlab --break-system-packages\n# Optional formula rendering:\npip install matplotlib --break-system-packages\n```\n\nRecommended Ubuntu/Debian fonts:\n\n```bash\nsudo apt install fonts-dejavu-core fonts-liberation fonts-freefont-ttf fonts-noto fonts-noto-cjk fonts-noto-color-emoji\n```","tags":["any2pdf","skills","lovstudio","agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"capabilities":["skill","source-lovstudio","skill-any2pdf","topic-agent-skills","topic-ai-coding-assistant","topic-cjk","topic-claude-code","topic-cursor","topic-gemini-cli","topic-markdown-to-docx","topic-markdown-to-pdf"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/lovstudio/skills/any2pdf","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add lovstudio/skills","source_repo":"https://github.com/lovstudio/skills","install_from":"skills.sh"}},"qualityScore":"0.477","qualityRationale":"deterministic score 0.48 from registry signals: · indexed on github topic:agent-skills · 54 github stars · SKILL.md body (14,819 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:57:48.080Z","embedding":null,"createdAt":"2026-04-18T22:18:52.100Z","updatedAt":"2026-05-18T18:57:48.080Z","lastSeenAt":"2026-05-18T18:57:48.080Z","tsv":"'-1':342 '/path/qr.png':362 '/path/to/image.png':583 '/tmp/frontispiece.png':399 '0':341 '0.0':1401 '0.1':413,1398 '0.5':1688,1887 '0.85':1755 '0.88':1806 '0.9':1691,1734,1745,1766,1797,1890 '0.92':1776,1786 '1':322,330,350,602,1346 '1.0':1402 '10':741 '11':755 '11pt':1603,1641,1839,1945 '18mm':681 '2':324,332,352,621,1351 '2.5':1599,1637,1835,1941 '2000':1429,1448 '3':326,354,636 '30':409,1325 '35':1409 '4':651 '45':417 '5':669,1360 '50':1388 '6':683 '7':694 '72':997 '8':708 '9':728 '9999':1423,1442 'a-k':376 'a4':1231,1234 'academ':163,452,1200,1457,1740 'accent':1483 'across':1006 'ad':1613,1710,1969 'ai':327,393,547,553 'ai-gener':546 'align':662,840 'alik':1063 'allow':868 'also':964,1125 'alt':911,1001 'alway':802 'anchor':693 'and/or':438 'angl':416,1405,1408,1412 'any2pdf':3,40 'appli':173,803 'approv':578 'apt':2083 'architectur':584 'arg':370,373 'argument':1139,1145 'art':2027 'articl':1612,1662,1860,1966,1985 'ascii':2026 'ask':187,212 'askuserquest':184,218,221 'assets/backcover-banner.jpg':1248 'assist':236 'author':157,158,1175,1176,1177,1274 'auto':617,984,996,1375,1383 'auto-fallback':616 'auto-scal':1382 'automat':633 'avail':766,1454 'avoid':1053 'awar':594 'b':251,456 'back':18,429,433,1249,1309,1314,1509 'background':1480,1489 'banner':432,1245,1246,1251 'base':676 'bash':147,2060,2081 'basic':1576 'basictex':2058 'bcg':317,539 'becom':1349 'better':25 'black':1782,1783,1784 'bleed':1343 'block':38,116,653,735,815,817,1093,1330,2032 'blue':1762,1763,1764,1772,1773,1774,1802,1803,1804 'bodi':607,611,721,1997 'body/bullet':865 'book':469,482 'bookmark':20,684,691 'border':1487 'bottom':1306 'boundari':873 'box':739 'brand/author':1275 'break':665,820,849,869,2065,2075 'break-system-packag':2064,2074 'breez':522,1472 'brew':2047,2050 'brown':1741,1742,1743,1751,1752,1753,1951,1954,1957 'build':599 'builder':951 'built':1990 'built-in':1989 'bundl':1247 'c':258,463,1681,1880 'cach':762 'calcul':1507 'call':219 'callout':127,729,740 'canva':647,874,901 'cask':2052 'caus':854,1501 'center':1431,1450 'chapter':704,1365 'chaptermark':686 'charact':106,628,779,872 'chart':1107 'charts/chart_01.png':912 'chines':70,488,490,797,1728,1810 'chinese-r':487,1727,1809 'chinese/japanese/korean':107 'choic':367,371,444 'chose':552,1531 'chosen':573 'cjk':105,610,622,627,778,812,863,871,877,1519,2020,2102 'cjk/latin':33,643,844 'cjkmainfont':1587,1625,1823,1929 'class':1986 'classic':459,1469,1749 'classic-thesi':458,1748 'classicthesi':256,462,1757 'claud':858 'clean':528,1534,1893,1901 'cli':369,372,1138 'cm':1600,1638,1836,1942 'code':37,115,592,613,652,656,814,816,828,1031,1318,1322,1329,1488,2031 'code-fence-awar':591 'code-max-lin':1317,1321 'col':998 'collaps':1021 'color':516,1201,1482,1484,1725,2106 'color/link':1716 'colorlink':1643,1841,1947 'column':674,1551 'command':1577,1708 'complet':1699 'complex':1108 'compon':601 'concis':232 'config':239 'configur':1120 'consult':536,1474,1800 'consulting-navi':535,1473,1799 'contain':104,796,811 'content':139,678,900,1106,1224 'convers':176,193 'convert':4,47,82,91,829,1082 'copyright':439,1312,1313,1316 'core':2088 'cover':15,19,135,422,425,430,434,648,1169,1189,1212,1213,1216,1244,1250,1286,1305,1310,1315,1333,1336,1344,1348,1982,1992,2005 'cover/footer':878 'crash':1572 'creat':567,688 'current':931 'custom':1207 'd':264,470 'date':903,1179,1180,1182 'deep':542 'deep-research':541 'default':171,847,994,1148 'defeat':1010 'defin':1478,1697 'degre':1414 'dejavu':2087 'deloitt':318,540 'depend':2036,2059 'descript':1149 'design':235,374,454,574 'develop':64 'diagram':2028 'dir':944 'directori':933,938,948 'disabl':1256 'disclaim':436,905,1307,1308,1311 'display':744 'distribut':2044 'document':6,103,112,122,492,557,1166,1545,1559 'documentclass':1611,1661,1859,1965 'docx':1078 'draft':335 'draftwatermark':1684,1883 'draw':640,894 'drawcentredstr':880 'drawstr':879 'drop':908,976 'e':270,478 'e.g':1087,1498 'edit':1297,1300,1302 'edition-lin':1296,1299 'edward':466 'eleg':481 'elegant-book':480 'elegantbook':484 'embed':1091 'emit':965 'emoji':128,756,758,771,2107 'empti':1194 'engin':13,22,388,1529,1541,1584,1622,1820,1926 'error':727 'esc':655,827 'etc':891 'except':166 'explicit':1137 'extens':66 'f':276,485 'fade':1485 'fail':1497 'fall':1508 'fallback':21,618,724,754,757,773,1492,1544,1980,2022,2038 'fals':1337 'fanci':1670,1868 'fancyfoot':1680,1879 'fancyhdr':1668,1866 'fancyhead':1672,1676,1870,1875 'fancyhf':1671,1869 'feed':986 'fenc':36,114,593,1032 'file':11,50,916,1070,1132,1155,1206,1210 'first':396,559,1086,1164 'fix':801,826,860,892,939,1017 'flag':1704,1717 'flowabl':597,687 'follow':224 'font':603,624,634,772,788,804,842,884,1380,2021,2080,2086,2090,2093,2097,2100,2104 'fontnam':792 'fonts-dejavu-cor':2085 'fonts-freefont-ttf':2092 'fonts-liber':2089 'fonts-noto':2096 'fonts-noto-cjk':2099 'fonts-noto-color-emoji':2103 'fontsiz':1602,1640,1838,1944 'footer':650,1269,1272,1277 'footer-left':1268,1271 'form':240 'formal':491 'format':477,1065,1081 'formula':131,742,745,2069 'found':970 'frame':722 'freefont':2094 'friend':230 'frontispiec':17,389,391,392,398,428,549,582,1237,1238,1339 'frontispiece/back':2004 'frontmatt':1136,1143,1146 'frost':514,1460,1792 'full':1240,1342,1707 'full-ble':1341 'full-pag':1239 'g':281,493 'generat':394,548,554,564,1215,1221 'geometri':1597,1635,1833,1939 'get':83,207,919 'github':288,503,505,507,1462,1770 'github-light':504,1461,1769 'gray':1690,1733,1744,1754,1765,1775,1785,1796,1805,1889 'gui':2056 'h':287,502 'h1':1165 'h1/h2':1364 'half':1376 'handl':27,32,545,642,1524 'handler':654,710,955 'hang':1558,1570 'hard':76,775 'hard-won':774 'head':589,695,701,1353,1357 'header':649,1258,1261,1267,1665,1863,1975 'header-includ':1664,1862,1974 'header-titl':1257,1260 'headers/footers':1615,1712,1971 'heading-top-spac':1352,1356 'high':1517 'high-qual':1516 'horizont':1425 'html':1041,1077,1092 'hyphen':1567 'ieee':268,473,475,1760 'ieee-journ':472,1759 'ignor':2025 'illustr':570 'imag':125,395,420,424,431,563,709,716,750,906,925,954,962,968,980,1015,1025,1060,1115,1242,1252,1332,1335 'image-cov':423,1331,1334 'import':179 'includ':813,1666,1864,1976,1995 'include-before-bodi':1994 'indent':658,835 'infinit':1502 'ink':496,499,1481,1780 'ink-wash':495,1779 'input':150,167,943,1064,1073,1150,1575 'input.html':1049 'input.md':1579,1617,1815,1921 'inspir':447 'instal':2048,2051,2062,2072,2084 'instead':973 'interact':210 'invok':1118 'issu':1058 'iter':67 'j':296,518 'journal':474,476,1761 'json':1209 'justifi':1565 'k':300,378,385,523,1536 'key':600,1147 'known':1977 'l':311,533,1673,1871 'latex':29,255,301,461,483,524,527,1533,1562,1756,1892,1896,1900,1913,2000 'latex-clean':526,1532,1891,1899 'latex-qu':28,1561 'latin':110,606,883 'layout':1556 'left':1270,1273 'length':679 'lesson':777 'letter':1236 'liber':2091 'librari':61 'light':506,1463,1466,1771 'like':233,702,857 'limit':1978 'line':661,664,707,819,839,850,979,1008,1014,1024,1029,1280,1283,1295,1298,1301,1303,1320,1324,1327 'line2':1289,1292 'linkcolor':1646,1721,1844,1950 'linux':620 'list':121,196 'local':390,711,770 'local/remote':124 'long':1000,1004 'loop':1503 'lose':818 'lovstudio':2,453 'lovstudio-any2pdf':1 'maco':615 'mactex':2054 'mactex-no-gui':2053 'main':940 'mainfont':1591,1629,1827,1933 'mandatori':178 'mani':1547 'map':365,443 'margin':1598,1636,1834,1940 'markdown':5,41,49,97,117,508,585,715,915,936,1042,1069,1085,1095,1112,1154 'match':571 'math':130 'mathtext':749 'matplotlib':748,2073 'max':1319,1323,1326 'may':1557,2013 'mckinsey':538 'md':80,92,698,946,1019 'md2pdf':991,1119 'md2pdf.py':1569,2009,2035 'md2pdf/scripts/md2pdf.py':149 'menlo':612,1595,1633,1831,1937 'merg':588,700 'mid':660,838 'mid-lin':659,837 'might':810 'minimum':682 'miss':961 'mix':34,108,637,641,644,895 'mm':1368 'mono':793 'monofont':1594,1632,1830,1936 'multi':978,1023,1550 'multi-column':1549 'multi-lin':977,1022 'multipl':1007 'must':181 'n':823,830 'naiv':79 'name':159,442,692,1178,1203 'navi':537,1475,1801 'ncode':859 'need':1560,2003 'nest':120 'none':1048,1090,1195,1254 'nord':292,511,513,515,1459,1791 'nord-frost':512,1458,1790 'note':734,1726 'noto':2098,2101,2105 'o':1050,1580,1618,1816,1922 'obsidian':126,732 'obsidian-styl':731 'ocean':521,1471 'ocean-breez':520,1470 'one':1028 'opac':412,1394,1397,1400 'option':169,177,197,214,419,747,1123,2068 'output':152,989,1156,1158 'output.md':1051 'output.pdf':1157,1581,1619,1817,1923 'outsid':1030 'packag':2067,2077 'page':16,136,1170,1217,1226,1229,1232,1241,1266,1345,1350,1377,1390,1433,1452,1479,1983 'page-s':1225,1228 'pagestyl':1669,1867 'paint':501 'palatino':605,1592,1630,1828,1934,2016 'pandoc':23,303,309,387,529,982,987,992,1044,1046,1088,1493,1511,1528,1537,1578,1616,1692,1702,1814,1906,1920,1979,1984,2037,2040,2049 'paper':1468 'paper-class':1467 'paragraph':560,668,784 'paragraphstyl':790 'paramet':165 'pars':590,1034,1057 'part':703 'pass':580,942,1097,1253 'path':910,926,958,1152,1160,1211 'path.png':1005 'pdf':10,44,56,81,93,144,242,598,689,1159,1583,1621,1819,1925 'pdf-engin':1582,1620,1818,1924 'pdfs':1520 'per':1328,1432,1451,1718 'pip':2061,2071 'pipe':1040 'pipelin':1035 'plain':199,1111 'pngs':764 'pre':175,1102 'pre-convers':174 'pre-process':1101 'preced':1141 'preprocess':586,697,1018 'preprocessor':696 'preserv':657,834 'preset':1694,1696,1719 'primari':12,1540 'problem':77 'process':1103 'produc':1515 'profession':8,43,101 'prompt':211 'proper':209,1522 'proport':673 'pt':1428,1447 'public':54 'publication-qu':53 'python':58,148 'qualiti':30,55,1518,1563 'question':189 'quick':145 'r':1677,1876 're':1039 'read':555 'real':69 'recommend':2078 'red':489,1647,1650,1653,1729,1730,1731,1732,1811,1845,1848,1851 'refer':981,1026,1116,1121 'regex':1016 'relat':712,909,957,1056 'remot':714 'render':639,730,736,743,760,780,799,887,2018,2029,2070 'replac':1714 'report':72,156,544,1263 'report.md':151 'report.pdf':153 'report/document':98 'reportlab':14,60,596,667,782,821,848,1496,1553,1568,1904,2063 'requir':427,1151,2039 'research':543 'resolv':928,956 'rotat':1411 'run':191,629 'safe':2023 'sc':609,1589,1627,1825,1931 'scale':718,1384 'scheme':517 'second':1293 'sensibl':170 'separ':706 'set':861,1127,1700 'setwatermarkcolor':1689,1888 'setwatermarkscal':1687,1886 'setwatermarktext':1685,1884 'sever':75 'show':576 'sidebar':690 'silent':907,975 'singl':217,1013,1430,1449 'single-lin':1012 'size':408,1227,1230,1233,1371,1374,1381 'skill':46,1067 'skill-any2pdf' 'skip':920 'small':1674,1678,1872,1877 'smart':670 'snippet':2001 'solar':1465 'solarized-light':1464 'solv':74 'songti':608,1588,1626,1824,1930 'source-lovstudio' 'space':833,853,1417,1421,1426,1436,1440,1445 'spacer':1355,1359,1362 'split':587,699,856 'start':146 'stat':904,1279,1282,1284,1288,1291,1294 'stats-lin':1278,1281 'stats-line2':1287,1290 'stderr':972 'stori':595 'string':1183,1187 'style':375,405,509,575,733,752,866,1135 'subtitl':1171,1172,1173 'sudo':2082 'support':2007 'switch':635 'symbol':2012 'system':455,604,685,2066,2076 'ta':39 'tabl':26,118,137,383,671,1062,1109,1113,1222,1500,1505,1523,1552,1555 'tag':631 'take':1068,1140 'teal':1793,1794,1795 'technic':71 'templat':225 'tex':2043 'texliv':310 'text':35,111,200,401,435,638,645,725,753,795,808,875,902,1002,1100,1174,1193,1347,1386,1486,1566 'theme':160,379,441,445,569,738,1196,1197,1202,1205,1208,1453,1477,1535,1693,1720 'theme-fil':1204 'thepag':1682,1881 'thesi':460,1750 'tint':1491 'tip':1036 'titl':154,558,1161,1162,1167,1259,1262,1264,1366,1608,1658,1856,1962 'toc':1218,1219,1604,1607,1654,1657,1852,1855,1916,1958,1961 'toc-titl':1606,1656,1854,1960 'toccolor':1649,1722,1847,1953 'today':1181 'tone':227 'tool':185,203,565 'top':1130,1354,1358,1361 'top-of-fil':1129 'topic-agent-skills' 'topic-ai-coding-assistant' 'topic-cjk' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-markdown-to-docx' 'topic-markdown-to-pdf' 'treat':822 'true':426,1214,1220,1644,1842,1948 'ttf':2095 'tuft':259,464,465,467 'twemoji':763 'typeset':9,31,102,1564 'ubuntu/debian':2079 'ugli':855 'urlcolor':1652,1723,1850,1956 'use':57,87,182,201,220,386,561,746,786,893,917,1045,1338,1527,1705,1993,2008 'usepackag':1667,1683,1865,1882 'user':88,94,132,206,366,551,899,1530 'user-cont':898 'v':1586,1590,1593,1596,1601,1605,1610,1624,1628,1631,1634,1639,1642,1645,1648,1651,1655,1660,1663,1703,1822,1826,1829,1832,1837,1840,1843,1846,1849,1853,1858,1861,1928,1932,1935,1938,1943,1946,1949,1952,1955,1959,1964,1973 'valu':381,446,1144 'version':1184,1185,1186 'vertic':1444 'via':581,1043,2019 'visual':1105 'want':89,100,133 'warm':162,451,1199,1456,1739 'warm-academ':161,450,1198,1455,1738 'warn':922,967,2014 'wash':497,500,1781 'watermark':141,400,402,404,1190,1191,1192,1379,1399,1410,1424,1443,1490,1614,1711,1724,1970 'whitespac':825 'wide':1548 'wide/complex':1499 'width':672,675,1378,1387,1391,1506 'without':921 'wm':407,411,415,1370,1373,1393,1396,1404,1407,1416,1420,1435,1439 'wm-angl':414,1403,1406 'wm-opac':410,1392,1395 'wm-size':406,1369,1372 'wm-spacing-i':1434,1438 'wm-spacing-x':1415,1419 'won':776 'word':845 'wordwrap':862 'work':932 'wrap':625,626,805,843,846,983,995,999,1047,1055,1089 'wrap-rel':1054 'wrapper':623 'wrong':84 'x':1418,1422 'xelatex':24,304,530,1494,1513,1585,1623,1821,1927,2046 'y':1437,1441 'yaml':1134 'yaml-styl':1133 '不加':331 '不用记编号':364 '中国红':277,486 '书卷气':273 '二维码':348 '仅供学习参考':360 '信息':440 '先帮你确认几个选项':243 '内部资料':336 '冰霜':293 '北欧冰霜蓝灰':1798 '原生排版':305,531 '参考上方':1968 '可选调整':337 '名片':347 '咖啡色调':272 '咨询深蓝':312,534,1807 '品牌':349 '品牌名':1874 '商业机密':1878,1885 '声明':437 '大写左对齐标题':315 '如':334 '如需添加页眉页脚或水印':1967 '字号':338 '学术风格':1897 '完整示例':1812,1894 '封底图片':361 '封底物料':346 '封面之后的全页插图':321 '干净学术风':307 '年':888 '开始转':241 '引导符':1917 '我提供图片':353 '我提供本地图片路径':325 '扉页图片':320 '扉页跳过':358 '技术书':275 '技术写作':263 '技术文档':1919 '报告标题':1873 '排版':1914 '文字':403 '文学':1788 '无封面':532,1909 '无封面无装饰':306 '无扉页':1910 '无装饰色块':1911 '日':890 '时':1902 '暖学术':246,449 '最简洁的':1895 '月':889 '期刊蓝':265,471 '期刊风格':1768 '本次一滕项目实际使用':1813 '朱红正式':1735 '朱红配暖纸':278 '极简留白':260 '极简蓝白':1777 '根据内容自动生成一张':328 '棕色调':253 '水印':329,359 '水印文字':1686 '水墨':282,494 '水墨画':498 '水墨素雅':1787 '海洋':297,519 '深海军蓝色块':313 '深红点缀':261 '清新自然':299 '清爽':302,525 '清爽现代':295 '温润典雅':248 '温润学术风':1747 '灵感':1758 '灵感源自':254,267 '点线':1915 '特点':1908 '生成':1907 '白底':314 '白皮书':280,1737 '目录':1609,1659,1857,1963 '直接使用':1905 '直接说人话就行':363 '研究报告风':1808 '研究报告风格':319 '示例回复':356 '社科报告':250 '程序员友好':1778 '程序员熟悉的风格':290 '精装书':271,479 '素雅克制':284 '纯':1912 '纯文字信息':355 '纯灰黑':283 '经典论文':252,457 '自定义文字':333 '蓝灰北欧风':294 '蓝白极简':289 '藏蓝严谨':266,1767 '角度':343 '设计类':1789 '设计类内容':286 '设计风格':244 '跳过':323,351,1903 '追加':1972 '适合中文正式报告':279 '适合人文':249 '适合内容为王的学术':1918 '适合学术论文':257 '适合政企报告':1736 '适合数据叙事':262 '适合文学':285 '适合正式发表风格':269 '适合长篇专著':274 '选择':1898 '透明度':340 '间距':345 '陶土色调':247,1746 '需装':308 '青绿色调':298 '页眉右侧文字':1679 '页眉左侧文字':1675 '麦肯锡':316 '默认35':344 '默认52':339","prices":[{"id":"46f524af-1c10-495d-bd23-e2261b7b1e45","listingId":"11baef81-8143-4376-9c41-917505630e81","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"lovstudio","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:18:52.100Z"}],"sources":[{"listingId":"11baef81-8143-4376-9c41-917505630e81","source":"github","sourceId":"lovstudio/skills/any2pdf","sourceUrl":"https://github.com/lovstudio/skills/tree/main/skills/any2pdf","isPrimary":false,"firstSeenAt":"2026-04-18T22:18:52.100Z","lastSeenAt":"2026-05-18T18:57:48.080Z"}],"details":{"listingId":"11baef81-8143-4376-9c41-917505630e81","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"lovstudio","slug":"any2pdf","github":{"repo":"lovstudio/skills","stars":54,"topics":["agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"license":"mit","html_url":"https://github.com/lovstudio/skills","pushed_at":"2026-05-17T09:28:31Z","description":"Top-level index for the Lovstudio skills ecosystem","skill_md_sha":"a3bce6d5592e407f9beeff8055159f92d19e431a","skill_md_path":"skills/any2pdf/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/lovstudio/skills/tree/main/skills/any2pdf"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"lovstudio-any2pdf","license":"MIT","description":"Convert Markdown documents to professionally typeset PDF files. Primary engine: reportlab (cover pages, frontispiece, back cover, bookmarks). Fallback engine: pandoc + XeLaTeX (better table handling, LaTeX-quality typesetting). Handles CJK/Latin mixed text, fenced code blocks, tables, blockquotes, Obsidian callouts, inline images, emoji fallback, LaTeX-style formulas, clickable TOC, watermarks, headers/footers, and page numbers. Supports multiple color themes and is battle-tested for Chinese technical reports. Trigger when user mentions \"markdown to PDF\", \"md2pdf\", \"any2pdf\", \"md转pdf\", \"报告生成\", \"导出pdf\", or wants a professionally formatted PDF from markdown.","compatibility":"Requires Python 3.8+ and reportlab (`pip install reportlab`). Optional: matplotlib (`pip install matplotlib`) for rendered display formulas. macOS: uses Palatino, Songti SC, Menlo (pre-installed). Linux: uses DejaVu/Liberation/FreeFont/Noto, Noto CJK, Droid Sans Fallback, DejaVu Sans Mono, and Noto Emoji when available."},"skills_sh_url":"https://skills.sh/lovstudio/skills/any2pdf"},"updatedAt":"2026-05-18T18:57:48.080Z"}}