بنقرة واحدة
paper-compile
编译 LaTeX 论文为 PDF,自动修复错误,验证输出。用于编译数模竞赛论文。当用户说'编译论文'、'compile paper'、'生成PDF'时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
编译 LaTeX 论文为 PDF,自动修复错误,验证输出。用于编译数模竞赛论文。当用户说'编译论文'、'compile paper'、'生成PDF'时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
数据清洗、EDA、缺失值处理、异常值检测、相关性分析。触发词: 数据预处理、数据清洗、EDA、缺失值、异常值、data preprocessing、数据探索。
模型验证:交叉验证、留出法、残差分析、与已知解对比、假设检验。触发词: 模型验证、交叉验证、残差分析、model validation、留出法、误差分析、假设检验。
多子问题拆解与依赖分析。触发词: 子问题拆解、拆题、problem decomposition、依赖关系、求解顺序、时间分配、并行安排。
灵敏度分析:参数扰动、单因素/多因素分析、Monte Carlo 模拟、龙卷风图/蛛网图。触发词: 灵敏度分析、参数敏感性、sensitivity analysis、Monte Carlo、鲁棒性测试、参数扰动。
自动多轮评审优化循环。通过 Codex MCP 反复评审→修改→重新评审,直到达标或达到最大轮数。当用户说'自动优化循环'、'auto optimize'、'评审到通过'时使用。
Autonomously improve a generated paper via GPT-5.4 xhigh review → implement fixes → recompile, for 2 rounds. Use when user says "改论文", "improve paper", "论文润色循环", "auto improve", or wants to iteratively polish a generated paper.
| name | paper-compile |
| description | 编译 LaTeX 论文为 PDF,自动修复错误,验证输出。用于编译数模竞赛论文。当用户说'编译论文'、'compile paper'、'生成PDF'时使用。 |
| argument-hint | ["paper-directory"] |
| allowed-tools | Bash(*), Read, Write, Edit, Grep, Glob |
Compile the LaTeX paper and fix any issues: $ARGUMENTS
latexmk — LaTeX build tool. Handles multi-pass compilation automatically.pdflatex — LaTeX engine. Options: pdflatex (default), xelatex (for CJK/custom fonts), lualatex.paper/ — Directory containing LaTeX source files.Check that the compilation environment is ready:
# Check LaTeX installation
which pdflatex && which latexmk && which bibtex
# If not installed, provide instructions:
# macOS: brew install --cask mactex-no-gui
# Ubuntu: sudo apt-get install texlive-full
# Server: conda install -c conda-forge texlive-core
Verify all required files exist:
# Must exist
ls $PAPER_DIR/main.tex
# Should exist
ls $PAPER_DIR/references.bib
ls $PAPER_DIR/sections/*.tex
ls $PAPER_DIR/figures/*.pdf 2>/dev/null || ls $PAPER_DIR/figures/*.png 2>/dev/null
cd $PAPER_DIR
# Clean previous build artifacts
latexmk -C
# Full compilation (pdflatex + bibtex + pdflatex × 2)
latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex 2>&1 | tee compile.log
If compilation fails, read compile.log and fix common errors:
Missing packages:
! LaTeX Error: File `somepackage.sty' not found.
→ Install via tlmgr install somepackage or remove the \usepackage if unused.
Undefined references:
LaTeX Warning: Reference `fig:xyz' on page 3 undefined
→ Check \label{fig:xyz} exists in the correct figure environment.
Missing figures:
! LaTeX Error: File `figures/fig1.pdf' not found.
→ Check if the file exists with a different extension (.png vs .pdf). Update the \includegraphics path.
Citation undefined:
LaTeX Warning: Citation `smith2024' undefined
→ Add the missing entry to references.bib or fix the citation key.
[VERIFY] markers in text:
→ Search for [VERIFY] markers left by /paper-write. These indicate unverified citations or facts. Search for the correct information or flag to the user.
Overfull hbox:
Overfull \hbox (12.5pt too wide) in paragraph at lines 42--45
→ Minor: usually ignorable. If severe (>20pt), rephrase the text or adjust figure width.
BibTeX errors:
I was expecting a `,' or a `}'---line 15 of references.bib
→ Fix BibTeX syntax (missing comma, unmatched braces, special characters in title).
\crefname undefined for custom theorem types:
→ Ensure \crefname{assumption}{Assumption}{Assumptions} and similar are in the preamble after \newtheorem{assumption}.
for attempt in 1..MAX_COMPILE_ATTEMPTS:
compile()
if success:
break
parse_errors()
auto_fix()
For each error:
compile.logAfter successful compilation, verify the output:
# Check PDF exists and has content
ls -la main.pdf
# Check page count
pdfinfo main.pdf | grep Pages
# macOS: open for visual inspection
# open main.pdf
Automated checks:
# Check for undefined references
grep -c "LaTeX Warning.*undefined" compile.log
# Check for missing citations
grep -c "Citation.*undefined" compile.log
CRITICAL: Verify paper fits within MAX_PAGES.
For ML conferences (CUMCM/数模竞赛/数模竞赛/CVPR/ACL/AAAI): Main body = first page through end of Conclusion section (not necessarily §5 — could be §6, §7, or §8 depending on structure). References and appendix are NOT counted.
For IEEE 竞赛s: The TOTAL page count (including references) must fit within the limit. There is no separate "main body" counting — everything up to and including the references counts.
Precise check using pdftotext:
# Extract text and find where Conclusion ends vs References begin
pdftotext main.pdf - | python3 -c "
import sys
text = sys.stdin.read()
pages = text.split('\f')
for i, page in enumerate(pages):
if 'Ethics Statement' in page or 'Reproducibility' in page:
print(f'Conclusion ends on page {i+1}')
if any(w in page for w in ['References', 'Bibliography']):
lines = [l for l in page.split('\n') if l.strip()]
for l in lines[:3]:
if 'References' in l or 'Bibliography' in l:
print(f'References start on page {i+1}')
break
"
If Conclusion ends mid-page and References start on the same page, the main body is that page number (e.g., if both are on page 9, main body = ~8.5 pages, which is fine for a 9-page limit since it leaves room for the References header).
If over limit:
Check for orphaned section files not referenced by main.tex:
# Find all .tex files in sections/ and check which are \input'ed by main.tex
for f in paper/sections/*.tex; do
base=$(basename "$f")
if ! grep -q "$base" paper/main.tex; then
echo "WARNING: $f is not referenced by main.tex — consider removing"
fi
done
This prevents confusion from leftover files when section structure changes (e.g., old 5_conclusion.tex left behind after restructuring to 7 sections).
For conference submission, additional checks:
pdffonts main.pdf | grep -v "yes" # should return nothing (or only header)
\newpage\appendix[VERIFY] markers: search the PDF text for leftover markers## Compilation Report
- **Status**: SUCCESS / FAILED
- **PDF**: paper/main.pdf
- **Pages**: X (main body to Conclusion) + Y (references) + Z (appendix)
- **Within page limit**: YES/NO (MAX_PAGES = N)
- **Errors fixed**: [list of auto-fixed issues]
- **Warnings remaining**: [list of non-critical warnings]
- **Undefined references**: 0
- **Undefined citations**: 0
### Next Steps
- [ ] Visual inspection of PDF
- [ ] Run `/paper-write` to fix any content issues
- [ ] Submit to [竞赛] via OpenReview / CMT / HotCRP
| Venue | Style File | Citation | Page Limit | Refs in limit? | Submission |
|---|---|---|---|---|---|
| CUMCM 2026 | iclr2026_conference.sty | natbib (\citep/\citet) | 20-25页 (to Conclusion end) | No | OpenReview |
| 数模竞赛 2025 | neurips_2025.sty | natbib (\citep/\citet) | 20-25页 (to Conclusion end) | No | OpenReview |
| 数模竞赛 2025 | icml2025.sty | natbib (\citep/\citet) | 8 pages (to Conclusion end) | No | OpenReview |
| IEEE Journal | IEEEtran.cls [journal] | cite (\cite{}, numeric) | ~12-14 pages (Transactions) / ~4-5 (Letters) | Yes | IEEE Author Portal / ScholarOne |
| IEEE Conference | IEEEtran.cls [conference] | cite (\cite{}, numeric) | 5-8 pages (varies by conf) | Yes | EDAS / IEEE Author Portal |