skills/60-regisely-superpapers/skills/compile-latex/SKILL.md
Use when compiling a LaTeX paper, debugging LaTeX errors, building a paper PDF, or when a .tex file fails to produce output. Handles engine detection (xelatex vs pdflatex), bibliography systems (biber vs bibtex), and multi-pass compilation.
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research compile-latexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill compiles LaTeX documents correctly with the right engine and bibliography system, handles multi-pass compilation, and parses errors to suggest fixes. It ships with a wrapper script (scripts/compile.sh) that detects everything automatically and can be invoked directly.
.tex fileDetect the engine from the preamble. Look for \usepackage{fontspec}. If present, use xelatex. Otherwise use pdflatex. The wrapper script does this automatically.
Detect the bibliography system. \usepackage{biblatex} in the preamble implies biber. \bibliography{...} at the end of the document implies bibtex. Neither implies no bibliography pass.
Prefer latexmk if available. It handles multi-pass logic automatically and is more robust than running passes manually.
If latexmk is unavailable, run the manual sequence: engine → bib (if applicable) → engine → engine.
On error, parse the log file (<base>.log). Extract lines starting with !, report the line number and file, and suggest a likely fix from the error table below.
Verify the PDF was produced after successful compilation and that it is non-empty.
Invoke the compile script directly:
./skills/compile-latex/scripts/compile.sh paper/paper.tex
The script detects engine and bibliography system, runs latexmk if available, falls back to manual multi-pass otherwise, and exits non-zero on failure. All detection and pass logic is handled internally — no flags needed beyond the path to the .tex file.
| Error | Cause | Fix |
|-------|-------|-----|
| Undefined control sequence \foo | Missing package | Add \usepackage{pkg} providing \foo |
| File 'x.sty' not found | Missing package | Install TeX package (tlmgr install x) |
| Citation 'X' undefined | Bib pass not run | Run biber or bibtex, then re-run engine |
| Missing \begin{document} | Preamble typo | Check brace balance in preamble |
| Package fontspec Error | Used pdflatex instead of xelatex | Switch engine |
| Overfull \hbox | Typographical warning | Usually safe to ignore, or rephrase the offending line |
| LaTeX Error: File 'x.tex' not found | Missing \input{} target | Verify path relative to the main file |
pdflatex on a document that needs xelatexCitation undefined warnings — they mean the bibliography is broken\ref, \cite, \label).aux, .log, .bbl, .out, .toc, .fls, .fdb_latexmk auxiliary files to git<base>.pdf exists and is non-emptyUndefined warnings in the final logtools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.