본문으로 건너뛰기
cccskills
무료GitHub에 공개

md-to-docx

Convert Markdown files into Word documents with headings, tables, images, and code formatting. Supports batch conversion, optional contents pages, custom templates, and Chinese document styling, including automatic superscript formatting for eligible citation numbers.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Convert Markdown files to Word documents (.docx) with proper formatting, Chinese font support (FangSong for all text including headings), black font color, 1.5x line spacing, precise first-line indent (24pt), heading spacing after (1 line), no italic headings, and automatic superscript conversion for citation numbers. Use when converting .md files to .docx, creating Word documents from markdown, or when user mentions Word, DOCX, or document conversion. Requires pandoc.

연동 도구Word

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Converting a Markdown report into a Word document
  • Formatting Chinese documents with citation superscripts
  • Batch converting Markdown files in a folder
  • Applying a custom Word template and adding contents

포함된 파일(10)

  • SKILL.md7.5 KB
  • chinese_template.docx26.7 KB
  • convert_md_to_docx.py18.8 KB
  • create_chinese_template.py9.9 KB
  • DISTRIBUTION.md4.4 KB
  • fix_heading_fonts.py2.6 KB
  • fix_tables.py6.6 KB
  • INSTALLATION.md2.6 KB
  • README.md4.7 KB
  • 快速使用指南.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Markdown to Word (DOCX) Converter

Convert markdown files to professionally formatted Word documents (.docx) using pandoc.

What this Skill does

This Skill enables Claude to convert Markdown files to Word documents with proper formatting, including:

  • Headings and text formatting (H1-H6, bold, italic, strikethrough)
  • Lists (ordered and unordered, nested)
  • Tables with proper formatting
  • Images (automatically embedded)
  • Links and references
  • Code blocks and inline code
  • Chinese punctuation preservation (。,""();!?)
  • Citation superscript: Automatically converts citation numbers (e.g., 文献1。 → 文献¹。) to superscript format for academic documents
  • Default Chinese template: Uses FangSong (仿宋) font for all Chinese text (body, headings, and subtitles), Times New Roman for English text, black color for all text, 1.5x line spacing, first-line indent of two characters (24pt, precisely aligned), heading spacing after (1 line / 12pt), and no italic style for headings

Requirements

Packages must be installed in your environment before using this Skill:

pandoc (required):

# macOS
brew install pandoc

# Linux (Debian/Ubuntu)
sudo apt-get install pandoc

# Windows
choco install pandoc

python-docx (required for template creation):

pip install python-docx

Verify pandoc installation:

pandoc --version

Instructions

When the user requests to convert a Markdown file to Word format:

  1. Check if pandoc is installed by running pandoc --version

    • If not installed, guide the user to install it (see Requirements section)
  2. Identify the input and output files

    • Ask for clarification if the user hasn't specified the output filename
    • Use meaningful names (e.g., if input is report.md, suggest report.docx)
  3. Run the conversion script using the Bash tool:

    python .claude/skills/md-to-docx/convert_md_to_docx.py input.md output.docx
    
  4. Use additional options as needed:

    • Add --toc for table of contents (default: no TOC)
    • Add --no-chinese-template if user doesn't want FangSong font
    • Add --no-superscript-citations to disable automatic citation superscript conversion
    • Add --reference-doc template.docx for custom styling
    • Add --title, --author, --date for document metadata
  5. For batch conversions:

    python .claude/skills/md-to-docx/convert_md_to_docx.py --batch input_dir/ output_dir/
    
  6. Verify the conversion succeeded and inform the user of the output location

Default behavior: The script automatically uses a Chinese template with FangSong (仿宋) font for Chinese text unless --no-chinese-template is specified.

Examples

Convert a single file (uses default Chinese template):

python .claude/skills/md-to-docx/convert_md_to_docx.py "教育改革方案.md" "教育改革方案.docx"

Convert with table of contents (optional, default is no TOC):

python .claude/skills/md-to-docx/convert_md_to_docx.py report.md report.docx --toc

Convert with metadata:

python .claude/skills/md-to-docx/convert_md_to_docx.py paper.md paper.docx \
  --title "研究报告" \
  --author "张三" \
  --date "2025-11-20"

Batch convert all markdown files:

python .claude/skills/md-to-docx/convert_md_to_docx.py --batch ./markdown_files/ ./word_docs/

Use custom template for organizational styling:

python .claude/skills/md-to-docx/convert_md_to_docx.py doc.md doc.docx \
  --reference-doc company_template.docx

Supporting Files

This Skill includes additional resources:

  • README.md: Detailed usage guide with examples
  • 快速使用指南.md: Quick start guide in Chinese
  • convert_md_to_docx.py: Main conversion script with automatic post-processing
  • create_chinese_template.py: Utility to create custom Chinese templates
  • fix_heading_fonts.py: Post-processing script for font and spacing fixes
  • chinese_template.docx: Default Chinese font template (FangSong, 1.5x line spacing, heading spacing)

