This skill should be used when the user needs to format a Word (.docx) thesis document according to the Shandong University undergraduate graduation thesis (design) writing standards. Triggers include requests like "按山大论文格式修改", "格式不对帮我改一下", "套用毕业论文模板", or any mention of 山东大学毕业论文格式/本科毕设格式排版. The skill handles page margins, heading styles, body text indentation, header/footer, abstract, and references formatting automatically via a Python script.
Automatically reformat a Word (.docx) file to comply with the Shandong University Undergraduate Graduation Thesis (Design) writing standards (山东大学本科毕业论文撰写规范).
Load this skill whenever a user asks to:
Confirm the path to the .docx file that needs formatting. Ask the user if not provided.
Execute scripts/format_thesis.py with the input file path.
The script produces a new file with _格式修改版 appended to the filename.
python scripts/format_thesis.py <input.docx> [output.docx]
input.docx — Path to the original thesis fileoutput.docx — (Optional) Explicit output path; defaults to <input stem>_格式修改版.docxAfter the script runs, confirm the following manually or by re-reading the document XML:
| Item | Target value |
|---|---|
| Page margins | Top/Bottom 2.5 cm · Left/Right 3.0 cm |
| Body font | 宋体 12pt (小四) |
| Line spacing | 1.5× for body & headings |
| Heading 1 | 黑体 三号 (16pt), centered, bold, para-before 0.8行, para-after 0.5行 |
| Heading 2 | 黑体 四号 (14pt), bold, para-before/after 0.5行 |
| Heading 3 | 黑体 小四 (12pt), bold |
| First-line indent | 480 DXA (2 characters) for all body paragraphs |
| Page header | "山东大学本科毕业论文(设计)" · 小五宋体 · centered |
| Reference title | 黑体 小二 (18pt), bold, centered, no indent |
| Reference body | Single line spacing |
| Abstract heading | "摘要" bold |
Send the _格式修改版.docx output file to the user.
Summarize what was changed and note anything that may need manual review (e.g., figure captions, tables, special characters).
lxml) manipulation; ensure lxml is installed.python-docx is optional and can be used to generate test documents.Heading 1/2/3 or Normal) may need manual adjustment after running.references/sdu-thesis-format.md.lxml>=4.9.0
Optional:
python-docx>=1.1.0
Install with:
pip install lxml
Edit PDFs with natural-language instructions using the nano-pdf CLI.