md2pdf
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.
Why use this skill?
Efficiently convert Markdown files to high-quality PDFs using OpenClaw's md2pdf skill. Features include LaTeX math rendering, CJK language support, and professional typesetting.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/huaruoji/md2pdf-xelatexWhat This Skill Does
The md2pdf skill is a specialized utility designed for OpenClaw agents to bridge the gap between structured Markdown documentation and high-quality, professional PDF reports. Unlike simple HTML-to-PDF converters, this skill leverages Pandoc and XeLaTeX to provide enterprise-grade typesetting. It is specifically optimized to handle complex academic or technical requirements, including native LaTeX mathematical rendering, which is essential for scientists, engineers, and researchers. Furthermore, it incorporates robust support for CJK (Chinese, Japanese, and Korean) characters, ensuring that multilingual documents are rendered correctly without the character replacement errors often found in standard converters. By automating the configuration of fonts, page margins, and table of contents generation, it allows users to focus on content creation rather than technical formatting.
Installation
To integrate this skill into your environment, run the following installation command in your terminal:
clawhub install openclaw/skills/skills/huaruoji/md2pdf-xelatex
Note that this skill relies on external system dependencies. You must ensure that your system has Pandoc and the XeLaTeX distribution installed. On Debian-based systems, use: sudo apt install pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra texlive-lang-chinese.
Use Cases
This skill is ideal for generating technical documentation, converting research papers written in Markdown to submission-ready PDFs, exporting project notes with embedded formulas, and producing standardized reports that require multi-language support. It is particularly useful for teams collaborating on international projects where both source code/Markdown files and readable documentation are required.
Example Prompts
- "Convert my notes.md file into a professional PDF report, making sure to render the math equations properly."
- "I have a documentation file with mixed English and Chinese content. Can you export this to a PDF so I can share it with the team?"
- "Please generate a printable PDF from this markdown, including a table of contents and a clean, standard layout."
Tips & Limitations
To get the best results, use standard $...$ and $$...$$ syntax for math rather than custom HTML tags. The tool automatically handles emoji by stripping or replacing them to avoid LaTeX rendering errors. For complex data presentation, stick to simple tables as the XeLaTeX engine can struggle with highly nested structures. If you experience missing characters, verify your local font library with fc-list :lang=zh. Always ensure your source Markdown uses standard formatting to prevent unexpected behavior during the conversion phase.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-huaruoji-md2pdf-xelatex": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write, code-execution
Related Skills
Canvas Study Helper
Skill by huaruoji
research-report
Research technical projects/papers and generate comprehensive reports with PDF export. Modes: lite (analysis + writing) or full (+ environment setup + experiments). Params: iterations, mode, project-path, output. Use for paper analysis, code review, technical reports, research documentation.