Fast Main-Text Chinese Review & Bidirectional PDF Sync (informs-zh-review)
Enable rapid human reading of INFORMS manuscripts in Chinese PDF form—stripping out heavy Online Appendix proofs—and cleanly synchronize PDF highlights, strikeouts, sticky notes, and handwritten ink markups back into both the English and Chinese LaTeX sources under strict Git version control.
1. Mandatory Git Versioning Discipline
Core manuscript sources (*.tex, *.bib, and zh_review/main_zh.tex) MUST be tracked in Git before and after every operation.
- Pre-Flight Check: Run
git statusin the project directory.- If not yet a Git repository: run
git init, ensure.gitignoreexcludes LaTeX build artifacts andzh_review/annot_snapshots/, and create an initial baseline commit (chore: baseline manuscript before zh-review). - If uncommitted edits exist before applying PDF annotations: commit a clean checkpoint (
checkpoint: before applying <pdf_name> annotations) so every change remains strictly reversible.
- If not yet a Git repository: run
- Post-Sync Commit: After compiling and verifying both updated sources, commit both English and Chinese
.texfiles atomically:git add <en_tex_files> zh_review/main_zh.tex && git commit -m "sync(zh-review): apply annotations from <pdf_name>"
2. Workflow A: Fast Main-Text EN -> ZH PDF Generation
Use when the user asks to translate an English .tex manuscript (or selected sections) into a Chinese PDF for quick review.
Step 1: Scope Filter (Main Text Only, Skip Online Appendix)
- Translate ONLY the main manuscript:
- Title, Abstract, Keywords
- Main body sections (Introduction through Conclusion)
- Formal Theorem, Proposition, Lemma, Corollary, Assumption, and Definition statements
- Main-text Figures (referencing
../figures/...),booktabsTables, and numbered Algorithms
- Strictly STOP at
\ECSwitch/\appendix/ Online Appendix: Do NOT translate Online Appendix proofs, helper lemmas, or supplementary tables. Append one closing italicized note at the end ofzh_review/main_zh.tex:\textit{Note omitted Online Appendix notice in Chinese}->\textit{注:Online Appendix(详细证明、辅助引理及补充数值实验)已按快速审阅模式略去。} - Skip translating the bibliography entries. Render in-text citations cleanly as
Author (Year)or(Author Year)so compilation never stalls on BibTeX lookups.
Step 2: 1-to-1 Structural Mirror & Sync Anchors
- Write the translated file to
zh_review/main_zh.texbased on ctex-review-template.tex. - Preserve identical section numbering, equation numbering, theorem/proposition/lemma counters, figure/table numbers, and paragraph breaks as the English source.
- Place a lightweight anchor comment immediately above every paragraph, theorem block, table, and displayed equation:
% [EN-SYNC: main.tex:sec2:p3] - Record the source English Git commit hash in the file header (
% Synced from ../main.tex @ <short_hash>).
Step 3: Translation Craft for OR/MS Scholars
- Preserve 100% of Mathematical Content: Keep all inline
$...$, displayed equations, variables, and theorem conditions identical to the English manuscript. - Natural Chinese Academic Prose: Write fluent, concise Chinese OR/MS prose—avoid stiff word-by-word translationese.
- Terminology Lock: Maintain a strict 1-to-1 Chinese-to-English term mapping matching the English manuscript's canonical terms. On first occurrence of key technical constructs, attach the canonical English term in parentheses (e.g.,
base-stock policy,submodularity,cross-moment regularity).
Step 4: Compile, Visually Inspect & Commit
- Compile inside
zh_review/usingxelatex:
(On Windows, ifxelatex -interaction=nonstopmode -halt-on-error main_zh.tex xelatex -interaction=nonstopmode -halt-on-error main_zh.texxelatexis not onPATH, checkC:\texlive\2021\bin\win32\xelatex.exe.) - Run
informs-writing'scheck_pdf_layout.pyonzh_review/main_zh.pdf(--render-flagged zh_review/annot_snapshots) and inspect flagged or table/figure pages viaread_fileto catch missing CJK/math glyphs, overlapping text, blank pages, or oversized whitespace voids; remove temporary PNGs afterward. - Verify
zh_review/main_zh.pdfexists with non-zero size and zero blocking visual/glyph defects, commitzh_review/main_zh.texto Git (feat(zh-review): generate main-text Chinese review PDF), and present a clickablefile:///link tozh_review/main_zh.pdf.
3. Workflow B: Annotated Chinese PDF -> Bidirectional EN + ZH Sync
Use when the user returns an annotated Chinese PDF (highlights, strikeouts, sticky notes, free-text comments, or iPad handwritten ink) and asks to update both versions.
Step 1: Dual-Channel Annotation Extraction
Run extract_pdf_annotations.py to capture both embedded PDF annotations and visual page snapshots:
python "<skill_dir>/scripts/extract_pdf_annotations.py" "<annotated.pdf>" --render-dir "<project>/zh_review/annot_snapshots"
- Channel 1 (Structured
/AnnotReport): Read the script output listing every page number, annotation type (Highlight,StrikeOut,Underline,Text,FreeText,Caret,Ink), exact underlying Chinese text, surrounding context, and user comment. - Channel 2 (Visual Inspection for Handwritten / Flattened Markups):
- Open every rendered PNG in
<project>/zh_review/annot_snapshots/withread_fileto inspect handwritten margin notes, circled equations, arrows, or crossed-out phrases. - If the script reports
0 embedded /Annot objects(common when tablet apps export flattened PDFs), inspect pages directly viaread_fileon the PDF or render pages with--render-all-if-flatso no handwritten markup is missed.
- Open every rendered PNG in
Step 2: Map to % [EN-SYNC: ...] Anchors & Triage
- Match each PDF annotation to its exact
% [EN-SYNC: ...]block inzh_review/main_zh.texand the corresponding lines in the English.texsource. - If a margin note is unambiguous (e.g., tighten intuition, fix a term, drop a symbol, rewrite an awkward claim, adjust scope), apply it directly. Only ask the user if an annotation poses an open modeling choice that alters theorem assumptions or mathematical truth.
Step 3: Dual-Standard Bidirectional Editing
- Update the English
.texFirst (Enforcinginforms-writingStandards):- Apply all 7 Iron Rules from
informs-writing: zero orphan notation, intuition-first concept onboarding, concrete SVO prose, positive upfront conditions (no defensive disclaimers), patterns/rounded magnitudes in prose, strict definition & terminology lock, and zero chat-context or revision-history leakage. - Critical Timeless-Prose Check: Translate the scholarly intent of the user's Chinese annotation into native INFORMS English. NEVER write meta-text such as "Unlike the previous version...", "Following the correction...", or "We updated...". The edited passage must read as if written cleanly from day one.
- Apply all 7 Iron Rules from
- Update
zh_review/main_zh.texin Lockstep:- Mirror the updated English logic, wording, and notation identically in
zh_review/main_zh.texso both files stay 1-to-1 synchronized.
- Mirror the updated English logic, wording, and notation identically in
Step 4: Audit, Recompile, Visually Inspect, Clean & Commit
- Run
informs-writing'saudit_informs_draft.py(andcheck_prose_craft.pyon revised paragraphs) against the updated English.texand resolve any flagged issues. - Recompile
zh_review/main_zh.pdfwithxelatex(and recompile the English PDF ifinforms4.clsis present). - Run
informs-writing'scheck_pdf_layout.pyon the compiled PDF(s) (--render-flagged zh_review/annot_snapshots), inspect any flagged pages or revised tables/figures viaread_file, and fix any glyph garbling, giant whitespace gaps, overlaps, or margin overflows before finishing. - Remove temporary
zh_review/annot_snapshots/PNGs so binary snapshots do not clutter Git. - Commit both updated
.texfiles to Git (sync(zh-review): apply PDF annotations from <pdf_name>). - Present a concise Revision Log Table (
PDF Page | Annotation Summary | English Edit Location & Change | Chinese Sync Edit | Git Commit) with clickablefile:///links to the updated PDFs and.texfiles.