
Minimax Docx
- 8 installs
- 33 repo stars
- Updated April 26, 2026
- bighardperson/computer-science-skills-collection
minimax-docx is a Claude skill and .NET CLI that creates, edits, and restyles Word DOCX documents via OpenXML, with templates, XSD validation, and track-changes support.
About
minimax-docx builds, edits, and restyles Word DOCX documents through OpenXML. It ships a .NET CLI (MiniMaxAIDocx) with commands to create a document from scratch, edit content, apply templates, validate against XSD schemas, diff, and manage track changes. It bundles scenario guides for reports, letters, memos, and academic papers plus style XML sets and typography references. A developer uses it to programmatically produce professionally formatted Word documents. Note: this listing had no SKILL.md, so grounding is from its bundled scenario and design references.
- Creates, edits, and restyles Word DOCX documents via OpenXML
- Ships a .NET CLI (MiniMaxAIDocx) with create, edit-content, apply-template, validate, diff, and track-changes commands
- Bundles report/letter/memo/academic scenario guides, style XML sets, and XSD validation
Minimax Docx by the numbers
- 8 all-time installs (skills.sh)
- Ranked #500 of 687 Office & Documents skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
minimax-docx capabilities & compatibility
Free; requires a .NET runtime to run the bundled CLI.
- Capabilities
- docx create · docx edit · apply template · docx validate
- Use cases
- documentation
- Pricing
- Free
What minimax-docx says it does
Use Scenario A when: - The user has no existing file and wants a brand new document
WHY certain typographic choices look good -- the perceptual and psychological reasons behind professional document design.
Assemble `word/document.xml` with:
npx skills add https://github.com/bighardperson/computer-science-skills-collection --skill minimax-docxAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 8 |
|---|---|
| repo stars | ★ 33 |
| Last updated | April 26, 2026 |
| Repository | bighardperson/computer-science-skills-collection ↗ |
What it does
Create, edit, and restyle Word DOCX documents from OpenXML using a .NET CLI with template and validation support.
Who is it for?
Developers who need to generate or edit professionally formatted Word documents programmatically.
Skip if: Simple Markdown-to-DOCX needs, or environments without the .NET runtime.
When should I use this skill?
You need to create a DOCX from scratch, edit its content, or apply a document template.
What you get
A validated, professionally styled DOCX is produced or edited by the CLI.
- generated DOCX files
- edited/restyled Word documents
By the numbers
- 6+ CLI commands (create, edit-content, apply-template, validate, diff, track-changes)
- 3 bundled style sets (default, corporate, academic)
Files
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<!-- Document Defaults -->
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:eastAsia="SimSun" w:cs="Times New Roman" />
<w:sz w:val="24" />
<w:szCs w:val="24" />
<w:lang w:val="en-US" w:eastAsia="zh-CN" w:bidi="ar-SA" />
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="0" w:line="480" w:lineRule="auto" />
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
<w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="0" w:defUnhideWhenUsed="0" w:defQFormat="0" w:count="376" />
<!-- Normal — Times New Roman 12pt, double spaced, first line indent -->
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
<w:name w:val="Normal" />
<w:qFormat />
<w:pPr>
<w:spacing w:after="0" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="720" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" />
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Default Paragraph Font -->
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font" />
<w:uiPriority w:val="1" />
<w:semiHidden />
<w:unhideWhenUsed />
</w:style>
<!-- Heading 1 — Bold, 14pt, no color, no indent -->
<w:style w:type="paragraph" w:styleId="Heading1">
<w:name w:val="heading 1" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="480" w:after="240" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:jc w:val="center" />
<w:outlineLvl w:val="0" />
</w:pPr>
<w:rPr>
<w:b />
<w:sz w:val="28" />
<w:szCs w:val="28" />
</w:rPr>
</w:style>
<!-- Heading 2 — Bold, 13pt -->
<w:style w:type="paragraph" w:styleId="Heading2">
<w:name w:val="heading 2" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="360" w:after="120" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:outlineLvl w:val="1" />
</w:pPr>
<w:rPr>
<w:b />
<w:sz w:val="26" />
<w:szCs w:val="26" />
</w:rPr>
</w:style>
<!-- Heading 3 — Bold, 12pt -->
<w:style w:type="paragraph" w:styleId="Heading3">
<w:name w:val="heading 3" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="240" w:after="80" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:outlineLvl w:val="2" />
</w:pPr>
<w:rPr>
<w:b />
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Title — Centered, bold, 14pt (academic title page) -->
<w:style w:type="paragraph" w:styleId="Title">
<w:name w:val="Title" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="10" />
<w:pPr>
<w:spacing w:after="480" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:b />
<w:sz w:val="28" />
<w:szCs w:val="28" />
</w:rPr>
</w:style>
<!-- Subtitle -->
<w:style w:type="paragraph" w:styleId="Subtitle">
<w:name w:val="Subtitle" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="11" />
<w:pPr>
<w:spacing w:after="240" w:line="480" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Quote — Block quote, indented 0.5 inch on both sides -->
<w:style w:type="paragraph" w:styleId="Quote">
<w:name w:val="Quote" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="29" />
<w:pPr>
<w:spacing w:before="240" w:after="240" w:line="480" w:lineRule="auto" />
<w:ind w:left="720" w:right="720" w:firstLine="0" />
</w:pPr>
</w:style>
<!-- Table Normal -->
<w:style w:type="table" w:default="1" w:styleId="TableNormal">
<w:name w:val="Normal Table" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0" w:type="dxa" />
<w:left w:w="108" w:type="dxa" />
<w:bottom w:w="0" w:type="dxa" />
<w:right w:w="108" w:type="dxa" />
</w:tblCellMar>
</w:tblPr>
</w:style>
<!-- Table Grid — Simple borders, no color -->
<w:style w:type="table" w:styleId="TableGrid">
<w:name w:val="Table Grid" />
<w:basedOn w:val="TableNormal" />
<w:uiPriority w:val="39" />
<w:tblPr>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:left w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:right w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto" />
</w:tblBorders>
</w:tblPr>
</w:style>
<!-- Header -->
<w:style w:type="paragraph" w:styleId="Header">
<w:name w:val="header" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
<w:ind w:firstLine="0" />
</w:pPr>
<w:rPr>
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Footer -->
<w:style w:type="paragraph" w:styleId="Footer">
<w:name w:val="footer" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
<w:ind w:firstLine="0" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Hyperlink -->
<w:style w:type="character" w:styleId="Hyperlink">
<w:name w:val="Hyperlink" />
<w:uiPriority w:val="99" />
<w:unhideWhenUsed />
<w:rPr>
<w:color w:val="0563C1" />
<w:u w:val="single" />
</w:rPr>
</w:style>
</w:styles>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<!-- Document Defaults -->
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Microsoft YaHei" w:cs="Arial" />
<w:color w:val="333333" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
<w:lang w:val="en-US" w:eastAsia="zh-CN" w:bidi="ar-SA" />
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="160" w:line="259" w:lineRule="auto" />
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
<w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="0" w:defUnhideWhenUsed="0" w:defQFormat="0" w:count="376" />
<!-- Normal -->
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
<w:name w:val="Normal" />
<w:qFormat />
<w:pPr>
<w:spacing w:after="160" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" />
<w:color w:val="333333" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:style>
<!-- Default Paragraph Font -->
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font" />
<w:uiPriority w:val="1" />
<w:semiHidden />
<w:unhideWhenUsed />
</w:style>
<!-- Heading 1 — Dark Blue -->
<w:style w:type="paragraph" w:styleId="Heading1">
<w:name w:val="heading 1" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="480" w:after="240" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="0" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="1F3864" />
<w:sz w:val="56" />
<w:szCs w:val="56" />
</w:rPr>
</w:style>
<!-- Heading 2 -->
<w:style w:type="paragraph" w:styleId="Heading2">
<w:name w:val="heading 2" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="360" w:after="120" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="1" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="1F3864" />
<w:sz w:val="48" />
<w:szCs w:val="48" />
</w:rPr>
</w:style>
<!-- Heading 3 -->
<w:style w:type="paragraph" w:styleId="Heading3">
<w:name w:val="heading 3" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="240" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="2" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="1F3864" />
<w:sz w:val="36" />
<w:szCs w:val="36" />
</w:rPr>
</w:style>
<!-- Heading 4 -->
<w:style w:type="paragraph" w:styleId="Heading4">
<w:name w:val="heading 4" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="160" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="3" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:i />
<w:color w:val="1F3864" />
<w:sz w:val="28" />
<w:szCs w:val="28" />
</w:rPr>
</w:style>
<!-- Title -->
<w:style w:type="paragraph" w:styleId="Title">
<w:name w:val="Title" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="10" />
<w:pPr>
<w:spacing w:after="240" w:line="240" w:lineRule="auto" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:color w:val="1F3864" />
<w:sz w:val="72" />
<w:szCs w:val="72" />
</w:rPr>
</w:style>
<!-- Subtitle -->
<w:style w:type="paragraph" w:styleId="Subtitle">
<w:name w:val="Subtitle" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="11" />
<w:pPr>
<w:spacing w:after="360" w:line="240" w:lineRule="auto" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:i />
<w:color w:val="595959" />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
</w:style>
<!-- Table Grid — Corporate with blue header -->
<w:style w:type="table" w:default="1" w:styleId="TableNormal">
<w:name w:val="Normal Table" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0" w:type="dxa" />
<w:left w:w="108" w:type="dxa" />
<w:bottom w:w="0" w:type="dxa" />
<w:right w:w="108" w:type="dxa" />
</w:tblCellMar>
</w:tblPr>
</w:style>
<w:style w:type="table" w:styleId="TableGrid">
<w:name w:val="Table Grid" />
<w:basedOn w:val="TableNormal" />
<w:uiPriority w:val="39" />
<w:tblPr>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
<w:left w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
<w:right w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="BFBFBF" />
</w:tblBorders>
</w:tblPr>
<w:tblStylePr w:type="firstRow">
<w:rPr>
<w:b />
<w:color w:val="FFFFFF" />
</w:rPr>
<w:tcPr>
<w:shd w:val="clear" w:color="auto" w:fill="2F5496" />
<w:tcBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="2F5496" />
<w:left w:val="single" w:sz="4" w:space="0" w:color="2F5496" />
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="2F5496" />
<w:right w:val="single" w:sz="4" w:space="0" w:color="2F5496" />
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="3A6BC5" />
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="3A6BC5" />
</w:tcBorders>
</w:tcPr>
</w:tblStylePr>
<w:tblStylePr w:type="band1Horz">
<w:tcPr>
<w:shd w:val="clear" w:color="auto" w:fill="D9E2F3" />
</w:tcPr>
</w:tblStylePr>
</w:style>
<!-- Header -->
<w:style w:type="paragraph" w:styleId="Header">
<w:name w:val="header" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
<w:color w:val="808080" />
</w:rPr>
</w:style>
<!-- Footer -->
<w:style w:type="paragraph" w:styleId="Footer">
<w:name w:val="footer" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
<w:color w:val="808080" />
</w:rPr>
</w:style>
<!-- Hyperlink -->
<w:style w:type="character" w:styleId="Hyperlink">
<w:name w:val="Hyperlink" />
<w:uiPriority w:val="99" />
<w:unhideWhenUsed />
<w:rPr>
<w:color w:val="0563C1" />
<w:u w:val="single" />
</w:rPr>
</w:style>
</w:styles>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<!-- Document Defaults -->
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="SimSun" w:cs="Arial" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
<w:lang w:val="en-US" w:eastAsia="zh-CN" w:bidi="ar-SA" />
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="160" w:line="259" w:lineRule="auto" />
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
<!-- Latent Styles -->
<w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="0" w:defUnhideWhenUsed="0" w:defQFormat="0" w:count="376" />
<!-- Normal (Default Paragraph Style) -->
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
<w:name w:val="Normal" />
<w:qFormat />
<w:pPr>
<w:spacing w:after="160" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:style>
<!-- Default Paragraph Font -->
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font" />
<w:uiPriority w:val="1" />
<w:semiHidden />
<w:unhideWhenUsed />
</w:style>
<!-- Heading 1 -->
<w:style w:type="paragraph" w:styleId="Heading1">
<w:name w:val="heading 1" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="480" w:after="240" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="0" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="2F5496" />
<w:sz w:val="56" />
<w:szCs w:val="56" />
</w:rPr>
</w:style>
<!-- Heading 2 -->
<w:style w:type="paragraph" w:styleId="Heading2">
<w:name w:val="heading 2" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="360" w:after="120" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="1" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="2F5496" />
<w:sz w:val="48" />
<w:szCs w:val="48" />
</w:rPr>
</w:style>
<!-- Heading 3 -->
<w:style w:type="paragraph" w:styleId="Heading3">
<w:name w:val="heading 3" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="240" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="2" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="2F5496" />
<w:sz w:val="36" />
<w:szCs w:val="36" />
</w:rPr>
</w:style>
<!-- Heading 4 -->
<w:style w:type="paragraph" w:styleId="Heading4">
<w:name w:val="heading 4" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="160" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="3" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:i />
<w:color w:val="2F5496" />
<w:sz w:val="28" />
<w:szCs w:val="28" />
</w:rPr>
</w:style>
<!-- Heading 5 -->
<w:style w:type="paragraph" w:styleId="Heading5">
<w:name w:val="heading 5" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="160" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="4" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:color w:val="2F5496" />
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:style>
<!-- Heading 6 -->
<w:style w:type="paragraph" w:styleId="Heading6">
<w:name w:val="heading 6" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="9" />
<w:pPr>
<w:keepNext />
<w:keepLines />
<w:spacing w:before="160" w:after="80" w:line="240" w:lineRule="auto" />
<w:outlineLvl w:val="5" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:b />
<w:i />
<w:color w:val="2F5496" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:style>
<!-- Title -->
<w:style w:type="paragraph" w:styleId="Title">
<w:name w:val="Title" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="10" />
<w:pPr>
<w:spacing w:after="240" w:line="240" w:lineRule="auto" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri Light" w:hAnsi="Calibri Light" />
<w:color w:val="2F5496" />
<w:sz w:val="72" />
<w:szCs w:val="72" />
</w:rPr>
</w:style>
<!-- Subtitle -->
<w:style w:type="paragraph" w:styleId="Subtitle">
<w:name w:val="Subtitle" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="11" />
<w:pPr>
<w:spacing w:after="360" w:line="240" w:lineRule="auto" />
<w:jc w:val="center" />
</w:pPr>
<w:rPr>
<w:i />
<w:color w:val="595959" />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
</w:style>
<!-- Quote -->
<w:style w:type="paragraph" w:styleId="Quote">
<w:name w:val="Quote" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="29" />
<w:pPr>
<w:spacing w:before="240" w:after="240" />
<w:ind w:left="720" w:right="720" />
</w:pPr>
<w:rPr>
<w:i />
<w:color w:val="404040" />
</w:rPr>
</w:style>
<!-- Intense Quote -->
<w:style w:type="paragraph" w:styleId="IntenseQuote">
<w:name w:val="Intense Quote" />
<w:basedOn w:val="Normal" />
<w:next w:val="Normal" />
<w:qFormat />
<w:uiPriority w:val="30" />
<w:pPr>
<w:spacing w:before="240" w:after="240" />
<w:ind w:left="720" w:right="720" />
<w:pBdr>
<w:left w:val="single" w:sz="18" w:space="12" w:color="2F5496" />
</w:pBdr>
</w:pPr>
<w:rPr>
<w:b />
<w:i />
<w:color w:val="2F5496" />
</w:rPr>
</w:style>
<!-- TOC Heading -->
<w:style w:type="paragraph" w:styleId="TOCHeading">
<w:name w:val="TOC Heading" />
<w:basedOn w:val="Heading1" />
<w:next w:val="Normal" />
<w:uiPriority w:val="39" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:outlineLvl w:val="9" />
</w:pPr>
</w:style>
<!-- TOC 1 -->
<w:style w:type="paragraph" w:styleId="TOC1">
<w:name w:val="toc 1" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="39" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:spacing w:before="120" w:after="0" />
</w:pPr>
<w:rPr>
<w:b />
</w:rPr>
</w:style>
<!-- TOC 2 -->
<w:style w:type="paragraph" w:styleId="TOC2">
<w:name w:val="toc 2" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="39" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:spacing w:after="0" />
<w:ind w:left="240" />
</w:pPr>
</w:style>
<!-- TOC 3 -->
<w:style w:type="paragraph" w:styleId="TOC3">
<w:name w:val="toc 3" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="39" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:spacing w:after="0" />
<w:ind w:left="480" />
</w:pPr>
</w:style>
<!-- List Bullet -->
<w:style w:type="paragraph" w:styleId="ListBullet">
<w:name w:val="List Bullet" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="36" />
<w:pPr>
<w:spacing w:after="0" />
<w:ind w:left="720" w:hanging="360" />
<w:contextualSpacing />
</w:pPr>
</w:style>
<!-- List Number -->
<w:style w:type="paragraph" w:styleId="ListNumber">
<w:name w:val="List Number" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="36" />
<w:pPr>
<w:spacing w:after="0" />
<w:ind w:left="720" w:hanging="360" />
<w:contextualSpacing />
</w:pPr>
</w:style>
<!-- Table Normal -->
<w:style w:type="table" w:default="1" w:styleId="TableNormal">
<w:name w:val="Normal Table" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0" w:type="dxa" />
<w:left w:w="108" w:type="dxa" />
<w:bottom w:w="0" w:type="dxa" />
<w:right w:w="108" w:type="dxa" />
</w:tblCellMar>
</w:tblPr>
</w:style>
<!-- Table Grid -->
<w:style w:type="table" w:styleId="TableGrid">
<w:name w:val="Table Grid" />
<w:basedOn w:val="TableNormal" />
<w:uiPriority w:val="39" />
<w:tblPr>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:left w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:right w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto" />
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto" />
</w:tblBorders>
</w:tblPr>
</w:style>
<!-- Header -->
<w:style w:type="paragraph" w:styleId="Header">
<w:name w:val="header" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
<w:color w:val="808080" />
</w:rPr>
</w:style>
<!-- Footer -->
<w:style w:type="paragraph" w:styleId="Footer">
<w:name w:val="footer" />
<w:basedOn w:val="Normal" />
<w:uiPriority w:val="99" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:tabs>
<w:tab w:val="center" w:pos="4680" />
<w:tab w:val="right" w:pos="9360" />
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
<w:color w:val="808080" />
</w:rPr>
</w:style>
<!-- Hyperlink -->
<w:style w:type="character" w:styleId="Hyperlink">
<w:name w:val="Hyperlink" />
<w:uiPriority w:val="99" />
<w:unhideWhenUsed />
<w:rPr>
<w:color w:val="0563C1" />
<w:u w:val="single" />
</w:rPr>
</w:style>
<!-- Comment Text -->
<w:style w:type="paragraph" w:styleId="CommentText">
<w:name w:val="annotation text" />
<w:basedOn w:val="Normal" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto" />
</w:pPr>
<w:rPr>
<w:sz w:val="20" />
<w:szCs w:val="20" />
</w:rPr>
</w:style>
<!-- Comment Reference -->
<w:style w:type="character" w:styleId="CommentReference">
<w:name w:val="annotation reference" />
<w:semiHidden />
<w:unhideWhenUsed />
<w:rPr>
<w:sz w:val="16" />
<w:szCs w:val="16" />
</w:rPr>
</w:style>
</w:styles>
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================================ -->
<!-- Aesthetic Rules Schema for minimax-docx -->
<!-- ============================================================================ -->
<!-- Purpose: Validates whether a document follows basic aesthetic rules that -->
<!-- produce visually harmonious results. This is a "taste checker" that flags -->
<!-- common ugly patterns. -->
<!-- -->
<!-- IMPORTANT: XSD validates STRUCTURE and VALUE RANGES, not SEMANTICS. -->
<!-- Many aesthetic rules require cross-element comparison (e.g., "H1 must be -->
<!-- larger than H2") which XSD cannot express. These rules are documented in -->
<!-- comments and must be enforced by a programmatic validator. -->
<!-- -->
<!-- Rules that CAN be expressed in XSD: -->
<!-- - Font size ranges (body 10-14pt, headings 10-26pt) -->
<!-- - Line spacing ranges (1.0x to 2.33x) -->
<!-- - Margin minimums (at least 0.5in on all sides) -->
<!-- - Table cell padding minimums -->
<!-- -->
<!-- Rules that CANNOT be expressed in XSD (enforce programmatically): -->
<!-- - H1 sz > H2 sz > H3 sz > body sz (hierarchy) -->
<!-- - Maximum 3 font families across all styles -->
<!-- - Heading space-before >= space-after -->
<!-- - Color contrast ratio between text and background -->
<!-- - Consistent font family within heading vs body groups -->
<!-- - Line spacing and font size harmony (larger text needs tighter spacing) -->
<!-- -->
<!-- MIT License - minimax-docx project -->
<!-- ============================================================================ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
elementFormDefault="qualified">
<!-- ============================================================ -->
<!-- RULE 1: Body Font Size Range -->
<!-- ============================================================ -->
<!-- Body text must be 10-14pt (half-points: 20-28). -->
<!-- WHY: Below 10pt is hard to read for most adults. -->
<!-- Above 14pt body text looks childish or wasteful. -->
<!-- The sweet spot is 10.5-12pt for most font families. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticBodyFontSize">
<xs:annotation>
<xs:documentation>
Body text font size in half-points.
Acceptable range: 20-28 (10pt-14pt).
- 10pt (20): minimum for comfortable reading
- 11pt (22): modern default (Calibri, Aptos)
- 12pt (24): traditional default (Times New Roman)
- 14pt (28): maximum before body text looks oversized
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="20"/> <!-- 10pt minimum -->
<xs:maxInclusive value="28"/> <!-- 14pt maximum -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 2: Heading Font Size Range -->
<!-- ============================================================ -->
<!-- Headings must be 12-26pt (half-points: 24-52). -->
<!-- WHY: Below 12pt, a heading cannot be visually distinguished -->
<!-- from body text by size alone. -->
<!-- Above 26pt is poster-sized and wastes vertical space. -->
<!-- NOTE: Some academic styles use 12pt headings (same as body) -->
<!-- and differentiate via bold/italic/centering instead. -->
<!-- The lower bound of 24 (12pt) accommodates this. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticHeadingFontSize">
<xs:annotation>
<xs:documentation>
Heading font size in half-points.
Acceptable range: 24-52 (12pt-26pt).
- 12pt (24): APA-style (hierarchy via bold/italic, not size)
- 16pt (32): typical H2/H3
- 20pt (40): typical H1
- 26pt (52): maximum before headings dominate the page
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="24"/> <!-- 12pt minimum -->
<xs:maxInclusive value="52"/> <!-- 26pt maximum -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 3: Line Spacing Range -->
<!-- ============================================================ -->
<!-- Line spacing (in auto mode) must be 240-560 (1.0x-2.33x). -->
<!-- WHY: Below 1.0x, ascenders/descenders overlap — unreadable. -->
<!-- Above 2.33x, lines appear disconnected. -->
<!-- Sweet spots: 1.15x (276) for sans, 1.5x (360) for -->
<!-- generous layouts, 2.0x (480) for academic. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticLineSpacing">
<xs:annotation>
<xs:documentation>
Line spacing value for auto line-spacing rule.
In 240ths of single spacing: 240 = 1.0x, 480 = 2.0x.
Acceptable range: 240-560 (1.0x to 2.33x).
Common values:
- 240: single spacing (dense, technical)
- 259: Word's 1.08x default
- 276: 1.15x (modern corporate default)
- 336: 1.4x (executive/generous)
- 360: 1.5x (generous/minimal)
- 480: 2.0x (academic double spacing)
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="240"/> <!-- 1.0x single spacing -->
<xs:maxInclusive value="560"/> <!-- ~2.33x — beyond double feels disconnected -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 3b: Fixed Line Spacing Range -->
<!-- ============================================================ -->
<!-- For lineRule="exact", line value is in DXA (twentieths of pt) -->
<!-- Range: 200-720 DXA (10pt-36pt fixed line height) -->
<!-- Chinese government standard uses 560 DXA (28pt). -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticFixedLineSpacing">
<xs:annotation>
<xs:documentation>
Fixed line spacing value (lineRule="exact") in DXA.
Acceptable range: 200-720 (10pt-36pt).
- 560: Chinese government standard (28pt, for 16pt body)
- 480: double-space equivalent for 12pt body
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="200"/> <!-- 10pt minimum fixed height -->
<xs:maxInclusive value="720"/> <!-- 36pt maximum fixed height -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 4: Margin Minimums -->
<!-- ============================================================ -->
<!-- All margins must be at least 720 DXA (0.5 inch). -->
<!-- WHY: Below 0.5in, most printers clip content. -->
<!-- Also, narrow margins create a cramped, unprofessional -->
<!-- appearance. Even "full bleed" designs need internal -->
<!-- text margins. -->
<!-- Max set to 4320 DXA (3 inches) to prevent absurd margins. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticMargin">
<xs:annotation>
<xs:documentation>
Page margin in DXA. Minimum 720 (0.5 inch), maximum 4320 (3 inches).
Common values:
- 720: 0.5in (minimum printable)
- 1440: 1.0in (standard US)
- 1588: 28mm (Chinese government left margin)
- 1800: 1.25in (executive/premium)
- 2160: 1.5in (binding margin or narrow-column design)
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="720"/> <!-- 0.5in — minimum for print safety -->
<xs:maxInclusive value="4320"/> <!-- 3in — beyond this is absurd -->
</xs:restriction>
</xs:simpleType>
<!-- Top/bottom margins: signed because negative values can create -->
<!-- overlap effects, but we still enforce a reasonable minimum. -->
<xs:simpleType name="ST_AestheticVerticalMargin">
<xs:annotation>
<xs:documentation>
Vertical (top/bottom) page margin in DXA.
Range: 360 to 4320 (0.25in to 3in).
Slightly more permissive than horizontal margins because
header/footer areas may reduce effective vertical margin.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="360"/> <!-- 0.25in — tighter vertical is sometimes acceptable -->
<xs:maxInclusive value="4320"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 5: Paragraph Spacing Ranges -->
<!-- ============================================================ -->
<!-- Space before/after paragraphs should be 0-960 DXA (0-48pt). -->
<!-- WHY: More than 48pt of space before/after creates awkward -->
<!-- gaps that disrupt reading flow. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticParaSpacing">
<xs:annotation>
<xs:documentation>
Paragraph spacing (before/after) in DXA.
Range: 0-960 (0pt-48pt).
Common values:
- 0: academic style (uses first-line indent instead)
- 80: 4pt (tight, used after H2/H3)
- 120: 6pt (moderate)
- 160: 8pt (standard modern spacing)
- 200: 10pt (generous/executive)
- 240: 12pt (very generous/minimal)
- 480: 24pt (heading before — creates section break)
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="960"/> <!-- 48pt max — beyond this is a page break, not spacing -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 6: Table Cell Padding Minimum -->
<!-- ============================================================ -->
<!-- Table cells need at least 28 DXA (~1.4pt) padding. -->
<!-- WHY: Without padding, text touches cell borders — visually -->
<!-- cramped and hard to read. Even borderless tables need -->
<!-- padding for column separation. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticCellPadding">
<xs:annotation>
<xs:documentation>
Table cell padding in DXA. Minimum 28 DXA (~1.4pt).
Recommended: 57 DXA (~2.85pt) for comfortable spacing.
Maximum: 288 DXA (~14pt) — beyond this wastes space.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="28"/> <!-- ~1.4pt minimum breathing room -->
<xs:maxInclusive value="288"/> <!-- ~14pt — more than this is excessive -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 7: Border Size Range -->
<!-- ============================================================ -->
<!-- Border size (in eighth-points) should be 2-24 (0.25pt-3pt). -->
<!-- WHY: Below 0.25pt borders may not render or print. -->
<!-- Above 3pt borders look heavy and distracting. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticBorderSize">
<xs:annotation>
<xs:documentation>
Border width in eighth-points.
Range: 2-24 (0.25pt to 3pt).
Common values:
- 4: 0.5pt (thin, standard)
- 6: 0.75pt (header separator in three-line tables)
- 8: 1.0pt (medium, good for framing borders)
- 12: 1.5pt (heavy, used for top/bottom in three-line tables)
- 24: 3.0pt (maximum before borders dominate)
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="2"/> <!-- 0.25pt minimum visible -->
<xs:maxInclusive value="24"/> <!-- 3pt maximum tasteful -->
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 8: Color Value Format -->
<!-- ============================================================ -->
<!-- Colors must be valid 6-digit hex (RRGGBB) or "auto". -->
<!-- This is structural validation, not aesthetic validation. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticColor">
<xs:annotation>
<xs:documentation>
Color value: 6-digit hex (RRGGBB) or "auto".
Examples: "000000", "1F3864", "2C3E50", "auto".
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9A-Fa-f]{6}|auto"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- RULE 9: First-Line Indent Range -->
<!-- ============================================================ -->
<!-- If first-line indent is used, it should be 360-1440 DXA -->
<!-- (0.25in - 1.0in). -->
<!-- WHY: Below 0.25in the indent is barely visible. -->
<!-- Above 1.0in the indent looks like a tab error. -->
<!-- ============================================================ -->
<xs:simpleType name="ST_AestheticFirstLineIndent">
<xs:annotation>
<xs:documentation>
First-line indent in DXA. Range: 0-1440 (0in to 1.0in).
- 0: no indent (modern style with space-after)
- 480: 0.33in (compact)
- 640: ~0.44in (2 Chinese characters at 16pt)
- 720: 0.5in (standard APA/academic)
- 1440: 1.0in (maximum before it looks wrong)
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1440"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- COMPOSITE TYPE: Aesthetic Run Properties Check -->
<!-- ============================================================ -->
<!-- Validates run-level properties for aesthetic compliance. -->
<!-- ============================================================ -->
<xs:complexType name="CT_AestheticRPr">
<xs:annotation>
<xs:documentation>
Aesthetic run properties validator.
Checks font size and color format at the run level.
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="sz" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="w:ST_AestheticBodyFontSize" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="szCs" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="w:ST_AestheticBodyFontSize" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="color" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="w:ST_AestheticColor" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- COMPOSITE TYPE: Aesthetic Spacing Check -->
<!-- ============================================================ -->
<xs:complexType name="CT_AestheticSpacing">
<xs:annotation>
<xs:documentation>
Aesthetic spacing validator for paragraph spacing properties.
Validates line spacing and before/after spacing are in range.
</xs:documentation>
</xs:annotation>
<xs:attribute name="line" type="w:ST_AestheticLineSpacing" use="optional"/>
<xs:attribute name="before" type="w:ST_AestheticParaSpacing" use="optional"/>
<xs:attribute name="after" type="w:ST_AestheticParaSpacing" use="optional"/>
<xs:attribute name="lineRule" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="auto"/>
<xs:enumeration value="exact"/>
<xs:enumeration value="atLeast"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<!-- ============================================================ -->
<!-- COMPOSITE TYPE: Aesthetic Page Margins Check -->
<!-- ============================================================ -->
<xs:complexType name="CT_AestheticPageMargins">
<xs:annotation>
<xs:documentation>
Aesthetic page margin validator.
Ensures all margins meet minimum print-safe thresholds.
</xs:documentation>
</xs:annotation>
<xs:attribute name="top" type="w:ST_AestheticVerticalMargin" use="required"/>
<xs:attribute name="bottom" type="w:ST_AestheticVerticalMargin" use="required"/>
<xs:attribute name="left" type="w:ST_AestheticMargin" use="required"/>
<xs:attribute name="right" type="w:ST_AestheticMargin" use="required"/>
<xs:attribute name="header" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="footer" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="gutter" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- COMPOSITE TYPE: Aesthetic Table Cell Margin Check -->
<!-- ============================================================ -->
<xs:complexType name="CT_AestheticTableCellMargin">
<xs:annotation>
<xs:documentation>
Aesthetic table cell margin validator.
Ensures minimum padding for readability.
</xs:documentation>
</xs:annotation>
<xs:attribute name="w" type="w:ST_AestheticCellPadding" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="dxa"/>
<xs:enumeration value="nil"/>
<xs:enumeration value="pct"/>
<xs:enumeration value="auto"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<!-- ============================================================ -->
<!-- PROGRAMMATIC RULES (cannot be expressed in XSD) -->
<!-- ============================================================ -->
<!-- -->
<!-- The following rules must be checked by a programmatic -->
<!-- validator (e.g., AestheticRuleValidator.cs). They are -->
<!-- documented here for completeness. -->
<!-- -->
<!-- ── RULE P1: Heading Size Hierarchy ── -->
<!-- H1 sz >= H2 sz >= H3 sz >= body sz -->
<!-- Exception: APA-style where all headings = body size. -->
<!-- Implementation: Collect sz from Heading1/2/3 styles and -->
<!-- docDefaults. Verify monotonic decrease (or equality). -->
<!-- -->
<!-- ── RULE P2: Maximum 3 Font Families ── -->
<!-- Across docDefaults rPr + all style rPr, at most 3 distinct -->
<!-- font families (by Ascii name) should be used. -->
<!-- WHY: More than 3 fonts creates visual chaos. Professional -->
<!-- designs typically use 1-2 families. -->
<!-- Implementation: Collect all rFonts.ascii values from -->
<!-- docDefaults and all styles. Count distinct. Warn if > 3. -->
<!-- -->
<!-- ── RULE P3: Heading Space-Before >= Space-After ── -->
<!-- For heading styles, spaceBefore should be >= spaceAfter. -->
<!-- WHY: Headings should be visually closer to the content they -->
<!-- introduce than to the content above. This is the -->
<!-- "proximity principle" of Gestalt design. -->
<!-- Implementation: For each Heading style, compare pPr spacing -->
<!-- before vs after values. -->
<!-- -->
<!-- ── RULE P4: Spacing-Size Coherence ── -->
<!-- Paragraph after-spacing should be proportional to body size: -->
<!-- after >= bodySize * 0.5 AND after <= bodySize * 1.5 -->
<!-- WHY: Too little spacing makes paragraphs run together. -->
<!-- Too much spacing disconnects them. -->
<!-- Implementation: Get body sz from docDefaults, convert to DXA -->
<!-- (multiply by 10), check after-spacing ratio. -->
<!-- -->
<!-- ── RULE P5: Color Consistency ── -->
<!-- All heading styles should use the same color value. -->
<!-- Body text color (if set) should be consistent across styles. -->
<!-- WHY: Inconsistent colors look accidental, not designed. -->
<!-- Exception: Caption and footnote styles may differ. -->
<!-- Implementation: Collect color.val from heading styles. -->
<!-- Verify all are identical. -->
<!-- -->
<!-- ── RULE P6: Indent/Spacing Mutual Exclusion ── -->
<!-- If first-line indent > 0 in docDefaults, then after-spacing -->
<!-- should be 0 (and vice versa). Using BOTH indent AND spacing -->
<!-- is visually redundant — it signals uncertainty. -->
<!-- Exception: Headings may override this. -->
<!-- Implementation: Check docDefaults pPr. If firstLine > 0 AND -->
<!-- after > 0, emit a warning (not error). -->
<!-- -->
<!-- ── RULE P7: Table Border Consistency ── -->
<!-- Within a single table, border styles should be internally -->
<!-- consistent (all single, or all none — not a random mix). -->
<!-- Implementation: Check tblBorders for consistent val values. -->
<!-- -->
<!-- ── RULE P8: Line Spacing vs Font Size Harmony ── -->
<!-- For fixed line spacing (lineRule="exact"): -->
<!-- lineHeight >= fontSize * 1.2 -->
<!-- WHY: Fixed line spacing less than 1.2x the font size causes -->
<!-- ascender/descender clipping. -->
<!-- Implementation: When lineRule="exact", compare line value -->
<!-- against the effective font size. -->
<!-- -->
<!-- ============================================================ -->
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Business Rules Gate-Check Schema for minimax-docx -->
<!-- Used in Scenario C (template application) as hard gate -->
<!-- Validates business compliance beyond XML correctness -->
<!-- MIT License - minimax-docx project -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
elementFormDefault="qualified">
<!-- ============================================================ -->
<!-- Page margins: constrained to reasonable bounds -->
<!-- Minimum 360 DXA (0.25 inch), maximum 4320 DXA (3 inches) -->
<!-- ============================================================ -->
<xs:simpleType name="ST_MarginMeasure">
<xs:restriction base="xs:integer">
<xs:minInclusive value="360"/>
<xs:maxInclusive value="4320"/>
</xs:restriction>
</xs:simpleType>
<!-- Signed margin (top/bottom can be negative for overlap) -->
<xs:simpleType name="ST_SignedMarginMeasure">
<xs:restriction base="xs:integer">
<xs:minInclusive value="-4320"/>
<xs:maxInclusive value="4320"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- Font size constraints -->
<!-- Body text: 16-144 half-points (8-72pt) -->
<!-- Heading text: 20-192 half-points (10-96pt) -->
<!-- ============================================================ -->
<xs:simpleType name="ST_BodyFontSize">
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="16"/>
<xs:maxInclusive value="144"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HeadingFontSize">
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="20"/>
<xs:maxInclusive value="192"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- Valid standard page sizes (width x height in DXA) -->
<!-- ============================================================ -->
<!-- Letter: 12240 x 15840 -->
<!-- A4: 11906 x 16838 -->
<!-- Legal: 12240 x 20160 -->
<!-- A3: 16838 x 23811 -->
<!-- A5: 8391 x 11906 -->
<xs:simpleType name="ST_PageWidth">
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="5040"/>
<xs:maxInclusive value="31680"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_PageHeight">
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="5040"/>
<xs:maxInclusive value="31680"/>
</xs:restriction>
</xs:simpleType>
<!-- ============================================================ -->
<!-- Constrained section properties for gate-check -->
<!-- ============================================================ -->
<xs:complexType name="CT_GateCheckSectPr">
<xs:all>
<xs:element name="pgSz" minOccurs="1">
<xs:complexType>
<xs:attribute name="w" type="w:ST_PageWidth" use="required"/>
<xs:attribute name="h" type="w:ST_PageHeight" use="required"/>
<xs:attribute name="orient" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="portrait"/>
<xs:enumeration value="landscape"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="pgMar" minOccurs="1">
<xs:complexType>
<xs:attribute name="top" type="w:ST_SignedMarginMeasure" use="required"/>
<xs:attribute name="bottom" type="w:ST_SignedMarginMeasure" use="required"/>
<xs:attribute name="left" type="w:ST_MarginMeasure" use="required"/>
<xs:attribute name="right" type="w:ST_MarginMeasure" use="required"/>
<xs:attribute name="header" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="footer" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="gutter" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- Required styles: at minimum Normal and Heading1 must exist -->
<!-- This is enforced programmatically by GateCheckValidator -->
<!-- rather than via XSD, since XSD cannot validate style presence -->
<!-- across separate XML parts. -->
<!-- ============================================================ -->
<!-- ============================================================ -->
<!-- Constrained run properties for font size validation -->
<!-- ============================================================ -->
<xs:complexType name="CT_GateCheckRPr">
<xs:all>
<xs:element name="sz" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="w:ST_BodyFontSize" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="szCs" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="w:ST_BodyFontSize" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Common type definitions for WordprocessingML subset schema -->
<!-- MIT License - minimax-docx project -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
elementFormDefault="qualified">
<!-- Measurement: non-negative twips (1/1440 inch) -->
<xs:simpleType name="ST_TwipsMeasure">
<xs:restriction base="xs:nonNegativeInteger"/>
</xs:simpleType>
<!-- Measurement: signed twips (for negative margins/indents) -->
<xs:simpleType name="ST_SignedTwipsMeasure">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
<!-- Half-point measure for font sizes (1 = 0.5pt) -->
<xs:simpleType name="ST_HpsMeasure">
<xs:restriction base="xs:positiveInteger"/>
</xs:simpleType>
<!-- Hex color: 6 hex digits -->
<xs:simpleType name="ST_HexColor">
<xs:restriction base="xs:string">
<xs:pattern value="auto|[0-9a-fA-F]{6}"/>
</xs:restriction>
</xs:simpleType>
<!-- On/Off toggle -->
<xs:simpleType name="ST_OnOff">
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
<!-- Justification -->
<xs:simpleType name="ST_Jc">
<xs:restriction base="xs:string">
<xs:enumeration value="left"/>
<xs:enumeration value="center"/>
<xs:enumeration value="right"/>
<xs:enumeration value="both"/>
<xs:enumeration value="distribute"/>
<xs:enumeration value="start"/>
<xs:enumeration value="end"/>
</xs:restriction>
</xs:simpleType>
<!-- Break type -->
<xs:simpleType name="ST_BrType">
<xs:restriction base="xs:string">
<xs:enumeration value="page"/>
<xs:enumeration value="column"/>
<xs:enumeration value="textWrapping"/>
</xs:restriction>
</xs:simpleType>
<!-- Underline patterns -->
<xs:simpleType name="ST_Underline">
<xs:restriction base="xs:string">
<xs:enumeration value="none"/>
<xs:enumeration value="single"/>
<xs:enumeration value="words"/>
<xs:enumeration value="double"/>
<xs:enumeration value="thick"/>
<xs:enumeration value="dotted"/>
<xs:enumeration value="dash"/>
<xs:enumeration value="dotDash"/>
<xs:enumeration value="dotDotDash"/>
<xs:enumeration value="wave"/>
</xs:restriction>
</xs:simpleType>
<!-- Vertical alignment for subscript/superscript -->
<xs:simpleType name="ST_VerticalAlignRun">
<xs:restriction base="xs:string">
<xs:enumeration value="baseline"/>
<xs:enumeration value="superscript"/>
<xs:enumeration value="subscript"/>
</xs:restriction>
</xs:simpleType>
<!-- Section break type -->
<xs:simpleType name="ST_SectionMark">
<xs:restriction base="xs:string">
<xs:enumeration value="nextPage"/>
<xs:enumeration value="nextColumn"/>
<xs:enumeration value="continuous"/>
<xs:enumeration value="evenPage"/>
<xs:enumeration value="oddPage"/>
</xs:restriction>
</xs:simpleType>
<!-- Header/footer type -->
<xs:simpleType name="ST_HdrFtr">
<xs:restriction base="xs:string">
<xs:enumeration value="even"/>
<xs:enumeration value="default"/>
<xs:enumeration value="first"/>
</xs:restriction>
</xs:simpleType>
<!-- Table width type -->
<xs:simpleType name="ST_TblWidth">
<xs:restriction base="xs:string">
<xs:enumeration value="auto"/>
<xs:enumeration value="dxa"/>
<xs:enumeration value="nil"/>
<xs:enumeration value="pct"/>
</xs:restriction>
</xs:simpleType>
<!-- Vertical merge -->
<xs:simpleType name="ST_Merge">
<xs:restriction base="xs:string">
<xs:enumeration value="continue"/>
<xs:enumeration value="restart"/>
</xs:restriction>
</xs:simpleType>
<!-- Highlight colors -->
<xs:simpleType name="ST_HighlightColor">
<xs:restriction base="xs:string">
<xs:enumeration value="black"/>
<xs:enumeration value="blue"/>
<xs:enumeration value="cyan"/>
<xs:enumeration value="darkBlue"/>
<xs:enumeration value="darkCyan"/>
<xs:enumeration value="darkGray"/>
<xs:enumeration value="darkGreen"/>
<xs:enumeration value="darkMagenta"/>
<xs:enumeration value="darkRed"/>
<xs:enumeration value="darkYellow"/>
<xs:enumeration value="green"/>
<xs:enumeration value="lightGray"/>
<xs:enumeration value="magenta"/>
<xs:enumeration value="none"/>
<xs:enumeration value="red"/>
<xs:enumeration value="white"/>
<xs:enumeration value="yellow"/>
</xs:restriction>
</xs:simpleType>
<!-- Percentage (for table width pct, etc.) -->
<xs:simpleType name="ST_DecimalNumber">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
<!-- Relationship ID reference -->
<xs:simpleType name="ST_RelationshipId">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<!-- WordprocessingML Subset Schema for minimax-docx -->
<!-- Curated subset of ISO 29500 covering elements agents commonly generate -->
<!-- MIT License - minimax-docx project -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
elementFormDefault="qualified">
<xs:import namespace="http://schemas.openxmlformats.org/officeDocument/2006/relationships"/>
<xs:import namespace="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"/>
<!-- ============================================================ -->
<!-- Root element -->
<!-- ============================================================ -->
<xs:element name="document" type="w:CT_Document"/>
<xs:complexType name="CT_Document">
<xs:sequence>
<xs:element name="body" type="w:CT_Body" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- ============================================================ -->
<!-- Body -->
<!-- ============================================================ -->
<xs:complexType name="CT_Body">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="p" type="w:CT_P"/>
<xs:element name="tbl" type="w:CT_Tbl"/>
<xs:element name="sdt" type="w:CT_SdtBlock"/>
<xs:element name="bookmarkStart" type="w:CT_BookmarkStart"/>
<xs:element name="bookmarkEnd" type="w:CT_BookmarkEnd"/>
</xs:choice>
<xs:element name="sectPr" type="w:CT_SectPr" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- ============================================================ -->
<!-- Paragraph -->
<!-- ============================================================ -->
<xs:complexType name="CT_P">
<xs:sequence>
<xs:element name="pPr" type="w:CT_PPr" minOccurs="0"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="r" type="w:CT_R"/>
<xs:element name="hyperlink" type="w:CT_Hyperlink"/>
<xs:element name="bookmarkStart" type="w:CT_BookmarkStart"/>
<xs:element name="bookmarkEnd" type="w:CT_BookmarkEnd"/>
<xs:element name="commentRangeStart" type="w:CT_MarkupRange"/>
<xs:element name="commentRangeEnd" type="w:CT_MarkupRange"/>
<xs:element name="ins" type="w:CT_RunTrackChange"/>
<xs:element name="del" type="w:CT_RunTrackChange"/>
</xs:choice>
</xs:sequence>
<xs:attribute ref="r:id" use="optional"/>
</xs:complexType>
<!-- Paragraph Properties -->
<xs:complexType name="CT_PPr">
<xs:all>
<xs:element name="pStyle" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="keepNext" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="keepLines" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="pageBreakBefore" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="widowControl" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="numPr" type="w:CT_NumPr" minOccurs="0"/>
<xs:element name="spacing" type="w:CT_Spacing" minOccurs="0"/>
<xs:element name="ind" type="w:CT_Ind" minOccurs="0"/>
<xs:element name="jc" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="outlineLvl" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="rPr" type="w:CT_RPr" minOccurs="0"/>
<xs:element name="pBdr" type="w:CT_PBdr" minOccurs="0"/>
<xs:element name="shd" type="w:CT_Shd" minOccurs="0"/>
<xs:element name="tabs" type="w:CT_Tabs" minOccurs="0"/>
<xs:element name="sectPr" type="w:CT_SectPr" minOccurs="0"/>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- Run -->
<!-- ============================================================ -->
<xs:complexType name="CT_R">
<xs:sequence>
<xs:element name="rPr" type="w:CT_RPr" minOccurs="0"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="t" type="w:CT_Text"/>
<xs:element name="delText" type="w:CT_Text"/>
<xs:element name="br" type="w:CT_Br"/>
<xs:element name="tab" type="w:CT_Empty"/>
<xs:element name="cr" type="w:CT_Empty"/>
<xs:element name="drawing" type="w:CT_Drawing"/>
<xs:element name="commentReference" type="w:CT_MarkupRef"/>
<xs:element name="footnoteReference" type="w:CT_FtnEdnRef"/>
<xs:element name="endnoteReference" type="w:CT_FtnEdnRef"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<!-- Run Properties -->
<xs:complexType name="CT_RPr">
<xs:all>
<xs:element name="rStyle" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="rFonts" type="w:CT_Fonts" minOccurs="0"/>
<xs:element name="b" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="bCs" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="i" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="iCs" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="caps" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="smallCaps" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="strike" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="dstrike" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="vanish" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="color" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
<xs:attribute name="themeColor" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="spacing" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="sz" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:positiveInteger" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="szCs" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:positiveInteger" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="highlight" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="u" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
<xs:attribute name="color" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="vertAlign" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="lang" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="optional"/>
<xs:attribute name="eastAsia" type="xs:string" use="optional"/>
<xs:attribute name="bidi" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- Text -->
<!-- ============================================================ -->
<xs:complexType name="CT_Text" mixed="true">
<xs:attribute ref="xml:space" use="optional"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Table -->
<!-- ============================================================ -->
<xs:complexType name="CT_Tbl">
<xs:sequence>
<xs:element name="tblPr" type="w:CT_TblPr" minOccurs="0"/>
<xs:element name="tblGrid" type="w:CT_TblGrid" minOccurs="0"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="tr" type="w:CT_Row"/>
<xs:element name="bookmarkStart" type="w:CT_BookmarkStart"/>
<xs:element name="bookmarkEnd" type="w:CT_BookmarkEnd"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_TblPr">
<xs:all>
<xs:element name="tblStyle" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="tblW" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="jc" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="tblInd" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="tblBorders" type="w:CT_TblBorders" minOccurs="0"/>
<xs:element name="shd" type="w:CT_Shd" minOccurs="0"/>
<xs:element name="tblLayout" minOccurs="0">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="tblCellMar" type="w:CT_TblCellMar" minOccurs="0"/>
<xs:element name="tblLook" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="optional"/>
<xs:attribute name="firstRow" type="xs:string" use="optional"/>
<xs:attribute name="lastRow" type="xs:string" use="optional"/>
<xs:attribute name="firstColumn" type="xs:string" use="optional"/>
<xs:attribute name="lastColumn" type="xs:string" use="optional"/>
<xs:attribute name="noHBand" type="xs:string" use="optional"/>
<xs:attribute name="noVBand" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_TblGrid">
<xs:sequence>
<xs:element name="gridCol" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="w" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_Row">
<xs:sequence>
<xs:element name="trPr" type="w:CT_TrPr" minOccurs="0"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="tc" type="w:CT_Cell"/>
<xs:element name="bookmarkStart" type="w:CT_BookmarkStart"/>
<xs:element name="bookmarkEnd" type="w:CT_BookmarkEnd"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_TrPr">
<xs:all>
<xs:element name="trHeight" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="hRule" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="tblHeader" type="w:CT_OnOff" minOccurs="0"/>
<xs:element name="jc" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_Cell">
<xs:sequence>
<xs:element name="tcPr" type="w:CT_TcPr" minOccurs="0"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="p" type="w:CT_P"/>
<xs:element name="tbl" type="w:CT_Tbl"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_TcPr">
<xs:all>
<xs:element name="tcW" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="gridSpan" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:positiveInteger" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="vMerge" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="tcBorders" type="w:CT_TcBorders" minOccurs="0"/>
<xs:element name="shd" type="w:CT_Shd" minOccurs="0"/>
<xs:element name="vAlign" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="noWrap" type="w:CT_OnOff" minOccurs="0"/>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- Section Properties -->
<!-- ============================================================ -->
<xs:complexType name="CT_SectPr">
<xs:all>
<xs:element name="headerReference" minOccurs="0">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute ref="r:id" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="footerReference" minOccurs="0">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute ref="r:id" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="type" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="pgSz" minOccurs="0">
<xs:complexType>
<xs:attribute name="w" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="h" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="orient" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="pgMar" minOccurs="0">
<xs:complexType>
<xs:attribute name="top" type="xs:integer" use="required"/>
<xs:attribute name="right" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="bottom" type="xs:integer" use="required"/>
<xs:attribute name="left" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="header" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="footer" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="gutter" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="pgNumType" minOccurs="0">
<xs:complexType>
<xs:attribute name="fmt" type="xs:string" use="optional"/>
<xs:attribute name="start" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="cols" minOccurs="0">
<xs:complexType>
<xs:attribute name="space" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="num" type="xs:positiveInteger" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="docGrid" minOccurs="0">
<xs:complexType>
<xs:attribute name="linePitch" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="type" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="titlePg" type="w:CT_OnOff" minOccurs="0"/>
</xs:all>
</xs:complexType>
<!-- ============================================================ -->
<!-- Hyperlink -->
<!-- ============================================================ -->
<xs:complexType name="CT_Hyperlink">
<xs:sequence>
<xs:element name="r" type="w:CT_R" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute ref="r:id" use="optional"/>
<xs:attribute name="anchor" type="xs:string" use="optional"/>
<xs:attribute name="history" type="xs:string" use="optional"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Track Changes -->
<!-- ============================================================ -->
<xs:complexType name="CT_RunTrackChange">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="r" type="w:CT_R"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="author" type="xs:string" use="required"/>
<xs:attribute name="date" type="xs:dateTime" use="optional"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Bookmarks -->
<!-- ============================================================ -->
<xs:complexType name="CT_BookmarkStart">
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="CT_BookmarkEnd">
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Comments -->
<!-- ============================================================ -->
<xs:complexType name="CT_MarkupRange">
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
<xs:complexType name="CT_MarkupRef">
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Footnote/Endnote reference -->
<!-- ============================================================ -->
<xs:complexType name="CT_FtnEdnRef">
<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
<!-- ============================================================ -->
<!-- Drawing (basic inline image) -->
<!-- ============================================================ -->
<xs:complexType name="CT_Drawing">
<xs:sequence>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- ============================================================ -->
<!-- Structured Document Tag (content control) -->
<!-- ============================================================ -->
<xs:complexType name="CT_SdtBlock">
<xs:sequence>
<xs:element name="sdtPr" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sdtContent" minOccurs="0">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="p" type="w:CT_P"/>
<xs:element name="tbl" type="w:CT_Tbl"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- ============================================================ -->
<!-- Helper types -->
<!-- ============================================================ -->
<xs:complexType name="CT_OnOff">
<xs:attribute name="val" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_Empty"/>
<xs:complexType name="CT_Br">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="clear" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_Fonts">
<xs:attribute name="ascii" type="xs:string" use="optional"/>
<xs:attribute name="hAnsi" type="xs:string" use="optional"/>
<xs:attribute name="eastAsia" type="xs:string" use="optional"/>
<xs:attribute name="cs" type="xs:string" use="optional"/>
<xs:attribute name="asciiTheme" type="xs:string" use="optional"/>
<xs:attribute name="hAnsiTheme" type="xs:string" use="optional"/>
<xs:attribute name="eastAsiaTheme" type="xs:string" use="optional"/>
<xs:attribute name="cstheme" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_NumPr">
<xs:all>
<xs:element name="ilvl" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="numId" minOccurs="0">
<xs:complexType>
<xs:attribute name="val" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_Spacing">
<xs:attribute name="before" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="after" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="line" type="xs:integer" use="optional"/>
<xs:attribute name="lineRule" type="xs:string" use="optional"/>
<xs:attribute name="beforeAutospacing" type="xs:string" use="optional"/>
<xs:attribute name="afterAutospacing" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_Ind">
<xs:attribute name="left" type="xs:integer" use="optional"/>
<xs:attribute name="right" type="xs:integer" use="optional"/>
<xs:attribute name="hanging" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="firstLine" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="start" type="xs:integer" use="optional"/>
<xs:attribute name="end" type="xs:integer" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_TblWidth">
<xs:attribute name="w" type="xs:string" use="optional"/>
<xs:attribute name="type" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_Shd">
<xs:attribute name="val" type="xs:string" use="optional"/>
<xs:attribute name="color" type="xs:string" use="optional"/>
<xs:attribute name="fill" type="xs:string" use="optional"/>
<xs:attribute name="themeFill" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_Border">
<xs:attribute name="val" type="xs:string" use="required"/>
<xs:attribute name="sz" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="space" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="color" type="xs:string" use="optional"/>
<xs:attribute name="themeColor" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="CT_PBdr">
<xs:all>
<xs:element name="top" type="w:CT_Border" minOccurs="0"/>
<xs:element name="left" type="w:CT_Border" minOccurs="0"/>
<xs:element name="bottom" type="w:CT_Border" minOccurs="0"/>
<xs:element name="right" type="w:CT_Border" minOccurs="0"/>
<xs:element name="between" type="w:CT_Border" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_TblBorders">
<xs:all>
<xs:element name="top" type="w:CT_Border" minOccurs="0"/>
<xs:element name="left" type="w:CT_Border" minOccurs="0"/>
<xs:element name="bottom" type="w:CT_Border" minOccurs="0"/>
<xs:element name="right" type="w:CT_Border" minOccurs="0"/>
<xs:element name="insideH" type="w:CT_Border" minOccurs="0"/>
<xs:element name="insideV" type="w:CT_Border" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_TcBorders">
<xs:all>
<xs:element name="top" type="w:CT_Border" minOccurs="0"/>
<xs:element name="left" type="w:CT_Border" minOccurs="0"/>
<xs:element name="bottom" type="w:CT_Border" minOccurs="0"/>
<xs:element name="right" type="w:CT_Border" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_TblCellMar">
<xs:all>
<xs:element name="top" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="left" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="bottom" type="w:CT_TblWidth" minOccurs="0"/>
<xs:element name="right" type="w:CT_TblWidth" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="CT_Tabs">
<xs:sequence>
<xs:element name="tab" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="val" type="xs:string" use="required"/>
<xs:attribute name="pos" type="xs:integer" use="required"/>
<xs:attribute name="leader" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
MIT License
Copyright (c) 2026 MiniMaxAI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
CJK Typography & Mixed-Script Guide
Rules for Chinese, Japanese, and Korean text in DOCX documents.
Table of Contents
1. Font Selection 2. Font Size Names (CJK) 3. RunFonts Mapping 4. Punctuation & Line Breaking 5. Paragraph Indentation 6. Line Spacing for CJK 7. Chinese Government Standard (GB/T 9704) 8. Mixed CJK + Latin Best Practices 9. OpenXML Quick Reference
---
Font Selection
Recommended CJK Fonts
| Language | Serif (正文) | Sans (标题) | Notes |
|---|---|---|---|
| Simplified Chinese | 宋体 (SimSun) | 微软雅黑 (Microsoft YaHei) | YaHei for screen, SimSun for print |
| Simplified Chinese | 仿宋 (FangSong) | 黑体 (SimHei) | Government documents |
| Traditional Chinese | 新細明體 (PMingLiU) | 微軟正黑體 (Microsoft JhengHei) | Taiwan standard |
| Japanese | MS 明朝 (MS Mincho) | MS ゴシック (MS Gothic) | Classic pairing |
| Japanese | 游明朝 (Yu Mincho) | 游ゴシック (Yu Gothic) | Modern, Windows 10+ |
| Korean | 바탕 (Batang) | 맑은 고딕 (Malgun Gothic) | Standard pairing |
Government Document Fonts (公文)
| Element | Font | Size |
|---|---|---|
| 标题 (title) | 小标宋 (FZXiaoBiaoSong-B05S) | 二号 (22pt) |
| 一级标题 | 黑体 (SimHei) | 三号 (16pt) |
| 二级标题 | 楷体_GB2312 (KaiTi_GB2312) | 三号 (16pt) |
| 三级标题 | 仿宋_GB2312 加粗 | 三号 (16pt) |
| 正文 (body) | 仿宋_GB2312 (FangSong_GB2312) | 三号 (16pt) |
| 附注/页码 | 宋体 (SimSun) | 四号 (14pt) |
---
Font Size Names
CJK uses named sizes. Map to points and w:sz half-point values:
| 字号 | Points | w:sz | Common Use |
|---|---|---|---|
| 初号 | 42pt | 84 | Display title |
| 小初 | 36pt | 72 | Large title |
| 一号 | 26pt | 52 | Chapter heading |
| 小一 | 24pt | 48 | Major heading |
| 二号 | 22pt | 44 | Document title (公文) |
| 小二 | 18pt | 36 | Western H1 equivalent |
| 三号 | 16pt | 32 | CJK heading / 公文 body |
| 小三 | 15pt | 30 | Sub-heading |
| 四号 | 14pt | 28 | CJK subheading |
| 小四 | 12pt | 24 | Standard body (CJK) |
| 五号 | 10.5pt | 21 | Compact CJK body |
| 小五 | 9pt | 18 | Footnotes |
| 六号 | 7.5pt | 15 | Fine print |
---
RunFonts Mapping
OpenXML uses four font slots to handle multilingual text:
<w:rFonts
w:ascii="Calibri" <!-- Latin characters (U+0000–U+007F) -->
w:hAnsi="Calibri" <!-- Latin extended, Greek, Cyrillic -->
w:eastAsia="SimSun" <!-- CJK Unified Ideographs, Kana, Hangul -->
w:cs="Arial" <!-- Arabic, Hebrew, Thai, Devanagari -->
/>Word's character classification logic:
1. Character is in CJK range → uses w:eastAsia font 2. Character is in complex script range → uses w:cs font 3. Character is basic Latin (ASCII) → uses w:ascii font 4. Everything else → uses w:hAnsi font
Key: w:eastAsia is the only way to set CJK fonts. Setting just w:ascii will NOT affect CJK characters. Mixed text within a single run auto-switches fonts at the character level — no need for separate runs.
Document Defaults
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="SimSun" w:cs="Arial" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
<w:lang w:val="en-US" w:eastAsia="zh-CN" />
</w:rPr>
</w:rPrDefault>
</w:docDefaults>w:lang w:eastAsia helps Word resolve ambiguous characters (e.g., punctuation shared between CJK and Latin).
---
Punctuation & Line Breaking
Full-Width vs Half-Width
CJK text uses full-width punctuation:
| Type | CJK | Latin |
|---|---|---|
| Period | 。(U+3002) | . |
| Comma | ,(U+FF0C) 、(U+3001) | , |
| Colon | :(U+FF1A) | : |
| Semicolon | ;(U+FF1B) | ; |
| Quotes | 「」『』 or ""'' | "" '' |
| Parentheses | ()(U+FF08/09) | () |
In mixed text, use the punctuation style of the surrounding language context.
OpenXML Controls
<w:pPr>
<w:adjustRightInd w:val="true" /> <!-- Adjust right indent for CJK punctuation -->
<w:snapToGrid w:val="true" /> <!-- Align to document grid -->
<w:kinsoku w:val="true" /> <!-- Enable CJK line breaking rules -->
<w:overflowPunct w:val="true" /> <!-- Allow punctuation to overflow margins -->
</w:pPr>Kinsoku Rules (禁則処理)
Prevents certain characters from appearing at the start or end of a line:
- Cannot start a line:
)」』】〉》。、,!?;:and closing brackets - Cannot end a line:
(「『【〈《and opening brackets
Word applies these automatically when w:kinsoku is enabled.
Line Breaking
- CJK characters can break between any two characters (no word boundaries needed)
- Latin words within CJK text still follow word-boundary breaking
w:wordWrap w:val="false"enables CJK-style breaking (break anywhere)
---
Paragraph Indentation
Chinese Standard: 2-Character Indent
Chinese body text conventionally uses a 2-character first-line indent:
<w:ind w:firstLineChars="200" /> <!-- 200 = 2 characters × 100 -->Preferred over w:firstLine with fixed DXA because firstLineChars scales with font size.
| Indent | Value |
|---|---|
| 1 character | w:firstLineChars="100" |
| 2 characters | w:firstLineChars="200" |
| 3 characters | w:firstLineChars="300" |
---
Line Spacing
- CJK characters are taller than Latin characters at the same point size
- Default
1.0line spacing may feel cramped with CJK text - Recommended:
1.15–1.5for mixed CJK+Latin,1.0with fixed 28pt for 公文
Auto Spacing
<w:pPr>
<w:autoSpaceDE w:val="true"/> <!-- auto space between CJK and Latin -->
<w:autoSpaceDN w:val="true"/> <!-- auto space between CJK and numbers -->
</w:pPr>Adds ~¼ em spacing between CJK and non-CJK characters automatically. Recommended: always enable.
---
GB/T 9704
Chinese government document standard (党政机关公文格式). These are strict requirements, not suggestions.
Page Setup
| Parameter | Value | OpenXML |
|---|---|---|
| Page size | A4 (210×297mm) | Width=11906, Height=16838 |
| Top margin | 37mm | 2098 DXA |
| Bottom margin | 35mm | 1984 DXA |
| Left margin | 28mm | 1588 DXA |
| Right margin | 26mm | 1474 DXA |
| Characters/line | 28 | |
| Lines/page | 22 | |
| Line spacing | Fixed 28pt | line="560" lineRule="exact" |
Document Structure
┌─────────────────────────────────┐
│ 发文机关标志 (红头) │ ← 小标宋 or 红色大字
│ ══════════════════ (红线) │ ← Red #FF0000, 2pt
├─────────────────────────────────┤
│ 发文字号: X机发〔2025〕X号 │ ← 仿宋 三号, centered
│ │
│ 标题 (Title) │ ← 小标宋 二号, centered
│ │ 可分多行,回行居中
│ 主送机关: │ ← 仿宋 三号
│ │
│ 正文 (Body)... │ ← 仿宋_GB2312 三号
│ 一、一级标题 │ ← 黑体 三号
│ (一)二级标题 │ ← 楷体 三号
│ 1. 三级标题 │ ← 仿宋 三号 加粗
│ (1) 四级标题 │ ← 仿宋 三号
│ │
│ 附件: 1. xxx │ ← 仿宋 三号
│ │
│ 发文机关署名 │ ← 仿宋 三号
│ 成文日期 │ ← 仿宋 三号, 小写中文数字
├─────────────────────────────────┤
│ ══════════════════ (版记线) │
│ 抄送: xxx │ ← 仿宋 四号
│ 印发机关及日期 │ ← 仿宋 四号
└─────────────────────────────────┘Numbering System
一、 ← 黑体 (SimHei), no indentation
(一) ← 楷体 (KaiTi), indented 2 chars
1. ← 仿宋加粗 (FangSong Bold), indented 2 chars
(1) ← 仿宋 (FangSong), indented 2 charsColors
| Element | Color | Requirement |
|---|---|---|
| All body text | Black #000000 | Mandatory |
| 红头 (agency name) | Red #FF0000 | Mandatory |
| 红线 (separator) | Red #FF0000 | Mandatory |
| 公章 (official seal) | Red | Mandatory |
Page Numbers
- Position: bottom center
- Format:
-X-(dash-number-dash) - Font: 宋体 四号 (SimSun 14pt,
sz="28") - No page number on cover page if present
---
Mixed Script
Font Size Harmony
CJK characters appear larger than Latin characters at the same point size. Compensation:
- If body is Calibri 11pt, pair with CJK at 11pt (same size — CJK looks slightly larger but acceptable)
- If precise visual match needed, CJK can be set 0.5–1pt smaller
- In practice, same point size is standard — don't over-optimize
Bold and Italic
- Chinese/Japanese have no true italic. Word synthesizes a slant which looks poor
- Use bold for emphasis in CJK text
- Use 着重号 (emphasis dots) for traditional emphasis:
<w:em w:val="dot"/>on RunProperties
---
OpenXML Quick Reference
Set EastAsia Font (C#)
new Run(
new RunProperties(
new RunFonts { EastAsia = "SimSun", Ascii = "Calibri", HighAnsi = "Calibri" },
new FontSize { Val = "32" } // 三号 = 16pt = sz 32
),
new Text("这是正文内容")
);Document Defaults (C#)
new DocDefaults(new RunPropertiesDefault(new RunPropertiesBaseStyle(
new RunFonts {
Ascii = "Calibri", HighAnsi = "Calibri",
EastAsia = "Microsoft YaHei"
},
new Languages { Val = "en-US", EastAsia = "zh-CN" }
)));公文 Style Definitions (C#)
// Title style — 小标宋 二号 centered
new Style(
new StyleName { Val = "GongWen Title" },
new BasedOn { Val = "Normal" },
new StyleRunProperties(
new RunFonts { EastAsia = "FZXiaoBiaoSong-B05S" },
new FontSize { Val = "44" }, // 二号 = 22pt
new Bold()
),
new StyleParagraphProperties(
new Justification { Val = JustificationValues.Center },
new SpacingBetweenLines { Line = "560", LineRule = LineSpacingRuleValues.Exact }
)
) { Type = StyleValues.Paragraph, StyleId = "GongWenTitle" };
// Body style — 仿宋_GB2312 三号
new Style(
new StyleName { Val = "GongWen Body" },
new StyleRunProperties(
new RunFonts { EastAsia = "FangSong_GB2312", Ascii = "FangSong_GB2312" },
new FontSize { Val = "32" } // 三号 = 16pt
),
new StyleParagraphProperties(
new SpacingBetweenLines { Line = "560", LineRule = LineSpacingRuleValues.Exact }
)
) { Type = StyleValues.Paragraph, StyleId = "GongWenBody" };Emphasis Dots (着重号)
new RunProperties(new Emphasis { Val = EmphasisMarkValues.Dot });East Asian Text Layout
<!-- Snap to grid (align CJK chars to character grid) -->
<w:snapToGrid w:val="true"/>
<!-- Two-lines-in-one (双行合一) -->
<w:eastAsianLayout w:id="1" w:combine="true"/>
<!-- Vertical text in a cell -->
<w:textDirection w:val="tbRl"/>Chinese University Thesis Template Guide (中国高校论文模板指南)
Why This Guide Exists
Chinese university thesis templates (.docx) have structural patterns that differ significantly from Western templates. Agents that assume Western conventions (Heading1/Heading2/Normal) will fail repeatedly. This guide documents the ACTUAL patterns found in Chinese templates.
Common StyleId Patterns
Pattern A: Numeric IDs (most common in Chinese Word templates)
| Style Purpose | styleId | w:name | w:basedOn |
|---|---|---|---|
| Normal body | a | "Normal" | — |
| Default paragraph font | a0 | "Default Paragraph Font" | — |
| Heading 1 (章标题) | 1 | "heading 1" | a |
| Heading 2 (节标题) | 2 | "heading 2" | a |
| Heading 3 (小节标题) | 3 | "heading 3" | a |
| TOC 1 | 11 | "toc 1" | a |
| TOC 2 | 21 | "toc 2" | a |
| TOC 3 | 31 | "toc 3" | a |
| Header | a3 | "header" | a |
| Footer | a4 | "footer" | a |
| Table of Contents heading | 10 | "TOC Heading" | 1 |
Pattern B: English IDs (less common, usually from international templates)
Standard Heading1/Heading2/Heading3/Normal — these follow the Western pattern.
Pattern C: Mixed (some Chinese, some English)
Some templates define custom styles with Chinese names:
| Style Purpose | styleId | w:name |
|---|---|---|
| 论文标题 | lunwenbiaoti | "论文标题" |
| 章标题 | zhangbiaoti | "章标题" |
| 正文 | zhengwen | "正文" |
How to Identify Which Pattern
# Extract all styleIds from the template
$CLI analyze --input template.docx --styles-only
# Or manually:
# unzip template.docx word/styles.xml
# Search for w:styleId= in the extracted fileLook at the first few styleIds. If you see 1, 2, 3, a, a0 → Pattern A. If you see Heading1, Normal → Pattern B.
Standard Thesis Structure
Chinese university theses follow a highly standardized structure:
┌─────────────────────────────────────┐
│ 封面 (Cover Page) │ ← Usually 1-2 pages
│ - 校名、校徽 │
│ - 论文题目 (title) │
│ - 作者、导师、院系、日期 │
├─────────────────────────────────────┤
│ 学术诚信承诺书 / 独创性声明 │ ← 1 page
│ (Academic Integrity Declaration) │
├─────────────────────────────────────┤
│ 中文摘要 (Chinese Abstract) │ ← 1-2 pages
│ - "摘 要" heading │
│ - Abstract body │
│ - "关键词:" line │
├─────────────────────────────────────┤
│ 英文摘要 (English Abstract) │ ← 1-2 pages
│ - "ABSTRACT" heading │
│ - Abstract body │
│ - "Keywords:" line │
├─────────────────────────────────────┤
│ 目录 (Table of Contents) │ ← 1-3 pages
│ - Often inside SDT block │
│ - Static example entries │
│ - TOC field code │
├─────────────────────────────────────┤
│ 正文 (Body) │ ← Main content
│ 第1章 绪论 │
│ 1.1 研究背景 │
│ 1.2 研究目的和意义 │
│ 第2章 文献综述 │
│ ... │
│ 第N章 结论与展望 │
├─────────────────────────────────────┤
│ 参考文献 (References) │ ← Styled differently
├─────────────────────────────────────┤
│ 致谢 (Acknowledgments) │ ← Optional
├─────────────────────────────────────┤
│ 附录 (Appendices) │ ← Optional
└─────────────────────────────────────┘Identifying Zone Boundaries in Templates
Templates contain EXAMPLE content that must be replaced. Here's how to find the zones:
Zone A (Front matter) — KEEP from template
- Starts at: paragraph 0
- Ends at: the paragraph BEFORE the first chapter heading
- Contains: cover, declaration, abstracts, TOC
- How to detect end: search for first paragraph with style
1(or Heading1) containing "第1章" or "绪论"
Zone B (Body content) — REPLACE with user content
- Starts at: first chapter heading ("第1章...")
- Ends at: "参考文献" heading (inclusive) or last body paragraph before acknowledgments
- How to detect:
for i, el in enumerate(body_elements):
text = get_text(el)
style = get_style(el)
if style in ('1', 'Heading1') and ('第1章' in text or '绪论' in text):
zone_b_start = i
if '参考文献' in text:
zone_b_end = iZone C (Back matter) — KEEP from template (or remove)
- Starts after: 参考文献
- Contains: 致谢, 附录, final sectPr
Font Expectations in Chinese Thesis Templates
| Element | Font | Size (字号) | Size (pt) | w:sz |
|---|---|---|---|---|
| 论文标题 | 华文中宋 or 黑体 | 二号 or 小二 | 22pt or 18pt | 44 or 36 |
| 章标题 (H1) | 黑体 | 三号 | 16pt | 32 |
| 节标题 (H2) | 黑体 | 四号 | 14pt | 28 |
| 小节标题 (H3) | 黑体 | 小四 | 12pt | 24 |
| 正文 | 宋体 | 小四 | 12pt | 24 |
| 页眉 | 宋体 | 五号 | 10.5pt | 21 |
| 页脚/页码 | 宋体 | 五号 | 10.5pt | 21 |
| 表格内容 | 宋体 | 五号 | 10.5pt | 21 |
| 参考文献条目 | 宋体 | 五号 | 10.5pt | 21 |
RunFonts for CJK Body Text
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman"
w:eastAsia="宋体" w:cs="Times New Roman"/>For headings:
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman"
w:eastAsia="黑体" w:cs="Times New Roman"/>IMPORTANT: When cleaning direct formatting, ALWAYS preserve w:eastAsia. Removing it causes Chinese text to fall back to the wrong font.
Common Mistakes with Chinese Templates
1. Searching for `Heading1` — Chinese templates use 1, not Heading1 2. Clearing all rFonts — Must keep eastAsia font declarations 3. Assuming "第1章" is the first paragraph — It's typically paragraph 100+ after cover/abstract/TOC 4. Ignoring SDT blocks in TOC — The TOC is wrapped in an SDT, not just field codes 5. Wrong line spacing — Chinese theses typically use fixed 20pt (line="400") or 22pt (line="440"), not the 28pt used in government documents 6. Missing section breaks — Each zone (abstract, TOC, body) usually has its own sectPr for different headers/footers
Style Mapping Quick Reference
When source document uses Western IDs and template uses Chinese numeric IDs:
{
"Heading1": "1",
"Heading2": "2",
"Heading3": "3",
"Heading4": "3",
"Normal": "a",
"BodyText": "a",
"ListParagraph": "a",
"Caption": "a",
"TOC1": "11",
"TOC2": "21",
"TOC3": "31"
}When source uses Chinese numeric IDs and template uses Western IDs — reverse the mapping.
Comments System Guide (4-File Architecture)
Overview
Word comments require coordination across four XML files plus references in document.xml, [Content_Types].xml, and document.xml.rels.
---
The Four Comment Files
1. word/comments.xml — Main Comment Content
Contains the actual comment text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:comments xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
<w:comment w:id="1" w:author="Alice" w:date="2026-03-21T09:00:00Z" w:initials="A">
<w:p>
<w:pPr><w:pStyle w:val="CommentText" /></w:pPr>
<w:r>
<w:rPr><w:rStyle w:val="CommentReference" /></w:rPr>
<w:annotationRef />
</w:r>
<w:r>
<w:t>This needs clarification.</w:t>
</w:r>
</w:p>
</w:comment>
</w:comments>Key attributes: w:id (unique integer), w:author, w:date (ISO 8601), w:initials.
2. word/commentsExtended.xml — W15 Extensions
Links comments to paragraphs and tracks resolved status:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w15:commentsEx xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml">
<w15:commentEx w15:paraId="1A2B3C4D" w15:done="0" />
</w15:commentsEx>w15:paraId— matches thew14:paraIdof the comment's paragraph incomments.xmlw15:done—"0"= open,"1"= resolved
3. word/commentsIds.xml — Persistent ID Mapping
Provides durable IDs that survive copy/paste across documents:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w16cid:commentsIds xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid">
<w16cid:commentId w16cid:paraId="1A2B3C4D" w16cid:durableId="12345678" />
</w16cid:commentsIds>w16cid:paraId— same asw15:paraIdw16cid:durableId— globally unique identifier (8-digit hex)
4. word/commentsExtensible.xml — W16 Extensions
Modern comment extensions (used in newer Word versions):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w16cex:commentsExtensible xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex">
<w16cex:commentExtensible w16cex:durableId="12345678" w16cex:dateUtc="2026-03-21T09:00:00Z" />
</w16cex:commentsExtensible>---
Document.xml References
Comments are anchored in document content using three elements:
<w:p>
<w:commentRangeStart w:id="1" />
<w:r><w:t>This text has a comment.</w:t></w:r>
<w:commentRangeEnd w:id="1" />
<w:r>
<w:rPr><w:rStyle w:val="CommentReference" /></w:rPr>
<w:commentReference w:id="1" />
</w:r>
</w:p>w:commentRangeStart— marks where the commented text beginsw:commentRangeEnd— marks where the commented text endsw:commentReference— the visible comment marker (superscript number), placed in a run after the range end
The w:id on all three must match the w:id in comments.xml.
---
Content Types Registration
Add to [Content_Types].xml:
<Override PartName="/word/comments.xml"
ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" />
<Override PartName="/word/commentsExtended.xml"
ContentType="application/vnd.ms-word.commentsExtended+xml" />
<Override PartName="/word/commentsIds.xml"
ContentType="application/vnd.ms-word.commentsIds+xml" />
<Override PartName="/word/commentsExtensible.xml"
ContentType="application/vnd.ms-word.commentsExtensible+xml" />---
Relationship Registration
Add to word/_rels/document.xml.rels:
<Relationship Id="rId20" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
Target="comments.xml" />
<Relationship Id="rId21" Type="http://schemas.microsoft.com/office/2011/relationships/commentsExtended"
Target="commentsExtended.xml" />
<Relationship Id="rId22" Type="http://schemas.microsoft.com/office/2016/09/relationships/commentsIds"
Target="commentsIds.xml" />
<Relationship Id="rId23" Type="http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"
Target="commentsExtensible.xml" />---
Step-by-Step: Adding a New Comment
1. Choose a unique comment ID (scan existing w:id values, use max + 1) 2. Generate a paraId (8-character hex, e.g., "1A2B3C4D") and durableId (8-digit hex) 3. Add to `comments.xml`: Create w:comment element with content 4. Add to `commentsExtended.xml`: Create w15:commentEx with paraId, done="0" 5. Add to `commentsIds.xml`: Create w16cid:commentId with paraId and durableId 6. Add to `commentsExtensible.xml`: Create w16cex:commentExtensible with durableId and dateUtc 7. Add to `document.xml`: Insert w:commentRangeStart, w:commentRangeEnd, and w:commentReference around target text 8. Verify `[Content_Types].xml` and document.xml.rels have entries for all 4 files
---
Step-by-Step: Adding a Reply
Replies are comments whose paragraph's w14:paraId links to a parent comment:
1. Create a new w:comment in comments.xml with a new w:id 2. In commentsExtended.xml, add w15:commentEx with:
w15:paraId= new paragraph IDw15:paraIdParent= theparaIdof the comment being replied tow15:done="0"
3. Add entries in commentsIds.xml and commentsExtensible.xml 4. In document.xml, the reply does NOT need its own range markers — it shares the parent's range
<!-- In commentsExtended.xml -->
<w15:commentEx w15:paraId="5E6F7A8B" w15:paraIdParent="1A2B3C4D" w15:done="0" />---
Step-by-Step: Resolving a Comment
Set w15:done="1" on the comment's w15:commentEx entry:
<!-- Before -->
<w15:commentEx w15:paraId="1A2B3C4D" w15:done="0" />
<!-- After -->
<w15:commentEx w15:paraId="1A2B3C4D" w15:done="1" />This marks the comment (and all its replies) as resolved. The comment remains visible but appears grayed out in Word.
---
Minimum Viable Comment
At minimum, a working comment requires: 1. comments.xml with the w:comment element 2. document.xml with range markers and reference 3. Relationship in document.xml.rels 4. Content type in [Content_Types].xml
The extended files (commentsExtended, commentsIds, commentsExtensible) are optional but recommended for full compatibility with modern Word.
OpenXML Child Element Ordering Rules
Element ordering in OpenXML is defined by the XSD schema. Incorrect ordering produces invalid documents that Word may refuse to open or silently repair (potentially losing data).
Key rule: Properties elements (*Pr) must always be the first child of their parent.---
w:document
Children in order:
1. w:background [0..1] — page background color/fill
2. w:body [0..1] — document content container---
w:body
Children in order (repeating group):
1. w:p [0..*] — paragraph
2. w:tbl [0..*] — table
3. w:sdt [0..*] — structured document tag (content control)
4. w:sectPr [0..1] — LAST child: final section propertiesNote: w:p, w:tbl, and w:sdt are interleaved in document order. The only strict rule is that w:sectPr must be the last child of w:body.
---
w:p (Paragraph)
Children in order:
1. w:pPr [0..1] — paragraph properties (MUST be first)
Then any mix of (interleaved in document order):
- w:r [0..*] — run
- w:hyperlink [0..*] — hyperlink wrapper
- w:ins [0..*] — tracked insertion
- w:del [0..*] — tracked deletion
- w:bookmarkStart [0..*] — bookmark anchor start
- w:bookmarkEnd [0..*] — bookmark anchor end
- w:commentRangeStart [0..*] — comment range start
- w:commentRangeEnd [0..*] — comment range end
- w:proofErr [0..*] — proofing error marker
- w:fldSimple [0..*] — simple field
- w:sdt [0..*] — inline content control
- w:smartTag [0..*] — smart tagPractical note: After w:pPr, the remaining children appear in document reading order. Runs, hyperlinks, bookmarks, and comment ranges intermix freely based on their position in the text.
---
w:pPr (Paragraph Properties)
Children in order:
1. w:pStyle [0..1] — paragraph style reference
2. w:keepNext [0..1] — keep with next paragraph
3. w:keepLines [0..1] — keep lines together
4. w:pageBreakBefore [0..1] — page break before paragraph
5. w:framePr [0..1] — text frame properties
6. w:widowControl [0..1] — widow/orphan control
7. w:numPr [0..1] — numbering properties
8. w:suppressLineNumbers [0..1]
9. w:pBdr [0..1] — paragraph borders
10. w:shd [0..1] — shading
11. w:tabs [0..1] — tab stops
12. w:suppressAutoHyphens [0..1]
13. w:kinsoku [0..1] — CJK kinsoku settings
14. w:wordWrap [0..1]
15. w:overflowPunct [0..1]
16. w:topLinePunct [0..1]
17. w:autoSpaceDE [0..1]
18. w:autoSpaceDN [0..1]
19. w:bidi [0..1] — right-to-left paragraph
20. w:adjustRightInd [0..1]
21. w:snapToGrid [0..1]
22. w:spacing [0..1] — line and paragraph spacing
23. w:ind [0..1] — indentation
24. w:contextualSpacing [0..1]
25. w:mirrorIndents [0..1]
26. w:suppressOverlap [0..1]
27. w:jc [0..1] — justification (left/center/right/both)
28. w:textDirection [0..1]
29. w:textAlignment [0..1]
30. w:outlineLvl [0..1] — outline level
31. w:divId [0..1]
32. w:rPr [0..1] — run properties for paragraph mark
33. w:sectPr [0..1] — section break (section ends at this paragraph)
34. w:pPrChange [0..1] — tracked paragraph property change---
w:r (Run)
Children in order:
1. w:rPr [0..1] — run properties (MUST be first)
Then any of (one per run, typically):
- w:t [0..*] — text content
- w:br [0..*] — break (line, page, column)
- w:tab [0..*] — tab character
- w:cr [0..*] — carriage return
- w:sym [0..*] — symbol character
- w:drawing [0..*] — DrawingML object (images)
- w:pict [0..*] — VML picture (legacy)
- w:fldChar [0..*] — complex field character
- w:instrText [0..*] — field instruction text
- w:delText [0..*] — deleted text (inside w:del)
- w:footnoteReference [0..*]
- w:endnoteReference [0..*]
- w:commentReference [0..*]
- w:lastRenderedPageBreak [0..*]---
w:rPr (Run Properties)
Children in order:
1. w:rStyle [0..1] — character style reference
2. w:rFonts [0..1] — font specification
3. w:b [0..1] — bold
4. w:bCs [0..1] — complex script bold
5. w:i [0..1] — italic
6. w:iCs [0..1] — complex script italic
7. w:caps [0..1] — all capitals
8. w:smallCaps [0..1] — small capitals
9. w:strike [0..1] — strikethrough
10. w:dstrike [0..1] — double strikethrough
11. w:outline [0..1]
12. w:shadow [0..1]
13. w:emboss [0..1]
14. w:imprint [0..1]
15. w:noProof [0..1] — suppress proofing
16. w:snapToGrid [0..1]
17. w:vanish [0..1] — hidden text
18. w:color [0..1] — text color
19. w:spacing [0..1] — character spacing
20. w:w [0..1] — character width scaling
21. w:kern [0..1] — font kerning
22. w:position [0..1] — vertical position (raise/lower)
23. w:sz [0..1] — font size (half-points)
24. w:szCs [0..1] — complex script font size
25. w:highlight [0..1] — text highlight color
26. w:u [0..1] — underline
27. w:effect [0..1] — text effect (animated)
28. w:bdr [0..1] — run border
29. w:shd [0..1] — run shading
30. w:vertAlign [0..1] — superscript/subscript
31. w:rtl [0..1] — right-to-left
32. w:cs [0..1] — complex script
33. w:lang [0..1] — language
34. w:rPrChange [0..1] — tracked run property change---
w:tbl (Table)
Children in order:
1. w:tblPr [1..1] — table properties (REQUIRED, must be first)
2. w:tblGrid [1..1] — column width definitions (REQUIRED)
3. w:tr [1..*] — table row(s)---
w:tblPr (Table Properties)
Children in order:
1. w:tblStyle [0..1] — table style reference
2. w:tblpPr [0..1] — table positioning
3. w:tblOverlap [0..1]
4. w:bidiVisual [0..1] — right-to-left table
5. w:tblStyleRowBandSize [0..1]
6. w:tblStyleColBandSize [0..1]
7. w:tblW [0..1] — preferred table width
8. w:jc [0..1] — table alignment
9. w:tblCellSpacing [0..1]
10. w:tblInd [0..1] — table indent from margin
11. w:tblBorders [0..1] — table borders
12. w:shd [0..1] — table shading
13. w:tblLayout [0..1] — fixed or autofit
14. w:tblCellMar [0..1] — default cell margins
15. w:tblLook [0..1] — conditional formatting flags
16. w:tblCaption [0..1] — accessibility caption
17. w:tblDescription [0..1] — accessibility description
18. w:tblPrChange [0..1] — tracked table property change---
w:tr (Table Row)
Children in order:
1. w:trPr [0..1] — row properties (must be first)
2. w:tc [1..*] — table cell(s)---
w:trPr (Table Row Properties)
Children in order:
1. w:cnfStyle [0..1] — conditional formatting
2. w:divId [0..1]
3. w:gridBefore [0..1] — grid columns before first cell
4. w:gridAfter [0..1] — grid columns after last cell
5. w:wBefore [0..1]
6. w:wAfter [0..1]
7. w:cantSplit [0..1] — don't split row across pages
8. w:trHeight [0..1] — row height
9. w:tblHeader [0..1] — repeat as header row
10. w:tblCellSpacing [0..1]
11. w:jc [0..1] — row alignment
12. w:hidden [0..1]
13. w:ins [0..1] — tracked row insertion
14. w:del [0..1] — tracked row deletion
15. w:trPrChange [0..1] — tracked row property change---
w:tc (Table Cell)
Children in order:
1. w:tcPr [0..1] — cell properties (must be first)
2. w:p [1..*] — paragraph(s) — at least one required
3. w:tbl [0..*] — nested table(s)---
w:tcPr (Table Cell Properties)
Children in order:
1. w:cnfStyle [0..1]
2. w:tcW [0..1] — cell width
3. w:gridSpan [0..1] — horizontal merge (column span)
4. w:hMerge [0..1] — legacy horizontal merge
5. w:vMerge [0..1] — vertical merge
6. w:tcBorders [0..1] — cell borders
7. w:shd [0..1] — cell shading
8. w:noWrap [0..1]
9. w:tcMar [0..1] — cell margins
10. w:textDirection [0..1]
11. w:tcFitText [0..1]
12. w:vAlign [0..1] — vertical alignment
13. w:hideMark [0..1]
14. w:tcPrChange [0..1] — tracked cell property change---
w:sectPr (Section Properties)
Children in order:
1. w:headerReference [0..*] — header references (type: default/first/even)
2. w:footerReference [0..*] — footer references
3. w:endnotePr [0..1]
4. w:footnotePr [0..1]
5. w:type [0..1] — section break type (nextPage/continuous/evenPage/oddPage)
6. w:pgSz [0..1] — page size
7. w:pgMar [0..1] — page margins
8. w:paperSrc [0..1]
9. w:pgBorders [0..1] — page borders
10. w:lnNumType [0..1] — line numbering
11. w:pgNumType [0..1] — page numbering
12. w:cols [0..1] — column definitions
13. w:formProt [0..1]
14. w:vAlign [0..1] — vertical alignment of page
15. w:noEndnote [0..1]
16. w:titlePg [0..1] — different first page header/footer
17. w:textDirection [0..1]
18. w:bidi [0..1]
19. w:rtlGutter [0..1]
20. w:docGrid [0..1] — document grid
21. w:sectPrChange [0..1] — tracked section property change---
w:hdr (Header) / w:ftr (Footer)
Children (same structure as w:body content):
1. w:p [0..*] — paragraph(s)
2. w:tbl [0..*] — table(s)
3. w:sdt [0..*] — content controlsHeaders and footers are essentially mini-documents. They follow the same content model as w:body but without a final w:sectPr.
OpenXML Unit Conversion Quick Reference
Master Conversion Table
| Unit | 1 inch | 1 cm | 1 mm | 1 pt | Description |
|---|---|---|---|---|---|
| DXA (twips) | 1440 | 567 | 56.7 | 20 | 1/20 of a point. Used for margins, indents, spacing, page size. |
| EMU | 914400 | 360000 | 36000 | 12700 | English Metric Unit. Used for images, drawings, shapes. |
| Half-points | 144 | 56.7 | 5.67 | 2 | Used for font sizes (w:sz, w:szCs). |
| Points | 72 | 28.35 | 2.835 | 1 | Standard typographic unit. Not used directly in most attributes. |
| Eighths of a point | 576 | 226.8 | 22.68 | 8 | Used for w:spacing character spacing. |
Common Page Sizes
| Size | Width (DXA) | Height (DXA) | Width (mm) | Height (mm) |
|---|---|---|---|---|
| A4 | 11906 | 16838 | 210 | 297 |
| Letter | 12240 | 15840 | 215.9 | 279.4 |
| Legal | 12240 | 20160 | 215.9 | 355.6 |
| A3 | 16838 | 23811 | 297 | 420 |
| A5 | 8391 | 11906 | 148 | 210 |
Common Margin Values
| Margin | DXA | Inches | cm |
|---|---|---|---|
| 0.5 inch | 720 | 0.5 | 1.27 |
| 0.75 inch | 1080 | 0.75 | 1.91 |
| 1 inch | 1440 | 1.0 | 2.54 |
| 1.25 inch | 1800 | 1.25 | 3.18 |
| 1.5 inch | 2160 | 1.5 | 3.81 |
Font Size Values (w:sz)
| Display Size | w:sz value | Notes |
|---|---|---|
| 8pt | 16 | |
| 9pt | 18 | |
| 10pt | 20 | |
| 10.5pt | 21 | Common CJK body size |
| 11pt | 22 | Default Calibri body |
| 12pt | 24 | Default TNR body |
| 14pt | 28 | Small heading |
| 16pt | 32 | |
| 18pt | 36 | |
| 20pt | 40 | |
| 24pt | 48 | |
| 28pt | 56 | |
| 36pt | 72 |
Line Spacing Values
Line spacing in w:spacing uses the w:line attribute in 240ths of a line (when w:lineRule="auto"):
| Spacing | w:line value | w:lineRule |
|---|---|---|
| Single | 240 | auto |
| 1.15 (Word default) | 276 | auto |
| 1.5 | 360 | auto |
| Double | 480 | auto |
| Exact 12pt | 240 | exact |
| At least 12pt | 240 | atLeast |
Note: When lineRule="exact" or "atLeast", w:line is in twips (DXA), not 240ths. So line="240" with lineRule="exact" means exactly 12pt (240/20 = 12pt).
Conversion Formulas
DXA = inches × 1440 = cm × 567 = pt × 20
EMU = inches × 914400 = cm × 360000 = pt × 12700
sz = pt × 2 (half-points)Related skills
FAQ
What can the CLI do?
Create documents, edit content, apply templates, validate against XSD, diff, merge runs, fix element order, and manage track changes.
What document types does it target?
Reports, letters, memos, academic papers, and custom layouts, with matching style XML sets.
What runtime does it need?
It ships a .NET (dotnet) CLI project, so a .NET runtime is required.