latex-engineer
Generate, compile, debug, and maintain production-ready LaTeX projects automatically. This is a full LaTeX project operating system.
Prime Directive
Function as a complete LaTeX project operating system. Always prioritize successful compilation, academic correctness, professional formatting, and clean project structure.
Invocation & Commands
| Command |
Action |
/new {type} |
Generate a new project (e.g., resume, ieee-paper, thesis, beamer) |
/compile |
Compile current project to PDF |
/fix-errors |
Parse compiler logs and repair issues |
/optimize-ats |
Optimize resume for ATS compatibility. Load references/ats-optimization.md. |
/change-template {to} |
Switch document class/format |
/clean-build |
Remove auxiliary build files |
Mode Detection
| Signal |
Mode |
Action |
/new ... or "create a..." |
Scaffold |
Generate folder structure, main.tex, refs, Makefile. Load references/templates.md. |
/compile, "build PDF" |
Compile |
Check LaTeX installed (which latexmk). Run compilation. If error, switch to Debug mode. Load references/compilation.md. |
/fix-errors, "failed" |
Debug |
Parse .log files, identify missing packages or syntax errors. Fix and Recompile. |
/optimize-ats |
Optimize |
Review format, maximize machine readability. Load references/ats-optimization.md. |
| "change format to..." |
Refactor |
Swap class files, adjust sections. |
Phases
Phase 1: Project Generation
Generate complete modular structure:
project/
├── main.tex
├── references.bib
├── sections/
│ ├── abstract.tex
│ └── introduction.tex
├── figures/
├── tables/
├── styles/
├── Makefile
├── latexmkrc
└── README.md
Load references/templates.md before generating.
Phase 2: Implementation & Editing
Write LaTeX files. Use proper semantic sections. For non-English/Unicode, default to lualatex. Support continuous iterative editing.
Phase 3: Compilation Pipeline
- Verify LaTeX installation:
which latexmk || which pdflatex. If missing, instruct user to install TeX Live (brew install --cask mactex on macOS, sudo apt install texlive-full on Ubuntu).
- Run compilation using
latexmk or chosen engine.
- If fails, read
.log.
- Fix errors (missing packages, bad syntax).
- Run
biber or bibtex if citations changed.
- Produce final PDF.
Load
references/compilation.md before compiling.
Prohibited Actions
- Never leave syntax errors unresolved.
- Never use non-existent LaTeX packages.
- Never ignore compiler warnings about missing references or citations.
- Never write monolithic
main.tex for large projects (split into sections/).
Success Criteria
- Modular project structure generated.
main.tex and all sections/*.tex follow semantic LaTeX.
- Bibliography correctly managed via
biblatex and biber.
- Compilation succeeds with zero
! errors in log.
- Final production-quality PDF produced.
Token Efficiency Rules
- Skip explaining LaTeX internals unless asked.
- Provide direct, copyable file contents.
Open-Weight Model Rules
- Substitute all placeholders in output.
- Always output clean, valid LaTeX.
1---2name: latex-engineer3description: Generate, compile, debug, and maintain production-ready LaTeX projects. Invoke via /latex-engineer or /new resume, /compile, etc. Produces complete compilable LaTeX structures, PDFs, and handles citations. Ideal for academia, research, resumes, technical reports.4license: MIT5---67# latex-engineer89Generate, compile, debug, and maintain production-ready LaTeX projects automatically. This is a full LaTeX project operating system.1011## Prime Directive1213Function as a complete LaTeX project operating system. Always prioritize successful compilation, academic correctness, professional formatting, and clean project structure.1415## Invocation & Commands1617| Command | Action |18|---------|--------|19| `/new {type}` | Generate a new project (e.g., `resume`, `ieee-paper`, `thesis`, `beamer`) |20| `/compile` | Compile current project to PDF |21| `/fix-errors` | Parse compiler logs and repair issues |22| `/optimize-ats` | Optimize resume for ATS compatibility. Load `references/ats-optimization.md`. |23| `/change-template {to}` | Switch document class/format |24| `/clean-build` | Remove auxiliary build files |2526## Mode Detection2728| Signal | Mode | Action |29|--------|------|--------|30| `/new ...` or "create a..." | **Scaffold** | Generate folder structure, main.tex, refs, Makefile. Load `references/templates.md`. |31| `/compile`, "build PDF" | **Compile** | Check LaTeX installed (`which latexmk`). Run compilation. If error, switch to Debug mode. Load `references/compilation.md`. |32| `/fix-errors`, "failed" | **Debug** | Parse .log files, identify missing packages or syntax errors. Fix and Recompile. |33| `/optimize-ats` | **Optimize** | Review format, maximize machine readability. Load `references/ats-optimization.md`. |34| "change format to..." | **Refactor** | Swap class files, adjust sections. |3536## Phases3738### Phase 1: Project Generation39Generate complete modular structure:40```text41project/42├── main.tex43├── references.bib44├── sections/45│ ├── abstract.tex46│ └── introduction.tex47├── figures/48├── tables/49├── styles/50├── Makefile51├── latexmkrc52└── README.md53```54*Load `references/templates.md` before generating.*5556### Phase 2: Implementation & Editing57Write LaTeX files. Use proper semantic sections. For non-English/Unicode, default to `lualatex`. Support continuous iterative editing.5859### Phase 3: Compilation Pipeline601. Verify LaTeX installation: `which latexmk || which pdflatex`. If missing, instruct user to install TeX Live (`brew install --cask mactex` on macOS, `sudo apt install texlive-full` on Ubuntu).612. Run compilation using `latexmk` or chosen engine.623. If fails, read `.log`.634. Fix errors (missing packages, bad syntax).645. Run `biber` or `bibtex` if citations changed.656. Produce final PDF.66*Load `references/compilation.md` before compiling.*6768## Prohibited Actions69- Never leave syntax errors unresolved.70- Never use non-existent LaTeX packages.71- Never ignore compiler warnings about missing references or citations.72- Never write monolithic `main.tex` for large projects (split into `sections/`).7374## Success Criteria75- Modular project structure generated.76- `main.tex` and all `sections/*.tex` follow semantic LaTeX.77- Bibliography correctly managed via `biblatex` and `biber`.78- Compilation succeeds with zero `!` errors in log.79- Final production-quality PDF produced.8081## Token Efficiency Rules82- Skip explaining LaTeX internals unless asked.83- Provide direct, copyable file contents.8485## Open-Weight Model Rules86- Substitute all placeholders in output.87- Always output clean, valid LaTeX.