latex-rescue

latex-rescue is a skill for Claude Code, Codex from Calix-L/awesome-latex-skills. It costs 37 tokens per session (3,298 once invoked), scanned A, original, MIT.

A LaTeX troubleshooting tool for finding and fixing errors that stop a document from compiling. Compilation is the process that turns LaTeX source files into a finished PDF.

In plain words
What is it for?
Use it when a LaTeX paper will not compile, especially to diagnose control-sequence errors, math-mode mistakes, package conflicts, undefined references, and mismatched environments.
Why use it?
It helps explain cryptic error messages and locate problems such as missing brackets, conflicting packages, broken references, or commands used in the wrong context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when a LaTeX paper will not compile, especially to diagnose control-sequence errors, math-mode mistakes, package conflicts, undefined references, and mismatched environments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/calix-l/awesome-latex-skills/latex-rescue
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Calix-L/awesome-latex-skills --skill latex-rescue
Clone the repo
git clone --depth 1 https://github.com/Calix-L/awesome-latex-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for latex-rescue

README.md
[![agentmods](https://agentmods.dev/badge/skills/calix-l/awesome-latex-skills/latex-rescue/github.svg)](https://agentmods.dev/skills/calix-l/awesome-latex-skills/latex-rescue)
Your own site
<a href="https://agentmods.dev/skills/calix-l/awesome-latex-skills/latex-rescue"><img src="https://agentmods.dev/badge/skills/calix-l/awesome-latex-skills/latex-rescue/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for latex-rescue

Your own site · 80×15
<a href="https://agentmods.dev/skills/calix-l/awesome-latex-skills/latex-rescue"><img src="https://agentmods.dev/badge/skills/calix-l/awesome-latex-skills/latex-rescue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,298 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.03298
Opus 5 $0.00018 $0.01649
Sonnet 5 $0.00007 $0.00660
Haiku 4.5 $0.00004 $0.00330

Measured 13d ago against content hash 84a0d825c49e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

latex-rescue scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

latex-rescue/SKILL.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Role

You are a LaTeX debugging expert with deep knowledge of TeX error messages, common failure patterns, and systematic debugging methodology. You have access to comprehensive reference catalogs of known errors and their fixes.

When to Activate

Activate this skill when the user:

  • Mentions LaTeX compilation failure
  • Shows a LaTeX error message or log excerpt
  • Says their paper won't compile
  • Invokes you with /latex-rescue

Workflow

Phase 1: Quick Entry (Pasted Error Message)

If the user pastes an error message directly instead of pointing to a project directory:

  1. Extract the error type from the message
  2. Identify the offending file/line if present
  3. Ask the user to point you to the project directory for context
  4. Proceed to Phase 2

Phase 2: Gather Information

  1. Identify the main .tex file. If the project has main.tex, use that. Otherwise scan for .tex files containing \documentclass. If ambiguous, ask the user.

  2. Detect the LaTeX engine. Check the preamble for engine-specific packages:

    • \usepackage{fontspec} or \usepackage{polyglossia} → use xelatex or lualatex
    • \usepackage[utf8]{inputenc} + \usepackage[T1]{fontenc} → likely pdflatex
    • When in doubt, try pdflatex first (most common in CS academia)
  3. Run first compilation to capture the current state:

    pdflatex -interaction=nonstopmode -file-line-error main.tex 2>&1 | tee build.log
    

    (Replace pdflatex with xelatex or lualatex if detected in step 2.)

  4. If the project uses a bibliography backend, run that too:

    # For bibtex (traditional):
    bibtex main 2>&1 | tee -a build.log
    
    # For biber (biblatex projects):
    biber main 2>&1 | tee -a build.log
    

    Detect which backend: if preamble has \usepackage{biblatex}, use biber; if it has \bibliographystyle{...}, use bibtex.

Phase 3: Parse and Classify Errors

Read build.log (or the .log file). Extract every error. For each error, record:

  • File and line number
  • Error type (see classification below)
  • The offending source line
  • 10 lines of surrounding context (read from source)

Read the full file on GitHub · 302 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 302 lines · 37 tokens per session scan A 84a0d825c49e

Subscribe to this mod's changes

latex-rescue is a skill published in the GitHub repository Calix-L/awesome-latex-skills (173 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 3,298 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

overleaf

Sync and manage Overleaf LaTeX projects from the command line. Pull projects locally, push changes back, compile PDFs, and download compile outputs like .bbl files for arXiv submissions. Use when working with LaTeX, Overleaf, academic papers, or arXiv.

aloth/olcli · 62 tokens

latex-compile

Compile a LaTeX document and fix every error plus aesthetic issue (overfull/underfull boxes, widows, alignment, fonts) for a clean PDF and log. Use this instead of running pdflatex/latexmk manually — it avoids the latexmk stale-log trap and silent grep failures on binary log output, and it reformats rather than…

Mexregkan/claude-for-researchers · 79 tokens

figure-drawing

MANDATORY skill for creating any figure, diagram, chart, table visualization, or TikZ graphic in a paper. Must be activated BEFORE writing any drawing code. Produces standalone .tex → compiled PDF/PNG → \includegraphics in paper. Never inline TikZ code directly into paper sections.

nanoAgentTeam/research-claw · 62 tokens

user-preview

Compile the current project's LaTeX files and send the generated PDF to the user for preview. Use when the user wants to check typesetting results or confirm the effect of recent edits.

nanoAgentTeam/research-claw · 42 tokens

read-paper-to-notes

Read an academic-paper PDF or supplied full text and turn it into a faithful, structured Markdown deep-reading note. Use when the user provides a research paper and asks to read, explain, summarize, take notes, extract its problem, method, equations, experiments, results, limitations, or research implications, or fill…

yujie-jason-zhang/polish_skill · 116 tokens

awesome-ieee-report

Generates IEEE-format LaTeX technical reports from project requirements and codebase evidence, using academic prose, pseudocode-only explanations, BibTeX references, and IEEEtran formatting.

EnesDemir143/awesome-ieee-report · 41 tokens