File size: 7,141 Bytes
67ad1a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE html>

<html lang="zh-CN">
<head>
<meta charset="utf-8"/>
<title>Poster Template - HSCR (Stable Columns)</title>
<style>
:root{
  --poster-width: 1400px;
  --poster-height: 900px;

  --header-bg: #cfe9ff;
  --border: #1f1f1f;
  --gap: 18px;

  --section-bar: #0b3d91;

  /* ===== 可压缩参数 ===== */
  --base-font: 16px;
  --line-height: 1.35;
  --para-gap: 10px;
  --li-gap: 6px;
  --img-max-width: 100%;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  background: #e9eef5;
  font-family: "Comic Sans MS", cursive;
}

.stage{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.poster{
  width: var(--poster-width);
  height: var(--poster-height);
  background: #fff;
  border: 3px solid var(--border);
  display: grid;
  grid-template-rows: 2fr 11fr;
  overflow: hidden;
}

/* ===== Header ===== */
.header{
  background: var(--header-bg);
  border-bottom: 3px solid var(--border);
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 7fr 1fr;
  gap: var(--gap);
}

.title{
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.authors{
  margin-top: 6px;
  font-size: 20px;
}

.conf{
  border-left: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
}

/* ===== Main ===== */
.main{
  padding: 18px;
  overflow: hidden;
}

.flow{
  height: 100%;
  column-count: 3;
  column-gap: var(--gap);
  column-fill: auto;
}

/* ===== Sections ===== */
.section{
  margin-bottom: 18px;
  break-inside: auto;
  background: #eef6ff;
}

.section-bar{
  background: var(--section-bar);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  padding: 5px 6px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.section-body{
  font-size: var(--base-font);
  line-height: var(--line-height);
}

.section-body p{
  margin: 0 0 var(--para-gap) 0;
}

.section-body ul{
  margin: 0 0 var(--para-gap) 20px;
  padding: 0;
}

.section-body li{
  margin-bottom: var(--li-gap);
}

.img-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--para-gap) 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.img-section img {
  flex: 1;

  min-width: 0;
  max-width: var(--img-max-width);
  height: auto;

  object-fit: contain;
  border: 1px solid #000;

  margin: 0;
}

</style>
</head>

<body>
<div class="stage">
<div class="poster">

  <header class="header">
    <div>
      <h1 class="title">HSCR: Hierarchical Self-Contrastive Rewarding for Aligning Medical Vision Language Models</h1>
      <div class="authors">Songtao Jiang1, Yan Zhang2, Yeying Jin3, Zhihang Tang1 Yangyang Wu1, Yang Feng4, Jian Wu1,5, Zuozhu Liu1,5†
      </div>
    </div>
    <div class="conf">ICML</div>
  </header>

  <main class="main">
    <div class="flow" id="flow">

 


    </div>
  </main>

</div>
</div>


<!--The following content is strictly prohibited from being modified and must be kept in its original form.-->
<script>
(function(){
  const flow = document.getElementById("flow");
  const root = document.documentElement;

  // 基础设置工具函数
  function setVar(k,v,u=""){ root.style.setProperty(k, v+u); }

  // 溢出检测(背包是否破裂)
  function overflowColumns(){
    return flow.scrollWidth > flow.clientWidth + 1;
  }

  // 常量设定
  const PARA_GAP = 12; // para-gap 取定值 (px)
  
  // 边界设定 (Constraint 3)
  const MIN_FONT = 10, MAX_FONT = 20;     // base-font 范围
  
  // 图片大小范围调整为 70% ~ 100%
  const MIN_IMG = 60,  MAX_IMG = 100;     

  // 步长设定 (Constraint 4)
  const STEP_FONT = 0.1;
  const STEP_IMG = 1;

  // 辅助函数:计算依赖变量 (line-height 和 li-gap)
  // 为了保证排版美观,这两个参数应当随字体大小动态变化
  function getDependentVars(f) {
    // 计算当前字体在 [MIN, MAX] 区间内的比例 (0.0 ~ 1.0)
    const ratio = (f - MIN_FONT) / (MAX_FONT - MIN_FONT);

    // line-height: 范围调整为 1.05 ~ 1.6
    // 计算:基数 1.05 + (区间跨度 0.55 * 比例)
    let lh = 1.05 + ratio * 0.55; 

    // li-gap: 范围调整为 2px ~ 8px
    // 计算:基数 2 + (区间跨度 6 * 比例)
    let lg = 2 + ratio * 6;
    
    return { lh, lg };
  }

  // 尝试将特定大小的“物品”装入“背包”
  // 返回 true 表示装得下,false 表示溢出
  function tryFit(f, w) {
    // 格式化精度
    f = Math.round(f * 10) / 10;
    w = Math.round(w);

    const { lh, lg } = getDependentVars(f);
    
    // 应用样式
    setVar("--base-font", f, "px");
    setVar("--img-max-width", w, "%");
    setVar("--line-height", lh.toFixed(3));
    setVar("--li-gap", lg.toFixed(1), "px");
    setVar("--para-gap", PARA_GAP, "px");

    // 检查容量
    return !overflowColumns();
  }

  // 主算法:背包资源分配 (二分查找 + 贪心策略)
  function fit(){
    // 重置状态
    setVar("--img-max-width",100,"%");
    setVar("--base-font",16,"px");

    // 阶段一:优先最大化 Font Size (高价值物品)
    // 策略:假设图片使用最小尺寸(MIN_IMG),寻找能容纳的最大字体
    let low = MIN_FONT;
    let high = MAX_FONT;
    let bestFont = MIN_FONT;

    // 二分查找最佳字体
    while (low <= high) {
      let mid = (low + high) / 2;
      // 按照精度步长对齐
      mid = Math.floor(mid / STEP_FONT) * STEP_FONT; 
      
      if (tryFit(mid, MIN_IMG)) {
        bestFont = mid; // 记录当前可行解
        low = mid + STEP_FONT; // 尝试更大的
      } else {
        high = mid - STEP_FONT; // 尝试更小的
      }
    }

    // 阶段二:在确定最佳字体后,最大化 Image Width (填充剩余空间)
    // 策略:固定字体为 bestFont,寻找能容纳的最大图片宽度
    let wLow = MIN_IMG;
    let wHigh = MAX_IMG;
    let bestImg = MIN_IMG;

    while (wLow <= wHigh) {
      let mid = Math.floor((wLow + wHigh) / 2);
      
      if (tryFit(bestFont, mid)) {
        bestImg = mid; // 记录当前可行解
        wLow = mid + STEP_IMG; // 尝试更大的
      } else {
        wHigh = mid - STEP_IMG; // 尝试更小的
      }
    }

    // 应用最终找到的最优解 (全局最优配置)
    tryFit(bestFont, bestImg);
  }

  // 事件监听保持不变
  window.addEventListener("load", fit);

  window.addEventListener("resize", () => {
    clearTimeout(window.__fitTimer);
    window.__fitTimer = setTimeout(fit, 80);
  });

  const mo = new MutationObserver(() => {
    clearTimeout(window.__fitTimer2);
    window.__fitTimer2 = setTimeout(fit, 80);
  });
  mo.observe(flow, { childList: true, subtree: true, characterData: true });

  function hookImages(){
    const imgs = flow.querySelectorAll("img");
    imgs.forEach(img=>{
      if (img.__fitHooked) return;
      img.__fitHooked = true;
      img.addEventListener("load", () => setTimeout(fit, 50));
      img.addEventListener("error", () => setTimeout(fit, 50));
    });
  }
  hookImages();
  const mo2 = new MutationObserver(hookImages);
  mo2.observe(flow, { childList: true, subtree: true });

})();
</script>

</body>
</html>