Skip to content
cccskills
FreePublished on GitHub

pdf2tex

Reconstruct editable LaTeX from PDF content using page-aware extraction and visual comparison. Preserve source evidence, flag uncertain math/tables/citations, and distinguish text extraction, OCR, reconstruction, and verified compilation.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (1)

  • SKILL.md5.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Establish the reconstruction target

Inspect the PDF, requested pages, available tools, and desired output. Determine whether the user wants content recovery or close visual reconstruction. Preserve the original PDF and write new artifacts to a separate destination.

A PDF may expose text, font names, coordinates, images, and metadata. It does not reliably encode its original document class, packages, macros, bibliography database, comments, or source-file boundaries. Font/creator metadata is evidence for a candidate setup, not proof of the original engine or class.

Extract evidence

When PyMuPDF is available, use the bundled helper from this skill's own directory. The following paths are relative to the repository root; for an installed skill, substitute its actual location. Dependency installation is separate from extraction.

python -m pip install -r pdf2tex/requirements.txt
python pdf2tex/scripts/extract_pdf.py paper.pdf --output extraction --pages 1-3,5 --images --render

The helper creates a new directory with report.html, text.txt, layout.json, and optional embedded images and whole-page PNG previews when requested. It records page numbers, raw text spans/font/position data, metadata, selected-page coverage, and warnings. It refuses existing output directories and refuses publication if the input fingerprint changes during extraction. Open report.html for offline page/text review; keep the entire directory together when sharing. It performs no OCR or conversion.

Read PDF extraction guide for API details, alternative readers, columns, fonts, and OCR. Sorted text is not guaranteed reading order; inspect page layouts and use coordinates. Images can be repeated or carry separate soft masks. Vector figures and composite panels often need a page crop or another export workflow. Use optional --render previews to inspect selected pages, including vector/composite figures; these are visual evidence, not OCR or segmented assets. --dpi accepts 72–300 with a per-page pixel limit.

Use optional --chars when inspecting scripts or small notation. It adds character origins/bounding boxes while retaining span text. Page geometry and rotation matrices help relate unrotated text coordinates to rendered previews; positions are evidence for candidate readings, not an automatic math parser.

A page without text may be blank, graphical, or scanned. Check it visually before choosing OCR. OCR requires separate tools and cannot establish the correctness of equations or tables. Retain page provenance and flag OCR-derived uncertainty. For a password-protected PDF, use an authorized readable copy.

Reconstruct without inventing content

Use structure detection to interpret blocks, math reconstruction for notation, and table reconstruction for cells and merged regions. These heuristics need comparison with the rendered original.

  • Select an available class and engine suitable for the target; state inferred choices. Use a supplied official author kit when exact publication layout is required.
  • Preserve selected-page coverage, section order, prose, equations, table values, captions, footnotes, and references. Escape LaTeX-special characters in prose without indiscriminately escaping math or generated commands.
  • Associate citation markers with bibliography entries only when the mapping is supported. Keep unmatched markers and uncertainty visible; do not invent bibliographic metadata or silently assign the nearest reference.
  • Preserve ambiguous glyphs, merged table cells, missing images, and illegible content as source evidence with % [UNCERTAIN: ...] or a visible placeholder. A comment alone must not hide missing content from the generated document.
  • Remove headers/footers or join hyphenated lines only after checking that they are layout artifacts. Preserve meaningful hyphens and repeated scientific text.
  • Do not guess original macros or file splitting. A self-contained source is a useful default, not a claim that it matches the original organization.

Build, compare, and deliver

Use the selected engine and actual bibliography backend, with additional passes for cross-references. latex-rescue can help when available. If tools or assets are unavailable, preserve the source and report compilation as unverified.

Compare the rendered reconstruction with the selected original pages: completeness, reading order, math symbols, tables, figure appearances, captions, and citations. Matching page counts does not establish fidelity. Check merged cells and OCR math manually, and distinguish a visual approximation from content verification.

Deliver the new source/assets, input version and selected pages, extraction and OCR methods actually used, inferred class/engine, build and visual-check results, and uncertainty locations. Separate recovered content from placeholders. Do not promise exact original source, perfect reconstruction, or immediate compilation. Use latex-polish or latex-fmt only for a further requested editing task.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What it does, one line>. Trigger phrases: <phrases>.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

Use this skill whenever the user wants to create or improve a presentation for an academic context — conference papers, seminar talks, thesis defenses, grant briefings, lab meetings, invited lectures, or any presentation where the audience will evaluate reasoning and evidence. Triggers include: 'conference talk', 'seminar slides', 'thesis defense', 'research presentation', 'academic deck', 'academic presentation'. Also triggers when the user asks to 'make slides' in combination with academic content (e.g., 'make slides for my paper on X', 'create a presentation for my dissertation defense', 'build a deck for my grant proposal'). This skill governs CONTENT and STRUCTURE decisions. For the technical work of creating or editing the .pptx file itself, also read the pptx SKILL.md.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

adapt

Free

Shortest English alias for web-adapt / universal-web-adaptation. Use this when adapting an unfamiliar public website generically before creating any site-specific rules.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

Use this skill to audit CLI adapter projects (like opencli) for missing output fields, then batch-generate fixes and submit PRs. Turns AI agents into adapter quality reviewers.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

ads

Free

Operate professional paid advertising across Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat, and X. Use for account intake, source-grounded audits, strategy, budget and measurement planning, creative production, experiments, reporting, monitoring, and explicitly approved campaign changes. Also trigger on PPC, paid social, retail media, attribution, tracking, landing pages, cross-platform conversion totals, negative keywords or search terms, beta-feature scoring, stale platform claims, API-token or credential setup, campaign deletion, and safe Claude Ads installation or uninstall.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

Audit Amazon Ads profiles, regions, Sponsored Products, Sponsored Brands, Sponsored Display, DSP, portfolios, targeting, search terms, retail readiness, creative, budgets, ACOS, TACOS, reporting, and policy. Use for Amazon Ads, sponsored ads, Amazon PPC, ACOS, TACOS, ASIN advertising, Amazon DSP, or retail-media optimization.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 23, 2026

See all skills by gabrielmoreira

Report a problem with this skill