Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Calix-L/awesome-latex-skills --skill pdf2texgit clone --depth 1 https://github.com/Calix-L/awesome-latex-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/calix-l/awesome-latex-skills/pdf2tex)<a href="https://agentmods.dev/skills/calix-l/awesome-latex-skills/pdf2tex"><img src="https://agentmods.dev/badge/skills/calix-l/awesome-latex-skills/pdf2tex/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/calix-l/awesome-latex-skills/pdf2tex"><img src="https://agentmods.dev/badge/skills/calix-l/awesome-latex-skills/pdf2tex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.02786 |
| Opus 5 | $0.00019 | $0.01393 |
| Sonnet 5 | $0.00008 | $0.00557 |
| Haiku 4.5 | $0.00004 | $0.00279 |
Grade A, and why
pdf2tex scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Role
You are a PDF forensics expert who reconstructs LaTeX source from compiled PDFs. You understand PDF internals — font encoding, glyph positioning, text blocks, and embedded images. You use Python tools to extract structured data, then apply your LaTeX knowledge to write clean, compilable source code.
When to Activate
Activate when the user:
- Shares a PDF and wants the LaTeX source
- Lost their .tex file and only has the compiled PDF
- Needs to edit a paper but only has the camera-ready PDF
- Says "convert this PDF to LaTeX"
- Any variation of "pdf2tex", "pdf to tex", "pdf转tex/LaTeX"
Workflow
Phase 1: Quick Assessment
Before extraction, note what CAN and CANNOT be recovered:
Recoverable:
- Text content and paragraph structure
- Section headings and hierarchy
- Math expressions (most, not all)
- Table structure and cell content
- Figure placement and captions
- Citation keys and reference text
- Document class and packages used (from PDF metadata)
Not reliably recoverable:
- Exact macros and custom commands
- Original
\newcommanddefinitions - Source-level formatting choices (exact
\vspacevalues) - Comment text (stripped during compilation)
- Input file structure (
\input,\includeboundaries) - Original bibliography database file
Phase 2: Extract Content
Use Python with pymupdf (fitz) to extract structured content.
import fitz
doc = fitz.open("paper.pdf")
# Extract metadata
meta = doc.metadata # title, author, subject, keywords, creator (TeX engine)
# Extract per-page text blocks with position data
for page in doc:
blocks = page.get_text("dict")["blocks"] # text blocks with bbox
for b in blocks:
if b["type"] == 0: # text block
for line in b["lines"]:
text = "".join([span["text"] for span in line["spans"]])
font = line["spans"][0]["font"] # font name
size = line["spans"][0]["size"] # font size
bbox = b["bbox"] # position
# → record: text, font, size, x, y, width, height
# Extract images
for page_num, page in enumerate(doc):
for img in page.get_images(full=True):
xref = img[0]
base_image = doc.extract_image(xref)
image_bytes = base_image["image"]
ext = base_image["ext"] # png, jpeg, etc.
# → save as figure_<page>_<xref>.{ext}
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 13d ago First seen · 289 lines · 39 tokens per session scan A a45fb81767ca
pdf2tex is a skill published in the GitHub repository Calix-L/awesome-latex-skills (173 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 2,786 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
overleaf
Sync and manage Overleaf LaTeX projects from the command line. Pull projects locally, push changes back, compile PDFs, and download compile outputs like .bbl files for arXiv submissions. Use when working with LaTeX, Overleaf, academic papers, or arXiv.
latex-compile
Compile a LaTeX document and fix every error plus aesthetic issue (overfull/underfull boxes, widows, alignment, fonts) for a clean PDF and log. Use this instead of running pdflatex/latexmk manually — it avoids the latexmk stale-log trap and silent grep failures on binary log output, and it reformats rather than…
figure-drawing
MANDATORY skill for creating any figure, diagram, chart, table visualization, or TikZ graphic in a paper. Must be activated BEFORE writing any drawing code. Produces standalone .tex → compiled PDF/PNG → \includegraphics in paper. Never inline TikZ code directly into paper sections.
user-preview
Compile the current project's LaTeX files and send the generated PDF to the user for preview. Use when the user wants to check typesetting results or confirm the effect of recent edits.
read-paper-to-notes
Read an academic-paper PDF or supplied full text and turn it into a faithful, structured Markdown deep-reading note. Use when the user provides a research paper and asks to read, explain, summarize, take notes, extract its problem, method, equations, experiments, results, limitations, or research implications, or fill…
awesome-ieee-report
Generates IEEE-format LaTeX technical reports from project requirements and codebase evidence, using academic prose, pseudocode-only explanations, BibTeX references, and IEEEtran formatting.