docx-skill-4-cn-paper  by Gostyan

AI agent skill for academic document generation

Created 4 months ago
311 stars

Top 86.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project provides an AI agent "skill" for automating the creation and formatting of Chinese academic documents (course papers, theses, math modeling reports). It solves the challenge of adhering to specific academic style guides by converting Markdown to .docx, handling LaTeX formulas, and applying standardized layouts, fonts, and numbering. The benefit is enabling AI agents to produce publication-ready documents efficiently and accurately, saving significant manual formatting time for researchers and students.

How It Works

The skill offers two workflows. The primary method parses Markdown, interpreting structural elements and converting LaTeX formulas to Word's native MathML format via temml and mathmlToDocx. It then generates a .docx file conforming to pre-defined Chinese academic templates. An alternative workflow allows unpacking existing .docx files, programmatic XML editing using Python/JavaScript, and repacking. This approach ensures robust LaTeX-to-Word formula conversion and a highly customizable document generation pipeline.

Quick Start & Requirements

Download the docx-editor-cn folder and place it in your skills directory.

  • Required Dependencies: Node.js environment with npm. Install core packages: npm install docx temml fast-xml-parser.
  • Optional Dependencies: Python 3.x for editing existing .docx files. LibreOffice is recommended for .doc conversion and revision acceptance. Pandoc for content extraction.

Highlighted Details

  • Academic Templates: Pre-configured for Chinese academic papers (A4, 2.5cm margins, specific fonts like SimSun/SimHei/Cambria Math, 12pt body text).
  • Automated Formatting: Features automatic numbering for headings, figures, tables, and standard "three-line table" styling.
  • Formula Conversion: Accurately converts LaTeX formulas to Word's native equation editor format using temml and mathmlToDocx.
  • Markdown to DOCX: One-click conversion from Markdown, preserving structure.
  • Customization: Extensive options for page dimensions, margins, fonts, line spacing, indents, and adding new styles via JavaScript.
  • Helper Functions: JavaScript API (scripts/new_doc.js) for programmatic document element creation.

Maintenance & Community

Last updated May 11, 2026, addressing multi-level heading numbering and formula detection robustness. No community links or specific contributor details are provided in the README.

Licensing & Compatibility

Released under the MIT License, which is permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

The "Todo" list indicates planned enhancements: support for more document elements (e.g., tables of contents), improved Markdown conversion for complex Word equation syntax, and performance optimization for large documents. While multi-level heading numbering was recently addressed, further refinement may be ongoing.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
73 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.