
Md2word
Converts Markdown to Word documents with templates, math, tables and Mermaid diagrams
From cp-yu/md2word
Md2word is an open-source agent skill for files and documents. It is available on Claude Code.
- Scripts
- PowerShell, Python
- Platforms
- Claude Code
- GitHub stars
- 15
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Md2word
This skill turns a Markdown file into a formatted Word document through a Windows pipeline: the Markdown is filled into an MHT template, opened in desktop Microsoft Word via COM and saved as DOCX, then LaTeX formulas are converted into Word Office Math in a separate output file. It supports user-supplied .mht or .docx templates, templates described in a spec file, and a built-in academic paper style preset with heading sizes and line spacing.
The rendering script embeds local images, builds standard Markdown tables as Word tables, renders Mermaid code blocks to images with a local mmdc or an npx fallback, and syntax-highlights code blocks with Pygments when it is installed. Block matrix and case environments are normalized before Word's BuildUp step, and page-number footer fields are tidied so page and total counts stay together.
It expects Windows with PowerShell, Python 3 and an installed Microsoft Word, and it works with Chinese-language documents such as technical disclosures and academic papers.
When your agent uses it
将 Markdown 在 Windows + Microsoft Word 流水线中稳定转换为 `.mht`、`.docx` 和 `.wordmath.docx`。用于交底书、学术论文、技术报告等 Markdown→Word 导出场景,支持 `.mht` 模板、`.docx` 模板、模板规格文件、普通或加粗头字段、Markdown 图片、表格、Mermaid 渲染、样式预设,以及需要把 LaTeX 公式交给 Word 转 Office Math 的任务。
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs PowerShell and Python scripts(see the files on GitHub)
- No network calls found in its scripts(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 15 files (259 KB) on GitHub on 2 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the md2word plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add cp-yu/md2word
/plugin install md2word@cp-yu-md2wordOr copy only this skill to ~/.claude/skills/md2word:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cp-yu/md2word.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/md2word &&
cp -R "$tmp/.claude/skills/md2word" ~/.claude/skills/md2word &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/md2word inside it instead.
Copy the skill folder to ~/.agents/skills/md2word to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cp-yu/md2word.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/md2word &&
cp -R "$tmp/.claude/skills/md2word" ~/.agents/skills/md2word &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/md2word inside it instead.
Copy the skill folder to ~/.cursor/skills/md2word to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cp-yu/md2word.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/md2word &&
cp -R "$tmp/.claude/skills/md2word" ~/.cursor/skills/md2word &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/md2word inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/cp-yu/md2word.git --path .claude/skills/md2wordOr copy the folder to ~/.gemini/skills/md2word yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/md2word:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cp-yu/md2word.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/md2word &&
cp -R "$tmp/.claude/skills/md2word" ~/.copilot/skills/md2word &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/md2word inside it instead.
Get the folder:
git clone --depth 1 https://github.com/cp-yu/md2word.gitThen copy md2word/.claude/skills/md2word into your agent's skills folder as md2word. Agents that support SKILL.md read one folder per skill.
What it does
- Template filling
- Places Markdown content into an existing MHT or DOCX template, or into a template generated from a spec file.
- Office Math conversion
- Converts LaTeX inline and display formulas into Word Office Math using Word itself.
- Mermaid diagram rendering
- Renders Mermaid code blocks to images and embeds them in the exported document.
- Style presets
- Applies a default or academic-paper preset covering heading levels and line spacing.
- Table and image handling
- Converts Markdown tables into Word tables and packages local images into the output.
- Code block highlighting
- Renders code blocks with Pygments syntax colors or falls back to editable plain text.
Good for
- Export a technical disclosure written in Markdown to a formatted Word file
- Convert an academic paper draft into a Word document with a paper layout
- Turn a Markdown report with LaTeX formulas into a Word file with editable equations
- Embed Mermaid flowcharts from a Markdown document into a Word report
Md2word FAQ
What does the skill need to run?
It needs Windows with PowerShell, Python 3, and desktop Microsoft Word with COM available. Mermaid rendering needs a local mmdc or permission to use npx.
Can I use my own Word template?
Yes. It accepts an .mht template directly, a .docx template that is normalized to MHT first, or a template spec file describing the layout.
How are math formulas handled?
LaTeX inside $...$ and $$...$$ is passed to Word and converted to Office Math, written to a separate .wordmath.docx file.
Is the skill open source?
The repository is published under the MIT license.
How do I install Md2word in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/md2word to use it in all your projects, or to .claude/skills/md2word in one project. Or install the md2word plugin, which includes it: /plugin marketplace add cp-yu/md2word, then /plugin install md2word@cp-yu-md2word.
Does Md2word run scripts?
Yes. It runs PowerShell and Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Md2word?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Md2word?
The closest alternatives to Md2word are Markdown to word mermaid, Md to DOCX, Convert word to md, DOCX and Convert plaintext to md.
Where this comes from
- Description: from the skill's own SKILL.md.





