# Arxiv2md

> Convert arXiv papers to clean Markdown using the online arxiv2md REST API plus a light cleanup pass. Use when the user wants to read, fetch, convert, inspect, or summarize an arXiv paper without local pandoc, PDFs, source downloads, or a local arxiv2md CLI.

- **Type:** Skill
- **Install:** `agentstack add skill-deviesvi-skills-arxiv2md`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [DeviesVi](https://agentstack.voostack.com/s/deviesvi)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [DeviesVi](https://github.com/DeviesVi)
- **Source:** https://github.com/DeviesVi/skills/tree/master/arxiv2md

## Install

```sh
agentstack add skill-deviesvi-skills-arxiv2md
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# arxiv2md

Convert arXiv papers to LLM-ready Markdown through the online service at `https://arxiv2md.org`. The service parses arXiv's native HTML, not PDFs. Do not install or use the local `arxiv2md` CLI for this skill.

## Standard Workflow

1. Create an output directory for the arXiv ID.
2. Call the online Markdown endpoint with:
   - `frontmatter=true`
   - `remove_refs=false`
   - `remove_citations=false`
   - `remove_toc=true`
3. Save the raw API result as `.md`.
4. Run `scripts/clean_arxiv2md_markdown.py` to produce `.cleaned.md`.
5. Return both paths and note remaining conversion artifacts.

Prefer keeping citations. `remove_citations=true` can leave awkward empty text such as `Shor , Steane , and Knill`.

## REST API

Base URL: `https://arxiv2md.org`

No auth required. Rate limit: 30 requests/minute.

### Recommended Markdown Request

```bash
curl "https://arxiv2md.org/api/markdown?url=2501.11120&frontmatter=true&remove_refs=false&remove_citations=false&remove_toc=true"
```

Returns raw Markdown as plain text.

### JSON Metadata

```bash
curl "https://arxiv2md.org/api/json?url=2501.11120"
```

Returns `{ "arxiv_id", "title", "source_url", "content" }`.

## Cleanup Script

Use the bundled cleanup script after saving API output:

```powershell
uv run python \scripts\clean_arxiv2md_markdown.py .\1708.02246.md -o .\1708.02246.cleaned.md
```

When arxiv2md frontmatter mixes affiliations into the author list, pass corrected values:

```powershell
uv run python \scripts\clean_arxiv2md_markdown.py .\1708.02246.md -o .\1708.02246.cleaned.md --author "Christopher Chamberland" --author "Michael E. Beverland" --affiliation "Institute for Quantum Computing and Department of Physics and Astronomy, University of Waterloo" --affiliation "Station Q Quantum Architectures and Computation Group, Microsoft Research"
```

The cleanup pass handles common arxiv2md/ar5iv artifacts:

- Removes the generated TOC, where math alt-text is often noisy.
- Fixes duplicated `Abstract` text.
- Corrects common ar5iv visual math alt-text around simple inline formulas, including duplicated variables such as `v 𝑣 v`, hyphenated variables such as `distance- d 𝑑 d`, and one-variable numeric expressions such as `d + 1 𝑑 1 d+1` or `d = 5 𝑑 5 d=5`.
- Normalizes ar5iv delimiter fragments that many KaTeX renderers reject, such as `\big{(}`, `\big{)}`, `\big{\{}`, and `\big{|}`.
- Converts `Figure: ...` plus `Refer to caption: URL` blocks into Markdown images.
- Repairs double-wrapped display math such as `$$ $\displaystyle ...$ (1) $$`.
- Tidies theorem-like headings such as `Definition 1 .`.
- Converts definition/proof markers from Markdown headings into bold paragraphs, and removes empty duplicate definition anchors emitted by ar5iv.

## Parameters

Use these query parameters for both endpoints unless noted:

| Param | Recommended | Description |
| --- | --- | --- |
| `url` | required | arXiv URL or ID, such as `2501.11120v1` or `https://arxiv.org/abs/2501.11120` |
| `remove_refs` | `false` | Keep bibliography/references section |
| `remove_toc` | `true` | Remove generated table of contents |
| `remove_citations` | `false` | Keep inline citation text |
| `frontmatter` | `true` | Prepend YAML metadata, `/api/markdown` only |

## Notes

- The online service may still emit ar5iv artifacts in figure captions, footnotes, or complex math. Preserve the raw file beside the cleaned file for comparison.
- The cleanup script intentionally handles only conservative formula artifacts. For complex formulas, inspect the cleaned Markdown against the raw file or arXiv HTML before making semantic corrections.
- If a paper has broken or missing arXiv HTML, report the API failure and do not fall back to pandoc unless the user asks.

## Source & license

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

- **Author:** [DeviesVi](https://github.com/DeviesVi)
- **Source:** [DeviesVi/skills](https://github.com/DeviesVi/skills)
- **License:** MIT

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

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-deviesvi-skills-arxiv2md
- Seller: https://agentstack.voostack.com/s/deviesvi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
