/papers:academic-pdf-to-mkdfrom Papers
Extracts academic PDFs into structured Markdown with figures, tables, and page thumbnails. Auto-selects engine (docling, pymupdf4llm, MinerU, poppler) per file based on layout, math density, and length. Includes OCR preflight for scanned papers.
Ships in Papers. 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; scripts run unread.
Extracts academic PDFs into structured Markdown, with figures, tables, and page thumbnails as separate artefacts. The orchestrator runs an OCR preflight, picks the right engine per file, and produces a consistent output tree regardless of engine.
| Engine | When chosen | Notes |
|---|---|---|
| docling (default for most papers) | Two-column papers, layout-heavy PDFs, fall-through case | MIT. MPS-accelerated. Best figures/tables. Writes a displayed equation it cannot read as <!-- formula-not-decoded -->; an auto run that finds one reruns the text with MinerU. |
| fast (pymupdf4llm) | Short (≤12 pp), dense, low-math, born-digital | AGPL. No model load — sub-second on small docs. |
| math (MinerU) | Math-symbol density ≥ 4% of word count | Apache-2.0 with usage thresholds. Strong on formulas. ~4.5 GB models, not bundled — first run downloads them (see below). |
| poppler (fallback) | Explicit --engine poppler when no Python venv | GPL. Deterministic, no models, weak structure. |
Auto-detection rules live in scripts/detect-engine.py — math-symbol ratio (∑∫∂∇... + numbered-equation markers), page count, and words-per-page.
Python deps via uv (per pyproject.toml), installed once into the plugin's data folder, which
survives plugin updates (the plugin's own folder is replaced on each update):
UV_PROJECT_ENVIRONMENT="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" uv sync --frozen --project "${CLAUDE_SKILL_DIR}"
This installs docling, pymupdf4llm, and mineru[all]. Python 3.11 to 3.13 is required, as the
pinned torch has no build for 3.14. uv uses an installed version or downloads one if needed,
so don't pass --python. The scripts use the environment named by PDF2MD_VENV, or otherwise
a .venv/ beside the skill. A plain uv sync in the skill's folder creates that environment
when the skill is used outside a plugin. If the scripts report a missing module, run the command
above first.
System tools:
brew install poppler ocrmypdf ghostscript
ocrmypdf is required for the OCR preflight on scan-only PDFs. ghostscript
is optional but useful for compressing repaired Zotero PDFs; everything else
degrades gracefully.
uv sync installs the code, not the model weights. Disk footprint per engine:
docling-models + docling-layout-heron), kept cached.opendatalab/PDF-Extract-Kit-1.0 + MinerU2.5-Pro), not pre-cached.The math engine's models are not bundled to keep the cache small. mineru-extract.sh
checks the HF cache ($HF_HOME or ~/.cache/huggingface/hub) first: if the opendatalab
models are absent it refuses to run rather than silently pulling ~4.5 GB. To proceed,
re-run with MINERU_ALLOW_DOWNLOAD=1; otherwise use --engine docling for non-math papers.
An auto run that chose docling also calls MinerU when docling leaves equations undecoded; without
the models, that run keeps docling's output and prints a warning.
Reclaim the space later with rm -rf ~/.cache/huggingface/hub/models--opendatalab--*.
PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/extract-pdf.sh" /path/to/paper.pdf
# or pin an engine
PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/extract-pdf.sh" /path/to/paper.pdf --engine docling
PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/extract-pdf.sh" /path/to/paper.pdf ~/out/paper-x --engine fast
Default output directory: ./output/<paper_id>/.
Use this branch when the deliverable should remain a searchable PDF for Zotero rather than Markdown.
PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/ocr-pdf-for-zotero.sh" /path/to/chapter.pdf
PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/ocr-pdf-for-zotero.sh" /path/to/chapter.pdf ~/out/chapter-zotero.pdf --split-spreads
Use --split-spreads for scanned book chapters where one PDF page contains
two printed pages. This produces one printed page per PDF page and prevents text
selection from crossing facing pages. Use --no-compress if Ghostscript
compression damages a particular scan.
Stage 0 ocr-preflight.sh Detect scan-only PDFs (< 100 words in pdftotext)
→ ocrmypdf -l eng --deskew --rotate-pages
Stage 1 detect-engine.py Choose docling | fast | math (skip if --engine ≠ auto)
Stage 2 <engine>-extract.{py,sh} Produce fulltext.md + figures/ + tables/
Stage 2b mineru-extract.sh Auto-chosen docling left <!-- formula-not-decoded -->:
MinerU's text and figures replace docling's
Stage 3 extract-pages.sh pdftoppm thumbnails (skipped if engine emits them)
Stage Z0 ocr-pdf-for-zotero.sh Run OCRmyPDF with deskew, rotation, and low rotation threshold
Stage Z1 split-copyfriendly-ocr-pdf Rebuild hidden text as whole-line invisible text
Stage Z2 --split-spreads optional Split two-up scans into one printed page per PDF page
Stage Z3 Ghostscript optional Compress the final PDF
Stage Z4 validation Word count, page count, raw text sample, preview PNGs
{output_dir}/
├── {paper_id}-fulltext.md # YAML frontmatter records engine used
├── pages/page-NNN.png # Page thumbnails
├── figures/
│ ├── {paper_id}-figure-NN.png
│ └── {paper_id}-figure-NN.md # Caption + TODO description
└── tables/
├── {paper_id}-table-NN.md # Markdown rendering + caption
└── {paper_id}-table-NN.csv # Raw data (docling only)
Tables are emitted as separate CSVs only by docling. fast and math engines keep tables inline in the fulltext markdown — read the engine field in the fulltext frontmatter to know which. After a Stage 2b rerun the frontmatter says engine: "mineru" with a rerun_from line, the fulltext has MinerU's inline tables, and tables/ and pages/ are still docling's.
This branch handles a different success criterion from Markdown extraction: Zotero needs a PDF that is searchable, selectable, and logically paged.
pdftotext input.pdf - | wc -w returns fewer than ~100 words.T h e r e i s.The wrapper uses this OCRmyPDF pattern:
ocrmypdf -l eng --deskew --rotate-pages --rotate-pages-threshold 1 \
--output-type pdf input.pdf output-ocr.pdf
The lower rotation threshold is useful when visual inspection shows that pages share one sideways orientation but OCRmyPDF leaves low-confidence pages unrotated.
Do not treat OCR success as only "words exist." Validate three layers:
pdftotext output.pdf - | wc -w should return a plausible word count.pdftotext -raw -f 1 -l 1 output.pdf - should not show spaced letters or merged words.If copied text appears as spaced characters, the OCR recognition may be fine
but the hidden text layer may be bad. Rebuild the text layer as line-level
invisible text with split-copyfriendly-ocr-pdf.py rather than using tightly
positioned character or word fragments.
If copied text or selection crosses facing pages, split the two-up spread. Move left-half OCR lines onto the left page and right-half OCR lines onto a new page with the right-half coordinates shifted to the new origin. Skip blank final halves.
Avoid horizontally squeezing invisible text to fit OCR boxes. It can make text extractors merge words. Prefer normal word spacing and reduce font size to fit long invisible lines inside their source line box.
pdfinfo output.pdf | sed -n '1,40p'
pdftotext output.pdf - | wc -w
pdftotext -raw -f 1 -l 1 output.pdf - | sed -n '1,80p'
pdftoppm -png -f 1 -l 1 -r 100 output.pdf previews/page
Visually inspect representative first, middle, and final pages, especially after rotation or spread splitting.
license-check check <pdf> --write <output_dir>/license.json. Exit code 3 means
the paper may not be processed here (a subscription copy from any publisher, or a manuscript
under review): stop, tell the user, and offer the open copy the card names. The licence-check
hook refuses the extraction command in that case anyway. The license.json makes any later
read of the output show the licence, and refuses it when the paper was refused.PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/extract-pdf.sh" <pdf> [output_dir]. Auto-detection picks the engine.{paper_id}-fulltext.md. Confirm headings parsed correctly and the engine in frontmatter matches expectations. If the run warned that the MinerU rerun failed, the equations are still <!-- formula-not-decoded -->: fix the cause it printed (usually the model download, MINERU_ALLOW_DOWNLOAD=1) and re-run with --engine math.--engine docling|fast|math|poppler if auto picked wrong.figures/*.md has a TODO: Describe figure placeholder. Use Vision to view the PNG and fill it in if the workflow needs it.paper-review workflow, move {paper_id}-fulltext.md into the review's working dir (e.g. paper-analysis/{paper_id}/).PDF2MD_VENV="${CLAUDE_PLUGIN_DATA}/pdf2md-venv" "${CLAUDE_SKILL_DIR}/scripts/ocr-pdf-for-zotero.sh" <pdf> [output_pdf].--split-spreads for two-up scanned book chapters.pdftotext -raw on pages where the user saw bad copy/paste.LICENSE (opens in a new tab)README.md (opens in a new tab)examples/example-figure-01.md (opens in a new tab)examples/example-fulltext.md (opens in a new tab)examples/example-table-01.md (opens in a new tab)pyproject.toml (opens in a new tab)scripts/clean-text.py (opens in a new tab)scripts/detect-engine.py (opens in a new tab)scripts/detect-tables.py (opens in a new tab)scripts/docling-extract.py (opens in a new tab)scripts/extract-figures.sh (opens in a new tab)scripts/extract-pages.sh (opens in a new tab)scripts/extract-pdf.sh (opens in a new tab)scripts/extract-tables.sh (opens in a new tab)scripts/extract-text.sh (opens in a new tab)scripts/mineru-extract.sh (opens in a new tab)scripts/ocr-pdf-for-zotero.sh (opens in a new tab)scripts/ocr-preflight.sh (opens in a new tab)scripts/pymupdf4llm-extract.py (opens in a new tab)scripts/split-copyfriendly-ocr-pdf.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub shocklab/co-scientist-toolkit --plugin papers8 skills in this plugin
/arxiv-fetcherFetch LaTeX source and PDF from arXiv papers. Use this skill whenever the user mentions an arXiv paper, arXiv ID, arXiv URL, or asks to download/fetch/pull/get a paper from arXiv. Also triggers when the user wants to read, review, or analyse an arXiv paper and you need to retrieve it first. Handles all arXiv ID formats (2301.12345, 2301.12345v2, hep-th/0601234, arxiv.org URLs). Downloads source .tex files and PDF. Works as a standalone tool or as a prerequisite for the paper-review skill./claim-fact-checkerFan-out fact-checking workflow that checks the claims its extractor lists in a deliverable against archived sources, with one isolated verifier subagent per claim plus a source-quality skeptic, and writes a findings + fix-plan pair. Use this whenever the user wants to fact-check, claims-audit, source-check, or verify a document or an academic paper review against its sources before committing or publishing. Trigger on phrases like "fact-check this report", "verify the claims", "audit the sources", "check this review against the paper", or when finishing a report or paper review that has a folder of sources. Built on Claude Code dynamic workflows, so it stays accurate on long deliverables where a single context window tends to degrade./library-searchSearch across the user's own papers on this machine: the Markdown that academic-pdf-to-mkd writes and the LaTeX that arxiv-fetcher downloads, indexed passage by passage with SQLite full-text search. Use when the user wants to find where a result, method, definition or phrase appears in their papers, asks which of their papers discusses something, wants a passage they half-remember, or wants a folder of converted papers made searchable. Triggers include: 'search my papers', 'which paper said', 'find where I read about', 'search the library', 'index these papers', 'is there anything in my papers on'. Refused papers (subscription papers and manuscripts under review, by the licence check's records) are found by title only, never by their text./paper-provenanceKeep a record tying each number and fact in a paper to the calculation, file or citation behind it, and check the manuscript against that record. Use whenever writing or editing results, tables, abstracts or any paper text that states numbers or facts, and before a paper is shared or submitted. Triggers include: 'where did this number come from', 'check the numbers in the paper', 'trace every number', 'is every figure sourced', 'provenance', 'are the numbers in the draft right', 'prepare for submission'. Works on .tex and .md manuscripts. Boundaries: whether a cited source supports a claim is claim-fact-checker; whether a reference exists is reference-verifier./paper-reviewMulti-agent academic paper review system. Use this skill whenever the user asks to review, critique, improve, or get feedback on an academic paper, manuscript, preprint, or draft. Triggers include: 'review my paper', 'critique this manuscript', 'find weaknesses in my paper', 'help me improve this draft', 'simulate peer review', 'what would reviewers say', 'prepare for submission', any mention of reviewing a .tex or .pdf paper, or requests to check a paper's theory, experiments, writing quality, or positioning before submission. Also triggers when the user wants to iteratively refine a paper through multiple review rounds. Works with LaTeX source (.tex files) or PDF. Supports venue-specific review rubrics (NeurIPS, ICML, ICLR, COLT, AAAI, JMLR, Nature, Science, PNAS, etc.)./reference-verifierVerify the references/bibliography of an academic paper. Use this skill whenever the user wants to check, verify, validate, audit, or sanity-check the references, citations, or bibliography of a paper, manuscript, or preprint. Triggers include: 'verify references', 'check the bibliography', 'are these citations real', 'find hallucinated citations', 'check for fake references', 'validate the bib file', 'audit citations', 'check DOIs', 'are the references correct', any mention of LLM-fabricated or AI-hallucinated citations, or requests to confirm that cited works actually exist before submission. Works with .tex and .bib source, and with PDF and Word manuscripts, whose reference list Claude transcribes into a .bib first. Performs existence checks, metadata cross-validation, DOI resolution, and duplicate/orphan detection; it does NOT verify whether the cited paper actually supports the claim.Other plugins' skills for the same job