OpenRaiser/PaperFit
📄 [Skill] Vision-in-the-loop LaTeX typesetting agent — auto-compile, render, diagnose, and fix paper layouts
PaperFit – Vision‑in‑the‑Loop Academic Typesetting Agent
What it is – PaperFit is an AI‑agent system that helps you polish the visual layout of LaTeX papers. It works with Claude Code, Codex and Cursor. You describe a goal in natural language (e.g., “fix the layout”, “migrate to the CVPR template”, “shrink to 8 pages”), and the agent runs a closed‑loop process:
- Compile the LaTeX project and parse the log.
- Render each PDF page to an image (via Poppler).
- Diagnose visual defects such as floating‑object piles, empty space, overfull boxes, inconsistent tables, etc.
- Plan source‑level fixes respecting template rules and a VTO taxonomy.
- Patch the
.texfiles only after explicit approval (--apply). - Re‑compile and repeat until the gatekeeper accepts the result.
The system is deliberately “vision‑in‑the‑loop”: it does not stop at a successful compile, but checks the look of the paper and iteratively improves it.
Core capabilities
| Capability | What it does |
|---|---|
| Visual layout diagnosis | Detects isolated lines, large blanks, double‑column holes, floating‑object congestion, table style mismatches, overflow, mis‑alignment. |
| Full VTO repair | End‑to‑end loop that compiles, renders, diagnoses, patches LaTeX, and re‑validates. |
| Template migration | Converts papers between common conference templates (CVPR, ICLR, ACL, ACM, …) while keeping figures, tables and references stable. |
| Page‑budget control | Adjusts layout to meet a target page count with minimal semantic changes. |
| Local object repair | Fixes a single table, figure, or formula without touching the rest of the manuscript. |
| Multi‑host distribution | Same capability can be installed as a Claude Code plugin, a Codex provider, or a Cursor rule set. |
Typical workflow (CLI / agent)
# 1. Install the CLI and host plugin
npm install -g paperfit-cli
paperfit-install --target claude # or codex / cursor
# 2. Run a health check and install Python deps
paperfit doctor --target claude
pip install -r $(npm root -g)/paperfit-cli/requirements.txt
# 3. Issue a natural‑language command (in the project root)
用 PaperFit 把这篇论文迁移到 CVPR 模板,并尽量保持图表和引用稳定
# or in English for Codex
Use the paperfit agent to compress the manuscript to 8 pages with minimal semantic change
# 4. PaperFit automatically:
# - finds the main .tex file
# - compiles → renders → diagnoses → proposes patches
# - shows a summary; you approve with `--apply`
# 5. After approval the agent patches the source, recompiles, and reports success.
Installation prerequisites
- Node.js 18+ (for the CLI and host plugins)
- Python 3.8+ (for the visual‑analysis scripts)
- Poppler (PDF → image conversion)
- A LaTeX engine (
tectonic,pdflatex, etc.) compatible with the target template.
On macOS: brew install poppler. Linux users install the corresponding package.
How to use
| Host | Entry command | Example request |
|---|---|---|
| Claude Code | /paperfit … |
/paperfit 用 PaperFit 分析 main.tex 的视觉排版问题 |
| Codex | Use the paperfit agent to … |
Use the paperfit agent to run a full layout repair loop |
| Cursor | Natural‑language task in the project | 用 PaperFit 把正文压到 8 页,尽量不要改学术内容 |
All actions are dry‑run by default. The agent only mutates source files when you add --apply (or the host gives explicit permission).
Architecture at a glance
- agents/ – definitions of the PaperFit agent (task orchestration, decision making).
- skills/ – reusable capability bundles (visual diagnosis, floating‑object optimization, template rules, semantic micro‑edits).
- config/ – template metadata, VTO taxonomy, layout rules.
- scripts/ – low‑level tools for PDF rendering, log parsing, defect aggregation, patch generation, gate‑keeping.
- bin/paperfit.js – CLI entry point used for installation, health checks, rendering, and invoking the agent.
Who benefits?
- Researchers who want a quick visual sanity‑check before submission.
- Authors migrating a paper to a new conference/journal template.
- Anyone needing to squeeze a manuscript into a strict page limit without altering scientific content.
License
MIT – see LICENSE.
All details are taken directly from the repository’s README; no additional features are inferred.
Related
- Project
- Project
- Project
- Project