| name | latex |
| description | Quick-access LaTeX typesetting expertise -- journal preambles, project macros, notation reference, document review, arxiv checklist |
| disable-model-invocation | true |
| argument-hint | --preamble <journal> | --macros | --notation | --journal <name> | --check <file> | --arxiv | --bib | --index |
LaTeX Typesetting Skill
Quick access to LaTeX formatting expertise for the project's paper preparation. Backed by the LaTeX reference documents in researchers/LaTeX/ and the latex-typesetting-specialist agent definition.
Usage
/latex --preamble jhep # Generate JHEP-ready preamble with project macros
/latex --preamble cmp # Generate CMP/JGP-ready preamble
/latex --preamble prd # Generate PRD (REVTeX) preamble
/latex --macros # Show/generate {{PROJECT_NAME}}.sty macro file
/latex --notation # Project notation quick reference
/latex --journal jhep # JHEP style summary and requirements
/latex --journal cmp # CMP style summary
/latex --journal jgp # JGP style summary
/latex --journal prd # PRD (REVTeX) style summary
/latex --check paper.tex # Review a .tex file for common issues
/latex --arxiv # ArXiv submission checklist
/latex --bib # Bibliography setup guide (BibTeX vs BibLaTeX per venue)
/latex --index # Show the full document index
Parse Arguments
Extract the subcommand flag and its argument from the invocation. The first token is the subcommand flag. Anything after it is the argument.
If no arguments provided, show the usage block above and stop.
Subcommand Implementations
--preamble <journal>
Generate a complete, ready-to-use LaTeX preamble for the specified journal. The preamble must include:
- The correct document class for the venue
- All required packages (amsmath, amssymb, amsthm, hyperref, cleveref, etc.)
- The full project macro set (see
--macros below, inline it)
- Theorem environments (Theorem, Lemma, Proposition, Corollary, Definition, Remark, Proof)
- Comments explaining each block
Venue mappings (read the corresponding reference doc for details):
| Argument | Document Class | Reference Doc | Notes |
|---|
jhep | jheppub | researchers/LaTeX/04_JHEP_Submission_Style_Guide.md | Springer, uses natbib |
cmp | svjour3 with [twocolumn] or article | researchers/LaTeX/14_Journal_Geometry_Physics_CMP_Style.md | Springer math physics |
jgp | elsarticle | researchers/LaTeX/14_Journal_Geometry_Physics_CMP_Style.md | Elsevier |
prd | revtex4-2 with [aps,prd,twocolumn] | researchers/LaTeX/03_REVTeX4_Physics_Journal_Style.md | APS, uses natbib |
arxiv | article with [11pt,a4paper] | researchers/LaTeX/12_ArXiv_Submission_Workflow.md | Generic, bibtex |
Steps:
- Read the corresponding reference doc from
researchers/LaTeX/
- Read
researchers/LaTeX/13_LaTeX_Macros_Physics_Papers.md for macro patterns
- Read
researchers/LaTeX/07_Spectral_Theory_NCG_Notation_LaTeX.md for NCG macros
- Read
researchers/LaTeX/06_Differential_Geometry_Notation_LaTeX.md for geometry macros
- Assemble a complete preamble in a LaTeX code block
- Include inline comments for every section
Output the preamble as a single LaTeX code block ready to copy-paste.
--macros
Generate the project's shared macro file {{PROJECT_NAME}}.sty. Read these documents:
researchers/LaTeX/13_LaTeX_Macros_Physics_Papers.md -- macro design patterns
researchers/LaTeX/07_Spectral_Theory_NCG_Notation_LaTeX.md -- NCG notation
researchers/LaTeX/06_Differential_Geometry_Notation_LaTeX.md -- geometry notation
researchers/LaTeX/10_Physics_Symbol_Conventions.md -- symbol conventions
Generate a .sty file with these sections:
%% {{PROJECT_NAME}}.sty -- Shared macros for the project's papers
%% Generated by /latex --macros
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{{{PROJECT_NAME}}}[2026/02/21 Project Macros]
%% === Required packages ===
% (amsmath, amssymb, mathtools, etc.)
%% === Operators ===
% \DeclareMathOperator{\Tr}{Tr}
% \DeclareMathOperator{\Spec}{Spec}
% \DeclareMathOperator{\Pf}{Pf}
% \DeclareMathOperator{\vol}{vol}
% \DeclareMathOperator{\KOdim}{KO\text{-}dim}
% \DeclareMathOperator{\diag}{diag}
% \DeclareMathOperator{\sgn}{sgn}
%% === Spectral triples and NCG ===
% \newcommand{\spectriple}{(\mathcal{A}, \mathcal{H}, D)}
% \newcommand{\AF}{\mathcal{A}_F}
% \newcommand{\HF}{\mathcal{H}_F}
% \newcommand{\DF}{D_F}
% \newcommand{\DK}{D_K} % Dirac on SU(3), Kosmann lift
% \newcommand{\DKtau}{D_K(\tau)} % Jensen-deformed Dirac
% \newcommand{\realJ}{J} % Real structure (roman J)
% \newcommand{\spectact}{\mathrm{Tr}\, f(D^2/\Lambda^2)}
%% === Geometry and KK ===
% \newcommand{\Riem}{R_{\mu\nu\rho\sigma}}
% \newcommand{\Ric}{R_{\mu\nu}}
% \newcommand{\Scal}{R} % Ricci scalar
% \newcommand{\covD}{\nabla}
% \newcommand{\Lie}{\mathcal{L}}
% \newcommand{\g}{g} % metric
% \newcommand{\gtau}{g(\tau)} % deformed metric
%% === Paasch and mass spectrum ===
% \newcommand{\phiP}{\phi_{\text{Paasch}}}
% \newcommand{\phival}{1.531580}
%% === Seeley-DeWitt ===
% \newcommand{\SDa}[1]{a_{#1}} % a_0, a_2, a_4
% \newcommand{\cutoff}{\Lambda}
%% === Common decorations ===
% \newcommand{\conj}[1]{\overline{#1}}
% \newcommand{\dual}[1]{#1^*}
% \newcommand{\dagger}[1]{#1^{\dagger}}
Present the full .sty file content. If the user approves, offer to write it to a file.
--notation
Quick reference card for project notation. Read:
researchers/LaTeX/10_Physics_Symbol_Conventions.md
researchers/LaTeX/07_Spectral_Theory_NCG_Notation_LaTeX.md
researchers/LaTeX/06_Differential_Geometry_Notation_LaTeX.md
Output a compact markdown table:
| Symbol | LaTeX | Meaning | First Appears |
|---|
| $D_K$ | D_K | Dirac operator on SU(3), Kosmann lift | Session 7 |
| $D_K(\tau)$ | D_K(\tau) | Jensen-deformed Dirac | Session 12 |
| $(A, H, D)$ | (\mathcal{A}, \mathcal{H}, D) | Spectral triple | Session 7 |
| ... | ... | ... | ... |
Include all project-critical symbols (30-50 entries), organized by category: NCG, geometry, Paasch, Seeley-DeWitt, condensed matter.
--journal <name>
Show a concise style summary for the named journal. Read the corresponding reference doc:
jhep -> researchers/LaTeX/04_JHEP_Submission_Style_Guide.md
cmp or jgp -> researchers/LaTeX/14_Journal_Geometry_Physics_CMP_Style.md
prd -> researchers/LaTeX/03_REVTeX4_Physics_Journal_Style.md
Output a structured summary:
- Document class and options
- Page limits (if any)
- Bibliography format (natbib vs biblatex, style file)
- Figure requirements (format, resolution, color)
- Abstract word limit and format
- Key formatting rules (section numbering, equation numbering, appendices)
- Submission portal URL
- Typical review timeline
- ArXiv cross-listing categories (hep-th, math-ph, gr-qc)
--check <file>
Review a .tex file for common issues. Read the file using the Read tool, then check:
- Package conflicts: natbib vs biblatex, hyperref load order
- Undefined references: scan for
\ref{...} and \cite{...}, cross-check against \label{...} and .bib entries
- Math mode issues: unmatched delimiters,
\left/\right pairing
- Notation consistency: scan for variant spellings of project terms (D_K vs \mathcal{D}_K, etc.)
- Style compliance: check document class against expected venue
- Common mistakes: double subscripts, missing
\, in integrals, \text{} inside math mode misuse
- Overfull warnings: lines exceeding 80 chars in source (indicator of long equations)
Output a categorized issue list with line numbers and suggested fixes.
--arxiv
ArXiv submission checklist. Read researchers/LaTeX/12_ArXiv_Submission_Workflow.md and produce:
## ArXiv Submission Checklist
### Pre-submission
- [ ] Compile .bbl file (arxiv cannot run bibtex/biber)
- [ ] Flatten \input commands OR include all .tex files
- [ ] All figures as PDF/PNG/EPS in submission directory
- [ ] Remove any \usepackage that arxiv doesn't support
- [ ] hyperref loaded LAST (or use \AtEndPreamble)
- [ ] No absolute paths in \includegraphics
### Metadata
- [ ] Title matches paper exactly
- [ ] All authors with correct affiliations
- [ ] Abstract (plain text, no LaTeX)
- [ ] Primary category: [hep-th / math-ph / gr-qc]
- [ ] Cross-list: [math.DG / math-ph / hep-ph]
- [ ] MSC codes (if math journal target)
- [ ] PACS codes (if physics journal target)
- [ ] Comments field: "N pages, M figures, submitted to [journal]"
### File package
- [ ] Single .tar.gz or .zip
- [ ] Main .tex file named clearly (e.g., {{PROJECT_NAME}}_main.tex)
- [ ] .bbl file included (NOT .bib)
- [ ] .sty file included if custom ({{PROJECT_NAME}}.sty)
- [ ] Figures in subdirectory (figures/) with relative paths
- [ ] Total size < 10 MB (< 1 MB preferred)
### Post-upload
- [ ] Verify PDF renders correctly in arxiv preview
- [ ] Check all cross-references resolve
- [ ] Check all figures appear
- [ ] Verify bibliography renders
- [ ] Note the arxiv ID for journal submission
--bib
Bibliography setup guide. Read researchers/LaTeX/05_BibLaTeX_Bibliography_Management.md and produce:
- Venue compatibility matrix:
| Venue | Engine | Style | Package | Notes |
|---|
| PRD | BibTeX | apsrev4-2 | natbib | REVTeX handles this |
| JHEP | BibTeX | JHEP | natbib | jheppub.sty includes setup |
| JGP | BibTeX/BibLaTeX | elsarticle-num | natbib or biblatex | Elsevier flexible |
| CMP | BibTeX | spmpsci | natbib | Springer style |
| ArXiv | BibTeX | any | any | Must pre-compile .bbl |
- INSPIRE-HEP workflow: How to export .bib entries from INSPIRE
- Single .bib strategy: One master .bib file, venue-specific compilation
- Common citation commands:
\cite, \citep, \citet, \citeauthor, \citeyear
--index
Show the full document index. Read researchers/LaTeX/index.md and display it to the user.
Error Handling
- If
--preamble argument doesn't match a known venue: list the valid venues and stop
- If
--journal argument doesn't match: list valid journals and stop
- If
--check file doesn't exist: report file not found
- If no subcommand given: show usage block
- If a reference doc is missing: report which doc is missing and suggest running
/new-researcher latex to regenerate
Notes
- This skill reads from
researchers/LaTeX/ -- it does NOT require spawning the latex-typesetting-specialist agent
- For complex tasks (writing full papers, multi-file template setup), spawn the agent instead via Task tool
- All generated LaTeX should use ASCII-safe source (no unicode in .tex files)
- A project may target multiple papers across venues (e.g., a primary results paper and a structure/methods paper)