LaTeX Build and Diagnostics
Use the smallest build path that matches the artifact and its toolchain.
A successful process exit is not enough: read the log for undefined citations,
references, missing glyphs, and overfull material, then inspect the PDF page.
Choose the path
| Artifact |
Build path |
Standalone .tex document opened in Codex |
Save it and use the built-in editor and compile_latex_document; inspect diagnostics and preview. No local TeX installation is required. |
| Existing multi-file project |
Use the repository's pinned build script or latexmk with its required engine and output directory. |
| Simple project with Tectonic available |
Use Tectonic with an explicit output directory when the project needs no unsupported external pass. |
| Committed PDF with metadata registry |
Use latex-whitepaper-engineering and the repository's pinned publication pipeline. |
A plugin's latex-compile script may detect Tectonic and a TeX Live fallback;
its latex-doctor script tests installed runtimes. Resolve the installed
plugin path at execution time. A staged marketplace path is transient and
must not be copied into a skill. Do not install a TeX toolchain to use the
Codex standalone editor.
Project build
For a conventional TeX Live project, latexmk owns repeated passes and
bibliography execution. Prefer -halt-on-error, an explicit engine, and an
output directory. Do not run fixed pass counts as a generic rule; follow a
repository's pinned recipe when it differs. Tectonic can compile a simple
project directly, but a bibliography, index, shell escape, custom engine, or
publisher's pinned output may require the full project toolchain.
Diagnose from the first error
- Locate the first
! or file-line error in the .log. Later errors may be
consequences of the first.
- Identify the source file and line, then inspect nearby braces, math mode,
alignment tabs, and package load order.
- Fix one cause, rebuild, and read the new first error.
- Check warnings after a clean build: undefined labels/citations, missing
glyphs, large overfull boxes, and a stale bibliography.
- Inspect affected pages at final size. A clean log does not prove readable
typography or uncropped figures.
references/debugging.md carries the longer error catalog and minimization
techniques. If no compiler is available for a multi-file project, report the
missing runtime and preserve the source; do not claim compilation.
1---2name: latex-build-diagnostics3description: >-4 Compile and troubleshoot a LaTeX document or project: select the available5 compiler, read the first log error, resolve references and citations, and6 verify rendered output. Use for build, render, install-status, or TeX log7 questions. NOT for source writing, Beamer composition, figure semantics,8 or a repository's committed-PDF registry and publication process.9license: Apache-2.010metadata:11 source: https://skillmd.com/skills/curiositech/latex-build-diagnostics12 category: Tooling13 tags: [latex, compile, tectonic, latexmk, diagnostics]14 pairs-with: [latex-authoring, latex-whitepaper-engineering]15---1617# LaTeX Build and Diagnostics1819Use the smallest build path that matches the artifact and its toolchain.20A successful process exit is not enough: read the log for undefined citations,21references, missing glyphs, and overfull material, then inspect the PDF page.2223## Choose the path2425| Artifact | Build path |26|---|---|27| Standalone `.tex` document opened in Codex | Save it and use the built-in editor and `compile_latex_document`; inspect diagnostics and preview. No local TeX installation is required. |28| Existing multi-file project | Use the repository's pinned build script or `latexmk` with its required engine and output directory. |29| Simple project with Tectonic available | Use Tectonic with an explicit output directory when the project needs no unsupported external pass. |30| Committed PDF with metadata registry | Use `latex-whitepaper-engineering` and the repository's pinned publication pipeline. |3132A plugin's `latex-compile` script may detect Tectonic and a TeX Live fallback;33its `latex-doctor` script tests installed runtimes. Resolve the installed34plugin path at execution time. A staged marketplace path is transient and35must not be copied into a skill. Do not install a TeX toolchain to use the36Codex standalone editor.3738## Project build3940For a conventional TeX Live project, `latexmk` owns repeated passes and41bibliography execution. Prefer `-halt-on-error`, an explicit engine, and an42output directory. Do not run fixed pass counts as a generic rule; follow a43repository's pinned recipe when it differs. Tectonic can compile a simple44project directly, but a bibliography, index, shell escape, custom engine, or45publisher's pinned output may require the full project toolchain.4647## Diagnose from the first error48491. Locate the first `!` or file-line error in the `.log`. Later errors may be50 consequences of the first.512. Identify the source file and line, then inspect nearby braces, math mode,52 alignment tabs, and package load order.533. Fix one cause, rebuild, and read the new first error.544. Check warnings after a clean build: undefined labels/citations, missing55 glyphs, large overfull boxes, and a stale bibliography.565. Inspect affected pages at final size. A clean log does not prove readable57 typography or uncropped figures.5859`references/debugging.md` carries the longer error catalog and minimization60techniques. If no compiler is available for a multi-file project, report the61missing runtime and preserve the source; do not claim compilation.