Verification and Acceptance (Typst / LaTeX)
This skill is the final gate of the complete workflow. It does not remodel the problem, generate new results, or rewrite the paper in place of the writing stage; it detects critical errors, fixes issues that can be fixed directly, and outputs
.
Mathematical Modeling Standards Reference
When domain-specific judgment is needed, read the “Paper Acceptance and Consistency” section in
../_references/math_modeling_norms.md
. CUMCM 2026 mode must also read
../_references/CUMCM_2026_RULES.md
; the specific directories, entry files, result files, and figure directories are determined by the current project structure.
Stage Boundaries
- This stage is responsible for: structural acceptance, text quality gates, figure and table reference checks, result consistency checks, Typst/LaTeX compilation checks, PDF visual inspection, and the submission checklist.
- This stage is not responsible for: redesigning the model, rerunning large-scale experiments, or reorganizing the entire paper.
- When a critical error is found, prioritize small-scale fixes that do not change the meaning of the model; if it is necessary to return to an earlier stage, record the issue in , mark it as failed, and provide structured routing.
CUMCM 2026 Submission Gates
When
competition_mode: CUMCM_2026
is detected, failure of any mandatory gate below must set
; an ordinary
must not override it:
- Page 1 of the PDF must be a dedicated abstract page containing the title, abstract, and keywords. The abstract should generally not exceed one page. The abstract page must be numbered as page 1, with continuous numbering centered in the footer.
- There must be no table of contents; the document must use A4 paper, with margins of at least 2.5 cm on all sides; the main text must not exceed 30 pages; and the paper file must not exceed 20 MB.
- The abstract, main text, appendices, and supporting materials must not contain names, schools, competition regions, or other identifying information.
- The paper must contain the official “AI Tool Use Statement” before the references. If AI was used, must be provided, covering tool names, versions or models, purposes and stages, primary prompting methods and processes, adoption, manual modifications, and manual verification.
- , , the paper declaration, and the AI details must be consistent; H1–H4 must all represent genuine human confirmations.
- The appendices must contain a list of supporting material files and all complete, runnable source code; there must be a unified execution entry point and environment manifest, and the core results must be reproducible and consistent with the paper.
- The supporting-material ZIP/RAR archive must exist, must not exceed 20 MB, and its contents, filenames, and the appendix list in the paper must be consistent. It must not contain pledge forms, numbered pages, or identifying information.
- In formal competition mode, must not contain current competition problem answers, ideas, code, or papers obtained from communication platforms.
The CUMCM-specific final file scan, AI details, and packaging are handled by
; this stage must still report the scientific and formatting gates above and must not defer all of them to the next stage.
Inputs
The model should first determine the project layout from the current workspace, then pass the actual paths to the checking script. Common inputs include, but are not limited to:
- Paper entry file: (Typst) or (LaTeX).
- Main-text section directory or several main-text files ( or ).
- References file ( or ).
- Analysis, modeling, result, and visualization reports from previous stages.
- Figure and table directory.
- Reproducible code directory.
- Compiled PDF, or an output PDF that can be compiled from the entry file.
Do not assume that the paper directory is always named
, or that result files are always located in the project root. If the project uses different names, pass the actual paths and explain them in
.
Workflow
Step 1: Run the Text Quality Gate
Prioritize running this skill's script. The script automatically selects the checking logic based on the entry file extension (
→ Typst checks,
→ LaTeX checks):
bash
set -o pipefail
mkdir -p _tmp
SCRIPT_PATH="<按当前 skill 实际位置确定>/scripts/writing_check.sh"
bash "$SCRIPT_PATH" \
--paper-dir "$PAPER_DIR" \
--main "$MAIN_FILE" \
--sections-dir "$SECTIONS_DIR" \
--references "$REFERENCES_FILE" \
--figures-dir "$FIGURES_DIR" \
--results-file "$RESULTS_FILE" \
--problem-analysis "$PROBLEM_ANALYSIS_FILE" \
--all-results "$ALL_RESULTS_FILE" \
| tee _tmp/writing_check.log
In CUMCM 2026 mode, add
to the arguments above to enable source-level mandatory gates for the absence of a table of contents, pagination, AI statement ordering, and appendix requirements.
If this skill has been copied to another directory, use the actual script path. You can run
to view the arguments. Do not hard-code the script path, paper directory, or filenames into the acceptance logic.
The script only scans text; it does not generate the paper or compile the PDF. A
from the script is a critical error and must be fixed before rerunning it.
Step 2: Section Count and Heading Order
Typst engine checks:
- Whether the number of calls in the entry file matches the actual main-text structure.
- Whether the include order follows the filename prefix order, such as , , .
- Whether every section has an explicit first-level heading (, with a space after the equals sign).
- Whether the heading order conforms to the selected paper type.
LaTeX engine checks:
- Whether the number of or calls in the entry file matches the actual main-text structure.
- Whether the section order follows the filename prefix order.
- Whether every section has a or a corresponding level heading.
General checks for both engines:
- Whether section files are missing, referenced more than once, or left unreferenced.
- If the problem does not contain three questions, do not force three problem-analysis sections; verify the count against the number of subproblems in
ANALYSIS_MODELING_REPORT.md
.
Step 3: Figure/Table and Section Matching
Typst engine checks:
- Whether PDFs in the figure directory are referenced in the main text.
- Whether images used by
#figure(image(...), caption: [...])
actually exist. Image paths must be relative to the file.
- Whether data figures are placed in the corresponding result or analysis sections, and non-data flowcharts are placed in the methodology or overall-approach sections.
LaTeX engine checks:
- Whether image files referenced by actually exist. Paths must be relative to the file.
- Whether is present.
- Whether data figures are placed in the corresponding result or analysis sections.
General checks for both engines:
- Whether there is sufficient explanatory text between consecutive figures or tables.
- Whether captions are overly long, too vague, or inconsistent with the figure or table.
- Whether figure and table numbering, in-text references, and section semantics are consistent.
Do not generate
or
; figures and tables must be embedded directly in their corresponding sections.
Step 4: Writing Quality and Leakage Checks
Check and fix:
- Placeholders such as , , , , and .
- Internal workflow filenames, temporary directory names, code directory names, or result JSON paths appearing in the main text.
- Excessive list-based writing, such as many or elements in Typst, or many or environments in LaTeX.
- Paragraphs repeatedly beginning with phrases such as “As shown in the figure,” “From the figure,” or “Figure X shows.”
- Missing explanations after figures or tables, missing explanations of variable meanings after formulas, and conclusions that only report numbers without interpreting them.
Step 5: Numerical and Result Consistency
Check:
- Key numerical values in the paper must come from the result records or result JSON declared by the current workflow.
- Objective function values, error metrics, rankings, weights, thresholds, and sensitivity results must not conflict with the result records.
- If a summary result JSON file exists, extract the key metrics and confirm that the corresponding results appear in the main text.
- Symbols in formulas should be explained in the symbol description or where they first appear in the main text.
When a numerical conflict is found, do not invent new results; return to the result records or code output and correct the paper accordingly.
Step 6: Citations and Template Standards
Check:
- Whether the references file exists, or whether the template uses another genuine reference mechanism.
- Whether in-text citation markers, such as Typst's / or LaTeX's , correspond to real references.
- Captions, table titles, and the abstract language must remain Chinese for Chinese papers and English for English papers.
- Whether the selected template entry file retains the required cover, abstract, numbering, header and footer, or submission format for the selected competition template.
- Do not accidentally delete the template structure and turn the document into an ordinary blank document.
Step 7: Compilation
Typst compilation:
bash
command -v typst >/dev/null 2>&1 && typst compile "$MAIN_FILE" "$OUTPUT_PDF"
LaTeX compilation:
bash
command -v xelatex >/dev/null 2>&1 && xelatex -interaction=nonstopmode "$MAIN_FILE" && xelatex -interaction=nonstopmode "$MAIN_FILE"
xelatex must be run twice to resolve cross-references. CUMCM mode must not generate a table of contents as part of the compilation process.
Compilation failures must be fixed by correcting syntax, paths, image references, or template issues, and then rerun. After successful compilation, confirm that the output PDF is not empty.
Step 8: PDF Visual Inspection
If the model has visual capabilities, it must export every page of the compiled PDF to PNG and inspect each page. This step is intended to detect layout errors that cannot be found through text-only scanning or by the compiler.
Prefer rasterization tools already available on the system; do not introduce heavy dependencies solely for visual inspection. Example commands:
bash
mkdir -p _tmp/pdf-pages
if command -v pdftoppm >/dev/null 2>&1; then
pdftoppm -png -r 160 "$OUTPUT_PDF" _tmp/pdf-pages/page
elif command -v mutool >/dev/null 2>&1; then
mutool draw -r 160 -o _tmp/pdf-pages/page-%03d.png "$OUTPUT_PDF"
elif command -v magick >/dev/null 2>&1; then
magick -density 160 "$OUTPUT_PDF" _tmp/pdf-pages/page-%03d.png
else
echo "No PDF rasterizer found; record visual check as not run."
fi
After exporting, inspect every page for:
- Blank pages, missing pages, abnormal page counts, or abnormal page dimensions.
- Clipped titles, abstracts, main text, headers, footers, or page numbers, or elements placed in clearly incorrect positions.
- Tables extending beyond the margins, or cell text that overlaps, overflows, or is truncated.
- Images, figure and table captions, formulas, or numbering overlapping the main text.
- Formulas extending beyond their boundaries, or long formulas intruding into the margins or subsequent paragraphs.
- Abnormally large whitespace, overlapping elements, or orphaned lines in lists, paragraphs, footnotes, and references.
- Obvious missing glyphs, garbled characters, or fallback issues in Chinese, English, or mathematical symbol fonts.
- Whether critical template pages, such as the cover, abstract page, and appendices, retain the visual structure required by the competition. Any table of contents in CUMCM mode must be treated as an immediate failure.
For template-conversion projects or projects with an existing reference PDF, PDFs from both engines should also be exported to PNG and compared page by page. Differences in page count or page dimensions must be recorded as a critical error or accompanied by a clear explanation.
If the model does not have visual capabilities, it must explicitly state the reason for “Visual inspection was not performed” in
and must at least complete programmatic checks of PDF non-emptiness, page count, page dimensions, and other basic properties.
Step 9: Write the Acceptance Report
markdown
# 验证和验收报告
## 结论
PASS / FAIL
## 检查项
| --- | --- | --- |
## 章节结构
## 图表引用
## 数值一致性
## 文本质量门禁
## 编译
## PDF 视觉检查
## CUMCM 2026 合规门禁
## 问题路由
## 仍需处理的问题
In CUMCM 2026 mode, the text scans, numerical checks, compilation diagnostics, and layout inspections performed by AI at this stage must also be appended to
compliance/AI_USAGE_LOG.md
, with automated check results distinguished from the participating team's human confirmations.
Only write
when all critical errors have been fixed, the text gate has passed, all core figures and tables are referenced, numerical values are consistent, compilation has succeeded or the reason it cannot be performed has been clearly stated, and visual inspection has passed or the reason it cannot be performed has been clearly stated.
Critical Error Criteria
The following issues must result in
:
- The selected paper entry file ( or ) or the core main text is missing.
- A section file referenced by the paper entry file does not exist.
- The Typst entry file has no , or the LaTeX entry file has no /.
- A main-text section lacks a first-level heading, such as a missing space after in Typst or a missing in LaTeX.
- The section order is clearly incorrect or contains duplicates.
- Placeholders remain in the main text.
- Internal workflow filenames are exposed in the main text.
- A referenced image does not exist.
- A key numerical value conflicts with the result records.
- The compiler is available but the paper fails to compile.
- The compiled PDF is empty, has missing pages, has an abnormal page count, or has abnormal page dimensions that cannot be explained.
- Visual inspection finds overlap, clipping, overflow, or garbled text involving key elements such as the main text, tables, images, formulas, headers, footers, or page numbers.
- Any CUMCM 2026 mandatory submission gate fails.
Error Routing
Record every unresolved issue in
:
yaml
issue_type: <assumption_error | numeric_inconsistency | figure_error | writing_error | submission_error>
route_to: <2analysis-modeling | 3coding-visual | 4drawio | 5writing | 7cumcm-submit>
severity: <hard | warning>
evidence: <file, page, command or value>
- Errors in problem interpretation, assumptions, the model, or constraints → .
- Errors in the program, results, baseline, feasibility, or reproducibility → .
- A non-data diagram structure that does not match the confirmed model → .
- Errors in the paper's expression, citations, numerical transcription, or template source → .
- Errors involving anonymization, AI details, file size, supporting materials, or packaging → .
After fixing the issues, rerun both the affected downstream stages and this acceptance stage; do not merely change the text from FAIL to PASS.
Warning Criteria
The following issues may be classified as
, but should be fixed whenever possible:
- Unreferenced backup images.
- A section that is too short or clearly unbalanced.
- An overly long caption.
- Too few references.
- Insufficient explanatory text after a figure or table.
- The visual inspection tool is unavailable, but the reason has been recorded and basic PDF metadata checks have been completed.
- Full code reproduction takes too long, so only a lightweight check was performed.