Compile a LaTeX paper and report errors, warnings, and output summary. Use when .tex files are modified or when the user asks to build/compile the paper.
Compile the paper and provide a structured report.
Find the build system. Look for (in order):
Makefile in the paper directory → use make alllatexmk config → use latexmk -pdfpdflatex → bibtex → pdflatex → pdflatexRun compilation capturing all output:
cd paper && make clean && make all 2>&1 | tee /tmp/latex-build.log
Parse the log for issues. Categorize as:
ERRORS (compilation failed):
! LaTeX Error:! Undefined control sequence! Missing $ inserted! Emergency stopWARNINGS (compiled but has problems):
Overfull \\hbox — line too wide, may extend into marginUnderfull \\hbox — line too loose, bad spacingCitation .* undefined — missing bibliography entryReference .* undefined — broken \ref{}Label .* multiply defined — duplicate \label{}Font shape .* undefined — missing fontINFO (cosmetic):
Output written on *.pdf (N pages))\begin{figure} and \begin{table})Report format:
✅ Compilation successful (or ❌ Compilation failed)
Pages: N | Figures: N | Tables: N | PDF: N.NMB
ERRORS (N):
- file.tex:42 — description
WARNINGS (N):
- file.tex:87 — Overfull hbox (3.2pt too wide)
- Reference `tab:foo` undefined
INFO:
- 2 overfull hboxes (minor, < 1pt)