paperfit-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/adjust-length.md +21 -0
- package/.claude/commands/check-visual.md +27 -0
- package/.claude/commands/fix-layout.md +31 -0
- package/.claude/commands/migrate-template.md +23 -0
- package/.claude/commands/repair-table.md +21 -0
- package/.claude/commands/show-status.md +32 -0
- package/.claude-plugin/README.md +77 -0
- package/.claude-plugin/marketplace.json +41 -0
- package/.claude-plugin/plugin.json +39 -0
- package/CLAUDE.md +266 -0
- package/CONTRIBUTING.md +131 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/agents/code-surgeon-agent.md +214 -0
- package/agents/layout-detective-agent.md +229 -0
- package/agents/orchestrator-agent.md +254 -0
- package/agents/quality-gatekeeper-agent.md +270 -0
- package/agents/rule-engine-agent.md +224 -0
- package/agents/semantic-polish-agent.md +250 -0
- package/bin/paperfit.js +176 -0
- package/config/agent_roles.yaml +56 -0
- package/config/layout_rules.yaml +54 -0
- package/config/templates.yaml +241 -0
- package/config/vto_taxonomy.yaml +489 -0
- package/config/writing_rules.yaml +64 -0
- package/install.sh +30 -0
- package/package.json +52 -0
- package/requirements.txt +5 -0
- package/scripts/benchmark_runner.py +629 -0
- package/scripts/compile.sh +244 -0
- package/scripts/config_validator.py +339 -0
- package/scripts/cv_detector.py +600 -0
- package/scripts/evidence_collector.py +167 -0
- package/scripts/float_fixers.py +861 -0
- package/scripts/inject_defects.py +549 -0
- package/scripts/install-claude-global.js +148 -0
- package/scripts/install.js +66 -0
- package/scripts/install.sh +106 -0
- package/scripts/overflow_fixers.py +656 -0
- package/scripts/package-for-opensource.sh +138 -0
- package/scripts/parse_log.py +260 -0
- package/scripts/postinstall.js +38 -0
- package/scripts/pre_tool_use.py +265 -0
- package/scripts/render_pages.py +244 -0
- package/scripts/session_logger.py +329 -0
- package/scripts/space_util_fixers.py +773 -0
- package/scripts/state_manager.py +352 -0
- package/scripts/test_commands.py +187 -0
- package/scripts/test_cv_detector.py +214 -0
- package/scripts/test_integration.py +290 -0
- package/skills/consistency-polisher/SKILL.md +337 -0
- package/skills/float-optimizer/SKILL.md +284 -0
- package/skills/latex_fixers/__init__.py +82 -0
- package/skills/latex_fixers/float_fixers.py +392 -0
- package/skills/latex_fixers/fullwidth_fixers.py +375 -0
- package/skills/latex_fixers/overflow_fixers.py +250 -0
- package/skills/latex_fixers/semantic_micro_tuning.py +362 -0
- package/skills/latex_fixers/space_util_fixers.py +389 -0
- package/skills/latex_fixers/utils.py +55 -0
- package/skills/overflow-repair/SKILL.md +304 -0
- package/skills/space-util-fixer/SKILL.md +307 -0
- package/skills/taxonomy-vto/SKILL.md +486 -0
- package/skills/template-migrator/SKILL.md +251 -0
- package/skills/visual-inspector/SKILL.md +217 -0
- package/skills/writing-polish/SKILL.md +289 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# VTO Taxonomy Configuration
|
|
2
|
+
# Visual Typesetting Optimization 缺陷分类体系
|
|
3
|
+
# 用于 layout-detective-agent 的诊断依据和修复策略路由
|
|
4
|
+
|
|
5
|
+
version: "1.0"
|
|
6
|
+
description: "学术论文视觉排版缺陷的层次化分类体系,定义 VTO 任务的评价维度"
|
|
7
|
+
|
|
8
|
+
categories:
|
|
9
|
+
- id: A
|
|
10
|
+
name: "空间利用缺陷"
|
|
11
|
+
name_en: "Space Utilization Defects"
|
|
12
|
+
description: "页面空间分配不合理,导致留白、孤行、页数失衡等问题"
|
|
13
|
+
severity_default: major
|
|
14
|
+
|
|
15
|
+
- id: B
|
|
16
|
+
name: "浮动体缺陷"
|
|
17
|
+
name_en: "Float Placement Defects"
|
|
18
|
+
description: "图表浮动体位置不当,影响阅读流畅性和版式美观"
|
|
19
|
+
severity_default: major
|
|
20
|
+
|
|
21
|
+
- id: C
|
|
22
|
+
name: "排版一致性缺陷"
|
|
23
|
+
name_en: "Consistency Defects"
|
|
24
|
+
description: "全篇排版风格不一致,如字号、图片质量、标题格式参差"
|
|
25
|
+
severity_default: minor
|
|
26
|
+
|
|
27
|
+
- id: D
|
|
28
|
+
name: "溢出与对齐缺陷"
|
|
29
|
+
name_en: "Overflow & Alignment Defects"
|
|
30
|
+
description: "内容超出栏宽或未正确断行,导致视觉溢出或对齐混乱"
|
|
31
|
+
severity_default: major
|
|
32
|
+
|
|
33
|
+
- id: E
|
|
34
|
+
name: "跨模板迁移缺陷"
|
|
35
|
+
name_en: "Cross-Template Transfer Defects"
|
|
36
|
+
description: "切换模板后产生的图表尺寸失配、页数预算改变等问题"
|
|
37
|
+
severity_default: critical
|
|
38
|
+
|
|
39
|
+
defects:
|
|
40
|
+
# ------------------------------------------------------------
|
|
41
|
+
# Category A: Space Utilization Defects
|
|
42
|
+
# ------------------------------------------------------------
|
|
43
|
+
- id: A1
|
|
44
|
+
category: A
|
|
45
|
+
name: "孤行/寡行"
|
|
46
|
+
name_en: "Widow/Orphan Lines"
|
|
47
|
+
severity: major
|
|
48
|
+
description: "段落最后一行单独出现在下一页顶部(孤行),或段落第一行单独留在上一页底部(寡行);也包括段尾仅含两三个单词的'小尾巴'"
|
|
49
|
+
detection:
|
|
50
|
+
visual_indicators:
|
|
51
|
+
- "页面顶部或底部出现极短的文本行"
|
|
52
|
+
- "段尾行长度小于栏宽的 1/4"
|
|
53
|
+
- "跨页段落断开位置不自然"
|
|
54
|
+
log_signals: [] # 无日志信号
|
|
55
|
+
page_image_required: true
|
|
56
|
+
fix_strategy:
|
|
57
|
+
primary_skill: space-util-fixer
|
|
58
|
+
approaches:
|
|
59
|
+
- "全局 penalty 防护(\widowpenalty=10000, \clubpenalty=10000)"
|
|
60
|
+
- "\looseness=-1 紧缩排版(消除小尾巴)"
|
|
61
|
+
- "\looseness=1 扩展排版(填充空白)"
|
|
62
|
+
- "语义级微调(最后手段,增删 3-8 词)"
|
|
63
|
+
semantic_allowed: true
|
|
64
|
+
semantic_constraints:
|
|
65
|
+
- "仅允许增删 3-8 个单词"
|
|
66
|
+
- "不改变数据、结论、引用含义"
|
|
67
|
+
- "优先使用排版手段,语义干预为最后手段
|
|
68
|
+
evaluation_metric:
|
|
69
|
+
name: "widow_orphan_count"
|
|
70
|
+
target: 0
|
|
71
|
+
|
|
72
|
+
- id: A2
|
|
73
|
+
category: A
|
|
74
|
+
name: "末页大面积留白"
|
|
75
|
+
name_en: "Excessive Trailing Whitespace"
|
|
76
|
+
severity: major
|
|
77
|
+
description: "论文最后一页(参考文献之前或之后)存在过大的空白区域,显得内容单薄"
|
|
78
|
+
detection:
|
|
79
|
+
visual_indicators:
|
|
80
|
+
- "末页空白面积超过页面高度的 20%"
|
|
81
|
+
- "参考文献页底部大面积空白"
|
|
82
|
+
log_signals: []
|
|
83
|
+
page_image_required: true
|
|
84
|
+
threshold:
|
|
85
|
+
max_whitespace_ratio: 0.20
|
|
86
|
+
fix_strategy:
|
|
87
|
+
primary_skill: space-util-fixer
|
|
88
|
+
approaches:
|
|
89
|
+
- "调整浮动体位置,将图表前移填充空白"
|
|
90
|
+
- "微调段落间距或 \looseness"
|
|
91
|
+
- "适当扩写结论/讨论部分(语义级)"
|
|
92
|
+
- "压缩过宽的页边距(谨慎)"
|
|
93
|
+
semantic_allowed: true
|
|
94
|
+
semantic_constraints:
|
|
95
|
+
- "仅限结论、分析段落、方法末尾"
|
|
96
|
+
- "不可引入新实验或数据"
|
|
97
|
+
evaluation_metric:
|
|
98
|
+
name: "last_page_whitespace_ratio"
|
|
99
|
+
target: "<0.20"
|
|
100
|
+
|
|
101
|
+
- id: A3
|
|
102
|
+
category: A
|
|
103
|
+
name: "页数预算违反"
|
|
104
|
+
name_en: "Page Budget Violation"
|
|
105
|
+
severity: critical
|
|
106
|
+
description: "论文总页数超出或不足会议/期刊规定页数(如要求 9 页,实际 8 或 10 页)"
|
|
107
|
+
detection:
|
|
108
|
+
visual_indicators:
|
|
109
|
+
- "PDF 总页数与用户指定目标不符"
|
|
110
|
+
log_signals: []
|
|
111
|
+
page_image_required: false
|
|
112
|
+
fix_strategy:
|
|
113
|
+
primary_skill: space-util-fixer
|
|
114
|
+
approaches:
|
|
115
|
+
- "若超页:压缩浮动体、缩减参考文献、精炼文字"
|
|
116
|
+
- "若不满页:扩写结论/讨论、微调图表尺寸、增加分析深度"
|
|
117
|
+
semantic_allowed: true
|
|
118
|
+
semantic_constraints:
|
|
119
|
+
- "不引入新数据或虚构内容"
|
|
120
|
+
- "优先调整非核心章节"
|
|
121
|
+
evaluation_metric:
|
|
122
|
+
name: "page_count_match"
|
|
123
|
+
target: true
|
|
124
|
+
|
|
125
|
+
- id: A4
|
|
126
|
+
category: A
|
|
127
|
+
name: "双栏末页左右栏高度不齐"
|
|
128
|
+
name_en: "Unbalanced Column Heights"
|
|
129
|
+
severity: minor
|
|
130
|
+
description: "双栏排版的最后一页,左右两栏底部高度不一致,影响视觉平衡"
|
|
131
|
+
detection:
|
|
132
|
+
visual_indicators:
|
|
133
|
+
- "双栏布局末页左右栏底部高度差超过 2 行"
|
|
134
|
+
log_signals: []
|
|
135
|
+
page_image_required: true
|
|
136
|
+
fix_strategy:
|
|
137
|
+
primary_skill: space-util-fixer
|
|
138
|
+
approaches:
|
|
139
|
+
- "使用 \balance 或 \flushend 宏包"
|
|
140
|
+
- "手动调整最后一节的分栏断点"
|
|
141
|
+
- "微调浮动体位置"
|
|
142
|
+
semantic_allowed: false
|
|
143
|
+
evaluation_metric:
|
|
144
|
+
name: "column_height_diff_lines"
|
|
145
|
+
target: "<=2"
|
|
146
|
+
|
|
147
|
+
# ------------------------------------------------------------
|
|
148
|
+
# Category B: Float Placement Defects
|
|
149
|
+
# ------------------------------------------------------------
|
|
150
|
+
- id: B1
|
|
151
|
+
category: B
|
|
152
|
+
name: "浮动体远离首次引用"
|
|
153
|
+
name_en: "Float-Reference Distance"
|
|
154
|
+
severity: major
|
|
155
|
+
description: "图表出现在距离其首次被引用的页面过远的位置,读者需翻页查找"
|
|
156
|
+
detection:
|
|
157
|
+
visual_indicators:
|
|
158
|
+
- "图表所在页码与首次引用页码差值 >= 2"
|
|
159
|
+
log_signals:
|
|
160
|
+
- "LaTeX Warning: Float too large for page"
|
|
161
|
+
page_image_required: true
|
|
162
|
+
fix_strategy:
|
|
163
|
+
primary_skill: float-optimizer
|
|
164
|
+
approaches:
|
|
165
|
+
- "调整浮动体位置参数 [htbp]"
|
|
166
|
+
- "使用 \FloatBarrier 控制浮动体边界"
|
|
167
|
+
- "微调图表前后正文数量"
|
|
168
|
+
semantic_allowed: false
|
|
169
|
+
evaluation_metric:
|
|
170
|
+
name: "float_reference_distance_pages"
|
|
171
|
+
target: "<=1"
|
|
172
|
+
|
|
173
|
+
- id: B2
|
|
174
|
+
category: B
|
|
175
|
+
name: "浮动体大小不适配栏宽"
|
|
176
|
+
name_en: "Float Width Mismatch"
|
|
177
|
+
severity: major
|
|
178
|
+
description: "图片或表格的宽度未充分利用当前栏宽,过窄或过宽;表格使用 \resizebox 暴力缩放导致字号不一"
|
|
179
|
+
detection:
|
|
180
|
+
visual_indicators:
|
|
181
|
+
- "图表宽度明显小于栏宽(两侧留白过大)"
|
|
182
|
+
- "图表超出栏宽导致内容被截断或溢出"
|
|
183
|
+
- "表格使用 \resizebox 导致字号不一致"
|
|
184
|
+
log_signals:
|
|
185
|
+
- "Overfull \hbox (图片相关)"
|
|
186
|
+
page_image_required: true
|
|
187
|
+
fix_strategy:
|
|
188
|
+
primary_skill: fullwidth-fixers
|
|
189
|
+
approaches:
|
|
190
|
+
- "图片设置 \includegraphics[width=\textwidth]"
|
|
191
|
+
- "表格使用 tabularx + \textwidth + 弹性 X 列"
|
|
192
|
+
- "微调 \tabcolsep 列间距"
|
|
193
|
+
- "双栏模板使用 table*/figure* 跨栏"
|
|
194
|
+
- "绝对禁止 \resizebox 暴力缩放"
|
|
195
|
+
semantic_allowed: false
|
|
196
|
+
evaluation_metric:
|
|
197
|
+
name: "float_width_utilization"
|
|
198
|
+
target: ">0.95 且 <=1.0"
|
|
199
|
+
|
|
200
|
+
- id: B3
|
|
201
|
+
category: B
|
|
202
|
+
name: "浮动体连续堆叠"
|
|
203
|
+
name_en: "Float Clustering"
|
|
204
|
+
severity: minor
|
|
205
|
+
description: "连续多个图表堆叠在一起,中间缺少正文间隔,形成'图表页'"
|
|
206
|
+
detection:
|
|
207
|
+
visual_indicators:
|
|
208
|
+
- "同一页或连续两页出现 >=3 个图表且正文极少"
|
|
209
|
+
log_signals: []
|
|
210
|
+
page_image_required: true
|
|
211
|
+
fix_strategy:
|
|
212
|
+
primary_skill: float-optimizer
|
|
213
|
+
approaches:
|
|
214
|
+
- "分散浮动体位置参数"
|
|
215
|
+
- "在图表间插入少量正文"
|
|
216
|
+
- "将部分图表移至附录"
|
|
217
|
+
semantic_allowed: false
|
|
218
|
+
evaluation_metric:
|
|
219
|
+
name: "max_consecutive_floats"
|
|
220
|
+
target: "<=2"
|
|
221
|
+
|
|
222
|
+
- id: B4
|
|
223
|
+
category: B
|
|
224
|
+
name: "浮动体跨页分裂"
|
|
225
|
+
name_en: "Float Page Orphaning"
|
|
226
|
+
severity: minor
|
|
227
|
+
description: "一个图表(特别是跨页的长表格)在不适当的位置断开,跨两页显示"
|
|
228
|
+
detection:
|
|
229
|
+
visual_indicators:
|
|
230
|
+
- "表格被分页符截断,表头未在第二页重复"
|
|
231
|
+
log_signals: []
|
|
232
|
+
page_image_required: true
|
|
233
|
+
fix_strategy:
|
|
234
|
+
primary_skill: float-optimizer
|
|
235
|
+
approaches:
|
|
236
|
+
- "对于表格,使用 longtable 或 supertabular"
|
|
237
|
+
- "调整浮动体大小避免分页"
|
|
238
|
+
- "手动控制分页点"
|
|
239
|
+
semantic_allowed: false
|
|
240
|
+
evaluation_metric:
|
|
241
|
+
name: "float_split_improper"
|
|
242
|
+
target: 0
|
|
243
|
+
|
|
244
|
+
# ------------------------------------------------------------
|
|
245
|
+
# Category C: Consistency Defects
|
|
246
|
+
# ------------------------------------------------------------
|
|
247
|
+
- id: C1
|
|
248
|
+
category: C
|
|
249
|
+
name: "表格字号不统一"
|
|
250
|
+
name_en: "Inconsistent Table Font Sizes"
|
|
251
|
+
severity: minor
|
|
252
|
+
description: "全篇表格使用了不同字号,通常由 \resizebox 或手动 \tiny/\small 滥用造成"
|
|
253
|
+
detection:
|
|
254
|
+
visual_indicators:
|
|
255
|
+
- "不同表格的字号大小明显不一致"
|
|
256
|
+
log_signals:
|
|
257
|
+
- "\resizebox 命令的过度使用"
|
|
258
|
+
page_image_required: true
|
|
259
|
+
fix_strategy:
|
|
260
|
+
primary_skill: consistency-polisher
|
|
261
|
+
approaches:
|
|
262
|
+
- "移除 \resizebox,重构表格列格式"
|
|
263
|
+
- "统一使用 \small 或模板默认字号"
|
|
264
|
+
- "确保所有表格风格一致"
|
|
265
|
+
semantic_allowed: false
|
|
266
|
+
evaluation_metric:
|
|
267
|
+
name: "table_font_size_consistency"
|
|
268
|
+
target: true
|
|
269
|
+
|
|
270
|
+
- id: C2
|
|
271
|
+
category: C
|
|
272
|
+
name: "图片分辨率/风格不一致"
|
|
273
|
+
name_en: "Inconsistent Figure Quality/Style"
|
|
274
|
+
severity: minor
|
|
275
|
+
description: "论文中图片分辨率差异大,或风格(如字体、配色)不统一"
|
|
276
|
+
detection:
|
|
277
|
+
visual_indicators:
|
|
278
|
+
- "图片模糊、锯齿严重"
|
|
279
|
+
- "矢量图与低分辨率位图混用"
|
|
280
|
+
- "不同图的配色、线条风格差异大"
|
|
281
|
+
log_signals: []
|
|
282
|
+
page_image_required: true
|
|
283
|
+
fix_strategy:
|
|
284
|
+
primary_skill: consistency-polisher
|
|
285
|
+
approaches:
|
|
286
|
+
- "提示用户替换低质量图片"
|
|
287
|
+
- "若为矢量图,检查编译方式"
|
|
288
|
+
- "(本系统不自动重绘图片,仅诊断)"
|
|
289
|
+
semantic_allowed: false
|
|
290
|
+
evaluation_metric:
|
|
291
|
+
name: "figure_quality_consistency"
|
|
292
|
+
target: true
|
|
293
|
+
note: "依赖用户手动替换"
|
|
294
|
+
|
|
295
|
+
- id: C3
|
|
296
|
+
category: C
|
|
297
|
+
name: "Caption 格式不统一"
|
|
298
|
+
name_en: "Inconsistent Caption Format"
|
|
299
|
+
severity: minor
|
|
300
|
+
description: "图表标题的字体、间距、编号格式、结尾标点不一致"
|
|
301
|
+
detection:
|
|
302
|
+
visual_indicators:
|
|
303
|
+
- "有的 caption 加粗,有的未加粗"
|
|
304
|
+
- "有的以句号结尾,有的无标点"
|
|
305
|
+
- "表格标题位置不一致(有的在上,有的在下)"
|
|
306
|
+
log_signals: []
|
|
307
|
+
page_image_required: true
|
|
308
|
+
fix_strategy:
|
|
309
|
+
primary_skill: consistency-polisher
|
|
310
|
+
approaches:
|
|
311
|
+
- "使用 \captionsetup 统一设置"
|
|
312
|
+
- "确保所有 caption 命令前后一致"
|
|
313
|
+
- "检查并统一标点"
|
|
314
|
+
semantic_allowed: false
|
|
315
|
+
evaluation_metric:
|
|
316
|
+
name: "caption_format_consistency"
|
|
317
|
+
target: true
|
|
318
|
+
|
|
319
|
+
# ------------------------------------------------------------
|
|
320
|
+
# Category D: Overflow & Alignment Defects
|
|
321
|
+
# ------------------------------------------------------------
|
|
322
|
+
- id: D1
|
|
323
|
+
category: D
|
|
324
|
+
name: "Overfull hbox"
|
|
325
|
+
name_en: "Overfull hbox"
|
|
326
|
+
severity: major
|
|
327
|
+
description: "文本行或表格单元格内容超出栏宽,LaTeX 无法自动断行"
|
|
328
|
+
detection:
|
|
329
|
+
visual_indicators:
|
|
330
|
+
- "内容伸出右边界,可能被截断"
|
|
331
|
+
log_signals:
|
|
332
|
+
- "Overfull \hbox (pt 值) in paragraph"
|
|
333
|
+
- "Overfull \hbox (pt 值) in alignment"
|
|
334
|
+
page_image_required: true
|
|
335
|
+
fix_strategy:
|
|
336
|
+
primary_skill: overflow-repair
|
|
337
|
+
approaches:
|
|
338
|
+
- "对于文本:调整断词、引入 \- 连字符、微调句子"
|
|
339
|
+
- "对于表格:重构列格式、允许换行"
|
|
340
|
+
- "对于公式:改用 align/multline 环境"
|
|
341
|
+
semantic_allowed: true
|
|
342
|
+
semantic_constraints:
|
|
343
|
+
- "仅允许局部微调单词或句子结构"
|
|
344
|
+
evaluation_metric:
|
|
345
|
+
name: "overfull_hbox_count"
|
|
346
|
+
target: 0
|
|
347
|
+
|
|
348
|
+
- id: D2
|
|
349
|
+
category: D
|
|
350
|
+
name: "长公式未合理断行"
|
|
351
|
+
name_en: "Unbroken Long Equations"
|
|
352
|
+
severity: major
|
|
353
|
+
description: "过长的数学公式未在多行环境中断行,导致溢出或视觉拥挤"
|
|
354
|
+
detection:
|
|
355
|
+
visual_indicators:
|
|
356
|
+
- "公式明显超出栏宽"
|
|
357
|
+
- "公式在等号处未对齐"
|
|
358
|
+
log_signals:
|
|
359
|
+
- "Overfull \hbox 在 equation 环境"
|
|
360
|
+
page_image_required: true
|
|
361
|
+
fix_strategy:
|
|
362
|
+
primary_skill: overflow-repair
|
|
363
|
+
approaches:
|
|
364
|
+
- "将 equation 替换为 align、multline 或 split"
|
|
365
|
+
- "在运算符处断行并合理对齐"
|
|
366
|
+
semantic_allowed: false
|
|
367
|
+
evaluation_metric:
|
|
368
|
+
name: "long_equation_overflow_count"
|
|
369
|
+
target: 0
|
|
370
|
+
|
|
371
|
+
- id: D3
|
|
372
|
+
category: D
|
|
373
|
+
name: "URL/长标识符溢出"
|
|
374
|
+
name_en: "URL/Long Identifier Overflow"
|
|
375
|
+
severity: minor
|
|
376
|
+
description: "参考文献或正文中的 URL、DOI、长标识符超出栏宽"
|
|
377
|
+
detection:
|
|
378
|
+
visual_indicators:
|
|
379
|
+
- "URL 伸出右边界"
|
|
380
|
+
log_signals:
|
|
381
|
+
- "Overfull \hbox 在参考文献区域"
|
|
382
|
+
page_image_required: true
|
|
383
|
+
fix_strategy:
|
|
384
|
+
primary_skill: overflow-repair
|
|
385
|
+
approaches:
|
|
386
|
+
- "使用 \url 命令(可自动断行)"
|
|
387
|
+
- "在参考文献样式中启用断行"
|
|
388
|
+
- "手动添加断行点"
|
|
389
|
+
semantic_allowed: false
|
|
390
|
+
evaluation_metric:
|
|
391
|
+
name: "url_overflow_count"
|
|
392
|
+
target: 0
|
|
393
|
+
|
|
394
|
+
# ------------------------------------------------------------
|
|
395
|
+
# Category E: Cross-Template Transfer Defects
|
|
396
|
+
# ------------------------------------------------------------
|
|
397
|
+
- id: E1
|
|
398
|
+
category: E
|
|
399
|
+
name: "单栏↔双栏图表尺寸失配"
|
|
400
|
+
name_en: "Single/Double Column Figure Mismatch"
|
|
401
|
+
severity: critical
|
|
402
|
+
description: "模板切换后,原为全宽的图表在新模板下尺寸不当(过小或溢出)"
|
|
403
|
+
detection:
|
|
404
|
+
visual_indicators:
|
|
405
|
+
- "原单栏全宽图在双栏中仍占单栏,显得过小"
|
|
406
|
+
- "原双栏跨栏图在单栏中尺寸异常"
|
|
407
|
+
log_signals: []
|
|
408
|
+
page_image_required: true
|
|
409
|
+
fix_strategy:
|
|
410
|
+
primary_skill: template-migrator
|
|
411
|
+
approaches:
|
|
412
|
+
- "检测图片宽高比,智能决定使用 figure 还是 figure*"
|
|
413
|
+
- "将 \textwidth 替换为 \linewidth 或 \columnwidth"
|
|
414
|
+
- "重新计算图表尺寸"
|
|
415
|
+
semantic_allowed: false
|
|
416
|
+
evaluation_metric:
|
|
417
|
+
name: "figure_width_adaptation"
|
|
418
|
+
target: true
|
|
419
|
+
|
|
420
|
+
- id: E2
|
|
421
|
+
category: E
|
|
422
|
+
name: "页数预算不匹配"
|
|
423
|
+
name_en: "Page Budget Mismatch"
|
|
424
|
+
severity: critical
|
|
425
|
+
description: "模板切换后总页数与目标页数相差较大(如 9 页→14 页)"
|
|
426
|
+
detection:
|
|
427
|
+
visual_indicators:
|
|
428
|
+
- "PDF 总页数与目标模板预期不符"
|
|
429
|
+
log_signals: []
|
|
430
|
+
page_image_required: false
|
|
431
|
+
fix_strategy:
|
|
432
|
+
primary_skill: template-migrator
|
|
433
|
+
approaches:
|
|
434
|
+
- "分析各章节信息密度,计算扩写/缩写弹性"
|
|
435
|
+
- "在 Discussion、Related Work 等处进行语义级扩写或精炼"
|
|
436
|
+
- "调整图表尺寸和浮动体位置"
|
|
437
|
+
semantic_allowed: true
|
|
438
|
+
semantic_constraints:
|
|
439
|
+
- "优先在非核心章节操作"
|
|
440
|
+
- "不引入新实验数据"
|
|
441
|
+
evaluation_metric:
|
|
442
|
+
name: "page_budget_match"
|
|
443
|
+
target: true
|
|
444
|
+
|
|
445
|
+
- id: E3
|
|
446
|
+
category: E
|
|
447
|
+
name: "模板特定宏兼容性"
|
|
448
|
+
name_en: "Template-Specific Macro Compatibility"
|
|
449
|
+
severity: critical
|
|
450
|
+
description: "新模板中使用了已废弃或冲突的宏包、命令"
|
|
451
|
+
detection:
|
|
452
|
+
visual_indicators:
|
|
453
|
+
- "编译失败或部分内容未渲染"
|
|
454
|
+
log_signals:
|
|
455
|
+
- "Undefined control sequence"
|
|
456
|
+
- "Option clash for package"
|
|
457
|
+
page_image_required: false
|
|
458
|
+
fix_strategy:
|
|
459
|
+
primary_skill: template-migrator
|
|
460
|
+
approaches:
|
|
461
|
+
- "根据新模板文档替换或删除冲突命令"
|
|
462
|
+
- "使用条件编译适配不同模板"
|
|
463
|
+
- "提供替代宏包建议"
|
|
464
|
+
semantic_allowed: false
|
|
465
|
+
evaluation_metric:
|
|
466
|
+
name: "compilation_success"
|
|
467
|
+
target: true
|
|
468
|
+
|
|
469
|
+
# 全局严重等级定义
|
|
470
|
+
severity_levels:
|
|
471
|
+
critical:
|
|
472
|
+
description: "必须修复,否则论文不符合投稿要求"
|
|
473
|
+
gate_blocking: true
|
|
474
|
+
major:
|
|
475
|
+
description: "严重影响视觉专业度,强烈建议修复"
|
|
476
|
+
gate_blocking: true
|
|
477
|
+
minor:
|
|
478
|
+
description: "影响美观但不致命,可在时间充裕时修复"
|
|
479
|
+
gate_blocking: false
|
|
480
|
+
|
|
481
|
+
# 修复策略到 Skill 的映射表(供 orchestrator 路由)
|
|
482
|
+
skill_routing:
|
|
483
|
+
space-util-fixer: [A1, A2, A3, A4]
|
|
484
|
+
float-optimizer: [B1, B3, B4]
|
|
485
|
+
fullwidth-fixers: [B2]
|
|
486
|
+
consistency-polisher: [C1, C2, C3]
|
|
487
|
+
overflow-repair: [D1, D2, D3]
|
|
488
|
+
template-migrator: [E1, E2, E3]
|
|
489
|
+
semantic-micro-tuning: [A1, A2, A3, E2]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 写作规范配置
|
|
2
|
+
# 供 semantic-polish-agent 遵循的硬规则
|
|
3
|
+
|
|
4
|
+
version: "1.0"
|
|
5
|
+
|
|
6
|
+
# 禁止的表达
|
|
7
|
+
forbidden:
|
|
8
|
+
contractions: # 禁止口语缩写
|
|
9
|
+
- "don't"
|
|
10
|
+
- "isn't"
|
|
11
|
+
- "can't"
|
|
12
|
+
- "won't"
|
|
13
|
+
- "it's"
|
|
14
|
+
- "that's"
|
|
15
|
+
- "we're"
|
|
16
|
+
- "they're"
|
|
17
|
+
filler_phrases: # 禁止无意义填充短语
|
|
18
|
+
- "It is worth noting that"
|
|
19
|
+
- "It should be emphasized that"
|
|
20
|
+
- "It is interesting to note that"
|
|
21
|
+
- "Needless to say"
|
|
22
|
+
- "As a matter of fact"
|
|
23
|
+
|
|
24
|
+
# 时态规则
|
|
25
|
+
tense:
|
|
26
|
+
introduction: present # 引言:现在时
|
|
27
|
+
related_work: present # 相关工作:现在时
|
|
28
|
+
method: past # 方法:过去时
|
|
29
|
+
experiments: past # 实验:过去时
|
|
30
|
+
results: present # 结果描述:现在时
|
|
31
|
+
conclusion: present # 结论:现在时
|
|
32
|
+
|
|
33
|
+
# 术语规范
|
|
34
|
+
terminology:
|
|
35
|
+
# 要求统一使用的术语(同一概念只用一个词)
|
|
36
|
+
preferred:
|
|
37
|
+
- preferred: "state-of-the-art"
|
|
38
|
+
avoid: ["SOTA", "cutting-edge", "leading"]
|
|
39
|
+
- preferred: "method"
|
|
40
|
+
avoid: ["approach", "framework", "technique"]
|
|
41
|
+
- preferred: "dataset"
|
|
42
|
+
avoid: ["corpus", "data set"]
|
|
43
|
+
# 缩写定义要求
|
|
44
|
+
abbreviations:
|
|
45
|
+
require_first_definition: true
|
|
46
|
+
allowed_without_definition: ["NLP", "CV", "ML", "AI"]
|
|
47
|
+
|
|
48
|
+
# 引用规范
|
|
49
|
+
citations:
|
|
50
|
+
style: "numerical" # 数值引用
|
|
51
|
+
forbid_manual_brackets: true # 禁止手写 [1] 而不使用 \cite
|
|
52
|
+
|
|
53
|
+
# 数学规范
|
|
54
|
+
math:
|
|
55
|
+
vector_notation: "\\mathbf" # 向量用粗体
|
|
56
|
+
scalar_notation: "italic" # 标量用斜体
|
|
57
|
+
function_names: "\\mathrm" # 函数名用正体
|
|
58
|
+
|
|
59
|
+
# 语义改写约束
|
|
60
|
+
semantic_polish:
|
|
61
|
+
max_word_change_per_edit: 15 # 单次改写最大增删词数
|
|
62
|
+
forbidden_edit_sections: ["abstract", "acknowledgments"] # 禁止改写的章节
|
|
63
|
+
preferred_expand_sections: ["discussion", "conclusion", "related_work"]
|
|
64
|
+
preferred_shorten_sections: ["introduction", "related_work"]
|
package/install.sh
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# One-shot install: global npm package + Claude Code home (~/.claude)
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
echo "PaperFit installer"
|
|
6
|
+
echo "=================="
|
|
7
|
+
|
|
8
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
9
|
+
echo "Error: Node.js 18+ is required (https://nodejs.org)"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
|
|
15
|
+
if [[ "${1:-}" == "--local" ]]; then
|
|
16
|
+
echo "Installing from local clone: $ROOT"
|
|
17
|
+
npm install -g "$ROOT"
|
|
18
|
+
else
|
|
19
|
+
echo "Installing from npm registry (paperfit-cli)..."
|
|
20
|
+
npm install -g paperfit-cli
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo ""
|
|
24
|
+
echo "Syncing agents, skills, commands, rules into ~/.claude ..."
|
|
25
|
+
paperfit-install
|
|
26
|
+
|
|
27
|
+
echo ""
|
|
28
|
+
echo "Done. Next: pip3 install -r \"$(npm root -g)/paperfit-cli/requirements.txt\" (or from clone path)"
|
|
29
|
+
echo " brew install poppler # PDF page rendering"
|
|
30
|
+
echo "Open Claude Code in your LaTeX project and run: /fix-layout"
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "paperfit-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Visual Typesetting Optimization Agent System for LaTeX papers",
|
|
5
|
+
"main": "bin/paperfit.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"paperfit": "bin/paperfit.js",
|
|
8
|
+
"paperfit-install": "scripts/install-claude-global.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"postinstall": "node scripts/postinstall.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"scripts/",
|
|
16
|
+
"agents/",
|
|
17
|
+
"skills/",
|
|
18
|
+
"config/",
|
|
19
|
+
".claude/",
|
|
20
|
+
".claude-plugin/",
|
|
21
|
+
"CLAUDE.md",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"CONTRIBUTING.md",
|
|
25
|
+
"requirements.txt",
|
|
26
|
+
"install.sh"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/OpenRaiser/PaperFit.git"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"latex",
|
|
34
|
+
"typesetting",
|
|
35
|
+
"visual-optimization",
|
|
36
|
+
"claude-code",
|
|
37
|
+
"agent-system"
|
|
38
|
+
],
|
|
39
|
+
"author": "PaperFit Team",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"chalk": "^5.3.0",
|
|
46
|
+
"commander": "^11.1.0",
|
|
47
|
+
"ora": "^7.0.1"
|
|
48
|
+
},
|
|
49
|
+
"optionalDependencies": {
|
|
50
|
+
"fsevents": "^2.3.3"
|
|
51
|
+
}
|
|
52
|
+
}
|