LaunchKit · 2026
Back to Skills

md2pdf-xelatex

Convert Markdown files to PDF with full LaTeX math formula rendering and CJK (Chinese/Japanese/Korean) support.

0
386 downloads
by @huaruoji

Setup & Installation

openclaw skills install @huaruoji/md2pdf-xelatex

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install md2pdf-xelatex

What This Skill Does

Converts Markdown files to PDF using Pandoc and XeLaTeX. Handles LaTeX math formulas ($...$ and $$...$$), CJK text (Chinese, Japanese, Korean), code blocks, and tables. Auto-detects CJK content and selects appropriate fonts.

Unlike browser-based Markdown-to-PDF tools, XeLaTeX renders LaTeX math natively and handles CJK fonts without extra configuration or plugins.

When to use it

  • Exporting a research report with equations to PDF
  • Converting Chinese-language notes to a printable document
  • Generating a PDF from a README with code blocks and tables
  • Rendering a math-heavy homework document from Markdown
  • Producing a formatted PDF from mixed CJK and Latin text

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: convert my notes.md file (containing Chinese text and math formulas) to a PDF

AGENT
  1. 1Run md2pdf.sh with notes.md as input
  2. 2Script scans content and detects CJK characters
  3. 3Script selects an available CJK font (e.g., Noto Sans CJK SC)
  4. 4Pandoc invokes XeLaTeX to render math and CJK text
  5. 5PDF is written to the specified output path
OUTPUT

A formatted PDF with rendered LaTeX equations, CJK text, syntax-highlighted code blocks, and a table of contents

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

pandoc system packagetexlive-xetex system packagetexlive-fonts-recommended system packagetexlive-fonts-extra system packagetexlive-latex-extra system packagetexlive-lang-chinese system package