# Latex Compile QA

Compile a LaTeX project and run basic QA (missing refs, bib errors, broken citations)...

- Repository: https://github.com/WILLOSCAR/research-units-pipeline-skills (517 stars)
- Category: Documents
- License: see repository
- Last updated: 2026-10-05
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill latex-compile-qa -g -a claude-code -y`
Codex: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill latex-compile-qa -g -a codex -y`
Cursor: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill latex-compile-qa -g -a cursor -y`
Gemini CLI: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill latex-compile-qa -g -a gemini-cli -y`

## Description

Compile a LaTeX project and run basic QA (missing refs, bib errors, broken citations), producing `latex/main.pdf` and a build report.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# LaTeX Compile + QA

## Triggers & routing

- **Trigger**: latex compile, build PDF, LaTeX errors, missing refs, 编译PDF, 引用错误.
- **Use when**: 已有 `latex/main.tex`（通常来自 `latex-scaffold`），需要确认可编译并输出失败原因报告。


Compile the LaTeX project and produce a PDF (when the toolchain is available), plus a short build report.

This step is deterministic; if compilation fails, record actionable diagnostics rather than guessing.

## Inputs

- `latex/main.tex`
- `citations/ref.bib`

## Outputs

- `latex/main.pdf` (if compilation succeeds)
- `output/LATEX_BUILD_REPORT.md` (recommended)

## Workflow

1. Run a LaTeX build (e.g., `latexmk`) if available.
2. Fix missing packages, missing bib entries, and unresolved references.
3. Record remaining issues in a build report.

## Quality checklist

- [ ] `latex/main.pdf` exists only when compilation succeeds; failed builds must remove stale PDFs and explain the failure in `output/LATEX_BUILD_REPORT.md`.
- [ ] For `arxiv-survey-latex` deliverables: `latex/main.pdf` is >= 8 pages and has no undefined citations/references (strict gate).

## Script

### Quick Start

- `uv run python .codex/skills/latex-compile-qa/scripts/run.py --help`
- `uv run python .codex/skills/latex-compile-qa/scripts/run.py --workspace <workspace>`

### All Options

- See `--help` (inputs/outputs are taken from the unit runner when used via pipeline)

### Examples

- Compile + produce report:
  - `uv run python .codex/skills/latex-compile-qa/scripts/run.py --workspace <workspace>`

### Notes

- Uses `latexmk -xelatex -bibtex` when available.
- Always writes `output/LATEX_BUILD_REPORT.md` (success or failure).
- Report includes page count + warning summary when available.

## Troubleshooting

### Common Issues

#### Issue: `latexmk` not found

**Symptom**:
- Build report says “latexmk not found in PATH”.

**Causes**:
- LaTeX toolchain is not installed.

The rest: https://github.com/WILLOSCAR/research-units-pipeline-skills/blob/HEAD/.codex/skills/latex-compile-qa/SKILL.md
