mdtoword Tool Documentation (English)
Overview
mdtoword is a powerful Markdown to Word conversion tool that transforms Markdown content into professionally formatted Word documents (.docx). It supports all standard Markdown syntax including headers, paragraphs, lists, tables, code blocks, and blockquotes.
Key Features
- Template System: Apply preset or custom templates for consistent document styling
- Style Configuration: Fine-tune document appearance with detailed style settings
- Chinese Document Standards: Default template follows Chinese typographic conventions
- Batch Processing: Efficiently convert multiple Markdown files
Preset Templates
| Template ID | Category | Description |
|---|---|---|
| customer-analysis | business | Default template with Chinese standards (2-character indent) |
| academic | academic | Formal template for academic papers |
| business | business | Professional business report format |
| technical | technical | Optimized for technical documentation |
| minimal | minimal | Clean and minimal styling |
Usage Example
{
"markdown": "# Document Title\n\nThis is a sample paragraph.",
"filename": "output.docx",
"template": {
"type": "preset",
"presetId": "business"
}
}Style Configuration Guide
Units
- Twip (Tw): 1/1440 inch (used for spacing/margins)
- Half-points: Font size unit (24 half-points = 12pt)
Color Codes (6-digit HEX)
000000- Pure black333333- Dark gray666666- Medium gray2E74B5- Professional blueD73A49- Alert red
First-line Indent Calculation
- Formula:
Font size (half-points) × Character count × 10 - Example for 24pt font (2 characters): 24 × 2 × 10 = 480 Tw
Configuration Snippet
{
"styleConfig": {
"paragraphStyles": {
"normal": {
"font": "SimSun",
"size": 24,
"color": "000000",
"indent": { "firstLine": 480 },
"spacing": { "line": 400, "after": 120 },
"alignment": "justify"
}
}
}
}Advanced Features
- Custom template support via base64-encoded DOCX files
- Header/footer configuration
- Table styling options
- Code block syntax highlighting
