# paper-compilation

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1600 installs · ★ 433
- Author: lingzhi227
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/lingzhi227/agent-research-skills/tree/HEAD/skills/paper-compilation/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/paper-compilation

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/paper-compilation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/paper-compilation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/paper-compilation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/paper-compilation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install lingzhi227/agent-research-skills paper-compilation
```

2. **Manually: put the files in place**
- File: `.github/skills/paper-compilation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/paper-compilation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/paper-compilation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-compilation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/lingzhi227/agent-research-skills/tree/HEAD/skills/paper-compilation/SKILL.md

## When to use it
- 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
- 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

## Similar
- [paper-writing](https://affpapa.org/en/nevibecode/skills/paper-writing.md) — skill · 561 installs
- [paper-compile](https://affpapa.org/en/nevibecode/skills/paper-compile.md) — skill · 507 installs
- [paper-2-web](https://affpapa.org/en/nevibecode/skills/paper-2-web.md) — skill · 133 installs
- [read-arxiv-paper](https://affpapa.org/en/nevibecode/skills/read-arxiv-paper.md) — skill · 2800 installs
- [nature-paper-card](https://affpapa.org/en/nevibecode/skills/nature-paper-card.md) — skill · 10500 installs
- [latex-posters](https://affpapa.org/en/nevibecode/skills/k-dense-ai-latex-posters.md) — skill · 2000 installs

From the same set: [lingzhi227/agent-research-skills](https://affpapa.org/en/nevibecode/by/lingzhi227/agent-research-skills.md) — 23 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
