Skip to content

Commit f5f24e5

Browse files
feat: 让longtable与文字的间距与其它浮动体相近,并支持用misc/floatSeparation统一调整
1 parent 689de6c commit f5f24e5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bithesis.dtx

+13-1
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,13 @@
10281028
\setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
10291029
% 浮动体位于页面顶部或底部时,调整浮动体与正文之间的距离,后或前加上一行空白
10301030
\setlength{\textfloatsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
1031+
\AtBeginDocument {
1032+
% longtable 宏包有另外的机制,需专门调整
1033+
\@ifpackageloaded{longtable}{
1034+
\setlength{\LTpre}{0.60\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
1035+
\setlength{\LTpost}{1.60\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
1036+
}{}
1037+
}
10311038
}
10321039
% \end{macrocode}
10331040
%
@@ -1580,7 +1587,7 @@
15801587
% 至于表格,虽然其caption位置在上方(而图片是在下方),
15811588
% 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。
15821589
\captionsetup{belowskip=-5pt}
1583-
% 不过 longtable 宏包提供的环境比较奇怪,不设置 belowskip 时间距已较小
1590+
% 不过 longtable 宏包有另外的机制,不设置 belowskip 时间距已可较小
15841591
% 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。
15851592
\captionsetup[longtable]{belowskip=0pt}
15861593

@@ -1654,6 +1661,11 @@
16541661
% 调整浮动体与文字之间的距离
16551662
\addtolength{\intextsep}{\l_@@_misc_float_separation_tl\baselineskip}
16561663
\addtolength{\textfloatsep}{\l_@@_misc_float_separation_tl\baselineskip}
1664+
% longtable 宏包有另外的机制,需专门调整
1665+
\@ifpackageloaded{longtable}{
1666+
\addtolength{\LTpre}{\l_@@_misc_float_separation_tl\baselineskip}
1667+
\addtolength{\LTpost}{\l_@@_misc_float_separation_tl\baselineskip}
1668+
}{}
16571669
% 调整算法与文字之间的距离
16581670
% 针对 algorithm2e 宏包
16591671
\@ifpackageloaded{algorithm2e}{

0 commit comments

Comments
 (0)