一键导入
latex-textbook-writer
Use when writing math textbook content in XeLaTeX, including definitions, theorems, proofs, and section formatting in English or Chinese.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing math textbook content in XeLaTeX, including definitions, theorems, proofs, and section formatting in English or Chinese.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when writing, revising, or auditing a standalone Markdown explanation of a research paper. Produces image-supported, source-verified explanations for an average reader in the paper's field, prioritizes the paper's mechanisms and algorithms over background or benchmark dumps, checks appendices/code/official web resources, follows md-report-writer information-density rules, and runs separate Reviewer and Reader subagents.
Use when generating a physics or engineering experiment report from measured data and reference materials — orchestrates Theory, Data Analysis, Plotting, and Report sub-agents to produce a compiled LaTeX PDF. Also use for any sub-task in that pipeline: deriving formulas, analyzing lab data, plotting measurements with theory overlay, or writing/compiling the report.
Use when creating LaTeX Beamer presentation slides from documents, especially for academic presentations. Use when source document contains structured content with sections, subsections, or clear hierarchical organization that should be preserved in slides.
Professional LaTeX experiment report writing assistant for physics and engineering. Focuses on narrative flow, coherent explanations, proper academic style, structured content, and LaTeX best practices.
Use when enhancing existing lecture notes with multiple course source materials (recordings, PPT slides, existing notes)
Professional report writing assistant using Markdown. Focuses on narrative flow, coherent explanations, noun-definition-first style, code interpretation, and proper Mermaid diagram usage.
| name | latex-textbook-writer |
| description | Use when writing math textbook content in XeLaTeX, including definitions, theorems, proofs, and section formatting in English or Chinese. |
Read and follow the shared narrative and evidence rules. Apply the direct, reader-facing style when explaining mathematical content; do not add process-oriented or defensive source disclaimers to the textbook.
Professional assistant for writing mathematical textbooks using XeLaTeX with proper formatting, structure, and narrative style.
This Skill provides comprehensive guidance for writing mathematics textbooks with:
Use this Skill when creating or modifying:
When using ctex package for Chinese support, theorem names and figure captions automatically become Chinese. Always add these overrides for English documents:
\usepackage{ctex}
\usepackage{amsmath,amssymb,amsthm}
\renewcommand{\proofname}{Proof} % Force English "Proof"
\renewcommand{\contentsname}{Contents} % Force English "Contents"
\usepackage{caption}
\captionsetup{figurename=Figure,tablename=Table} % Force English captions
RGB(34,139,34)RGB(230,126,0)RGB(0,51,102)RGB(70,130,180)RGB(139,69,19)RGB(200,200,200) (no border, no title)All theorem/definition/example boxes use \newtcbtheorem with:
\begin{definition}{Title}{label} (two arguments, not [Title])NEVER start a section directly with a definition/theorem box. ALWAYS include explanatory text first.
BAD (boxes without introduction):
\section{Groups}
\begin{definition}{Group}{def:group}
...
\end{definition}
GOOD (narrative leads into boxes):
\section{Groups}
Group theory studies groups, the most fundamental algebraic structures. This section introduces the definition and basic properties of groups.
\begin{definition}{Group}{def:group}
A group is a set $G$ with a binary operation satisfying...
\end{definition}
The above definition requires three key conditions...
The goal is narrative-box-narrative-box-narrative, not narrative-box-box-box-narrative.
After a box, add:
Proofs should flow as continuous text, not step-by-step lists.
BAD:
\textbf{Step 1}: ...
\textbf{Step 2}: ...
\textbf{Step 3}: ...
GOOD:
\begin{proof}
Since $U \in SU(4)$ and the exponential map is surjective, there exists $X \in \mathfrak{su}(4)$ such that $\exp(X) = U$.
Next, we express $X$ as a linear combination of Hamiltonians. By the completeness of the Lie algebra...
Therefore, the theorem is proved. $\square$
\end{proof}
DO NOT use italics in mathematical textbooks. Use bold for:
BAD:
Let $V$ be a *vector space*. The \textit{Hahn-Banach theorem} states...
GOOD:
Let $V$ be a vector space. The \textbf{Hahn-Banach theorem} states...
Bold a term to introduce or name it; do not use vague emphasis words such as "核心", "关键", "重要", "主要", "本质", or "显著" as a substitute for saying what a concept is or does. State the definition, hypothesis, or measured effect directly.
ONLY use bullets (itemize) and numbered lists (enumerate) in:
\begin{example}...\end{example})\begin{exercise}...\end{exercise})NEVER use bullets or numbered lists in main narrative text.
Keep only sentences that help the reader understand the mathematics: definitions, assumptions, relations, proofs, examples, consequences, or necessary limitations. Do not include meta-commentary about the author's writing process, intent, fidelity to a source, or why an omission was made. Do not explain that an unsupported point cannot be inferred merely to describe the drafting process; omit it or state the concrete mathematical limitation when it matters.
When writing Chinese text in LaTeX (with ctex package), ALWAYS use proper quote marks:
Chinese Double Quotes:
`` (two backticks)'' (two single quotes/apostrophes)Chinese Single Quotes:
` (one backtick)' (one single quote/apostrophe)How to type:
`) twice for left double quote: ``') twice for right double quote: ''Examples:
% CORRECT - Chinese quotes
The concept of ``closeness'' and ``continuity''...
This is a ``simple'' definition.
% INCORRECT - ASCII straight quotes (ugly in PDF)
The concept of "closeness" and "continuity"...
IMPORTANT: Always use and '' for quotes in Chinese text, never use ", corner brackets, or any other form!
ALWAYS state which set each variable belongs to before writing formulas, not after.
BAD (domain specified after formula):
We can verify
$$
\langle \operatorname{ad}_{X}(Y), Z \rangle = \langle Y, \operatorname{ad}_{X^{*}}(Z) \rangle
$$
for $X \in \mathfrak{r}$ and $Y, Z \in \mathfrak{g}$.
GOOD (domain specified first):
Take any $X \in \mathfrak{r}$ and $Y, Z \in \mathfrak{g}$. We can verify
$$
\langle \operatorname{ad}_{X}(Y), Z \rangle = \langle Y, \operatorname{ad}_{X^{*}}(Z) \rangle
$$
Use phrases like: "Take any...", "For...", "Let...", "For any...".
English format:
Chinese format (for Chinese documents):
English:
Chinese:
Introduce the concept with background and motivation.
\begin{definition}{Concept Name}{def:concept}
Formal definition.
\end{definition}
Explain the meaning and intuition behind the definition.
Set up the context for the proposition.
\begin{proposition}{Proposition Name}{prop:name}
Statement.
\end{proposition}
\begin{proof}
Coherent proof narrative.
\end{proof}
Discuss the significance and applications.
Before considering content complete:
\begin{definition}{Title}{label} (not [Title])\ref{}\renewcommand{\proofname}{Proof} and \captionsetup{figurename=Figure,tablename=Table} and '', NOT " or corner brackets\textbf{解:} / \textbf{Solution:} with one formula per line format# Always compile TWICE for cross-references
xelatex -interaction=nonstopmode main.tex
xelatex -interaction=nonstopmode main.tex
references/format-en.tex: English textbook templatereferences/format-zh.tex: Chinese textbook templateThese templates contain complete preamble setup, color definitions, and box styles ready to copy into your project.
When a 习题/ directory exists, create exercise.tex and answers.tex appendix files. Solutions must use "one formula per line" (一行一公式) format with display math for each formula.
See references/exercise-format.md for complete format specifications, examples, anti-examples, and translation guide.
Figures can be created using TikZ code inline in chapter .tex files, or using Python scripts (matplotlib) stored in a figures/ directory.
For mathematical diagrams (group-algebra relationships, commutative diagrams, etc.), use TikZ code directly in chapter .tex files:
\begin{center}
\begin{tikzpicture}[
box/.style={draw, rounded corners=4pt, ...},
...
]
\node[box] (A) at (0,0) {$SU(2)$};
...
\draw[->, thick] (A) -- (B);
\end{tikzpicture}
\end{center}
For plots, curves, and complex illustrations, use Python scripts:
project/
├── figures/ # Python scripts and generated images
│ ├── draw_xxx.py # matplotlib scripts
│ ├── xxx.png # Generated images
│ └── ...
conda run -n py313 python figures/draw_xxx.pydpi=200, bbox_inches='tight', facecolor='white'\includegraphics[width=0.85\textwidth]{figures/xxx.png}New syntax (using \newtcbtheorem):
% Definition with label
\begin{definition}{Title}{def:label}
Content here...
\end{definition}
% Theorem with label
\begin{theorem}{Title}{thm:label}
Statement here...
\end{theorem}
% Example with label
\begin{example}{Title}{ex:label}
Content here...
\end{example}
% Remark (different syntax, no label)
\begin{remark}[Optional Title]
Content here...
\end{remark}
% Proof (inline style, no colon)
\begin{proof}
Proof content here...
\end{proof}
Important notes:
{Title}{label} instead of [Title]def:vector_space)\quad (two spaces) instead of colon after "Proof"[Title] syntax (no label needed)