# Md2word

> Md2word is an open-source agent skill for files and documents. Converts Markdown to Word documents with templates, math, tables and Mermaid diagrams. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/cp-yu/md2word/tree/main/.claude/skills/md2word
- **Repository:** https://github.com/cp-yu/md2word
- **GitHub stars:** 15
- **License:** MIT
- **Skill name:** md2word
- **Collection:** https://github.com/cp-yu/md2word
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents)
- **Listing updated:** 2026-12-01

## About

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 的任务。

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs PowerShell and Python scripts](https://github.com/cp-yu/md2word/tree/HEAD/.claude/skills/md2word)
- [No network calls found in its scripts](https://github.com/cp-yu/md2word/tree/HEAD/.claude/skills/md2word)
- [License: MIT](https://github.com/cp-yu/md2word/tree/HEAD/.claude/skills/md2word)

## Features

- **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

## Install

### Claude Code

This skill ships in the `md2word` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add cp-yu/md2word
/plugin install md2word@cp-yu-md2word
```

Or copy only this skill to `~/.claude/skills/md2word`:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/md2word` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/md2word` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/cp-yu/md2word.git --path .claude/skills/md2word
```

Or copy the folder to `~/.gemini/skills/md2word` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/md2word`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/cp-yu/md2word.git
```

Then copy `md2word/.claude/skills/md2word` into your agent's skills folder as `md2word`. Agents that support SKILL.md read one folder per skill.

## 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.

## Alternatives

- [Markdown to word mermaid](https://ai-powered.com/skills/markdown-to-word-mermaid): Markdown to word mermaid is an open-source agent skill for files and documents.
- [Md to DOCX](https://ai-powered.com/skills/md-to-docx): Md to DOCX is an open-source agent skill for files and documents.
- [Convert word to md](https://ai-powered.com/skills/convert-word-to-md): Convert word to md is an open-source agent skill for files and documents.
- [DOCX](https://ai-powered.com/skills/docx-anthropics): DOCX is a free agent skill for files and documents.
- [Convert plaintext to md](https://ai-powered.com/skills/convert-plaintext-to-md): Convert plaintext to md is an open-source agent skill for files and documents.
- [Convert PDF to md](https://ai-powered.com/skills/convert-pdf-to-md): Convert PDF to md is an open-source agent skill for files and documents.
- [DOCX](https://ai-powered.com/skills/docx-melandlabs): DOCX is an open-source agent skill for files and documents.
- [Convert excel to md](https://ai-powered.com/skills/convert-excel-to-md): Convert excel to md is an open-source agent skill for files and documents.

---
Source: https://ai-powered.com/skills/md2word
