Inspired by pandoc-docx-tools. Based on the default DOCX template of Pandoc 3.9.
# Make script executable
chmod +x pandoc-docx.sh
# Generate reference.docx from `reference` folder
./pandoc-docx.sh zip
# Edit reference.docx in Microsoft Word
# Unzip reference.docx to `reference` folder
./pandoc-docx.sh unzipUse the reference.docx file as the template:
./pandoc-docx.sh zip && pandoc -o test.docx --reference-doc=reference.docx test.md --number-sectionscustom.openxml is a Pandoc --template for controlling the document body structure. Based on the official default, with affiliation and email metadata fields added after author.