A local DOCX formatter for theses and papers.
It changes fonts, spacing, indents, headings and captions to match a format guide. It does not rewrite the paper. Before saving, it compares a fingerprint of the body and table text from before and after the run. If the text changed, it aborts instead of writing the formatted file.
Everything runs on your machine. Nothing is uploaded.
Report fields from a real run (--engine python):
{
"content_fingerprint_before": "793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db",
"content_fingerprint_after": "793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db",
"content_changed": false,
"content_guard_enforced": true
}The two hashes should match. If they don't, the formatter exits with
content guard failed and the formatted DOCX is not written.
What the check covers: body paragraphs and tables, with whitespace and stray
bullet characters normalized before comparing. Headers and footers are out of
scope because the formatter sets those on purpose. Use --engine python when
the fingerprint must cover the final saved DOCX; the other engines run a local
post-processor after the check, e.g. to refresh the table of contents.
To watch the guard trip, run python tools/demo_content_guard.py. It formats
a synthetic paper, then repeats the run with the styling step patched to edit
one sentence of the in-memory document. The second run aborts without writing
the DOCX.
pip install -r requirements.txt
python -m paper_format_agent.cli \
--format-file "format_guide.docx" \
--paper-file "paper.docx" \
--out-dir "./output" \
--engine python