DOCX工具
创建、编辑、校验和转换 Word DOCX,支持把完整 LaTeX 论文转换为 DOCX,以及数学建模论文模板、原生公式、三线表、修订和批注。
npx skills add XiaoMaColtAI/math-modeling-skill --skill docx --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# DOCX 工具 ## 路径与写入 - 当前目录为本工具根目录,只读。 - 模板和脚本从本目录读取。 - 生成或修改后的 DOCX 必须写入用户 `PROJECT_ROOT`。 - 默认不覆盖输入文件或 Skill 文件。 ## 数学建模论文推荐流程 采用“当届官方参考模板 + `python-docx` 构建 + OMML 公式 + OOXML 校验 + 渲染抽检”。官方模板控制页面、样式、分节、页眉页脚和编号;代码负责稳定写入内容。 ```python from pathlib import Path import sys scripts = Path("<SKILL_ROOT>") / "tools" / "docx" / "scripts" sys.path.insert(0, str(scripts)) import paper_format as pf doc = pf.new_document( contest="cumcm", template_path=Path("<PROJECT_ROOT>") / "当届官方模板.docx", preserve_template_content=False, ) # 此示例只借用模板样式后追加正文。 # 若官方模板包含固定摘要页或编号页,应改为 True 并在原位置填充。 pf.title(doc, "论文题目") pf.abstract_title(doc) pf.body(doc, "摘要正文。") pf.keywords(doc, "优化;预测") pf.equation(doc, r"\min f(x)=\sum_{i=1}^{n}x_i^2") pf.three_line_table(doc, [["符号", "说明"], ["x", "决策变量"]]) pf.save_document(doc, Path("<PROJECT_ROOT>"), contest="cumcm") ``` ## 公式 ### 直接写入 `scripts/equations.py` 把常用 LaTeX 子集转成 Word 原生 OMML。未知命令、未闭合分组和不支持环境会报错,不会静默生成错误文本。 ```powershell python scripts/equations.py replace "输入.docx" ` --replace "EQ_OBJECTIVE" "\min f(x)=\sum_{i=1}^{n}x_i^2" ` --output "<PROJECT_ROOT>/输出.docx" ``` 同一占位符出现多次时会全部替换。支持分式、上下标、根式、n 次根、常用希腊字母与关系符号、反三角函数和常见矩阵,包括 `\nu`、`\mu`、`\approx`、`\arcsin`、`\arccos`、`
- 路径与写入
- 数学建模论文推荐流程
- 公式
- 直接写入
- 复杂公式
- 完整 LaTeX 论文转 DOCX
- 解包、校验与重打包
- 修订
- 批注
- 必做验证
What does the DOCX工具 skill do?
创建、编辑、校验和转换 Word DOCX,支持把完整 LaTeX 论文转换为 DOCX,以及数学建模论文模板、原生公式、三线表、修订和批注。
How do I install it?
Run `npx skills add XiaoMaColtAI/math-modeling-skill --skill docx --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From XiaoMaColtAI/math-modeling-skill, a repository with 590 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
