pdf

Extract text and tables from PDFs and merge validated MCM/ICM submission documents.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/SPIRAL-EDWIN/Skills-for-Math-Modeling-MCM-ICM --skill pdf-spiral-edwin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/SPIRAL-EDWIN/Skills-for-Math-Modeling-MCM-ICM/tree/main/.github/skills/pdf
Command: npx skills add https://github.com/SPIRAL-EDWIN/Skills-for-Math-Modeling-MCM-ICM --skill pdf-spiral-edwin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, PyMuPDF, pandas, reportlab, pdf2image, pytesseract.

What problem does it solve? Academic competition teams waste hours manually reading reference papers and risk disqualification from formatting errors when assembling final PDF submissions under deadline pressure. ## Core Features & Use Cases - Literature Extraction: Pull text, tables, and equations from research PDFs using pypdf, pdfplumber, and PyMuPDF, with OCR fallback for scanned documents. - Submission Assembly: Merge control sheet, main paper, and code appendix into a single compliant PDF with optional separator pages. - Compliance Validation: Automatically check page limits (25 pages), font sizes (≥10pt), and control sheet presence before submission. - Use Case: During an MCM/ICM contest, batch-extract text from five reference papers in Hour 12, then at Hour 92 merge your control sheet, 22-page paper, and code appendix, and run validation to confirm the submission passes all checks. ## Quick Start Use the pdf skill to merge control_sheet.pdf, main_paper.pdf, and code_appendix.pdf into final_submission.pdf and validate it against MCM page limits.

Frequently Asked Questions about pdf

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

FAQPage Schema
How do I extract tables from a PDF in Python?▼

Use pdfplumber's page.extract_tables() method to detect table structures and return cell data, then convert results to a pandas DataFrame. For poorly formatted tables, crop the page to a bounding box before extraction.

How do I merge multiple PDF files into one document?▼

Use pypdf's PdfMerger class: append each PDF path in order, then call write() with the output path. This preserves page order, which matters for submissions requiring control sheet first, then paper, then appendix.

What is the difference between pypdf and pdfplumber?▼

pypdf handles basic text extraction, merging, and metadata, while pdfplumber preserves layout better and excels at table extraction. PyMuPDF (fitz) is preferred for rendering page regions as images, such as equations.

Can I extract text from a scanned PDF without selectable text?▼

Standard parsers cannot read scanned image PDFs. Convert pages to images with pdf2image, then run pytesseract OCR on each image to recover machine-readable text.

How do I check if a PDF exceeds a page limit?▼

Open the file with pypdf's PdfReader and count len(reader.pages), subtracting excluded pages like the control sheet or appendix. Compare the result against the limit, such as 25 pages for MCM main papers.

Why does equation extraction from PDFs produce garbled output?▼

PDFs often store equations as images or fragmented text glyphs, so text extraction fails. The reliable approach is rendering the equation region as an image with PyMuPDF and manually transcribing it to LaTeX.