latex-compile
Skill0 starsChanged 2 months agoMITView on GitHub
编译 LaTeX 文档:xelatex → bibtex → xelatex ×2 多遍循环,输出日志尾部、页数与警告信号,可选用 --min-pages / --min-refs 做编译前门禁。当用户要编译 .tex、把论文/报告导出 PDF、或排查 LaTeX 编译报错时使用。 Compile a LaTeX project (xelatex x bibtex x xelatex x 2) and report the log tail, page count, and warning signals, with optional pre-compile gates. Use when the user wants a .tex file turned into a PDF, a citation/page contract enforced before compilation, or a LaTeX build failure diagnosed. Ported and generalized from the OpenSquilla latex-compile skill.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- JihaoXin/paper-machinetheir own version, first seen Oct 15, 2026
- MercatorProj/vibe-thesis-skillstheir own version, first seen Oct 10, 2026
- xjsongphy/skillstheir own version, first seen Aug 17, 2026
- DaRL-GenAI/instructional_agents-skillstheir own version, first seen Apr 15, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- MercatorProj/vibe-thesis-skills★ 8same name
- xjsongphy/skills★ 7same name
- DaRL-GenAI/instructional_agents-skills★ 1same name
- JihaoXin/paper-machine★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository45 other files it gives its agents.
- 3d-creationSkill
- 60fps-animationSkill
- aihotSkill
- arxivSkill
- awesome-design-mdSkill
- buildSkill
- canvas-designSkill
- cavemanSkill
- cli-anything-hubSkill
- data-analyticsSkill
- defineSkill
- design-blueprintSkill
- diagnoseSkill
- dsh-plugin-developmentSkill
- feishu-cliSkill
- find-skillsSkill
- flow-canvasSkill
- frontend-designSkill
- fun-code-reverseSkill
- github-cliSkill
- github-trending-cnSkill
- handoffSkill
- learn-everythingSkill
- metaSkill
- modern-python-toolchainSkill
- multi-search-engineSkill
- myagents-routerSkill
- office-docsSkill
- perplexitySkill
- planSkill
- product-designSkill
- research-paper-writingSkill
- reverse-proxySkill
- reverse-skill-routerSkill
- reviewSkill
- salesSkill
- shipSkill
- skill-auditSkill
- skill-createSkill
- super-researchSkill
- teachSkill
- verifySkill
- videoSkill
- visualizerSkill
- web-search-exaSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Run the four-pass LaTeX build loop and report something a human can act on: the log tail, the page count, and the warnings that actually …
- Very specific: line 44
If xelatex is missing, stop and give the install command (winget install MiKTeX.MiKTeX or choco install miktex on Windows.
- Very specific: line 94
Stale
.aux/.bbl: if citations look wrong after a .bib edit, delete *.aux / *.bbl and rebuild — the four-pass loop alone cannot always …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LaTeX Compile
Run the four-pass LaTeX build loop and report something a human can act on: the log tail, the page count, and the warnings that actually matter (undefined citations, overfull boxes, missing font shapes).
Boundaries
Do:
- Compile an existing
.texentry file into a PDF. - Report exit code, page count, and extracted warning signals.
- Optionally enforce
--min-pages/--min-refsas pre-compile gates.
Do not:
- Rewrite the user's
.texsource. This skill only reads it. - Inject an author/title line or assemble sibling
abstract.tex/method.texfragments — that was the upstream meta-skill's contract, not a general compiler's job. - Claim a build succeeded without checking that the PDF actually exists.
Preflight
# 1. engine present?
Get-Command xelatex -ErrorAction SilentlyContinue
# 2. document present?
Get-Item .\paper\paper.tex
# 3. bibliography present (only needed for citations)?
Get-ChildItem .\paper\*.bibIf xelatex is missing, stop and give the install command (winget install MiKTeX.MiKTeX or
choco install miktex on Windows; tlmgr/TeX Live elsewhere). Do not fall back to a different
engine silently — pdflatex cannot render CJK without extra packages.
Run
python scripts\compile.py .\paper\paper.tex
python scripts\compile.py .\paper\paper.tex --engine pdflatex --no-bibtex
python scripts\compile.py .\paper\paper.tex --min-pages 10 --min-refs 20
python scripts\compile.py .\paper\paper.tex --bib .\paper\refs.bib --tail-lines 80| Flag | Default | Meaning |
tex_path | — | .tex entry file (required) |
--engine | xelatex | LaTeX engine; use pdflatex for ASCII-only docs |
--bib | auto | .bib path; otherwise <stem>.bib or references.bib next to the .tex |
--no-bibtex | off | skip the bibtex pass |
--min-pages | 0 (off) | fail when the PDF has fewer pages |
--min-refs | 0 (off) | fail when fewer references are cited |
--tail-lines | 40 | log tail lines written to stderr |
--timeout | 300 | per-pass timeout in seconds |
What the script does
- Preflight:
.texexists, engine onPATH,.biblocated. - Optional citation gate: undefined
\citekeys and--min-refsare checked before spending build time. - Build passes:
xelatex→bibtex→xelatex→xelatex.xelatexreturns 0 even on minor issues, so only the final pass is allowed to fail hard. - PDF existence check, page-count parse from the log, warning extraction.
- stdout stays a single clean line (
Compiled: <pdf> (<n> KB, pages=<n>)); the verbose log tail and warnings go to stderr.
Exit codes
| Code | Meaning |
| 0 | success |
| 2 | .tex does not exist |
| 3 | engine not on PATH |
| 4 | no PDF produced |
| 5 | citation contract failed (undefined keys or --min-refs) |
| 6 | page contract failed (--min-pages) |
| 124 | a pass timed out |
| other | exit code of the final engine pass |
Common traps
- Stale
.aux/.bbl: if citations look wrong after a.bibedit, delete*.aux/*.bbland rebuild — the four-pass loop alone cannot always recover a corrupt aux. bibtexfails but PDF exists: reported as a warning, not a hard failure. Check the warning list forbibtex:lines before telling the user citations resolved.- CJK renders as boxes: the engine lacks a CJK font mapping. Add
\usepackage{xeCJK}+\setCJKmainfont{...}(orfontspecwith a CJK TTF) to the preamble; the script does not inject it. - Windows PATH: a freshly installed MiKTeX/TeX Live needs a new shell. If
Get-Command xelatexworks but the script reports exit 3, pass the absolute engine path by putting itsbinonPATHfirst. - Overfull hbox floods the tail: harmless warnings. Do not "fix" them by trimming the user's prose unless asked.
Related skills
../research-paper-writing/SKILL.md— drafting and polishing the manuscript itself.../arxiv/SKILL.md— fetching papers and generating BibTeX entries.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

