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
累计下载
1,977
星标
-
全站排名
#4,443
全站前 88% · 「办公效率」前 80%
平台累计安装累计下载星标评论
ClawHub ↗511,750--
SkillHub ↗1331,977-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该技能可处理代码块、表格及混合中日韩与拉丁文字;转换依赖本地 Pandoc、XeLaTeX 和相应字体。未经信任的 Markdown 可能包含会由 XeLaTeX 解释的原始 TeX,应只转换可信文档,或在容器/沙盒中处理外部文件。 还需要 fontconfig。

资料发布于 2026-10-29

可以用来做什么

  • 需要把含公式、代码、表格或中日韩文字的 Markdown 文档制作为 PDF 的用户。

什么时候用

  • 转换前确认本地依赖和字体可用;只处理自己创建或信任的 Markdown,处理下载或他人提供的文件时使用隔离环境。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

请将这份可信的 Markdown 转成 PDF,保留公式、表格和中日韩文字,并报告缺少的本地依赖。

月度数据趋势

累计下载1,977
5461,3152,0832026-03 · 累计下载 6522026-05 · 累计下载 1,1552026-06 · 累计下载 1,3192026-07 · 累计下载 1,5572026-08 · 累计下载 1,7092026-09 · 累计下载 1,97726-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,977—-
2026-081,709+9.8%-
2026-071,557+18.0%-
2026-061,319+14.2%-
2026-051,155—-
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),按月更新。口径说明见数据方法。