From b6d3e12f3d09880a065ab0a8d3b918758a24fffe Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Sat, 25 May 2024 12:23:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=94=A8`misc/ta?= =?UTF-8?q?bularRowSeparation`=E8=B0=83=E8=8A=82`longtable`=E5=AE=8F?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relates-to: #501 --- bithesis-doc.tex | 4 ++-- bithesis.dtx | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bithesis-doc.tex b/bithesis-doc.tex index 47fbf6a1..fe3a8272 100644 --- a/bithesis-doc.tex +++ b/bithesis-doc.tex @@ -1351,7 +1351,7 @@ \subsubsection{其他配置} \end{function} -\begin{function}[added=2024-04-30, updated=2024-05-13]{misc/tabularRowSeparation} +\begin{function}[added=2024-04-30, updated=2024-05-25]{misc/tabularRowSeparation} \begin{bitsyntax}[emph={[1]tabularRowSeparation}] tabularRowSeparation = (*(1)|\marg{正实数}*) \end{bitsyntax} @@ -1362,7 +1362,7 @@ \subsubsection{其他配置} 学校没有明文规定,不过设为1.25更接近本科Word模板实作,设为1.6更接近硕博Word模板实作。 - 此选项影响的“表格”具体包括标准 |tabular|、|tabular*| 环境,以及 |tabularx| 宏包提供的环境。并不影响 |longtable| 宏包提供的环境,因为宏包已经调节了。 + 此选项影响的“表格”具体包括标准 |tabular|、|tabular*| 环境,以及 |tabularx| 和 |longtable| 宏包提供的环境。 \textit{请在导言区使用此选项。} diff --git a/bithesis.dtx b/bithesis.dtx index b6a8f8d1..04940402 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1495,6 +1495,10 @@ % preamble 中也不会有影响。 % % 支持标准tabular、tabular*环境和宏包tabularx、longtable。 + % + % 为保证各种表格效果一致,要先手动重置setspace宏包漏掉的longtable; + \AtBeginEnvironment {longtable} {\singlespacing} + % 之后再统一设置。 \clist_map_inline:nn {tabular, tabular*, tabularx, longtable} { @@ -1504,10 +1508,7 @@ % 而longtable的caption虽在环境内,但caption宏包能正常处理。 \zihao{\l_@@_misc_tabular_font_size_tl} % 各行间距只想影响表格,不想影响矩阵,因此也必须在钩子中设置。 - % 另外,longtable宏包已经调节了空隙,我们就不重复调节了。 - \str_if_eq:nnF {##1} {longtable} { - \cs_set:Npn \arraystretch {\l_@@_misc_tabular_row_separation_tl} - } + \cs_set:Npn \arraystretch {\l_@@_misc_tabular_row_separation_tl} } } } From 4ea541d56d1a48fc0a541cc2054b2c6c47608fde Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Sun, 26 May 2024 14:44:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4longtable=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=B8=8A=E6=A1=86=E7=BA=BF=E5=92=8Ccaption=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relates-to: #501 --- bithesis.dtx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bithesis.dtx b/bithesis.dtx index 04940402..625b7345 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1580,6 +1580,9 @@ % 至于表格,虽然其caption位置在上方(而图片是在下方), % 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。 \captionsetup{belowskip=-5pt} + % 不过 longtable 宏包提供的环境比较奇怪,不设置 belowskip 时间距已较小, + % 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。 + \captionsetup[longtable]{belowskip=0pt} % 此外在浮动体内部,调整表格 caption 和表格本体间的距离。 % 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。 From 6a212a3c92d27ae5a3e6ae7b755e43c3d4bf798e Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Sun, 26 May 2024 15:12:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E8=AE=A9longtable=E4=B8=8E?= =?UTF-8?q?=E6=96=87=E5=AD=97=E7=9A=84=E9=97=B4=E8=B7=9D=E4=B8=8E=E5=85=B6?= =?UTF-8?q?=E5=AE=83=E6=B5=AE=E5=8A=A8=E4=BD=93=E7=9B=B8=E8=BF=91=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=94=AF=E6=8C=81=E7=94=A8`misc/floatSeparation`?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bithesis.dtx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bithesis.dtx b/bithesis.dtx index 625b7345..33e92dcb 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1028,6 +1028,13 @@ \setlength{\intextsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} % 浮动体位于页面顶部或底部时,调整浮动体与正文之间的距离,后或前加上一行空白 \setlength{\textfloatsep}{1.80\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + \AtBeginDocument { + % longtable 宏包有另外的机制,需专门调整 + \@ifpackageloaded{longtable}{ + \setlength{\LTpre}{0.60\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + \setlength{\LTpost}{1.60\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} + }{} + } } % \end{macrocode} % @@ -1580,7 +1587,7 @@ % 至于表格,虽然其caption位置在上方(而图片是在下方), % 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。 \captionsetup{belowskip=-5pt} - % 不过 longtable 宏包提供的环境比较奇怪,不设置 belowskip 时间距已较小, + % 不过 longtable 宏包有另外的机制,不设置 belowskip 时间距已可较小, % 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。 \captionsetup[longtable]{belowskip=0pt} @@ -1654,6 +1661,11 @@ % 调整浮动体与文字之间的距离 \addtolength{\intextsep}{\l_@@_misc_float_separation_tl\baselineskip} \addtolength{\textfloatsep}{\l_@@_misc_float_separation_tl\baselineskip} + % longtable 宏包有另外的机制,需专门调整 + \@ifpackageloaded{longtable}{ + \addtolength{\LTpre}{\l_@@_misc_float_separation_tl\baselineskip} + \addtolength{\LTpost}{\l_@@_misc_float_separation_tl\baselineskip} + }{} % 调整算法与文字之间的距离 % 针对 algorithm2e 宏包 \@ifpackageloaded{algorithm2e}{