LaTeX Skill
Purpose and Scope
This skill defines how Claude writes LaTeX. It is project-agnostic: the rules
here apply to a terse formula sheet and a verbose lecture handout equally.
Where a rule must be adapted for a specific project, that adaptation lives in
the project's own project_philosophy.md, which takes precedence over this
skill for that project only.
This skill governs both file production and LaTeX advice. When
reviewing, explaining, or recommending LaTeX without producing a file, the
same principles apply. Advising someone to use eqnarray is wrong for the
same reason writing it is wrong.
What this skill governs:
- File header format and versioning
- Package import conventions
- Math environments and notation
- Table conventions
- Inline commenting discipline
- File structure and modularity (
\input vs. \include)
- File naming (applies to all projects, not only multi-file ones)
- Bibliography and citation workflow (BibTeX vs. biblatex/biber)
- Symbol selection and disambiguation
- Antipatterns to avoid — consult
antipatterns.md before generating, not
only when reviewing
- Compile warning philosophy
- Verification workflow (chktex, full compile, KNOWN WARNINGS lifecycle)
What this skill does NOT govern:
- Document class selection
- Font choices
- Page geometry or margin widths
- Information density or whitespace preferences
- Project-specific macro libraries
- Any opinion about what a document should contain
Systems-Level Framing
A .tex file is source code. It will be read by humans, diffed, versioned,
compiled by machines, and handed to collaborators who weren't in the room when
decisions were made. Every convention in this skill exists to serve one or more
of these four goals:
- Readability — a future reader (including future you) can understand
intent without reverse-engineering it from output.
- Maintainability — changes are local, diff-friendly, and don't ripple
unexpectedly through the document.
- Portability — the file compiles cleanly in standard distributions
(TeX Live, MiKTeX) without undocumented dependencies.
- Correctness — the typeset output faithfully represents the intended
mathematics and structure, with no silent errors hiding in unread warnings.
When a rule in this skill seems arbitrary, trace it back to one of these four
goals. If a project-level decision conflicts with this skill, ask which goals
are being traded and whether that trade is intentional.
Rules below are tagged [R], [M], [P], or [C] to indicate which goal(s) they
primarily serve.
Reference Files
SKILL.md is a routing document. The detail lives in the reference files
below. How much to read depends on what's being done — see Proportional
Response immediately below the file table.
| File |
Contents |
references/headers.md |
File header format, versioning scheme, known-warnings field |
references/packages.md |
Package import conventions, grouping, load order |
references/math.md |
Math environments, notation, units, labeling, physics notation packages |
references/tables.md |
booktabs style, tabularx, siunitx, caption placement |
references/comments.md |
Inline commenting discipline, TODOs, sign conventions |
references/structure.md |
\input vs \include, standalone vs modular files, custom commands, collaborator communication |
references/naming.md |
File naming conventions for .tex, .bib, and figure files |
references/antipatterns.md |
Explicit list of things never to do, with rationale |
references/warnings.md |
Compile warning philosophy, triage, and documentation |
references/compilation.md |
Claude's verification workflow: chktex, full compile, log parsing, KNOWN WARNINGS updates |
references/symbols.md |
Common math/physics/engineering symbols, semantic meaning, correct commands |
references/bibliography.md |
BibTeX vs biblatex/biber, .bib conventions, citation styles, migration |
Proportional Response
Not every task warrants reading the full reference set. Unnecessary reads cost
time and tokens without improving output. Match the effort to the scope.
Tier 1 — New file generation
Read antipatterns.md first (always), then the full set of files relevant to
what the document contains. Use the routing guide below. Run chktex after
generating.
Tier 2 — Edits and advice
This covers both surgical edits to existing source and LaTeX advice without
producing a file. Both involve reasoning about specific LaTeX decisions rather
than building something from scratch — the same proportional reading applies.
Read antipatterns.md + the one or two reference files directly relevant to
the specific change or question. Run chktex only if the edit changes compiled
output (same threshold as VERSION increments).
Tier 3 — Comment, header, or metadata-only changes
Changes that don't affect compiled output: updating PURPOSE, resolving a TODO,
adding a KNOWN WARNINGS entry, fixing a comment. No reference file reads
required. No chktex.
When in doubt about which tier applies, default to Tier 2.
Routing Guide
Which reference files to read for common tasks:
- Starting a new .tex file from scratch →
headers.md, packages.md,
naming.md, structure.md
- Writing or editing math →
math.md
- Writing or editing a table →
tables.md
- Adding comments or TODOs →
comments.md
- Setting up a multi-file project →
structure.md, naming.md
- Naming any file (standalone or multi-file) →
naming.md
- Defining or reviewing custom commands / macros →
structure.md
- Looking up a symbol or choosing between symbol variants →
symbols.md
- Setting up citations, a bibliography, or choosing between biblatex and bibtex →
bibliography.md
- Setting up theorem, proof, lemma, or definition environments →
math.md
- Physics notation packages (
physics, physics2) → math.md
- Before generating any LaTeX output → scan
antipatterns.md first
- Reviewing or auditing existing LaTeX →
antipatterns.md, warnings.md
- Running chktex or deciding whether to compile →
compilation.md
- Updating the KNOWN WARNINGS block after verification →
compilation.md, headers.md
- Unsure → read
antipatterns.md first; it covers the highest-impact issues
in the smallest space
Diff Discipline
When making edits to an existing .tex file, prefer surgical changes over
full rewrites. A change that touches three lines should produce a three-line
diff, not a re-emission of the entire file. This is not just housekeeping —
minimal diffs preserve version history legibility and make review tractable.
Apply this principle to comment additions too: when a known-warnings entry is
added to a file header, or a TODO is resolved, those are diffs, not rewrites.
Project Philosophy Files
Each project that uses this skill should maintain a project_philosophy.md
at the project root. This file is the bridge between this skill's universal
rules and the specific decisions a project has made. Its primary audience is
any future collaborator — human or AI — who needs to get up to speed without
asking questions.
Minimum expected contents:
- Project name, author(s), and one-paragraph purpose statement
- Document class choice and rationale
- Compiler and distribution if non-default (e.g., LuaLaTeX, MiKTeX)
- Project-specific packages beyond this skill's defaults, with rationale
- Directory and file naming conventions if they deviate from
naming.md
- Whitespace, density, and layout preferences
- Any deliberate deviation from this skill, with justification
- Domain conventions in force: sign conventions, unit systems, notation
choices that affect how math and tables are written throughout the project
- Custom command inventory: what is defined in
macros.tex and why
Every item above must be answered explicitly. If a project has no requirement for a given item, write N/A — not applicable with a brief reason (e.g., N/A — single standalone file, no directory structure to define). A missing item is ambiguous; N/A with a reason is not.
Decisions this skill explicitly leaves to project_philosophy.md:
The following are open by design and must be resolved per project: document
class, font selection, page geometry, information density, custom label
schemes, TODO/HACK variation labels beyond the defaults, and any versioning
scheme other than YYYYMMDD.NNN.
If no project_philosophy.md exists, apply this skill's defaults without
deviation and note its absence to the collaborator.
1---2name: latex3description: Governs how Claude writes, edits, reviews, and gives advice about LaTeX. Use this skill for ANY task involving .tex files — no exceptions. This includes: producing new .tex files of any type (worksheets, formula sheets, handouts, reports, problem sets, exams, multi-file projects); editing or auditing existing LaTeX source; reviewing someone's LaTeX for correctness or style; and giving LaTeX advice or recommendations without producing a file (e.g. "should I use align or equation here?", "what's the right way to typeset units?", "how do I structure a multi-chapter project?"). Trigger whenever the user mentions LaTeX, .tex files, pdflatex, XeLaTeX, LuaLaTeX, Overleaf, TeX Live, MiKTeX, compiling a document, or asks Claude to write math, tables, or structured technical documents in LaTeX. Does NOT encode opinions about information density, whitespace, or document class — those belong in project-level philosophy files.4---56# LaTeX Skill78## Purpose and Scope910This skill defines how Claude writes LaTeX. It is project-agnostic: the rules11here apply to a terse formula sheet and a verbose lecture handout equally.12Where a rule must be adapted for a specific project, that adaptation lives in13the project's own `project_philosophy.md`, which takes precedence over this14skill for that project only.1516This skill governs both **file production** and **LaTeX advice**. When17reviewing, explaining, or recommending LaTeX without producing a file, the18same principles apply. Advising someone to use `eqnarray` is wrong for the19same reason writing it is wrong.2021**What this skill governs:**22- File header format and versioning23- Package import conventions24- Math environments and notation25- Table conventions26- Inline commenting discipline27- File structure and modularity (`\input` vs. `\include`)28- File naming (applies to all projects, not only multi-file ones)29- Bibliography and citation workflow (BibTeX vs. biblatex/biber)30- Symbol selection and disambiguation31- Antipatterns to avoid — consult `antipatterns.md` *before* generating, not32 only when reviewing33- Compile warning philosophy34- Verification workflow (chktex, full compile, KNOWN WARNINGS lifecycle)3536**What this skill does NOT govern:**37- Document class selection38- Font choices39- Page geometry or margin widths40- Information density or whitespace preferences41- Project-specific macro libraries42- Any opinion about what a document should *contain*4344---4546## Systems-Level Framing4748A `.tex` file is source code. It will be read by humans, diffed, versioned,49compiled by machines, and handed to collaborators who weren't in the room when50decisions were made. Every convention in this skill exists to serve one or more51of these four goals:52531. **Readability** — a future reader (including future you) can understand54 intent without reverse-engineering it from output.552. **Maintainability** — changes are local, diff-friendly, and don't ripple56 unexpectedly through the document.573. **Portability** — the file compiles cleanly in standard distributions58 (TeX Live, MiKTeX) without undocumented dependencies.594. **Correctness** — the typeset output faithfully represents the intended60 mathematics and structure, with no silent errors hiding in unread warnings.6162When a rule in this skill seems arbitrary, trace it back to one of these four63goals. If a project-level decision conflicts with this skill, ask which goals64are being traded and whether that trade is intentional.6566Rules below are tagged [R], [M], [P], or [C] to indicate which goal(s) they67primarily serve.6869---7071## Reference Files7273`SKILL.md` is a routing document. The detail lives in the reference files74below. How much to read depends on what's being done — see **Proportional75Response** immediately below the file table.7677| File | Contents |78|------|----------|79| `references/headers.md` | File header format, versioning scheme, known-warnings field |80| `references/packages.md` | Package import conventions, grouping, load order |81| `references/math.md` | Math environments, notation, units, labeling, physics notation packages |82| `references/tables.md` | booktabs style, tabularx, siunitx, caption placement |83| `references/comments.md` | Inline commenting discipline, TODOs, sign conventions |84| `references/structure.md` | `\input` vs `\include`, standalone vs modular files, custom commands, collaborator communication |85| `references/naming.md` | File naming conventions for .tex, .bib, and figure files |86| `references/antipatterns.md` | Explicit list of things never to do, with rationale |87| `references/warnings.md` | Compile warning philosophy, triage, and documentation |88| `references/compilation.md` | Claude's verification workflow: chktex, full compile, log parsing, KNOWN WARNINGS updates |89| `references/symbols.md` | Common math/physics/engineering symbols, semantic meaning, correct commands |90| `references/bibliography.md` | BibTeX vs biblatex/biber, .bib conventions, citation styles, migration |9192---9394## Proportional Response9596Not every task warrants reading the full reference set. Unnecessary reads cost97time and tokens without improving output. Match the effort to the scope.9899**Tier 1 — New file generation**100Read `antipatterns.md` first (always), then the full set of files relevant to101what the document contains. Use the routing guide below. Run chktex after102generating.103104**Tier 2 — Edits and advice**105This covers both surgical edits to existing source *and* LaTeX advice without106producing a file. Both involve reasoning about specific LaTeX decisions rather107than building something from scratch — the same proportional reading applies.108Read `antipatterns.md` + the one or two reference files directly relevant to109the specific change or question. Run chktex only if the edit changes compiled110output (same threshold as VERSION increments).111112**Tier 3 — Comment, header, or metadata-only changes**113Changes that don't affect compiled output: updating PURPOSE, resolving a TODO,114adding a KNOWN WARNINGS entry, fixing a comment. No reference file reads115required. No chktex.116117When in doubt about which tier applies, default to Tier 2.118119---120121## Routing Guide122123Which reference files to read for common tasks:124125- *Starting a new .tex file from scratch* → `headers.md`, `packages.md`,126 `naming.md`, `structure.md`127- *Writing or editing math* → `math.md`128- *Writing or editing a table* → `tables.md`129- *Adding comments or TODOs* → `comments.md`130- *Setting up a multi-file project* → `structure.md`, `naming.md`131- *Naming any file (standalone or multi-file)* → `naming.md`132- *Defining or reviewing custom commands / macros* → `structure.md`133- *Looking up a symbol or choosing between symbol variants* → `symbols.md`134- *Setting up citations, a bibliography, or choosing between biblatex and bibtex* → `bibliography.md`135- *Setting up theorem, proof, lemma, or definition environments* → `math.md`136- *Physics notation packages (`physics`, `physics2`)* → `math.md`137- *Before generating any LaTeX output* → scan `antipatterns.md` first138- *Reviewing or auditing existing LaTeX* → `antipatterns.md`, `warnings.md`139- *Running chktex or deciding whether to compile* → `compilation.md`140- *Updating the KNOWN WARNINGS block after verification* → `compilation.md`, `headers.md`141- *Unsure* → read `antipatterns.md` first; it covers the highest-impact issues142 in the smallest space143144---145146## Diff Discipline147148When making edits to an existing `.tex` file, prefer surgical changes over149full rewrites. A change that touches three lines should produce a three-line150diff, not a re-emission of the entire file. This is not just housekeeping —151minimal diffs preserve version history legibility and make review tractable.152153Apply this principle to comment additions too: when a known-warnings entry is154added to a file header, or a TODO is resolved, those are diffs, not rewrites.155156---157158## Project Philosophy Files159160Each project that uses this skill should maintain a `project_philosophy.md`161at the project root. This file is the bridge between this skill's universal162rules and the specific decisions a project has made. Its primary audience is163any future collaborator — human or AI — who needs to get up to speed without164asking questions.165166**Minimum expected contents:**167168- Project name, author(s), and one-paragraph purpose statement169- Document class choice and rationale170- Compiler and distribution if non-default (e.g., LuaLaTeX, MiKTeX)171- Project-specific packages beyond this skill's defaults, with rationale172- Directory and file naming conventions if they deviate from `naming.md`173- Whitespace, density, and layout preferences174- Any deliberate deviation from this skill, with justification175- Domain conventions in force: sign conventions, unit systems, notation176 choices that affect how math and tables are written throughout the project177- Custom command inventory: what is defined in `macros.tex` and why178179**Every item above must be answered explicitly.** If a project has no requirement for a given item, write `N/A — not applicable` with a brief reason (e.g., `N/A — single standalone file, no directory structure to define`). A missing item is ambiguous; `N/A` with a reason is not.180181**Decisions this skill explicitly leaves to `project_philosophy.md`:**182183The following are open by design and must be resolved per project: document184class, font selection, page geometry, information density, custom label185schemes, TODO/HACK variation labels beyond the defaults, and any versioning186scheme other than `YYYYMMDD.NNN`.187188If no `project_philosophy.md` exists, apply this skill's defaults without189deviation and note its absence to the collaborator.