Yuno Wang

md2pdf-xelatex

辦公效率v1.0.0
作者:Yuno Wang更新於 2026-05-17@clawhub_huaruoji/md2pdf-xelatex
檔案處理PDF 處理#PDF

據 AlphaMoat 統計,截至 2026-09,md2pdf-xelatex 累計下載 1,977 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 4,443 位,在「辦公效率」分類(435 個)中排名第 346 位。

累計安裝
133
累計下載
1977
星標
-
全站排名
#4,443
全站前 88% · 「辦公效率」前 80%
平台累計安裝累計下載星標評論
ClawHub ↗511750--
SkillHub ↗1331977-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該技能可處理程式碼塊、表格及混合中日韓與拉丁文字;轉換依賴本地 Pandoc、XeLaTeX 和相應字型。未經信任的 Markdown 可能包含會由 XeLaTeX 解釋的原始 TeX,應只轉換可信文件,或在容器/沙盒中處理外部檔案。 還需要 fontconfig。

資料釋出於 2026-10-29

可以用來做什麼

  • 需要把含公式、程式碼、表格或中日韓文字的 Markdown 文件製作為 PDF 的使用者。

什麼時候用

  • 轉換前確認本地依賴和字型可用;只處理自己建立或信任的 Markdown,處理下載或他人提供的檔案時使用隔離環境。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

請將這份可信的 Markdown 轉成 PDF,保留公式、表格和中日韓文字,並報告缺少的本地依賴。

月度資料趨勢

累計下載1977
546131520832026-03 · 累計下載 6522026-05 · 累計下載 11552026-06 · 累計下載 13192026-07 · 累計下載 15572026-08 · 累計下載 17092026-09 · 累計下載 197726-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-091977—-
2026-081709+9.8%-
2026-071557+18.0%-
2026-061319+14.2%-
2026-051155—-
2026-03652—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

2.3 KB · ClawHub v1.0.0
---
name: md2pdf
description: Convert Markdown files to PDF with full LaTeX math formula rendering and CJK (Chinese/Japanese/Korean) support. Use when the user asks to convert markdown to PDF, render a report as PDF, export notes to PDF, or generate a printable document from markdown. Handles $...$ inline and $$...$$ display math, code blocks, tables, and mixed CJK/Latin text. Requires pandoc + texlive-xetex.
---

# md2pdf

Convert Markdown → PDF via Pandoc + XeLaTeX. Full LaTeX math + CJK support.

## Prerequisites
展開全部(共 67 行)

System packages (apt):

```
pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra texlive-lang-chinese
```

## Quick Convert

```bash
bash <skill_dir>/scripts/md2pdf.sh input.md output.pdf
```

The script auto-detects CJK content, picks suitable fonts, sanitizes emoji, adds TOC, and configures XeLaTeX.

## Manual Pandoc Command

For fine-grained control, run pandoc directly:

```bash
pandoc input.md -o output.pdf \
  --pdf-engine=xelatex \
  -f markdown-smart \
  -H header.tex \
  -V mainfont="DejaVu Sans" \
  -V monofont="DejaVu Sans Mono" \
  -V geometry:margin=20mm \
  -V fontsize=10pt \
  -V colorlinks=true \
  --highlight-style=tango \
  --toc -V toc-title="Table of Contents"
```

Where `header.tex` contains:

```latex
\usepackage{xeCJK}
\setCJKmainfont{<CJK font name>}
```

## Key Details

- **Math**: Pandoc natively converts `$...$` (inline) and `$$...$$` (display) to LaTeX math. No MathJax/KaTeX needed.
- **CJK fonts**: Script auto-detects from: Noto Sans CJK SC > WenQuanYi Micro Hei > Droid Sans Fallback > AR PL UMing CN.
- **Emoji**: Replaced with text equivalents (`✅` → `[Y]`, `❌` → `[N]`, `⭐` → `*`) since most LaTeX fonts lack emoji glyphs.
- **Smart quotes**: Use `-f markdown-smart` to avoid curly quote rendering issues.
- **Long tables**: Pandoc may struggle with complex tables; keep tables simple or use `longtable` LaTeX package.

## Troubleshooting

| Problem | Fix |
|---------|-----|
| Missing character warnings | Check `fc-list :lang=zh` for available CJK fonts; install `fonts-noto-cjk` if needed |
| `xelatex not found` | Install `texlive-xetex` |
| PDF has no math rendering | Ensure markdown uses `$...$` / `$$...$$` (not HTML math tags) |
| Broken table layout | Simplify table or add `-V geometry:margin=15mm` for more width |

「辦公效率」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。