$ show Gostyan/docx-skill-4-cn-paper
The repository provides a specialized toolkit for creating and editing Microsoft Word documents (.docx) with a focus on Chinese academic formatting standards. It enables conversion of Markdown to formatted DOCX, including precise handling of three-line tables (δΈηΊΏθ‘¨), mathematical formulas via LaTeX-to-OMML conversion, chapter-based heading numbering with Chinese numerals, and GB/T 7714-compliant citation formatting. Additionally, it offers utilities for manipulating existing DOCX files, such as accepting tracked changes using LibreOffice, adding comments via XML manipulation, and validating documents against included Office Open XML schemas. The architecture consists of independent Python and JavaScript scripts that function as command-line tools, with core functionality centered around the docx-js library for document generation and Python scripts for low-level XML operations.
The LLM identified 2 files worth highlighting for reuse:
Implements the precise border styling required for Chinese academic three-line tables (δΈηΊΏθ‘¨): thick top and bottom borders (0.5pt), thin header separator (0.5pt), and no interior borders. The function is self-contained, accepts a document object and data array, and applies exact width calculations (summing to 9070 DXA) to ensure compliance with academic standards. Demonstrates non-obvious skill in translating complex formatting requirements into programmable table properties.
Converts LaTeX mathematical formulas to Office Math Markup Language (OMML) via a pandoc-mediated MathML intermediate step. The script handles block formulas by embedding them in a 3-column borderless table for proper alignment (spacer | formula | equation number), ensuring native, editable equation rendering in Word without relying on images. Demonstrates a non-obvious pipeline for overcoming limitations of direct LaTeX support in docx libraries while maintaining document editability.