Competition Paper Writing (Typst / LaTeX)
This skill follows
and
. The preceding stages provide only real data, figure PDFs, and record files; this stage is responsible for selecting the competition template and typesetting engine, organizing the paper structure, and determining which section each figure and table should be placed in.
Under the
Typst engine, the
skill can be invoked to learn Typst syntax. For the
LaTeX engine, refer to the “LaTeX Writing Essentials” section at the end of this document.
Mathematical Modeling Standards Reference
For domain-specific judgment, read the “Paper Writing,” “Figures and Visualization,” and “Selection of Non-Data Visualization Tools” sections in
../_references/math_modeling_norms.md
. CUMCM 2026 mode must also read
../_references/CUMCM_2026_RULES.md
. Competition-specific rules take precedence over general experience and legacy templates.
Template Families
The templates bundled in this skill are located at:
text
templates/zh/<竞赛>/main.typ # Typst 模板
templates/zh/<竞赛>-latex/main.tex # LaTeX 模板
templates/en/<竞赛>/main.typ # Typst 模板
templates/en/<竞赛>-latex/main.tex # LaTeX 模板
LaTeX Template Coverage: LaTeX versions are provided for all Chinese and English templates, using the
suffix and compiled with xelatex.
Supported Chinese templates, with both Typst and LaTeX versions:
text
apmcm, changsanjiao, cumcm, default, diangongbei, dongsansheng,
huashubei, huaweibei, huazhongbei, mathorcup, mcm, shuweibei, stats, wuyibei
The Huawei Cup, Central China Cup, and May 5th Cup consistently use
,
, and
as their templates.
Supported English templates, with both Typst and LaTeX versions:
All numerical results and figure-based conclusions in the paper must come from
reports/RESULTS_REPORT.md
or
. Do not fabricate, estimate, or apply a different rounding convention.
CUMCM 2026 Hard Constraints
- The first page of the electronic version must be a dedicated abstract page containing the title, abstract, and keywords. This page is numbered 1, followed by continuous Arabic numerals centered in the footer.
- The abstract should generally not exceed one page, and an English abstract is not required. Write the abstract last, condense the background and process descriptions, and cover the method, key numerical values, and overall conclusion for each question. Abstracts typically contain 3–5 keywords.
- The main text begins on the page after the abstract, and no table of contents is generated. Source files must not contain , , , or .
- Use A4 paper with margins of at least 2.5 cm on all sides. The main text must not exceed 30 pages, while the appendix has no page limit. The electronic paper file must not exceed 20 MB.
- Names, schools, regional divisions, and other identifying information must not appear in the abstract, main text, or appendix.
- An “AI Tool Usage Statement” must be placed before the references, and only one of the two official statements may be used, according to the actual circumstances. The statement must not be placed after the references.
- The appendix must first list the supporting-material files, followed by all complete, runnable source program code used for modeling and any necessary interactive commands. If there is genuinely no program or supporting material, use the explicit statement required by the official rules.
Immediately after preparing the CUMCM template, scan for and remove any table-of-contents implementation. Do not merely hide the table-of-contents page or rely on the user to disable it manually.
Workflow
Step 0: Determine the Typesetting Engine
The typesetting engine must be determined before writing the paper. The engine determines every subsequent step, including template paths, section-file extensions, image-insertion syntax, and compilation commands. Choosing the wrong engine can cause formatting errors throughout the paper.
If neither
nor the user context can determine the engine, ask: “Which typesetting engine will you use to write the paper?”
- Option 1: LaTeX, compiled with xelatex; the mainstream choice for mathematical modeling competitions, with all templates ready — place the recommended option first
- Option 2: Typst, compiled with typst; invoke the skill to assist with writing
First read the “User Preferences → Typesetting Engine” field in
:
- If already records an engine and the user has not requested a change, continue with it without asking again.
- If does not exist or does not record an engine, ask the user to choose one.
- If the user does not explicitly choose an engine or skips the question, default to LaTeX.
Select the corresponding template family based on the chosen engine:
- Typst engine: Use
templates/<lang>/<竞赛>/main.typ
and invoke the skill. Compile with .
- LaTeX engine: Use
templates/<lang>/<竞赛>-latex/main.tex
and compile with xelatex. Run the compilation twice for both Chinese and English documents to resolve cross-references. The command is xelatex -interaction=nonstopmode main.tex
.
All code examples, file extensions, and image-insertion syntax in subsequent steps must use the version corresponding to the selected engine. Do not mix them.
Step 1: Select the Language and Template
Unless the user explicitly requests Chinese, MCM/ICM/COMAP must always use English. Chinese competition names should remain in Chinese.
Template-key examples for the Typst engine:
text
长三角 -> zh/changsanjiao
APMCM 英文版 -> en/apmcm
全国赛/国赛/CUMCM -> zh/cumcm
统计建模 -> zh/stats
MCM/ICM/COMAP -> en/mcm
Template-key examples for the LaTeX engine:
text
全国赛/国赛/CUMCM -> zh/cumcm-latex
MCM/ICM/COMAP -> en/mcm-latex
Step 2: Prepare the Template
Use the following command to check whether the bundled template is accessible, where
is the directory containing this skill:
Typst template:
bash
ls "$SKILL_DIR/templates/zh/<竞赛>/main.typ" 2>/dev/null && echo "OK" || echo "MISSING"
- The file exists (OK): Copy the entire directory into . These templates are self-contained entry files and do not depend on additional shared style files.
- The file does not exist (MISSING): This indicates that the skill was not fully installed or that the template is unavailable in the sandbox. In this case, rebuild a minimal compilable Typst framework from scratch according to the section-file structure listed in Step 3 of this SKILL.md, and include the note “Rebuilt from default structure” in .
Whenever a matching template exists, never write the paper from scratch.
LaTeX template:
bash
ls "$SKILL_DIR/templates/zh/<竞赛>-latex/main.tex" 2>/dev/null && echo "OK" || echo "MISSING"
- The file exists (OK): Copy the entire directory into .
- The file does not exist (MISSING): This indicates that the skill was not fully installed or that the template is unavailable in the sandbox. In this case, rebuild a minimal compilable LaTeX framework from scratch according to the section-file structure listed in Step 3 of this SKILL.md, and include the note “Rebuilt from default-latex structure” in .
Step 3: Build the Figure and Table Plan
Before writing any main-text sections, build a figure and table plan based on
,
reports/RESULTS_REPORT.md
, and
if it exists:
text
图表规划
fig_roadmap.pdf -> 引言/问题重述
fig_flow_q1.pdf -> 问题一模型构建
fig_flow_q2.pdf -> 问题二模型构建
fig_pipeline.pdf -> 数据预处理/方法节
结果图 -> 对应的结果节
Image paths are relative to the file in which the image is inserted. When written in
or
, the usual path is
. When written in
or
, the usual path is
.
Typst engine image insertion:
typst
#figure(
image("../../figures/fig_q1_error_dist.pdf", width: 85%),
caption: [问题一预测误差分布],
)
LaTeX engine image insertion:
latex
\begin{figure}[H]
\centering
\includegraphics[width=0.85\textwidth]{../../figures/fig_q1_error_dist.pdf}
\caption{问题一预测误差分布}
\label{fig:q1_error}
\end{figure}
English papers must use English captions.
Step 4: Write the Sections
The section filenames below use the extension for Typst or the extension for LaTeX, depending on the selected engine. For example, use
with the Typst engine and
with the LaTeX engine. Keep the main filenames consistent.
Section files for common Chinese mathematical-modeling templates (
,
,
,
, and
):
text
1_restatement.typ - 问题重述与分析
2_analysis.typ - 数据理解与总体思路
3_assumptions.typ - 模型假设
4_symbols.typ - 符号说明
5_problem1.typ - 问题一建模与求解
6_problem2.typ - 问题二建模与求解
7_problem3.typ - 问题三建模与求解
... - 根据题目调整问题数量
8_evaluation.typ - 灵敏度分析、模型评价与推广
A_code.typ - 附录代码
The national competition, Central China Cup, and Huawei Cup templates (
,
, and
) use the following section structure:
text
1_restatement.typ
2_analysis.typ
3_assumptions.typ
4_symbols.typ
5_problem1.typ
6_problem2.typ
7_problem3.typ
... - 根据题目调整问题数量
8_sensitivity.typ
9_evaluation.typ
A_code.typ
The Northeast Three Provinces template (
) uses a separate abstract file:
text
abstract.typ
1_restatement.typ
2_analysis.typ
3_assumptions.typ
4_symbols.typ
5_problem1.typ
6_problem2.typ
7_problem3.typ
... - 根据题目调整问题数量
8_evaluation.typ
A_code.typ
The Shuweibei template (
) preserves the original LaTeX sample entry-file names:
text
Abstract.typ
Introduction.typ
2_analysis.typ
3_assumptions.typ
4_symbols.typ
5_problem1.typ
6_problem2.typ
7_problem3.typ
... - 根据题目调整问题数量
8_evaluation.typ
Appendices1.typ
A_code.typ
The default Chinese template (
) uses:
text
1_restatement.typ
2_assumptions.typ
3_symbols.typ
4_problem1.typ
5_problem2.typ
6_problem3.typ
... - 根据题目调整问题数量
7_sensitivity.typ
8_evaluation.typ
A_code.typ
The Chinese statistical-modeling template uses:
text
1_introduction.typ
2_method.typ
3_data.typ
4_analysis.typ
5_results.typ
6_conclusion.typ
A_code.typ
The English MCM/APMCM templates (
,
,
, and
) use:
text
1_introduction.typ
2_assumptions.typ
3_model_design.typ
4_solution.typ
5_sensitivity.typ
6_strengths_weaknesses.typ
7_conclusions.typ
A_code.typ
LaTeX template section files correspond one-to-one with the Typst versions and use the
suffix:
CUMCM LaTeX template (
, corresponding to the
Typst version):
text
1_restatement.tex
2_analysis.tex
3_assumptions.tex
4_symbols.tex
5_problem1.tex
6_problem2.tex
7_problem3.tex
8_sensitivity.tex
9_evaluation.tex
A_code.tex
MCM/ICM LaTeX template (
):
text
1_introduction.tex
2_assumptions.tex
3_model_design.tex
4_solution.tex
5_sensitivity.tex
6_strengths_weaknesses.tex
7_conclusions.tex
A_code.tex
The section-file naming for the remaining LaTeX templates (
,
,
,
,
,
,
,
,
,
,
,
,
,
, and
) is similar to the structures above. The filenames referenced by
in
are authoritative.
The English default template (
) uses:
text
1_introduction.typ
2_assumptions.typ
3_notations.typ
4_model.typ
5_sensitivity.typ
6_evaluation.typ
7_conclusions.typ
A_code.typ
The main text should use coherent academic paragraphs. Do not include internal workflow names, AI product names, prompts, or agent workflows in the final paper. The only exception in the main text is CUMCM’s officially required “AI Tool Usage Statement”; detailed processes should appear only in in the supporting materials.
Step 5: References
Use only references that genuinely exist and support the claims in the main text. For every citation, verify at least the title, authors, year, and source. If a DOI, publisher page, or official data page is available, verify and retain the URL or DOI as well. Do not write bibliography entries based solely on search snippets, memory, or model-generated bibliographic information. Select the filename according to the engine: use
for Typst and
for LaTeX.
Typst engine:
typst
#set enum(numbering: "[1]")
#enum[
作者. 题名[J]. 期刊名, 年份, 卷(期): 页码.
Author. "Title." Journal or Conference, year.
]
Superscript citation in the body:
相关研究已用于物流网络优化#super("[1]")
.
LaTeX engine:
latex
\begin{thebibliography}{99}
\bibitem{ref1} 作者. 题名[J]. 期刊名, 年份, 卷(期): 页码.
\bibitem{ref2} Author. "Title." Journal, year.
\end{thebibliography}
Use
or
for citations in the body.
Step 6: CUMCM AI Statement, References, and Appendix Order
The fixed order for CUMCM 2026 is:
text
摘要 → 正文 → AI工具使用声明 → 参考文献 → 附录
Select one of the official statements below according to the actual circumstances recorded in
compliance/AI_USAGE_LOG.md
:
- AI was not used: “This team did not use any AI tools during the competition.”
- AI was used: “This team used AI tools during the competition, primarily for [brief purpose]. See the supporting materials for details.”
Using this workflow itself constitutes the use of AI, so the “AI was not used” statement must not be selected. Replace [brief purpose] with the actual use recorded in the log. Do not conceal tool participation or freely rewrite the statement in a way that reduces accountability. Do not place detailed information about tools, prompt processes, adoption, modifications, and verification in the paper statement. Leave that information to
to generate
.
The CUMCM appendix must begin with every actual supporting-material file and its purpose, followed by all complete, runnable source code. It must not contain only the “core code,” pseudocode, or truncated snippets. The appendix file list, supporting-materials directory, and final archive must be identical.
Step 7: Finally Write the Abstract or Summary
After all sections are complete, write the Chinese abstract or English Summary Sheet. It must include the method and exact numerical results for every subproblem. The CUMCM abstract should target a single page: the first paragraph should summarize the problem and overall approach, followed by a “model + key result” for each subproblem, with the final paragraph summarizing the value. Avoid complex formulas, tables, and lengthy background descriptions.
Step 8: CUMCM H4 Human Paper Review
In CUMCM 2026 mode, first truthfully append this stage’s AI-assisted paper organization, wording assistance, citation verification, typesetting, or compilation debugging to
compliance/AI_USAGE_LOG.md
. Record what was adopted, what was manually modified, and what was verified. Do not record only the modeling and coding stages.
After compiling the paper and completing a basic visual inspection, write
STATUS: WAITING_FOR_HUMAN_PAPER_REVIEW
in
compliance/HUMAN_REVIEW_LOG.md
. Provide the team with the abstract, key formulas and numerical values, figures and tables, citations, AI statement, appendix source code, and supporting-material list for item-by-item review. The status may be changed to
only after the team members explicitly confirm the paper and record their revisions. The Agent must not approve on their behalf. Do not proceed to the final submission-ready state without passing H4.
LaTeX Writing Essentials
The following guidance applies to the
LaTeX engine. For the Typst engine, invoke the
skill for syntax help.
Compilation Commands
bash
# 中文模板(xelatex,跑两遍解决交叉引用)
xelatex main.tex && xelatex main.tex
# 英文模板(xelatex,同样跑两遍)
xelatex main.tex && xelatex main.tex
Document Structure
latex
\documentclass[a4paper,12pt]{article} % 英文
\documentclass[a4paper,12pt]{ctexart} % 中文
\usepackage{...} % 宏包加载
\usepackage{graphicx} % 图片支持
\usepackage{booktabs} % 三线表
\usepackage{amsmath,amssymb} % 数学公式
\usepackage{hyperref} % 交叉引用(需两遍编译)
Figure and Table Insertion
latex
\begin{figure}[H]
\centering
\includegraphics[width=0.85\textwidth]{../../figures/fig_q1.pdf}
\caption{图注}
\label{fig:q1}
\end{figure}
% 三线表
\begin{table}[htbp]
\centering
\caption{表注}
\begin{tabular}{ccc}
\toprule
\textbf{列1} & \textbf{列2} & \textbf{列3} \\
\midrule
数据 & 数据 & 数据 \\
\bottomrule
\end{tabular}
\end{table}
Cross-References
latex
如图~\ref{fig:q1}所示,... % 图片引用
式~(\ref{eq:objective}) 给出... % 公式引用
见第~\pageref{fig:q1} 页 % 页码引用
Mathematical Formulas
latex
行内公式:$f(x) = \sum_{i=1}^n \theta_i \phi_i(x)$
行间公式:
\begin{equation}
\mathcal{L}(\theta) = \frac{1}{N}\sum_{i=1}^N (y_i - \hat{y}_i)^2
\label{eq:objective}
\end{equation}
Sections and Emphasis
latex
\section{问题重述}
\subsection{问题背景}
\textbf{问题一:} xxx % 对应 Typst 的 #strong