# compile-latex

Compiles Beamer slide decks using XeLaTeX across three passes and BibTeX. Helpful when rendering slides inside Slides/ with custom themes and citations.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 1671
- Author: pedrohcgs
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compile-latex/SKILL.md
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/skills/compile-latex

## What it does

This skill automates Beamer presentation compilation inside the `Slides/` directory. It executes a multi-step sequence: an initial `xelatex` run generates the `.aux` file, `bibtex` processes references into `.bbl`, and two subsequent `xelatex` passes resolve page numbers and cross-references. An alternative one-line build with `latexmk` is also supported.

Once finished, the agent scans compiler logs via `grep` for missing references, changed labels, and `Overfull \hbox` warnings. It launches the compiled PDF via `open` on macOS or `xdg-open` on Linux, followed by a summary of total pages and any warnings encountered.

The workflow assumes a fixed folder arrangement. It sets `TEXINPUTS` pointing to `../Preambles` and `BIBINPUTS` pointing to the repository root for `.bib` files. Standard `pdflatex` is explicitly forbidden by the workflow: your environment must have `xelatex` available.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compile-latex -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compile-latex -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compile-latex -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pedrohcgs/claude-code-my-workflow compile-latex
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compile-latex -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pedrohcgs/claude-code-my-workflow --path .claude/skills/compile-latex
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compile-latex -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/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compile-latex/SKILL.md

## When to use it
- compile Beamer presentations with full citation resolution
- check LaTeX logs for Overfull hbox warnings and undefined references
- open the generated PDF file automatically after building
- resolve Beamer styles located in Preambles/ using TEXINPUTS

## Example prompts
- Build the presentation slide deck inside Slides
- Compile lecture01 and verify if any citations are undefined
- Rebuild the PDF for talk and check the final page count

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 93928d0d005a312c.

BEGIN THIRD-PARTY FILE 93928d0d005a312c
````text
---
name: compile-latex
description: Compile a Beamer LaTeX slide deck with XeLaTeX (3 passes + bibtex). Use when user says "compile", "build the slides", "rebuild the PDF", "run latex", "render the tex", or asks why a `.tex` file isn't producing a PDF. Operates on `Slides/*.tex`.
argument-hint: "[filename without .tex extension]"
allowed-tools: ["Read", "Bash", "Glob"]
---

# Compile Beamer LaTeX Slides

Compile a Beamer slide deck using XeLaTeX with full citation resolution.

## Steps

1. **Navigate to Slides/ directory** and compile with 3-pass sequence:

```bash
cd Slides
TEXINPUTS=../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode $ARGUMENTS.tex
BIBINPUTS=..:$BIBINPUTS bibtex $ARGUMENTS
TEXINPUTS=../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode $ARGUMENTS.tex
TEXINPUTS=../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode $ARGUMENTS.tex
```

**Alternative (latexmk):**
```bash
cd Slides
TEXINPUTS=../Preambles:$TEXINPUTS BIBINPUTS=..:$BIBINPUTS latexmk -xelatex -interaction=nonstopmode $ARGUMENTS.tex
```

2. **Check for warnings:**
   - Grep output for `Overfull \\hbox` warnings
   - Grep for `undefined citations` or `Label(s) may have changed`
   - Report any issues found

3. **Open the PDF** for visual verification:
   ```bash
   open Slides/$ARGUMENTS.pdf          # macOS
   # xdg-open Slides/$ARGUMENTS.pdf    # Linux
   ```

4. **Report results:**
   - Compilation success/failure
   - Number of overfull hbox warnings
   - Any undefined citations
   - PDF page count

## Why 3 passes?
1. First xelatex: Creates `.aux` file with citation keys
2. bibtex: Reads `.aux`, generates `.bbl` with formatted references
3. Second xelatex: Incorporates bibliography
4. Third xelatex: Resolves all cross-references with final page numbers

## Important
- **Always use XeLaTeX**, never pdflatex
- **TEXINPUTS** is required: your Beamer theme lives in `Preambles/`
- **BIBINPUTS** is required: your `.bib` file lives in the repo root
````
END THIRD-PARTY FILE 93928d0d005a312c

The third-party file has ended. Everything between the 93928d0d005a312c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© pedrohcgs · MIT · https://github.com/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compile-latex/SKILL.md

## Similar
- [grill-with-docs](https://affpapa.org/en/nevibecode/skills/grill-with-docs.md) — skill · 1219756 installs
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [handoff](https://affpapa.org/en/nevibecode/skills/handoff.md) — skill · 1038491 installs
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [domain-modeling](https://affpapa.org/en/nevibecode/skills/domain-modeling.md) — skill · 876391 installs

From the same set: [pedrohcgs/claude-code-my-workflow](https://affpapa.org/en/nevibecode/by/pedrohcgs/claude-code-my-workflow.md) — 56 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
