Draft LaTeX paper section by section from an outline. Use when user says "写论文", "write paper", "draft LaTeX", "开始写", or wants to generate LaTeX content from a paper plan.
Draft a LaTeX paper based on: $ARGUMENTS
DECISION_MODEL = Opus — Use for section-ownership decisions, story conflicts, and the final whole-paper merge.
EXECUTION_MODEL = Sonnet — Use for section first drafts, bibliography cleanup, local rewrites, and figure/table insertion.
REVIEWER_MODEL = gpt-5.4 — Model used via a secondary Codex agent for section review. Must be an OpenAI model.
TARGET_VENUE = IEEE_TRANS — Supported: IEEE_TAC, IEEE_TSMC, IEEE_TCYB, IEEE_TIE, IEEE_TNNLS, IEEE_TCSI, IEEE_ACCESS, AUTOMATICA. Determines style file and formatting.
ANONYMOUS = false — IEEE Trans papers are NOT anonymous.
MAX_PAGES = 14 — Guideline page count for IEEE Trans regular papers (two-column). No hard limit, but be concise.
DBLP_BIBTEX = true — Fetch real BibTeX from DBLP/CrossRef. Eliminates hallucinated citations.
模型路由规则详见 ../shared-references/model-routing-policy.md。
/paper-plan)figures/ (from /paper-figure)figures/latex_includes.tex (from /paper-figure).bib file, or will create oneIf no PAPER_PLAN.md exists, ask the user to run /paper-plan first or provide a brief outline.
Before drafting, resolve automation defaults in this precedence order:
PROJECT_AUTOMATION.md in the project rootCLAUDE.md in the project rootIf AUTO_PROCEED=false, stop after producing the outline-consistency check, after drafting the Abstract + Introduction, and before the final whole-paper polish pass.
\documentclass[journal]{IEEEtran}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{cite}
\usepackage{bm}
\usepackage{mathrsfs}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{subfigure}
% Theorem environments
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{assumption}{Assumption}
\newtheorem{remark}{Remark}
\newtheorem{problem}{Problem}
\begin{document}
\title{Paper Title Here}
\author{First Author,~\IEEEmembership{Member,~IEEE,}
Second Author,~and~Third Author,~\IEEEmembership{Senior Member,~IEEE}
\thanks{This work was supported by ...}
\thanks{F. Author is with the Department of ..., University of ..., City, Country (e-mail: ...).}}
\markboth{IEEE TRANSACTIONS ON ..., VOL. XX, NO. X, MONTH YEAR}
{Author \MakeLowercase{\textit{et al.}}: Short Title}
\maketitle
\begin{abstract}
...
\end{abstract}
\begin{IEEEkeywords}
Keyword1, keyword2, keyword3.
\end{IEEEkeywords}
\input{sections/1_introduction}
\input{sections/2_preliminaries}
\input{sections/3_main_results}
\input{sections/4_simulation}
\input{sections/5_conclusion}
\appendices
\input{sections/A_appendix}
\bibliographystyle{IEEEtran}
\bibliography{references}
% Author biographies (optional, for final version)
% \begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{bio_photo.jpg}}]{Author Name}
% Biography text here.
% \end{IEEEbiography}
\end{document}
Generate this file structure:
paper/
├── main.tex # master file
├── math_commands.tex # shared math macros
├── references.bib # bibliography (only cited entries)
├── sections/
│ ├── 1_introduction.tex
│ ├── 2_preliminaries.tex
│ ├── 3_main_results.tex # or split into 3_observer.tex + 4_controller.tex
│ ├── 4_simulation.tex # or 5_simulation.tex if split
│ ├── 5_conclusion.tex
│ └── A_appendix.tex # proof details
└── figures/ # symlink or copy from project figures/
Section files are FLEXIBLE: If the paper plan has 6-8 sections, create corresponding files.
If paper/ already exists, back up to paper-backup-{timestamp}/ before overwriting.
CRITICAL: Clean stale files. When changing section structure, delete section files no longer referenced by main.tex.
paper/ directorymain.tex with IEEEtran document classmath_commands.tex with paper-specific notationAuthor block (placeholder):
\author{First~Author,~\IEEEmembership{Member,~IEEE,}
and~Second~Author
\thanks{Manuscript received ...; revised .... This work was supported by ....}
\thanks{Authors are with the Department of ..., University of ..., City, Country (e-mail: ...).}}
Create shared math macros for control systems notation:
% math_commands.tex — shared notation for control systems
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tr}{\mathrm{tr}}
\newcommand{\diag}{\mathrm{diag}}
\newcommand{\sgn}{\mathrm{sgn}}
\newcommand{\rank}{\mathrm{rank}}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\col}{col}
\DeclareMathOperator{\Span}{span}
% Vectors and matrices (bold)
\newcommand{\vx}{\bm{x}}
\newcommand{\vu}{\bm{u}}
\newcommand{\ve}{\bm{e}}
% Calligraphic sets
\newcommand{\calG}{\mathcal{G}}
\newcommand{\calN}{\mathcal{N}}
\newcommand{\calV}{\mathcal{V}}
\newcommand{\calE}{\mathcal{E}}
\newcommand{\calL}{\mathcal{L}}
% Kronecker product
\newcommand{\kron}{\otimes}
% Add paper-specific notation here
Before drafting: Read ../shared-references/writing-principles.md for sentence-level clarity rules and IEEE Trans conventions.
When the outline is frozen and file ownership is disjoint, you may draft in parallel using these slices:
frontmatter: Abstract + Introduction + Conclusion framingtheory: Method + Main Results + Appendix proof scaffoldingresults: Simulation section + tables + captions + bibliography cleanupDraft the slices with Sonnet, review them with gpt-5.4, then merge serially and let Opus perform the final whole-paper integration pass.
If the parent session is running on Opus or any non-Sonnet model, do not bulk-draft these slices in the parent session. Spawn dedicated Sonnet workers instead:
spawn_agent:
model: sonnet
reasoning_effort: high
message: |
You own the [frontmatter/theory/results] slice only.
Draft LaTeX for this slice from PAPER_PLAN.md, NARRATIVE_REPORT.md, and existing figures.
Do not change the claim boundary. Do not rewrite other slices.
Output only grounded manuscript text and any local TODOs that block compilation.
Use one worker per disjoint slice. Merge only after all slice reviews are back.
Process sections in order. For each section:
figures/latex_includes.tex\cite{key} (IEEE numbered style)Abstract:
Index Terms (IEEEkeywords):
I. Introduction(引言的核心是讲故事——用逐层递进的逻辑把读者带到你的研究空白处):
引言的叙事逻辑是一个漏斗结构,从广到窄,每一段都为下一段做铺垫。段落之间必须有因果或递进关系,不能各自独立。以下是从真实论文中总结的段落推进逻辑:
第一段:广域背景(1段)
第二段起:主题文献综述(2-4段,每段一个方向)
研究空白段(承上启下的关键段)
贡献列表(编号列表,2-4项)
文章结构段:"The rest of this article is organized as follows. Section II introduces... Section III presents... Section IV provides... Section V concludes this article."
符号段:"Notations: $\mathbb{R}^n$ denotes the $n$-dimensional Euclidean space. $|\cdot|$ represents the Euclidean norm. $I_n$ denotes the identity matrix of dimension $n$. $\lambda_{\min}(A)$ and $\lambda_{\max}(A)$ stand for the minimum and maximum eigenvalues of matrix $A$, respectively. $\otimes$ denotes the Kronecker product."
Target: 2-2.5 pages (two-column)
降低AI率的具体要求:
II. Problem Formulation / Preliminaries:
III. Main Results (Controller/Observer Design + Stability):
\begin{theorem}...\end{theorem} for all main resultsIV. Simulation Results:
V. Conclusion(结论写作原则——从真实论文中提炼):
结论应当简短、克制、事实性强。从35篇真实论文中观察到:结论通常只有1段,5-10句话,绝不超过半栏。
Appendix:
CRITICAL: Only include entries that are actually cited in the paper.
\cite{} references in the drafted sections.bib files in the projectreferences.bib containing ONLY cited entriesStep A: DBLP
curl -s "https://dblp.org/search/publ/api?q=TITLE+AUTHOR&format=json&h=3"
curl -s "https://dblp.org/rec/{key}.bib"
Step B: CrossRef DOI
curl -sLH "Accept: application/x-bibtex" "https://doi.org/{doi}"
Step C: Mark [VERIFY] if both fail.
IEEE-specific citation rules:
\cite{key} (numbered style [1]), NOT \citep{}/\citet{}IEEEtran.bst for formatting{firstauthor}{year}{keyword}Before this step: Read ../shared-references/anti-ai-writing.md for the full de-AI word lists and sentence pattern checks.
摘要、引言和结论必须通过此检查。 这是用户明确要求的。
检查标准不是套模板,而是对照真实已发表的IEEE Trans控制论文的写作习惯。
一至四:通用去AI检查
自夸词、AI典型句式、结构单调性、语态语气等通用检查规则详见 ../shared-references/anti-ai-writing.md。执行本步骤前必须先读取该文件并逐条对照。
五、段落过渡检查(引言专用)
六、正面质量检查(不只是禁止——还要确保内容具体)
Before this step: Read ../shared-references/agent-role-charter.md for reviewer role definitions and review protocol.
Send the complete draft to GPT-5.4 xhigh:
spawn_agent:
model: gpt-5.4
reasoning_effort: xhigh
message: |
You are a senior professor in multi-agent control and robotics, with extensive
IEEE Transactions reviewer and associate-editor experience. You also act like a
strong corresponding author who can spot AI-looking prose immediately.
Review this IEEE Transactions paper draft in control systems.
Focus on:
1. Does each contribution from the intro have a corresponding theorem and simulation?
2. Is the writing natural and free of AI-generated patterns?
3. Are the assumptions well-justified with Remarks?
4. Are the proofs logically sound (Lyapunov function → derivative → stability)?
5. Does the simulation section validate ALL theoretical results?
6. Are the comparisons with prior work specific and fair?
7. Is the notation consistent throughout?
Non-negotiable review standards:
- no hype language
- no vague praise
- no generic transitions or filler background
- no claim stronger than theorems, simulations, or comparisons support
For each issue, specify: severity (CRITICAL/MAJOR/MINOR), location, and fix.
Prefer the minimum grounded rewrite or structural change that would make the
paper read like a publishable journal manuscript rather than AI-generated prose.
[paste full draft text]
Apply CRITICAL and MAJOR fixes. Document MINOR issues for the user.
After drafting all sections:
Before declaring done:
\ref{} and \label{} match (no undefined references)\cite{} have corresponding BibTeX entries[VERIFY] markers left uncheckedreferences.bib contains ONLY cited entriessections/ is \inputed by main.texLarge file handling: If the Write tool fails due to file size, immediately retry using Bash (cat << 'EOF' > file) to write in chunks. Do NOT ask the user for permission — just do it silently.
Do NOT generate real author names — use placeholder unless user provides
Write complete sections, not outlines — the output should be compilable LaTeX
One file per section — modular structure for easy editing
Every contribution must have evidence — theorem + simulation for each
Compile-ready — the output should compile with latexmk without errors
No over-claiming — use measured language, especially in Abstract/Conclusion
IEEE citation style — \cite{} with IEEEtran.bst, NOT \citep{}/\citet{}
Clean bib — references.bib must only contain actually cited entries
Section count is flexible — match PAPER_PLAN structure
Do not write in generic AI prose — if a sentence could fit many papers, rewrite it to mention the actual problem, assumption, theorem, figure, or comparison
Do not self-praise — replace adjectives like novel, innovative, remarkable, effective with concrete claims and evidence
Abstract / Introduction / Conclusion require an explicit de-AI pass before finalization
Backup before overwrite — never destroy existing paper/ directory without backing up
Front-load the contribution — the reader should know the main result by page 2
De-AI writing is mandatory — especially in Abstract, Introduction, and Conclusion
Convergence proofs — for cooperative-competitive scenarios, use super-stochastic matrix convergence theory
Default drafting role — write as a senior corresponding author in multi-agent control / robotics who publishes in scientific journals and line-edits for field-native prose
../shared-references/writing-principles.md — story framing, sentence-level clarity, IEEE Trans specific conventions../shared-references/venue-checklists.md — IEEE Trans submission requirements../shared-references/citation-discipline.md — stricter fallback for ambiguous citations