AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Pdf To Markdown

skill-yhbcode000-paper-share-skills-pdf-to-markdown · by yhbcode000

Convert a PDF (especially academic papers) to clean Markdown using MinerU — preserves reading order, LaTeX equations, tables, and figures, and runs on the GPU. Use when the user asks to convert/extract a PDF to markdown/text. Invoke directly — no need for the user to type the skill name.

No reviews yet
0 installs
19 views
0.0% view→install

Install

$ agentstack add skill-yhbcode000-paper-share-skills-pdf-to-markdown

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-yhbcode000-paper-share-skills-pdf-to-markdown)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
21d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Pdf To Markdown? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

PDF → Markdown (MinerU)

Converts PDFs to clean, structure-preserving Markdown using MinerU (opendatalab/MinerU), the highest-fidelity open-source engine for academic papers. Runs the pipeline backend on the GPU (CUDA). Output keeps heading hierarchy, inline LaTeX math ($...$), figures, and tables (as HTML).

When to use

  • The user asks to "convert / extract / turn this PDF into markdown (or text)."
  • Best fit: academic papers — multi-column layouts, LaTeX math, tables, references.
  • Also handles images, .docx, .pptx, .xlsx (pass the file directly).

How to run

MinerU lives in a dedicated isolated env and is driven through the bundled convert.py wrapper, which calls MinerU's Python API in-process.

> Do not use the mineru CLI here — in 3.4.0 it spins up a local API server > that returns 502 Bad Gateway on Windows. The wrapper bypasses that.

"$MINERU_PYTHON" \
  "/pdf-to-markdown/convert.py" \
  "" "" --lang en

- Arg 1 — input file (pdf/image/docx/pptx/xlsx).
- Arg 2 — output directory.
- `--lang` — OCR language hint: `en` for English, `ch` for Chinese/mixed (default `ch`,
  which also handles English). Only affects OCR'd (scanned) pages.
- The script prints `DONE -> ` on success.

### Output layout

//auto/.md # the markdown //auto/images/ # extracted figures (referenced from the md) //auto/_*.json # layout/content metadata (can be ignored)


## After converting

1. Read the printed `DONE -> ...md` path and report it to the user.
2. Optionally show a short preview (title + first headings).
3. Note where extracted images were written.
4. Quality is normally high: headings as `#`, inline math as `$...$`, tables as
   `` HTML (with LaTeX inside cells). If a scanned PDF comes out garbled,
   re-run with `--method ocr`.

## Preflight / setup (only if something is missing)

- Interpreter with MinerU (env `MINERU_PYTHON`, default `python`).
- Verify CUDA: `$MINERU_PYTHON -c "import torch; print(torch.cuda.is_available())"` → `True`.
- Models are pre-downloaded to `~/.cache/huggingface/hub/` (one-time).

If the env is missing, recreate it (install `uv` first if needed):

uv venv --python 3.12 "" uv pip install --python "/Scripts/python.exe" torch torchvision --index-url https://download.pytorch.org/whl/cu124 uv pip install --python "/Scripts/python.exe" -U "mineru[core]" "/Scripts/mineru-models-download.exe" -s huggingface -m pipeline

Then set `MINERU_PYTHON` to `/Scripts/python.exe` (Windows) or
`/bin/python` (macOS/Linux). On macOS/Linux the models-download binary is
`mineru-models-download` (no `.exe` suffix).

## Troubleshooting
- **`cuda.is_available()` is False** → reinstall torch from the `cu124` index (see setup).
  The pipeline still runs on CPU if needed, just slower.
- **Model download fails / slow** → re-run `mineru-models-download` with `-s modelscope`.
- **Scanned PDF garbled** → add `--method ocr` to the `convert.py` call.
- **`vlm-engine` / `hybrid-engine` backends** → these need vLLM/SGLang (Linux); they 502
  on Windows. Stick with the default `pipeline` backend used by the wrapper.

## Lightweight fallback (simple / Office docs)

For non-paper files where layout fidelity doesn't matter, Microsoft's **MarkItDown**
is faster and simpler — but it mangles academic two-column PDFs and tables, so prefer
MinerU for papers:

"$MINERUPYTHON" -m pip install markitdown "$MINERUPYTHON" -m markitdown "" > out.md


## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [yhbcode000](https://github.com/yhbcode000)
- **Source:** [yhbcode000/paper-share-skills](https://github.com/yhbcode000/paper-share-skills)
- **License:** Apache-2.0
- **Homepage:** https://blog.yhbcode000.tech/paper-share-skills/

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.