Help us improve
Share bugs, ideas, or general feedback.
From paperfit
Fixes LaTeX layout defects: widows/orphans, excessive trailing whitespace, page budget violations, unbalanced column heights, and vertical holes in two-column pages. Prioritizes typographic control commands over semantic rewrites.
npx claudepluginhub openraiser/paperfitHow this skill is triggered — by the user, by Claude, or both
Slash command
/paperfit:space-util-fixerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
本技能专门处理 **Category A:空间利用缺陷**,包括:
Fixes LaTeX float/figure defects: distance from reference, width mismatch, clustering, and page orphaning. Reads cross-reference JSON and adjusts placement or moves source code.
Audits LaTeX academic manuscripts for typographic conventions including booktabs tables, caption placement, dashes/quotes, units/numbers, cross-references, layout, and polish. Useful for paper review phase.
Automates conversion of LaTeX academic papers between publisher formats (Springer/IPOL to MDPI/IEEE/Nature) via extraction, content injection, formatting fixes, and PDF compilation.
Share bugs, ideas, or general feedback.
本技能专门处理 Category A:空间利用缺陷,包括:
figure*/[H]/不当断页有关)该技能由 code-surgeon-agent 或 semantic-polish-agent 调用,通过对段落级排版控制、浮动体调度和最小语义改写的组合运用,优化页面空间分配,使文档达到专业级的视觉均衡。
空间利用问题的修复常常需要多轮迭代,因为局部调整会影响全局分页。因此,每次修改后必须重新编译并审查页图。
| 缺陷 ID | 描述 | 优先级 | 是否允许语义修改 |
|---|---|---|---|
| A1 | 孤行/寡行 | High | 是(最后手段) |
| A2 | 末页大面积留白 | High | 是(最后手段) |
| A3 | 页数预算违反 | Critical | 是(最后手段) |
| A4 | 双栏末页左右栏高度不齐 | Medium | 否 |
| A5 | 双栏页内列竖向空洞(非末页、栏内大块无正文空白) | High | 视情况 |
| 输入项 | 来源 | 说明 |
|---|---|---|
主 .tex 文件路径 | 项目上下文 | 需修改的源文件 |
| 排版侦探报告 | layout-detective-agent 输出 | 包含 A 类缺陷的页码和描述 |
| 目标页数(若适用) | 用户约束 | A3 修复必须提供 |
| 模板类型 | templates.yaml 或上下文 | 单栏/双栏 |
{
"skill": "space-util-fixer",
"status": "success | partial | failed",
"modified_files": ["main.tex"],
"changes": [
{
"defect_id": "A1",
"object": "第4页顶部孤行",
"action": "在段落前添加 \\looseness=-1",
"before_snippet": "The proposed method achieves...",
"after_snippet": "{\\looseness=-1 The proposed method achieves...}"
}
],
"unresolved": []
}
\newpage 或 \clearpage 来“凑页数”,这会破坏文档结构的自然性。问题特征:
修复策略(严格按优先级顺序尝试):
\looseness=-1)通过在段落前设置 \looseness=-1,指示 TeX 引擎尝试将段落收缩一行,从而消除孤行或小尾巴。
% 修改前
The proposed method achieves state-of-the-art performance on several
benchmarks, demonstrating the effectiveness of our approach.
% 修改后
{\looseness=-1 The proposed method achieves state-of-the-art performance on several
benchmarks, demonstrating the effectiveness of our approach.}
注意:
{ } 括起,以限制 \looseness 的作用范围。\looseness=1)若段落太紧,可尝试扩张一行,使段末行变长。
{\looseness=1 This paragraph will be typeset with one more line...}
\emergencystretch)为特定段落增加紧急拉伸量,允许行间略微拉伸以调整断行。
{\emergencystretch=1em This paragraph content...}
semantic-polish-agent)若排版控制无效,则进行最小语义改写:
in order to 改为 to,或将 demonstrate 改为 show)。% 修改前
The proposed method achieves state-of-the-art performance on several
benchmarks, demonstrating the effectiveness of our approach.
% 修改后
The proposed method achieves state-of-the-art results on several
benchmarks, showing the effectiveness of our approach.
语义改写必须由 semantic-polish-agent 执行,本技能仅提出请求。
在导言区增加以下设置(通常模板已包含,可作为兜底):
\widowpenalty=10000
\clubpenalty=10000
\displaywidowpenalty=10000
注意:此设置影响全局,需谨慎。若模板已设置,则无需重复。
问题特征:
修复策略(按优先级):
检查倒数第二、第三页是否有可前移的图表。调整其位置参数 [htbp],使其占据末页空白区域。
% 将原本放在倒数第二页的图强制前移
\begin{figure}[t] → \begin{figure}[ht]
在不影响整体美观的前提下,微调末页前的某些垂直间距(如 \vspace、章节间距)。
% 轻微缩小最后一节前的间距
\vspace{-0.5em}
\section{Conclusion}
注意:不要制造新的视觉不协调。
在结论、讨论或分析段落中增加有实质内容的 2-4 行文本(约 30-60 词),以自然填充空白。
此操作必须由 semantic-polish-agent 执行。
若用户同意,可将部分非核心内容(如额外消融实验)从正文移至附录,或在末页后增加致谢部分。
问题特征:
修复策略:
本缺陷修复需要系统性操作,通常结合多种手段。
优先级从高到低:
压缩浮动体
width=0.95\linewidth 代替 \linewidth)。longtable(可跨页,避免独占一页)。缩减垂直间距
\vspace{-0.2cm} 微调节标题、图表与正文的间距。\newline 或空行。精炼文字(语义级)
在非核心段落(Related Work、Introduction 末尾)进行精简:
压缩参考文献
若参考文献过多,使用 \bibliographystyle{abbrv} 或类似缩写样式,或使用 biblatex 的压缩选项。
缩小页边距(谨慎)
若模板允许,使用 \usepackage[margin=...]{geometry} 微调边距。必须在模板允许范围内。
优先级从高到低:
检查浮动体堆积
是否因 \FloatBarrier 或 [H] 导致页面空白?若是,先按 B 类缺陷修复。
适当扩写结论、讨论或分析段落
增加 5-10 行有实质内容的分析,例如:
增加附录或补充材料
若会议允许附录且不计入页数限制,可将部分内容移至附录,使正文恰好满页。
微调图表尺寸
将部分图片略微放大(width=1.0\linewidth 代替 0.95\linewidth),使其占据更多空间但不溢出。
增加分页点
在合适位置(如章节末尾)添加 \newpage 迫使内容分页,但必须确保不产生孤页。
问题特征:
修复策略:
\balance 或 flushend 宏包在导言区加载 flushend 宏包,自动平衡末页两栏高度。
\usepackage{flushend}
注意:flushend 与某些宏包(如 multicol)可能冲突,需在特定模板下测试。
若自动平衡无效,在最后一节结束前插入 \balance 命令(需 balance 宏包)。
\usepackage{balance}
...
\section{Conclusion}
...
\balance
\end{document}
对末页最后一段使用 \looseness=-1 或 \looseness=1,改变其行数,从而影响两栏高度。
若末页有浮动体,尝试将其移至前一页或强制放在当前页底部,以改变栏内内容分布。
问题特征:某一页左栏或右栏在标题/段落后出现大块竖向空白(无图无表),另一栏同期仍有连续正文;常见于 figure* 顶到下一页后在栏内留下“断层”、滥用 \\ / \clearpage、\FloatBarrier、[H] 等。
修复策略(优先浮动体与断页,再动正文):
figure* / table*:尝试将浮动环境在源码中前移/后移,或改为单栏 figure/table(若尺寸允许)。\\(段内强制换行)、\newpage、\vfill;慎用 [H]。\FloatBarrier,评估是否可删除或挪到节末。Float too large 日志后再看栏内空洞是否消失。\looseness 或最小语义扩写,使分栏断点上移。每完成一项修复后:
Space Utilization Fixer Skill 就绪。 等待调用,优化页面空间分配。