| name | swun-thesis-docx-banshi1 |
| description | Build SWUN thesis DOCX (Format 1 / 版式1) from LaTeX using the official SWUN reference template, with post-processing fixes (TOC, chapter page breaks, indents, isLgl numbering fix). |
| version | 1.0.0 |
SWUN Thesis DOCX (版式1)
Generate a .docx from a SWUN thesis LaTeX project while treating the official SWUN Format 1 template as the source of truth.
Output
main_版式1.docx in the thesis directory.
Pipeline
latexpand flattens main.tex
pandoc converts LaTeX -> DOCX with:
--reference-doc pointing at the official template
--citeproc + GB/T 7714-2015 numeric CSL
--resource-path so \\includegraphics assets are embedded
- OOXML post-processing:
- inserts Word TOC field
- adds page breaks before each chapter (Heading 1)
- adds first-line indents for body paragraphs
- adds hanging indents for bibliography entries
- fixes mixed Chinese/Arabic section numbering by adding
w:isLgl to ilvl >= 1 (abstractNumId=0)
Prerequisites
- Tools:
pandoc, latexpand, python3
- Thesis workspace contains
build_docx_banshi1.py and verify_docx.py
- Official template exists (default):
/Users/bit/LaTeX/西南民族大学研究生学位论文写作规范_模板部分_版式1.docx
Usage
bash /Users/bit/.codex/skills/swun-thesis-docx-banshi1/scripts/main.sh
bash /Users/bit/.codex/skills/swun-thesis-docx-banshi1/scripts/main.sh /path/to/SWUN_Thesis
export SWUN_TEMPLATE_DOCX="/path/to/西南民族大学研究生学位论文写作规范_模板部分_版式1.docx"
Guardrails
- Never recreate styles/numbering from scratch. Always use the official template as
--reference-doc.
- Do not manually type heading numbering; rely on the template multilevel list mapping.