{"id":51492288,"url":"https://github.com/openraiser/paperfit","last_synced_at":"2026-07-26T08:01:26.948Z","repository":{"id":360417531,"uuid":"1176901361","full_name":"OpenRaiser/PaperFit","owner":"OpenRaiser","description":"📄 [Skill] Vision-in-the-loop LaTeX typesetting agent — auto-compile, render, diagnose, and fix paper layouts","archived":false,"fork":false,"pushed_at":"2026-06-22T05:25:42.000Z","size":98175,"stargazers_count":316,"open_issues_count":1,"forks_count":22,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-06-22T07:22:04.855Z","etag":null,"topics":["academic-paper","agent","automation","claude-code","codex","cursor","latex","layout","paper-writing","pdf","typesetting","vision"],"latest_commit_sha":null,"homepage":"https://openraiser.github.io/PaperFit/","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenRaiser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-09T13:50:09.000Z","updated_at":"2026-06-22T05:25:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/OpenRaiser/PaperFit","commit_stats":null,"previous_names":["openraiser/paperfit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OpenRaiser/PaperFit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRaiser%2FPaperFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRaiser%2FPaperFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRaiser%2FPaperFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRaiser%2FPaperFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenRaiser","download_url":"https://codeload.github.com/OpenRaiser/PaperFit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRaiser%2FPaperFit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35905913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-26T02:00:06.503Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["academic-paper","agent","automation","claude-code","codex","cursor","latex","layout","paper-writing","pdf","typesetting","vision"],"created_at":"2026-07-07T12:02:11.382Z","updated_at":"2026-07-26T08:01:26.923Z","avatar_url":"https://github.com/OpenRaiser.png","language":"TeX","funding_links":[],"categories":["Review \u0026 Publish"],"sub_categories":["Submission, Formatting \u0026 Conversion"],"readme":"\u003ca id=\"top\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"plugins/paperfit/assets/paperfit-readme-banner.png\" alt=\"PaperFit - Vision-in-the-Loop Academic Typesetting\" width=\"980\" /\u003e\n\n# PaperFit\n\n**Vision-in-the-Loop Academic Typesetting Agent System**\n\nPaperFit 是面向 `Claude Code`、`Codex`、`Cursor` 的 LaTeX 论文排版 Agent System。你只需要在论文项目根目录描述目标，PaperFit 会自动完成编译、页图渲染、视觉诊断、源码修复与最终验收。\n\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/status-active%20development-2ea44f?style=for-the-badge\" alt=\"Project Status\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.8%2B-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white\" alt=\"Python\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/node.js-18%2B-339933?style=for-the-badge\u0026logo=node.js\u0026logoColor=white\" alt=\"Node.js\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/hosts-Claude%20Code%20%7C%20Codex%20%7C%20Cursor-1F5E4A?style=for-the-badge\" alt=\"Hosts\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue?style=for-the-badge\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"#为什么需要-paperfit\"\u003e\u003cb\u003e为什么需要\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#核心能力\"\u003e\u003cb\u003e核心能力\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#真实效果展示\"\u003e\u003cb\u003e效果展示\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#快速开始\"\u003e\u003cb\u003e快速开始\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#安装\"\u003e\u003cb\u003e安装\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#使用方法\"\u003e\u003cb\u003e使用方法\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#工作流\"\u003e\u003cb\u003e工作流\u003c/b\u003e\u003c/a\u003e ·\n  \u003ca href=\"#架构\"\u003e\u003cb\u003e架构\u003c/b\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\n## 为什么需要 PaperFit\n\n论文的 LaTeX 编译通过，并不代表版面已经合格。真实投稿前常见的问题往往发生在视觉层面：浮动体堆在一起、双栏页面出现大面积空洞、表格风格不一致、公式或表格溢出、模板迁移后对象位置失控。这些问题很难只靠 `.log` 文件发现，也很难靠一次性文本改写稳定解决。\n\nPaperFit 把论文排版视为一个视觉闭环任务：先把 PDF 渲染成页面图像，再结合 LaTeX 日志、交叉引用和模板规则判断问题，最后回写源码并重新渲染验收。它的目标不是替代作者写论文，而是把“看版面、修源码、再检查”的重复劳动交给 Agent。\n\n| 传统方式 | PaperFit |\n|------|------|\n| 主要关注编译错误 | 同时关注编译、视觉版面和内容完整性 |\n| 人工翻 PDF 找问题 | 页图渲染后按缺陷类型系统诊断 |\n| 手动调整浮动体和表格 | 由 Agent 生成修复策略并受控改源码 |\n| 模板迁移后逐页救火 | 将模板规则、栏型、浮动体和表格一起处理 |\n| 修完后靠肉眼确认 | 用视觉门禁决定继续修复还是交付 |\n\n## 核心能力\n\n| 能力 | 说明 |\n|------|------|\n| **视觉排版诊断** | 识别孤行、末页留白、双栏空洞、浮动体堆积、表格不一致、溢出与对齐问题。 |\n| **完整 VTO 修复** | 串联编译、日志解析、页图渲染、视觉诊断、源码修复与复验。 |\n| **模板迁移** | 支持 CVPR、ICLR、ACL、ACM 等常见学术模板之间的迁移与版式重整。 |\n| **页数控制** | 在目标页数预算下优先做版式级调整，必要时进行最小、可审计的语义微调。 |\n| **局部对象修复** | 针对单个表格、图、公式或页面问题执行更小范围的修复。 |\n| **跨宿主分发** | 同一套能力可安装到 `Claude Code`、`Codex`、`Cursor`。 |\n\n## 真实效果展示\n\n下面的案例来自 PaperFit 的真实排版修复效果展示。\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"images/case1.pdf\"\u003e\n    \u003cimg src=\"plugins/paperfit/assets/paperfit-case1.png\" alt=\"PaperFit case 1 layout repair result\" width=\"980\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"images/case2.pdf\"\u003e\n    \u003cimg src=\"plugins/paperfit/assets/paperfit-case2.png\" alt=\"PaperFit case 2 layout repair result\" width=\"980\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 适合场景\n\n- 投稿前检查论文是否存在明显视觉排版缺陷。\n- 将已有论文迁移到新的会议模板，并尽量保持内容和对象稳定。\n- 把正文压缩到目标页数，同时尽量不改变学术含义。\n- 修复宽表、浮动体堆叠、双栏空洞、overfull、caption 不一致等问题。\n- 在 Agent 宿主中用自然语言发起排版任务，而不是手动串脚本。\n\n## 快速开始\n\n安装完成后，在论文项目根目录直接对宿主说目标即可：\n\n```text\n用 PaperFit 分析这篇论文的排版问题\n```\n\n```text\nUse the paperfit agent to inspect this paper's layout and tell me the main visual defects\n```\n\n```text\n用 PaperFit 把这篇论文迁移到 CVPR 模板，并尽量保持图表和引用稳定\n```\n\n```text\n用 PaperFit 把正文压到 8 页，尽量不要改学术内容\n```\n\nPaperFit 会自动推断主 `.tex` 文件、当前模板、页面预算和需要进入的修复路径。只有在项目结构不清楚、环境缺失或目标本身有歧义时，它才需要你补充信息。\n\n## 安装\n\n### 环境要求\n\n- Node.js `18+`\n- Python `3.8+`\n- Poppler：用于 PDF 信息读取和页图渲染\n- LaTeX 编译环境：如 `tectonic`、`pdflatex` 或模板要求的工具链\n\nmacOS 上可安装 Poppler：\n\n```bash\nbrew install poppler\n```\n\n### npm 安装\n\n```bash\nnpm install -g paperfit-cli\npaperfit-install --target claude\n```\n\n也可以安装到其他宿主：\n\n```bash\npaperfit-install --target codex\npaperfit-install --target cursor --project /path/to/paper\npaperfit-install --target all\n```\n\n安装后建议运行一次体检，并安装 Python 依赖：\n\n```bash\npaperfit doctor --target claude\npip3 install -r \"$(npm root -g)/paperfit-cli/requirements.txt\"\n```\n\n### 从源码安装\n\n```bash\ngit clone https://github.com/OpenRaiser/PaperFit.git\ncd PaperFit\nnpm install\nbash install.sh --local --target claude\n```\n\nClaude Code 插件市场安装：\n\n```text\n/plugin marketplace add OpenRaiser/PaperFit\n/plugin install paperfit@paperfit-vto\n```\n\nCodex provider 相关说明见 [docs/CODEX_PROVIDER_SETUP.md](docs/CODEX_PROVIDER_SETUP.md)。\n\n## 使用方法\n\nPaperFit 的推荐入口是自然语言，而不是记忆内部命令。\n\n| 宿主 | 推荐入口 |\n|------|------|\n| `Claude Code` | `/paperfit` 后描述排版目标；也可使用 `/fix-layout`、`/check-visual`、`/repair-table` 等快捷命令。 |\n| `Codex` | 明确请求 `Use the paperfit agent to ...`，之后可通过 `/agent` 切回已创建的 PaperFit agent 线程。 |\n| `Cursor` | 在论文项目中描述任务，项目级 rule 会引导 Cursor 调用 PaperFit 能力。 |\n\n常见任务：\n\n| 任务 | 示例 |\n|------|------|\n| 排版分析 | `用 PaperFit 分析 main.tex 的视觉排版问题` |\n| 完整修复 | `Use the paperfit agent to run a full layout repair loop` |\n| 视觉检查 | `Use PaperFit for visual inspection only` |\n| 表格修复 | `用 PaperFit 修复这个跨栏表格，不要用 resizebox 硬压缩` |\n| 模板迁移 | `用 PaperFit 把这篇论文迁移到 CVPR 模板` |\n| 长度调整 | `用 PaperFit 把正文压到 8 页，语义修改要最小` |\n| 状态查看 | `Use the paperfit agent to summarize the current layout status` |\n\n## 工作流\n\nPaperFit 的闭环可以概括为：\n\n```text\nLaTeX project\n  -\u003e compile and parse logs\n  -\u003e render PDF pages\n  -\u003e diagnose visual defects\n  -\u003e plan source-level repairs\n  -\u003e patch LaTeX safely\n  -\u003e recompile and rerender\n  -\u003e gatekeeper acceptance\n```\n\n视觉检查是交付前的必要步骤。PaperFit 不会只因为编译通过就宣称排版完成，也不会为了压缩页数静默删除 figure、table、caption、label 或交叉引用。\n\n## VTO 缺陷分类\n\nPaperFit 使用 Visual Typesetting Optimization (VTO) taxonomy 来统一诊断和修复语言：\n\n| 类别 | 关注问题 |\n|------|------|\n| **A 空间利用** | 孤行、寡行、末页留白、双栏高度失衡、页面大空洞。 |\n| **B 浮动体** | 图表位置、尺寸、堆叠、跨栏与正文关系。 |\n| **C 一致性** | 表格、图表、caption、间距、风格不统一。 |\n| **D 溢出与对齐** | overfull、公式断行、表格超宽、对象边界错位。 |\n| **E 模板迁移** | 单双栏变化、宏包兼容、会议模板规则差异。 |\n\n完整定义见 [config/vto_taxonomy.yaml](config/vto_taxonomy.yaml)。\n\n## 架构\n\nPaperFit 由 Agent 角色、技能包、配置和执行层组成。Agent 负责判断任务和组织闭环；CLI 与脚本负责渲染、状态记录、日志解析和可重复执行的修复动作。\n\n| 组件 | 职责 |\n|------|------|\n| `agents/` | 调度、视觉诊断、规则检查、源码修复、语义微调、质量门禁的角色说明。 |\n| `skills/` | VTO taxonomy、视觉检查、浮动体优化、溢出修复、模板迁移、写作微调等能力说明。 |\n| `config/` | 模板元数据、版式规则、Agent 角色、写作边界和缺陷分类配置。 |\n| `scripts/` | PDF 渲染、日志解析、视觉信号聚合、状态管理、修复执行和门禁检查。 |\n| `bin/paperfit.js` | `paperfit` CLI 入口，供安装、体检、渲染和内部执行调用。 |\n\n简化目录：\n\n```text\nPaperFit/\n├── agents/                 # Agent role definitions\n├── skills/                 # PaperFit capability bundle\n├── config/                 # templates, layout rules, taxonomy\n├── scripts/                # render, inspect, repair, gatekeeper\n├── plugins/paperfit/       # Codex plugin assets\n├── .claude/commands/       # Claude Code commands\n├── bin/paperfit.js         # CLI entry\n├── install.sh\n└── README.md\n```\n\n## 开发与验证\n\n在仓库根目录准备开发环境：\n\n```bash\nnpm install\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n运行基础验证：\n\n```bash\nnpm run verify\n```\n\n常用开发命令：\n\n```bash\npaperfit doctor --target claude\npaperfit render paper.pdf --output data/pages\npaperfit status\n```\n\n更多安装和命令细节见：\n\n- [docs/COMMANDS_SETUP.md](docs/COMMANDS_SETUP.md)\n- [docs/RELEASE_AND_LOCAL_UPDATE.md](docs/RELEASE_AND_LOCAL_UPDATE.md)\n- [.claude-plugin/README.md](.claude-plugin/README.md)\n\n## 内容保护\n\nPaperFit 的自动修复必须保护学术内容和关键对象：\n\n- 不静默删除 figure、table、caption、label、引用或实验结果。\n- 不用 `\\resizebox`、`\\scalebox` 作为默认的表格压缩手段。\n- 优先使用 `table*`、`tabularx`、列宽重构、浮动体重排等版式级方案。\n- 语义编辑必须最小、可审计，并保留修复依据。\n\n相关协议见 [protocols/content-integrity-protection.md](protocols/content-integrity-protection.md)。\n\n---\n\n## 引用\n\n如有帮助，请引用：\n\n```bibtex\n@article{yu2026paperfit,\n  title={PaperFit: Vision-in-the-Loop Typesetting Optimization for Scientific Documents},\n  author={Yu, Bihui and Xu, Xinglong and Jiang, Junjie and Cheng, Jiabei and Jia, Caijun and Li, Siyuan and He, Conghui and Wei, Jingxuan and Tan, Cheng},\n  journal={arXiv preprint arXiv:2605.10341},\n  year={2026}\n}\n```\n\n## 许可证\n\nMIT 许可证，见 [LICENSE](LICENSE)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenraiser%2Fpaperfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenraiser%2Fpaperfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenraiser%2Fpaperfit/lists"}