# Papyrus Diagnose Compilation

Diagnose and fix LaTeX compilation failures.

- Repository: https://github.com/kirodotdev/KiroCrew (4711 stars)
- Category: Documents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add kirodotdev/KiroCrew --skill papyrus-diagnose-compilation -g -a claude-code -y`
Codex: `npx skills add kirodotdev/KiroCrew --skill papyrus-diagnose-compilation -g -a codex -y`
Cursor: `npx skills add kirodotdev/KiroCrew --skill papyrus-diagnose-compilation -g -a cursor -y`
Gemini CLI: `npx skills add kirodotdev/KiroCrew --skill papyrus-diagnose-compilation -g -a gemini-cli -y`

## Description

Diagnose and fix LaTeX compilation failures. Use when the document does not compile, pdflatex/bibtex/biber/tectonic errors out, the PDF is stale, or the author reports a build/compile error in the Papyrus editor.

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

# Diagnose LaTeX Compilation

Turn a failed build into a located, classified, minimally-fixed error. Never
mass-rewrite the source to "make it compile", find the one thing that broke.

In Papyrus the app owns compilation (Cmd+S / Ctrl+S) and shows the AUTHOR a
clickable diagnostics list. You cannot see that list: read the compiler log the
app leaves in the project's top-level directory (`<main>.log`, named after the
main `.tex`), or ask the author to paste the error. Do not run the compiler
yourself in Papyrus (see `papyrus-writing`). Running the compiler directly
applies only outside the app.

## Step 1, Read the FIRST real error
Work from the first error, not the last: LaTeX errors cascade, and the tail of
the log is usually damage from the head. The app's list is grouped by kind
(`file:line` errors, then `!` errors, then warnings, then boxes), not log order,
and is parsed from only the last 20,000 characters of the final pass, so its top
row may not be the first error; the `.log` on disk is complete. In a raw log, the first `file:line: message` (or `! …`) line is the
one to fix.

`-file-line-error` makes a compiler print `file:line: message`. If citations/refs
are wrong (not the compile itself), the full cycle is `pdflatex → bibtex`/`biber`
`→ pdflatex → pdflatex`; Tectonic runs that cycle itself. In Papyrus, when the
app compiles with `pdflatex` it runs the `bibtex` cycle for you if the document
cites anything, but never `biber`: a `biblatex` document on the biber backend
will not resolve its citations there, tell the author rather than editing
around it.

The rest: https://github.com/kirodotdev/KiroCrew/blob/HEAD/src/kiro_crew/builtin_skills/papyrus-diagnose-compilation/SKILL.md
