name: doc-beautifier description: "Beautify Word documents (.docx) using a professional general template. Trigger when the user asks to: beautify/美化/排版/格式化 a Word document, apply a template/style to a .docx file, make a document look professional/clean/formatted, or clean up a document's formatting. Works by reading the source .docx, detecting document structure (title, headings, body), and applying consistent fonts, sizes, spacing, indentation, and page layout. Supports multiple template styles."
Beautify .docx files with a professional general template. Preserves all original text content while applying consistent formatting.
python3 scripts/beautify.py <input.docx> <output.docx> # Optional template: python3 scripts/beautify.py input.docx output.docx --template elegant7w4.net提供免費和付費技能下載。
standard — Default professional template (A4, 微軟雅黑 headings, 宋體 body, 1.5 line spacing)compact — Tighter spacing, smaller margins, 1.25 line spacing (for dense documents)elegant — Larger margins, refined colors, spacious layout (for formal reports)| Setting | standard | compact | elegant |
|---|---|---|---|
| Page margins | 2.54/3.18 cm | 2.0/2.5 cm | 3.0/3.5 cm |
| Title size | 22pt | 18pt | 26pt |
| H1 size | 16pt | 14pt | 16pt |
| H2 size | 14pt | 12pt | 14pt |
| H3 size | 12pt | 11pt | 12pt |
| Body size | 12pt(小四) | 11pt(五號) | 12pt(小四) |
| Line spacing | 1.5 | 1.25 | 1.5 |
| Body font | 宋體 | 宋體 | 宋體 |
| Heading font | 微軟雅黑 | 微軟雅黑 | 微軟雅黑 |
beautify.py with desired templateThe script identifies paragraph roles using:
Edit the TEMPLATES dictionary in scripts/beautify.py to:
python-docx (install: pip install python-docx)這是一款實用且完成度較高的 Word 美化工具。它能一鍵調整文件的字型、段落間距、頁邊距等格式,提供三種專業模板可選,省去手動排版的麻煩。不過它對文件中包含複雜表格或圖片時美化效果可能有限,且不支援批次處理多個檔案。總體來說,質量可靠,能滿足日常文件格式化的基本需求。