math-extractor

Extract mathematical terms from PDFs and convert them to Markdown.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/Develata/Deve-Skills --skill math-extractor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: math-extractor
Source: https://github.com/Develata/Deve-Skills/tree/main/My-Skills/math-extractor
Command: npx skills add https://github.com/Develata/Deve-Skills --skill math-extractor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve?

Extracts strictly mathematical terms (Definitions, Theorems, Lemmas, Propositions, Proofs) from documents, handling PDF conversion and AI-based cleaning. Use when the user wants to extract math content from a file.

Core Features & Use Cases

  • Robust PDF Conversion: Uses MinerU for high-quality PDF to Markdown conversion.
  • Smart Chunking: Splits text by paragraphs to avoid breaking math formulas.
  • Cost Optimization: Heuristically filters out non-math chunks to save tokens.
  • Math Protection: Whitelists safe HTML tags to prevent accidental deletion of math inequalities (e.g., a < b).
  • Encoding Fallback: Automatically tries UTF-8, GBK, and Latin-1 encodings.
  • Retry Logic: Built-in retries for API calls to handle network instability.
  • Use Case: Imagine you have a scanned thesis in PDF or a collection of lecture notes; run this skill to extract all mathematical terms and compile them into a clean Markdown file.

Quick Start

Run the Python script with a document path and an output directory to produce a file named <filename>_extracted.md.

Frequently Asked Questions about math-extractor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract mathematical definitions and theorems from a PDF research paper?

You can extract math content from PDF, TEX, TXT, and Markdown files. The tool processes these formats by chunking text by paragraphs to avoid breaking formulas and applies AI-based cleaning to retain math inequalities.

Why does PDF to Markdown conversion break my math formulas and inequalities?

This tool requires the requests library and environment keys like EXTRACTION_API_KEY and EXTRACTION_BASE_URL. Optional keys include MINERU_API_KEY and MINERU_BASE_URL for high-quality PDF conversion, plus an optional LLM_MODEL configuration.

Can I use this tool to extract math terms from lecture notes with different encodings?

The tool handles network instability during API calls with built-in retry logic. This ensures that math extraction processes complete successfully even when connections to the extraction API fluctuate.

Does MinerU support high-quality PDF conversion for scanned thesis documents?

The tool skips non-math chunks heuristically to save tokens. It focuses on retaining strictly mathematical terms such as definitions, theorems, lemmas, propositions, and proofs, ensuring the final output is focused math content.