Fetches an arXiv paper's LaTeX source instead of OCR-ing the PDF, extracts every display equation with its label, environment, and enclosing proposition, and renders each to MathML. Use when you need exact formulas to replicate a method, implement a loss function, verify numbers, or check claims against the authors' source.
Ships in arxiv-source-first. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Self-Evolving skill. If a step here fails or the tooling drifts, fix this file in the same change. The Post-Execution Reflection at the bottom says what to check.
The whole idea in one line: for an arXiv paper, the PDF is a rendering of something you can get losslessly, so do not read the rendering.
arxiv.org/e-print/<id> serves the authors' own LaTeX. It carries the exact formulas, their
\labels, and — critically — which formulas are stated propositions rather than intermediate
steps inside a proof. None of that survives into a PDF, so no vision model can recover it.
Measured on one real paper, OCR of the PDF reached 0.958 mean token similarity to the source and
only 49 % of its formulas compiled, against 98 % for the source. Full numbers, including a
systematic model defect that similarity cannot see, in
../../references/OCR-VERSUS-AUTHOR-LATEX-GROUND-TRUTH.md.
Identify yourself; arXiv asks for it and rate-limits anonymous bulk access.
ID=2605.00501
UA="your-project/1.0 (mailto:[email protected])"
mkdir -p /tmp/paper && cd /tmp/paper
curl -sSL -A "$UA" "https://export.arxiv.org/api/query?id_list=$ID" -o meta.xml
curl -sSL -A "$UA" "https://arxiv.org/e-print/$ID" -o eprint.tar.gz
mkdir -p src && tar xzf eprint.tar.gz -C src
If tar fails the e-print may be a single gzipped .tex — gunzip -c eprint.tar.gz > src/main.tex.
Papers withdrawn or submitted as PDF-only have no source; that is when you OCR, and the
unlimited-ocr plugin is the tool.
The tools live beside this file, under tools/ in this skill directory.
SKILL_DIR="$(dirname "$0")" # or the directory containing this SKILL.md
cargo run --release \
--manifest-path "$SKILL_DIR/tools/arxiv-latex-display-math-extractor/Cargo.toml" \
-- /tmp/paper/src > /tmp/paper/equations.json
Each record carries label, environment_name, enclosing_theorem_environment,
enclosing_theorem_title, is_boxed_by_authors, the verbatim LaTeX, and MathML.
Read enclosing_theorem_environment before you trust a formula. A formula inside proposition
is a stated result; the same-looking formula inside proof is a step in an argument. Implementing
the second as though it were the first is a silent error. is_boxed_by_authors is a strong signal
too — authors box the result they want you to take away.
bun run "$SKILL_DIR/tools/compile_each_formula_with_real_tex_engine.ts"
Requires TeX Live. Every formula compiles as its own minimal document, so one failure cannot cascade.
Do this even when the source is your only input. It catches author macros your extraction context lacks, and it is the only check that answers "can I use this" rather than "does this look right".
| Approach | Why it loses to the source |
|---|---|
| OCR the PDF with a vision model | Lossy by construction. Measured 49 % compile rate, and it invents fused commands like \neqi that read plausibly. |
pdftotext / PyMuPDF text layer | Cannot express mathematics at all — a displayed equation is glyph positioning, not a string. Returns broken fragments. |
| Ask a language model to recall the paper | No provenance, and the failure mode is confident fabrication of specific numbers. |
ar5iv.org/abs/<id> | Genuinely good, and it is LaTeXML over this same source. Use it to READ; use this to EXTRACT machine-readable records. |
For prose as well as formulas, latexml (the converter behind arXiv's own HTML) produces semantic
MathML, and pandoc -f latex -t html --mathml is far faster and usually sufficient. Both are
complements to step 2, not replacements: neither emits one record per equation with its proposition
context.
After this skill completes, check before closing:
.tex, PDF-only,
withdrawn), record the shape and the branch taken here so the next run does not rediscover it.unlimited-ocr.tools/arxiv-latex-display-math-extractor/Cargo.lock (opens in a new tab)tools/arxiv-latex-display-math-extractor/Cargo.toml (opens in a new tab)tools/arxiv-latex-display-math-extractor/src/main.rs (opens in a new tab)tools/compile_each_formula_with_real_tex_engine.ts (opens in a new tab)tools/latex-math-validity-oracle/Cargo.lock (opens in a new tab)tools/latex-math-validity-oracle/Cargo.toml (opens in a new tab)tools/latex-math-validity-oracle/src/main.rs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
arxiv, latex-source, mathml, equation-extraction, paper-ingest, scientific-papers
/arxiv-source-first:arxiv-source-first-paper-ingestfrom arxiv-source-first
npx claudepluginhub terrylica/cc-skills --plugin arxiv-source-firstOther plugins' skills for the same job