Releases: AllenWang2005/Word-typesetting
Release list
v1.3.0 — formula italic/number fixes + appendix code font
Targets three real formatting failures seen in generated reports.
Since v1.2.2
Formulas
- The whole equation was being italicized, so digits and operators came out slanted — fixed: only variable letters are italic; digits/operators/parentheses/units stay upright (do not add
<w:i/>to the whole equation). - Multi-letter coefficients (
CI,CG,CS) must be one variable + upright subscript (C_I,C_G,C_S), not adjacent italic letters. - The equation number was centered; it must be right-aligned. Use a left-aligned paragraph with a center tab (equation) + right tab (number), not a centered line.
Appendix code
- Now pinned to Times New Roman 小四 for English/numbers (Songti 小四 for Chinese); added to the font-size table.
Auditor
- New
FORMULA_DIGIT_ITALIC(italic number/operator in a formula) andEQUATION_NUMBER_CENTER(centered numbered formula) checks. 55 unit tests.
v1.2.2 — three-line table OOXML recipe
Makes the three-line table rule actually implementable.
Since v1.2.1
Models were applying a gridded / header-shaded table style and producing a table with no top/bottom rule and a thick middle line — the opposite of a three-line table. The line-width numbers alone weren't enough guidance.
- New
references/three-line-table-ooxml.md— a concrete recipe: exactly which borders to set (thick top/bottomw:sz≈12, a single thin header rulew:sz≈6, all other bordersnone), thew:szwidth table (eighths of a point), a python-docx note, and how to avoid gridded/header-shaded styles. SKILL.md+formatting-standard.mdspell out: top and bottom rules visible and thicker, a single thinner middle (header) rule, every other border none, and no gridded/header-shaded table style.- Standard version → 2026-06-28.
v1.2.1 — in-table formulas use the 五号 table size
A small but visible consistency fix for tables.
Since v1.2.0
- Standard: formulas, variables, and quantity symbols inside a table now follow the table text size (五号 / 10.5 pt), not the body size (小四 / 12 pt). Formula font size follows its context everywhere (body → 小四, table → 五号), and the OMML conversion step sets the size explicitly.
- Auditor:
TABLE_SIZEnow also inspects OMML math runs (m:r), so an in-table formula left at the wrong (larger) size is flagged, not just ordinary cell text. - 50 standard-library unit tests.
v1.2.0 — fewer false positives, three-line + heading-style checks
False-positive cleanup plus two new structural checks, a compliant example, and a changelog.
Highlights since v1.1.0
Auditor
- Paragraph-based checks now exclude table-cell text — removes the
H1_CENTER/H1_GAP/ punctuation / formula false positives caused by numbers and short fragments inside table cells. - New
TABLE_BORDERS: flags a table with direct vertical/inner borders instead of a white three-line layout. - New
HEADING_NO_STYLE: flags a heading-looking line that uses no Word heading style (so it never enters the TOC). - Tightened the bare-symbol formula heuristic so prose like "为 A 方案" / "取 N 个" is no longer flagged;
BODY_FONTno longer flags centered cover titles.
Examples & docs
examples/make_sample.py --compliantbuilds a document the auditor reports asPASS, with captured output.CHANGELOG.mdadded; standard version bumped to 2026-06-26; both READMEs list the new codes.- 48 standard-library unit tests; CI on Python 3.9 / 3.12.
v1.1.0 — spec refinements + bilingual README
Refinements to the formatting standard and the audit tooling, aligned to a common Chinese thesis/course-design spec, plus a bilingual README.
Highlights since v1.0.0
Standard
- Headings: level 1–2 in Heiti, not bold; level-3 in bold Songti; cover title 二号 Heiti bold. Line spacing default 1.5×.
- Numbers & units: the number–unit gap is a half-width (non-breaking) space, not full-width;
%,°,℃/°Cattach directly with no space (50%,30°,25℃). - Tables: content font 五号 (10.5 pt) — one size below the body (小四 still accepted, never larger than body); table notes 小五.
- Page margins default to top 2.54 / bottom 2.5 / left 3 / right 2.5 cm.
Auditor
TABLE_SIZEnow accepts 五号 (w:sz=21) and 小四 (24) and flags oversized table text.HEADING_FONTonly flags level 1–2 Songti headings (level-3 is intentionally Songti).COLORignores hyperlink and theme colors (no more TOC/link false positives).- Checks added in this line:
HEADING_PUNCT,HEADING_FONT/BODY_FONT,CAPTION_POSITION,CITATION_NO_BRACKETS.
Docs & repo
- Bilingual README:
README.md(English) +README.zh-CN.md(简体中文) with a click-to-switch language link. normalize_docx.pysafe auto-fixer (full-width citation brackets, ASCII-punctuation-between-CJK).- 40 stdlib
unittesttests; CI on Python 3.9 / 3.12.
v1.0.0 — Word Report Formatting skill
First stable release of the Word Report Formatting skill — a reusable Codex / Claude Code skill that formats formal Chinese Word (.docx) reports to a consistent academic standard.
What's included
The standard (SKILL.md + references/)
- Typography: Songti body / Heiti headings / Times New Roman for English, full font-size hierarchy, dominant-language punctuation, justified body.
- Document structure & page setup: section order, A4 margins/gutter, headers/footers, Roman→Arabic page numbering via section breaks, auto TOC, multilevel heading numbering, widow/orphan control.
- Tables (white three-line, caption above, header repeated), figures (caption below), by-chapter numbering, reference-before-appearance.
- Formulas authored as LaTeX → native Word OMML (variables italic, units/operators upright); chapter equation numbers.
- Citations as field-backed superscript cross-references to the whole bracketed
[1]; bibliography per GB/T 7714—2015. - Numbers/units (GB 3100/3101/3102, GB/T 15835); appendix code with red comments.
Tooling (scripts/)
audit_docx_format.py— read-only guardrail with 16 machine checks (punctuation, headings, fonts, captions, tables, citations, formulas),--jsonoutput, FAIL/WARN summary. Domain-neutral.normalize_docx.py— safe auto-fixer for full-width citation brackets and ASCII-punctuation-between-CJK.
Quality
- 36 stdlib
unittesttests; GitHub Actions CI (py_compile + tests on Python 3.9 / 3.12). examples/with a non-compliant sample generator and its captured audit report.
Standard version: 2026-06-25.