Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Pdf2tex

ASecurity

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.

19 stars
0 votes
0 copies
0 views
Added 10/3/2026
researchpythonapidatabasebackend

Works with

api

Security Analysis

A96/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned 10/3/2026

$npx -y skills add gabrielmoreira/agent-skills-mirror --skill pdf2tex --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdf2tex?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pdf2tex
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-pdf2tex/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-pdf2tex)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: pdf2tex
description: 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.
metadata:
  version: "1.3.0"
---

## 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.

```sh
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](references/pdf-extraction-guide.md) 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](references/structure-detection.md) to interpret blocks,
[math reconstruction](references/math-reconstruction.md) for notation, and
[table reconstruction](references/table-reconstruction.md) 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.

Attribution

gabrielmoreiragabrielmoreira
View sourceSee grades on GitHubMore from gabrielmoreira →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Competitor Analysis

This skill provides comprehensive analysis of competitor SEO and GEO strategies, revealing what's working in your market and identifying opportunities to outperform the competition.

1823 votes

Deep Research

Universal deep research agent team. 13-agent pipeline for rigorous academic research on any topic. 8 modes: full research, quick brief, paper review, lit-review, fact-check, three-way literature scan, Socratic guided research dialogue, and systematic review with optional meta-analysis. Covers research question formulation, Socratic mentoring, methodology design, systematic literature search, source verification, cross-source synthesis, risk of bias assessment, meta-analysis, APA 7.0 report co...

502942 votes

Paperclip Distill

Use when an operation issue is a Paperclip cursor-window, distill, or backfill — `operationType: "distill"` or `"backfill"` and the body references a Paperclip source bundle for a project or root issue. Turn raw Paperclip activity into a wiki-insightful project page, decisions log, and history note. This skill exists specifically to replace the stiff, datestamp-heavy templated output that the deterministic distiller produces.

953191 votes

Academic Pipeline

Orchestrator for the full academic research pipeline: research -> write -> integrity check -> review -> revise -> re-review -> re-revise -> final integrity check -> finalize. Coordinates deep-research, academic-paper, and academic-paper-reviewer into a seamless 10-stage workflow with mandatory, coverage-bounded integrity checks, two-stage peer review, and auditable quality-assurance artifacts. Triggers on: academic pipeline, research to paper, full paper workflow, paper pipeline, end-to-end p...

502941 votes

Literature Review

Assistance with writing literature reviews by searching for academic sources via Semantic Scholar, OpenAlex, Crossref and PubMed APIs. Use when the user needs to find papers on a topic, get details for specific DOIs, or draft sections of a literature review with proper citations.

6511 votes
View all in research →