paper-compilation — Claude Code skill: compile LaTeX to PDF
Compiles a LaTeX paper to PDF, catches build errors and checks citations and references. Useful when pdflatex throws errors and the log is a mess.
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a claude-codeWhat paper-compilation does
The skill runs the full pdflatex → bibtex → pdflatex → pdflatex pipeline and reports back: build status, page count, warnings, citation and reference stats. Before compiling you can validate the source — every \cite{key} has a matching .bib entry, every \includegraphics{file} exists, no duplicate labels.
Three scripts do the work. compile_paper.py builds the PDF and takes --check-style for chktex and --auto-fix, which calls fix_latex_errors.py and recompiles for up to 3 rounds. That fixer handles HTML tags left in LaTeX, mismatched environments and missing figures, with --dry-run and --auto-detect flags. If the build still fails, the skill reads the log and applies one minimal fix per round, up to 5 rounds.
You need pdflatex installed: brew install --cask mactex-no-gui on macOS, sudo apt install texlive-full on Ubuntu. Without it the scripts won't start, so check that first. The path to the main .tex file is passed as an argument.
What it helps with
- build a PDF from a LaTeX paper in one command
- find why pdflatex failed by reading the log
- verify every citation has a .bib entry
- fix HTML tags and mismatched environments in a .tex file
- check page count against a venue limit
Example prompts for the agent
- compile paper/main.tex to PDF and show the report
- run paper/main.tex with chktex style checking
- recompile with auto-fix: paper/main.tex --auto-fix
How to install paper-compilation
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a claude-code2Manually: put the files in place
~/.claude/skills/paper-compilation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/paper-compilation/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a codex2Manually: put the files in place
.agents/skills/paper-compilation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a cursor2Manually: put the files in place
.cursor/skills/paper-compilation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install lingzhi227/agent-research-skills paper-compilation2Manually: put the files in place
.github/skills/paper-compilation/SKILL.md1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a gemini-cli2Platform CLI
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/paper-compilationManually: put the files in place
.devin/skills/paper-compilation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about paper-compilation
How do I install paper-compilation in Claude?
Run npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a claude-code. The skill file then lives at ~/.claude/skills/paper-compilation/SKILL.md.
What does paper-compilation do?
It compiles a LaTeX paper to PDF through pdflatex and bibtex, validates citations and references, and fixes .tex errors before recompiling.
What do I need for it to work?
A working pdflatex. On macOS install it with brew install --cask mactex-no-gui, on Ubuntu with sudo apt install texlive-full.