Troubleshooting

"pandoc: command not found"

  • Install pandoc using your package manager (see Requirements section)

Images not appearing in output

  • Ensure image paths in markdown are correct (use relative paths from markdown file location)
  • Verify image files exist at specified paths

Table formatting issues

  • Verify markdown table syntax:
    | Header 1 | Header 2 |
    |----------|----------|
    | Cell 1   | Cell 2   |
    

Script execution errors

  • Ensure script has execute permissions: chmod +x convert_md_to_docx.py
  • Use forward slashes in all file paths (Unix style)

Chinese Document Best Practices

When converting Chinese documents:

  1. Encoding: Ensure markdown files use UTF-8 encoding
  2. Punctuation: Use proper Chinese punctuation (。,""();!?)
  3. Font: Default template uses FangSong for all Chinese text (body, headings, and subtitles) with black color
  4. Line spacing: 1.5x line spacing for all paragraphs (符合中文文档标准)
  5. Paragraph formatting: First-line indent of two characters (24pt, precisely aligned) for proper Chinese document style
  6. Heading spacing: 1 line (12pt) spacing after all headings for better readability
  7. Heading style: All headings use FangSong font without italic style
  8. Custom templates: Create organizational templates with create_chinese_template.py

Command Line Options Reference

OptionDescription
input.mdInput Markdown file path
output.docxOutput Word document path
--tocGenerate table of contents (default: no TOC)
--no-chinese-templateDon't use default Chinese font template
--no-superscript-citationsDon't convert citation numbers to superscript
--reference-doc FILEUse custom Word template for styling
--title TEXTSet document title metadata
--author TEXTSet document author metadata
--date TEXTSet document date metadata
--batchEnable batch conversion mode
--pattern PATTERNFile pattern for batch mode (default: *.md)

Default Document Formatting

The Chinese template automatically applies:

  • Font: FangSong (仿宋) for Chinese text, Times New Roman for English
  • Font size: 12pt (body text)
  • Font color: Black for all text
  • Line spacing: 1.5x for all paragraphs
  • First-line indent: 24pt (2 Chinese characters)
  • Heading spacing: 12pt (1 line) after each heading
  • Heading style: Bold, no italic
  • Citation superscript: Numbers before sentence-ending punctuation (。;) are automatically converted to superscript (e.g., 参考文献1。 → 参考文献¹。). Only converts numbers 1-60 that directly follow Chinese characters or letters.
  • Table of contents: Not generated by default (use --toc to add)

For complete documentation, see README.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

a1

무료

Turn a broad research idea into clear, testable questions. Compare familiar and less conventional approaches, structure the selected question around its population and methods, and assess variables, feasibility, and potential theoretical contributions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Turn a research topic into testable questions
  • Narrow an overly broad research question
  • Compare alternative research angles
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

a2

무료

Helps build a research framework by comparing theories, mapping relationships between variables, and deriving testable hypotheses. Explores less conventional options, examines weaknesses and competing explanations, and produces diagrams with anticipated reviewer objections.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing theories for a research question
  • Deriving hypotheses from relationships between variables
  • Examining weaknesses and anticipated reviewer objections
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

a5

무료

Clarify the philosophical assumptions behind a research project and check whether they fit the proposed methods. Get a reasoned research stance, draft proposal wording, and guidance for explaining how the researcher's background and values shape the study.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Clarifying philosophical foundations for a research proposal
  • Explaining why the chosen research methods fit the study
  • Drafting a statement about the researcher's position
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

Plan and draft academic papers through specialized agent roles covering literature, arguments, citations, and review. Get chapter guidance, revision roadmaps, Traditional Chinese and English abstracts, and documents formatted as LaTeX, DOCX, PDF, or Markdown.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Planning a paper chapter by chapter
  • Drafting a paper from research materials
  • Turning reviewer comments into a revision roadmap
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

Turn a detailed outline into a philosophy or interdisciplinary manuscript. Draft chapters with repeated quality reviews, check terminology and arguments across sections, and prepare the manuscript, evaluation reports, abstract, and metadata for submission.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Draft a full paper from a detailed outline
  • Review argument and citation quality chapter by chapter
  • Check terminology and argument flow across chapters
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

Simulate academic peer review through five reviewer roles tailored to the paper's field. Receive separate critiques, an editorial decision, and a prioritized revision roadmap, or check whether a revised manuscript addresses earlier comments.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review a manuscript before journal submission
  • Examine research methods and statistical validity
  • Challenge core arguments and alternative explanations
brycewang-stanford/Auto-Empirical-Research-Skills4.7천2026년 10월 20일 업데이트

brycewang-stanford의 스킬 모두 보기

이 스킬의 문제 신고