float-optimizer

A document-layout helper for LaTeX, the system commonly used to typeset research papers. It adjusts how figures and tables are placed near the text that refers to them.

In plain words
What is it for?
Use it to correct figure and table placement, size, and spacing in one- or two-column papers, using source files, layout reports, and page images for verification.
Why use it?
It helps fix figures that appear far from their first mention, do not fit the column, pile up together, or split across pages.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/openraiser/paperfit/float-optimizer
Any agent
npx skills add OpenRaiser/PaperFit --skill float-optimizer
Clone the repo
git clone --depth 1 https://github.com/OpenRaiser/PaperFit

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03514
Opus 5 $0.00000 $0.01757
Sonnet 5 $0.00000 $0.00703
Haiku 4.5 $0.00000 $0.00351

Measured 2d ago against content hash 1306e7c1d15f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

float-optimizer 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 2d 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.

skills/float-optimizer/SKILL.md · 310 lines

How it starts

The opening of the file, as written. The whole thing — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Float Optimizer Skill

概述

本技能专门处理 Category B:浮动体缺陷,包括:

  • B1:浮动体远离首次引用(Float-Reference Distance)
  • B2:浮动体大小不适配栏宽(Float Width Mismatch)
  • B3:连续多个浮动体堆叠无正文间隔(Float Clustering)
  • B4:浮动体跨页分裂(Float Page Orphaning)

该技能由 code-surgeon-agent 调用,通过对浮动体位置参数、尺寸设置和周围正文结构的精确调整,实现图表与正文的和谐共处。浮动体优化是视觉排版中最具挑战性的环节之一,必须结合页图反馈迭代验证。


适用场景

layout-detective-agent 报告中出现以下缺陷 ID 时,路由至本技能:

缺陷 ID 描述 优先级
B1 浮动体远离首次引用 High
B2 浮动体大小不适配栏宽 High
B3 浮动体连续堆叠 Medium
B4 浮动体跨页分裂 Medium

输入规范

输入项 来源 说明
.tex 文件路径 项目上下文 需修改的源文件
排版侦探报告 layout-detective-agent 输出 包含缺陷对象(图表标签)、页码、描述
源码交叉引用报告 extract_crossrefs.py 输出 (data/crossrefs.json) 提供每个图表的首次引用行号、定义行号、行距离、节距离
当前 PDF 页图 visual-inspector 输出 用于验证修复后视觉效果
模板类型 用户上下文或 templates.yaml 单栏/双栏,影响浮动体宽度策略

输入使用说明

  • crossrefs.jsondistances[] 数组中提取 ref_linefigure_line,计算源码距离
  • 若源码距离近(line_distance < 50section_distance = 0)但视觉距离远 → 典型 LaTeX 浮动体放置问题,使用本技能的浮动体参数调整策略
  • 若源码距离本身远 → 优先建议移动源码位置(策略 3),而非调整浮动体参数

输出规范

修改完成后,必须返回以下信息:

{
  "skill": "float-optimizer",
  "status": "success | partial | failed",
  "modified_files": ["main.tex"],
  "changes": [
    {
      "defect_id": "B1",
      "object": "Figure 3",
      "action": "调整浮动体位置参数为 [ht]",
      "before": "\\begin{figure}[t]",
      "after": "\\begin{figure}[ht]"
    },
    {
      "defect_id": "B2",
      "object": "Table 1",
      "action": "将 tabular 宽度设为 \\linewidth",
      "before": "\\begin{tabular}{|l|c|c|}",
      "after": "\\begin{tabularx}{\\linewidth}{|l|X|X|}"
    }
  ],
  "unresolved": []
}

修复策略

通用原则

  1. 浮动体是“浮动”的:LaTeX 的浮动体放置算法具有不确定性,同一份源码在不同编译中可能产生不同输出。因此,修复后必须多次编译以验证稳定性。
  2. 最小侵入:优先调整位置参数 [ht],其次调整尺寸,最后才考虑移动浮动体在源码中的位置。
  3. Endmatter 硬约束:正文浮动体不得进入 AcknowledgementsReferencesBibliography 所在页;若发生,按失败处理,并优先在 endmatter 前插入 \FloatBarrier
  4. 视觉验证必须:浮动体修复的效果必须在页图上肉眼确认,不能仅凭日志判断。

Read the full file on GitHub · 310 lines

Changes

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.

  1. 2d ago First seen · 310 lines · 0 tokens per session scan A 1306e7c1d15f

Subscribe to this mod's changes

float-optimizer is a skill published in the GitHub repository OpenRaiser/PaperFit (330 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,514 tokens. 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.

Related

Other skills, from other repositories

gsap-scrolltrigger

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is…

calesthio/OpenMontage · 68 tokens

gsap-core

Official GSAP skill for the core API — gsap.to(), from(), fromTo(), easing, duration, stagger, defaults, gsap.matchMedia() (responsive, prefers-reduced-motion). Use when the user asks for a JavaScript animation library, animation in React/Vue/vanilla, GSAP tweens, easing, basic animation, responsive or reduced-motion…

calesthio/OpenMontage · 128 tokens

gsap-utils

Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP.

calesthio/OpenMontage · 64 tokens

playwright-recording

Record browser interactions as video using Playwright. Use for capturing demo videos, app walkthroughs, and UI flows for Remotion videos. Triggers include recording a demo, capturing browser video, screen recording a website, or creating walkthrough footage.

calesthio/OpenMontage · 53 tokens

bfl-api

BFL FLUX API integration guide covering endpoints, async polling patterns, rate limiting, error handling, webhooks, and regional endpoints with Python and TypeScript code examples.

calesthio/OpenMontage · 38 tokens

comfyui

Use when working with ComfyUI workflows in OpenMontage, including comfyuiimage/comfyuivideo/comfyuimusic, custom workflowjson/workflowpath inputs, outputnode selection, missing model setup, LoRAs, low-VRAM workflow choices, and community workflow imports.

calesthio/OpenMontage · 61 tokens