Gostyan/docx-skill-4-cn-paper

中文论文常用排版格式Skills,适用于课程论文、数模竞赛、毕业论文等场景,让llm agent写word论文或者将.md转.docx时可调用

What it solves

This project provides a specialized toolset (a "Skill") for AI Agents to generate and edit Microsoft Word documents that adhere to strict Chinese academic formatting standards. It eliminates the manual effort of formatting course papers, graduation theses, and mathematical modeling papers to meet specific institutional requirements.

How it works

The tool operates through two primary workflows:

  1. Markdown to Word Conversion: It parses Markdown files, converts LaTeX formulas into native Word MathML using temml, and applies pre-configured academic styles to generate a .docx file.
  2. Direct Word Editing: It uses Python scripts to unpack .docx files into XML, allows for programmatic editing of content and styles, and then repacks them.

It includes a library of helper functions (e.g., h1(), threeLineTable(), formula()) to automate the creation of structured academic elements like three-line tables, centered formulas with right-aligned numbering, and superscript citations.

Who it’s for

  • AI Agent developers who want their agents to produce professional academic documents.
  • Students and researchers in China who need to automate the formatting of academic papers in Word.

Highlights

  • Academic Presets: Pre-configured fonts (SimSun, SimHei), sizes, and margins specifically for Chinese university standards.
  • Native Formula Support: Converts LaTeX to native Word equations rather than images.
  • Academic Elements: Built-in support for standard "three-line tables" and automatic heading numbering.
  • Customizable: Allows users to easily modify page dimensions, fonts, and line spacing via configuration constants.