PDF Extract — User-Defined Evidence Tables
Overview
The free analog of Elicit's "columns" feature. Point it at a stack of PDFs, declare the
columns you care about, and get back a tidy evidence table — one row per paper, one
column per question — as CSV or a Markdown table. Built for data extraction across a
corpus: literature screening, methods comparison, PICO/sample-size pulls, and review
evidence sheets.
Every input is normalized to clean Markdown via Microsoft MarkItDown (see the
alterlab-markitdown skill) before any column is extracted, so PDF, DOCX, PPTX, HTML, and
the other MarkItDown formats all work.
When to Use This Skill
- Extracting the same fields from many papers into a comparison table or spreadsheet.
- Building a data-extraction sheet for a review (sample size, design, intervention,
outcome, effect size, limitations).
- Screening a folder of PDFs into a CSV you can sort/filter.
- Any "make me a table where each row is a paper and each column is X" request.
This skill operates on documents you already have and produces a structured table, not
prose — use it after you have the papers.
Does NOT Trigger
| Scenario |
Use Instead |
| Searching databases to find papers, or writing the narrative synthesis |
alterlab-literature-review |
| Interrogating one PDF in depth (every section, figure, table, appendix) |
alterlab-pdf-explore |
| Just converting a document to Markdown |
alterlab-markitdown |
| Structured experimental data for papers you do not have on disk |
alterlab-bgpt-search |
| Managing the PDFs and their references in a Zotero library |
alterlab-pyzotero |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-literature-review) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Default Workflow (no API key)
The keyless path is the precise one: the script converts and drafts, and you read each paper.
- Convert and draft. Run the script with the default heuristic backend and
--markdown-dir:SCRIPT=scripts/extract_to_table.py # relative to this skill's directory
uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" papers/*.pdf \
--column "Sample size:how many participants were enrolled" \
--column "Design:study design randomised cohort survey interview" \
--column "Main finding:primary result reported" \
--column "Limitations:study limitations weaknesses" \
--markdown-dir converted/ --format md -o draft_table.md
uv resolves MarkItDown per call (no install step, no virtualenv). Each cell is the best keyword-matching sentence — a pointer, not an answer (it may be cut off, or empty when the paper uses other words).
- Read every converted paper (
converted/<stem>.md, with Read). For each column, confirm or replace the draft cell with the exact value the paper states — the number enrolled and the number analysed when they differ, the effect estimate with its metric and CI, the design as the authors name it.
- Mark silence explicitly. When a paper does not report a column (e.g. no limitations section), write "not reported" — never infer or invent it.
- Write the final table (Markdown, or CSV for Excel) with Write: one row per paper,
Source first, one column per attribute, and a short evidence quote or section name per cell when the user wants an audit trail. Spot-check a few numbers against the PDF pages (Read opens PDFs) when a conversion looks garbled.
- Say how the table was made. Under the table in your reply, state the extraction method: each document converted to Markdown with MarkItDown, the
--column "label:question" specs you ran (the question behind each column), that every cell was then checked against the converted paper, and the paths of the saved table and converted/ folder. A review's methods must report how data were extracted (PRISMA 2020 item 9), and the user needs the column questions to rerun or extend the sheet.
Checked on this skill's fixtures: the draft cell for Dlamini 2024 read "we enrolled 312 students on academic" (the sentence wraps), while the saved Markdown states "312 … 287 (92%) completed follow-up and were analysed" and "odds ratio 1.62, 95% CI 1.05 to 2.50" — the read step is what turns the draft into the right row.
Quick Start
SCRIPT=scripts/extract_to_table.py # relative to this skill's directory
# Drop a --with flag only where that package is already importable by the Python that runs it.
# Heuristic backend: use 'label:question' so the question carries the words the
# papers actually use — overlap is lexical, so a bare label like "Sample size"
# rarely matches "we enrolled 240 participants" (see Backends below).
uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" papers/*.pdf \
--column "Sample size:how many participants were enrolled" \
--column "Main finding:primary result reported" \
--column "Limitations:study limitations weaknesses" --format md --markdown-dir converted/
# Columns with explicit extraction questions, CSV to a file:
uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" a.pdf b.pdf \
--column "n:how many participants were enrolled" \
--column "effect:what was the main reported effect size" \
--format csv -o evidence.csv
# Optional unattended LLM batch extraction (OPENROUTER_API_KEY or OPENAI_API_KEY) —
# label-only columns are fine here, since the model reads the paper:
uv run --python ">=3.11" --with 'markitdown[all]' --with openai python "$SCRIPT" lit/*.pdf \
--columns "Population" "Intervention" "Outcome" --backend llm
Defining Columns
A column is a label plus the question that drives extraction. Two ways to declare:
| Spec form |
Meaning |
"Sample size" |
label == question; keywords come from the label |
"n:how many participants" |
label n, question how many participants |
Use --columns for a space-separated list of simple labels, and repeat --column for
specs that need an explicit question. Both combine; duplicate labels are rejected.
Backends
- heuristic (default, offline, keyless): for each column, scores Markdown sentences by
literal keyword overlap with the column spec and emits the best evidence snippet.
Deterministic — good for a first pass, screening, and reproducible runs, and the draft you
finish by reading the papers (Default Workflow above). Returns an empty cell when no
sentence shares a keyword.
Gotcha: matching is lexical, not semantic. A generic label like
"Sample size"
tokenizes to sample, size — which never appears in "we enrolled 240 participants", so
the cell comes back empty. For the heuristic backend, phrase columns as Label:question
where the question uses the words the papers actually use (participants, enrolled,
cohort, n=). Quantitative questions also get a small ranking bonus for sentences
containing digits when the question itself contains a digit or %. When you only have
generic labels, rely on the read step (or, if the user wants an unattended batch and has a
key, the llm backend).
- llm (optional, unattended batch): sends the converted Markdown (first 24,000 characters)
plus all column questions to an OpenAI-compatible endpoint for a concise per-column answer
(
N/A when the paper is silent). Use it only when the user asks for it or the corpus is too
large to read in the conversation. Requested without a key, the script exits 2 before
converting anything and names the keyless alternative; it never falls back silently.
With OPENROUTER_API_KEY set, requests go to OpenRouter;
otherwise OPENAI_API_KEY is sent to OPENAI_BASE_URL (or the OpenAI default) — each key
only ever goes to its own endpoint. The model ID follows the ALTERLAB_MODEL convention
(shared/model_env.md): $ALTERLAB_MODEL, else the dated default; override
per-run with --model (on a non-OpenRouter endpoint, pass a model ID it serves). Spot-check
LLM answers against the PDFs before they enter a review, since a confident wrong number
looks the same as a right one in the table.
Output
--format md → GitHub-flavored Markdown table (pipes in cell text are escaped).
--format csv → CSV via csv.DictWriter.
-o FILE writes to disk (UTF-8); otherwise the table goes to stdout.
--markdown-dir DIR also writes each converted document as DIR/<stem>.md for the read step.
The first column is always Source (the input filename); a file that fails conversion
yields an ERROR row so the table stays aligned.
Pipeline Fit
alterlab-pdf-extract sits downstream of paper discovery and upstream of synthesis:
- Find papers — database/search skills (
alterlab-literature-review, search backends).
- Extract the evidence table — this skill.
- Synthesize / write up —
alterlab-literature-review, alterlab-paper-writer.
Files
scripts/extract_to_table.py — the CLI. --help lists every flag; --columns /
--column define the table; --backend, --markdown-dir, --format, --model, -o
control extraction and output.
Part of the AlterLab Academic Skills suite.
1---2name: alterlab-pdf-extract3description: Free Elicit-columns analog — ingest N PDFs (or any MarkItDown-supported document) and build a per-paper evidence table with user-defined columns, one row per paper and one column per attribute/question you want pulled from every source. Use when extracting structured data across many papers into a comparison table or data-extraction sheet (sample size, methods, main finding, effect, population/intervention/outcome, limitations), screening a corpus into a spreadsheet, or pulling the same fields from a stack of PDFs into CSV/Markdown. Keyless by default — MarkItDown conversion, an offline heuristic draft of every cell, then Claude reads each converted paper to confirm or fill the cells exactly; an LLM API batch backend is optional. Part of the AlterLab Academic Skills suite.4allowed-tools: Read Write Edit Bash5license: MIT6compatibility: No API key required. MarkItDown >= 0.1 converts each document (run the script as uv run --with 'markitdown[all]' python ...), the offline heuristic backend drafts the cells, and Claude reads the saved Markdown (--markdown-dir) to finish them. Optional llm batch backend - the openai client (add --with openai) plus OPENROUTER_API_KEY or OPENAI_API_KEY with OPENAI_BASE_URL - sends paper text to that endpoint.7metadata:8 source: https://skillmd.com/skills/alterlab-ieu/alterlab-pdf-extract9 skill-author: AlterLab10 version: "1.1.1"11 last_updated: "2026-11-04"12 credentials: "optional: OPENROUTER_API_KEY or OPENAI_API_KEY (the --backend llm unattended batch mode, which sends paper text to that endpoint). Not needed for precise cells: by default Claude reads the converted Markdown itself"13---1415# PDF Extract — User-Defined Evidence Tables1617## Overview1819The free analog of Elicit's "columns" feature. Point it at a stack of PDFs, declare the20columns you care about, and get back a tidy evidence table — **one row per paper, one21column per question** — as CSV or a Markdown table. Built for data extraction across a22corpus: literature screening, methods comparison, PICO/sample-size pulls, and review23evidence sheets.2425Every input is normalized to clean Markdown via Microsoft **MarkItDown** (see the26`alterlab-markitdown` skill) before any column is extracted, so PDF, DOCX, PPTX, HTML, and27the other MarkItDown formats all work.2829## When to Use This Skill3031- Extracting the **same fields from many papers** into a comparison table or spreadsheet.32- Building a data-extraction sheet for a review (sample size, design, intervention,33 outcome, effect size, limitations).34- Screening a folder of PDFs into a CSV you can sort/filter.35- Any "make me a table where each row is a paper and each column is X" request.3637This skill operates on documents you already have and produces a structured table, not38prose — use it *after* you have the papers.3940### Does NOT Trigger4142| Scenario | Use Instead |43|----------|-------------|44| Searching databases to find papers, or writing the narrative synthesis | `alterlab-literature-review` |45| Interrogating one PDF in depth (every section, figure, table, appendix) | `alterlab-pdf-explore` |46| Just converting a document to Markdown | `alterlab-markitdown` |47| Structured experimental data for papers you do not have on disk | `alterlab-bgpt-search` |48| Managing the PDFs and their references in a Zotero library | `alterlab-pyzotero` |4950**Hand-off rule.** When the request matches a row above, open your answer by naming that skill by its exact id (for example `alterlab-literature-review`) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.5152## Default Workflow (no API key)5354The keyless path is the precise one: the script converts and drafts, and **you** read each paper.55561. **Convert and draft.** Run the script with the default heuristic backend and `--markdown-dir`:57 ```bash58 SCRIPT=scripts/extract_to_table.py # relative to this skill's directory59 uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" papers/*.pdf \60 --column "Sample size:how many participants were enrolled" \61 --column "Design:study design randomised cohort survey interview" \62 --column "Main finding:primary result reported" \63 --column "Limitations:study limitations weaknesses" \64 --markdown-dir converted/ --format md -o draft_table.md65 ```66 uv resolves MarkItDown per call (no install step, no virtualenv). Each cell is the best keyword-matching sentence — a pointer, not an answer (it may be cut off, or empty when the paper uses other words).672. **Read every converted paper** (`converted/<stem>.md`, with Read). For each column, confirm or replace the draft cell with the exact value the paper states — the number enrolled *and* the number analysed when they differ, the effect estimate with its metric and CI, the design as the authors name it.683. **Mark silence explicitly.** When a paper does not report a column (e.g. no limitations section), write "not reported" — never infer or invent it.694. **Write the final table** (Markdown, or CSV for Excel) with Write: one row per paper, `Source` first, one column per attribute, and a short evidence quote or section name per cell when the user wants an audit trail. Spot-check a few numbers against the PDF pages (Read opens PDFs) when a conversion looks garbled.705. **Say how the table was made.** Under the table in your reply, state the extraction method: each document converted to Markdown with MarkItDown, the `--column "label:question"` specs you ran (the question behind each column), that every cell was then checked against the converted paper, and the paths of the saved table and `converted/` folder. A review's methods must report how data were extracted (PRISMA 2020 item 9), and the user needs the column questions to rerun or extend the sheet.7172Checked on this skill's fixtures: the draft cell for Dlamini 2024 read "we enrolled 312 students on academic" (the sentence wraps), while the saved Markdown states "312 … 287 (92%) completed follow-up and were analysed" and "odds ratio 1.62, 95% CI 1.05 to 2.50" — the read step is what turns the draft into the right row.7374## Quick Start7576```bash77SCRIPT=scripts/extract_to_table.py # relative to this skill's directory78# Drop a --with flag only where that package is already importable by the Python that runs it.7980# Heuristic backend: use 'label:question' so the question carries the words the81# papers actually use — overlap is lexical, so a bare label like "Sample size"82# rarely matches "we enrolled 240 participants" (see Backends below).83uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" papers/*.pdf \84 --column "Sample size:how many participants were enrolled" \85 --column "Main finding:primary result reported" \86 --column "Limitations:study limitations weaknesses" --format md --markdown-dir converted/8788# Columns with explicit extraction questions, CSV to a file:89uv run --python ">=3.11" --with 'markitdown[all]' python "$SCRIPT" a.pdf b.pdf \90 --column "n:how many participants were enrolled" \91 --column "effect:what was the main reported effect size" \92 --format csv -o evidence.csv9394# Optional unattended LLM batch extraction (OPENROUTER_API_KEY or OPENAI_API_KEY) —95# label-only columns are fine here, since the model reads the paper:96uv run --python ">=3.11" --with 'markitdown[all]' --with openai python "$SCRIPT" lit/*.pdf \97 --columns "Population" "Intervention" "Outcome" --backend llm98```99100## Defining Columns101102A column is a **label** plus the **question** that drives extraction. Two ways to declare:103104| Spec form | Meaning |105|-----------|---------|106| `"Sample size"` | label == question; keywords come from the label |107| `"n:how many participants"` | label `n`, question `how many participants` |108109Use `--columns` for a space-separated list of simple labels, and repeat `--column` for110specs that need an explicit question. Both combine; duplicate labels are rejected.111112## Backends113114- **heuristic** (default, offline, keyless): for each column, scores Markdown sentences by115 **literal keyword overlap** with the column spec and emits the best evidence snippet.116 Deterministic — good for a first pass, screening, and reproducible runs, and the draft you117 finish by reading the papers (Default Workflow above). Returns an empty cell when no118 sentence shares a keyword.119 **Gotcha:** matching is lexical, not semantic. A generic label like `"Sample size"`120 tokenizes to `sample`, `size` — which never appears in "we enrolled 240 participants", so121 the cell comes back empty. For the heuristic backend, phrase columns as `Label:question`122 where the question uses the **words the papers actually use** (`participants`, `enrolled`,123 `cohort`, `n=`). Quantitative questions also get a small ranking bonus for sentences124 containing digits when the question itself contains a digit or `%`. When you only have125 generic labels, rely on the read step (or, if the user wants an unattended batch and has a126 key, the `llm` backend).127- **llm** (optional, unattended batch): sends the converted Markdown (first 24,000 characters)128 plus all column questions to an OpenAI-compatible endpoint for a concise per-column answer129 (`N/A` when the paper is silent). Use it only when the user asks for it or the corpus is too130 large to read in the conversation. Requested without a key, the script exits 2 before131 converting anything and names the keyless alternative; it never falls back silently.132 With `OPENROUTER_API_KEY` set, requests go to OpenRouter;133 otherwise `OPENAI_API_KEY` is sent to `OPENAI_BASE_URL` (or the OpenAI default) — each key134 only ever goes to its own endpoint. The model ID follows the **ALTERLAB_MODEL** convention135 (`shared/model_env.md`): `$ALTERLAB_MODEL`, else the dated default; override136 per-run with `--model` (on a non-OpenRouter endpoint, pass a model ID it serves). Spot-check137 LLM answers against the PDFs before they enter a review, since a confident wrong number138 looks the same as a right one in the table.139140## Output141142- `--format md` → GitHub-flavored Markdown table (pipes in cell text are escaped).143- `--format csv` → CSV via `csv.DictWriter`.144- `-o FILE` writes to disk (UTF-8); otherwise the table goes to stdout.145- `--markdown-dir DIR` also writes each converted document as `DIR/<stem>.md` for the read step.146147The first column is always `Source` (the input filename); a file that fails conversion148yields an `ERROR` row so the table stays aligned.149150## Pipeline Fit151152`alterlab-pdf-extract` sits downstream of paper discovery and upstream of synthesis:1531541. Find papers — database/search skills (`alterlab-literature-review`, search backends).1552. **Extract the evidence table — this skill.**1563. Synthesize / write up — `alterlab-literature-review`, `alterlab-paper-writer`.157158## Files159160- `scripts/extract_to_table.py` — the CLI. `--help` lists every flag; `--columns` /161 `--column` define the table; `--backend`, `--markdown-dir`, `--format`, `--model`, `-o`162 control extraction and output.163164Part of the AlterLab Academic Skills suite.