Activate ONLY when the user explicitly runs the command:
text
/djtu-vehicle-eng-thesis-check
Do NOT activate on natural language requests such as "check my thesis", "format my paper", "generate docx", or "convert to Word" — those are too broad and may not relate to a DJTU Vehicle Engineering thesis.
NEVER use pypandoc.download_pandoc() or download pandoc from GitHub.
NEVER attempt to install pandoc by any method other than check_env.sh.
Do not write ad-hoc install commands. Do not try apt-get without sudo.
Do not try running without sudo as a fallback. These will always fail silently
or with errors and waste the user's time.
If check_env.sh outputs [SUDO NEEDED]:
bash scripts/check_env.sh.sudo scope: sudo is used ONLY for apt-get install -y pandoc (or dnf).
Never for pip, never for building the docx, never for anything else.
pandoc install priority (handled by check_env.sh automatically):
sudo apt-get install -y pandoc — always firstsudo dnf install -y pandoc — if apt not availablebrew install pandoc — macOS onlytext
bash scripts/check_env.sh
Run this and follow its output exactly:
[OK] for all items → proceed to Step 2.[SUDO NEEDED] → stop, show the user the command, wait for
them to run it, then re-run this step.[ERROR] or [MISSING] for anything other than pandoc →
report the error to the user and stop.Full dependency list: references/requirements.txt.
text
python scripts/validate.py <path/to/draft.md>
Checks performed (rules sourced from references/formatting-spec.md):
CheckWhat it looks forCover page fields学生姓名, 导师, 专业名称, 学号 in first 50 linesSection order摘要 → 绪论 → 结论 → 参考文献 → 致谢 all present as H1, in orderHeading hierarchyNo H3 before H2; no headings deeper than H3Figure captionsEvery ![…] image followed by 图X.X 图名 on next non-empty lineTable captionsEvery table row preceded by 表X.X 表名 captionCitationsNo author-year format (Smith, 2020) — must use [n] superscriptReferences section# 参 考 文 献 exists; entries numbered [1] Author …Abstract lengthChinese abstract: 500–800 CJK charactersTotal lengthTotal CJK character count flagged if < 10 000Glossary termsTechnical terms cross-checked against references/glossary.md
Warnings report line numbers only — no draft content is echoed into output.
Fix all [ERROR] items before proceeding. [WARN] items are advisory.
text
python scripts/build_docx.py <path/to/draft.md> <output/thesis.docx>
Applied formatting (all values from references/formatting-spec.md):
ElementValueMarginsTop 2.5 cm / Bottom 2.0 cm / Left 2.0 cm / Right 2.0 cmBody fontSimSun (宋体) + Times New Roman, 小四号 (12pt)Body spacing多倍行距 1.25×, first-line indent 2 characters (24pt)H1 fontSimHei (黑体) + Times New Roman, 小三号 (15pt), centered, page-break beforeH2 fontSimHei + Times New Roman, 四号 (14pt), justified, 1.5× spacingH3 fontSimHei + Times New Roman, 小四号 (12pt), justified, 1.5× spacingTOCAuto-generated, 3 levels deepSection numberingPreserved as-is from the Markdown headings (no auto-numbering)
Output: <output/thesis.docx> — open in Word for final review.
FilePurposereferences/formatting-spec.mdOfficial DJTU formatting rules (extracted from 模板.docx comments)references/glossary.mdVehicle engineering terminology & standard abbreviationsreferences/requirements.txtpip dependencies (pinned versions)references/examples/chapter-sample.mdCorrectly-formatted sample chapterreferences/examples/bad-vs-good.mdCommon mistakes with corrections
build_docx.py applies fonts, margins, spacing, and page breaks.
Final touches (page headers, Roman numeral front-matter page numbers,
three-line table borders) still require manual adjustment in Word.图X.X 图名 / 表X.X 表名 for validation to pass.references/glossary.md.
Add project-specific terms there before running validate.py.