texlive[74740] Master/texmf-dist: bithesis (25mar25)

commits+karl at tug.org commits+karl at tug.org
Tue Mar 25 20:45:51 CET 2025


Revision: 74740
          https://tug.org/svn/texlive?view=revision&revision=74740
Author:   karl
Date:     2025-03-25 20:45:50 +0100 (Tue, 25 Mar 2025)
Log Message:
-----------
bithesis (25mar25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bithesis/bithesis.pdf
    trunk/Master/texmf-dist/doc/latex/bithesis/dtx-style.sty
    trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
    trunk/Master/texmf-dist/source/latex/bithesis/bithesis.ins
    trunk/Master/texmf-dist/tex/latex/bithesis/bitbeamer.cls
    trunk/Master/texmf-dist/tex/latex/bithesis/bithesis.cls
    trunk/Master/texmf-dist/tex/latex/bithesis/bitreport.cls

Modified: trunk/Master/texmf-dist/doc/latex/bithesis/bithesis.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bithesis/dtx-style.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bithesis/dtx-style.sty	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/doc/latex/bithesis/dtx-style.sty	2025-03-25 19:45:50 UTC (rev 74740)
@@ -14,9 +14,9 @@
 %%     conditions of the LaTeX Project Public License, either
 %%     version 1.3c of this license or (at your option) any later
 %%     version. This version of this license is in
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
 %%     and the latest version of this license is in
-%%        http://www.latex-project.org/lppl.txt
+%%        https://www.latex-project.org/lppl.txt
 %%     and version 1.3 or later is part of all distributions of
 %%     LaTeX version 2020/11/27 or later.
 %% 

Modified: trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx	2025-03-25 19:45:50 UTC (rev 74740)
@@ -8,9 +8,9 @@
 % conditions of the LaTeX Project Public License, either
 % version 1.3c of this license or (at your option) any later
 % version. This version of this license is in
-%    http://www.latex-project.org/lppl/lppl-1-3c.txt
+%    https://www.latex-project.org/lppl/lppl-1-3c.txt
 % and the latest version of this license is in
-%    http://www.latex-project.org/lppl.txt
+%    https://www.latex-project.org/lppl.txt
 % and version 1.3 or later is part of all distributions of
 % LaTeX version 2020/11/27 or later.
 %
@@ -21,10 +21,10 @@
 %<thesis>\ProvidesExplClass{bithesis}
 %<report>\ProvidesExplClass{bitreport}
 %<beamer>\ProvidesExplClass{bitbeamer}
-%<cls>{2025-01-03}{3.8.1}{BIT Thesis Templates}
+%<cls>{2025-03-25}{3.8.2}{BIT Thesis Templates}
 %
 %<*driver>
-\ProvidesFile{bithesis.dtx}[2025/01/03 3.8.1 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2025/03/25 3.8.2 BIT Thesis Templates]
 \documentclass[letterpaper]{l3doc}
 \usepackage{dtx-style}
 
@@ -40,7 +40,6 @@
 %</driver>
 % \fi
 %
-% \begin{macro}
 % \section{实现细节}
 %
 %    \begin{macrocode}
@@ -704,19 +703,7 @@
     tabularFontSize .tl_set:N = \l_@@_misc_tabular_font_size_tl,
     tabularFontSize .initial:n = {5},
     arialFont .tl_set:N = \l_@@_misc_arial_font_path_tl,
-    autoref / algo .code:n = {
-      \AtBeginDocument{
-        % 定义算法标题
-        % 针对 algorithm 宏包
-        \tl_set:Nn \ALG at name {#1}
-        % 针对 algorithm2e 宏包
-        \tl_set:Nn \algorithmcfname {#1}
-
-        % 定义算法的 autoref
-        % algorithm2e 宏包会覆写它,所以我们必须AtBeginDocument时再修改
-        \tl_set:Nn \algorithmautorefname {#1}
-      }
-    },
+    autoref / algo .tl_set:N = \l_@@_misc_autoref_algo_tl,
     autoref / algo .initial:n = {\g_@@_const_autoref_algo_tl},
     autoref / them .tl_set:N = \themautorefname,
     autoref / them .initial:n = {\g_@@_const_autoref_them_tl},
@@ -986,6 +973,10 @@
 % \subsubsection{定义模板类样式}
 %
 % 加载所需的宏包。
+%
+% 在加载宏包之前,尽量不使用 AtBeginDocument 等 hook。
+% 因为 listings 等宏包也会用这些 hook。若在加载它们之前使用 hook,会导致我们所有 hook 在这些宏包“之前”运行。
+%
 %    \begin{macrocode}
 \RequirePackage{geometry}
 \RequirePackage[table,xcdraw]{xcolor}
@@ -1063,23 +1054,6 @@
 }
 %    \end{macrocode}
 %
-% 根据学校的要求,在本科生模板图片前后加上一行空白。
-%    \begin{macrocode}
-\@@_if_bachelor_thesis:T {
-  % 浮动体位于正文中间时,调整浮动体与上下正文之间的距离,即"前后加上一行空白"
-  \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}
-%
 %  \subsubsection{定义字体相关选项}
 %
 % 设置 Times New Roman 字体。
@@ -1606,39 +1580,125 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% 定义标题的前后间距。
+% 设置图表浮动体与前后正文的间距,以及浮动体内部的图表本体与 caption 的间距。
+%
+% 此处只满足学校要求;后续`misc/floatSeparation`等设置会在此基础上叠加。
+%
+% 学校要求:
+%
+% - 本科生
+%   - 图表与上下文之间各空一行。
+%   - 空行一边是 caption,一边是正文,字号不同。空行的字号具体采用哪个没有说明。
+% - 研究生
+%   - 图序、图题、表序、表题单倍行距,段前6磅,段后6磅。
+%   - 图表本体与正文的间距没有明确规定,不过Word模板实作明显窄于LaTeX默认间距(甚至小于行距),特别是表格。
+%
+% 这些间距在LaTeX中比较复杂:
+%
+% - 图表 caption 的布局位置相反,却共用术语
+%
+%   图自上而下的布局顺序是“正文 → 图本体 → caption → 正文”,而表是“正文 → caption → 表本体 → 正文”。
+%   按照图的布局,caption 的 below 指“caption 🡘 正文”距离,above 指“图表本体 🡘 caption”距离。
+%   这种 below、above 说法外推到了表的布局,导致表的所谓 below、above 与实际空间关系相反。
+%   详见`caption`宏包手册。
+%
+% - 间距是多个设置之和
+%
+%   可能涉及以下四类设置。
+%   1. 浮动体设置 intextsep、textfloatsep、floatsep ——默认是一段非零的弹性长度(由 LaTeX 和 CTeX 共同提供),可`setlength`。
+%   2. caption 设置 belowcaptionskip、abovecaptionskip ——默认为零,可直接`setlength`,或间接用`captionsetup`设置。
+%   3. `caption`宏包加的 strut——这部分为零,因为引入宏包时已设置`strut=off`。
+%   4. 行距——捉摸不定(因为间距两边字号不同),并且难以修改。
+%   详见 https://github.com/CTeX-org/forum/issues/86https://tex.stackexchange.com/q/26521/266758。
+%
+% - 图表具体形式多样
+%
+%   图可能包含子图,子图还可能有多行,要避免各行间遮挡。
+%   表除了普通 table,还可能有 longtable,后者有另外的`LTpre`、`LTpost`机制。
+%
 %    \begin{macrocode}
-\setlength{\abovecaptionskip}{11pt}
+%
+% 1. 设置相对简单的浮动体内部“图表本体 🡘 caption”距离。
+%
 \@@_if_bachelor_thesis:TF {
+  \setlength{\abovecaptionskip}{11pt}
+
+  % 调整表格 caption 和表格本体间的距离。
   \@@_if_thesis_english:TF {
+    % 英文模板缺乏规定,只调整中文模板
+  } {
+    % 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。
+    \captionsetup[table]{skip=5pt}
+  }
+} {
+  \captionsetup[table]{skip=8bp}
+}
+%
+% 2. 设置比较复杂的图表浮动体与前后正文的间距。
+%    a. 首先设置浮动体,保证“图表本体 🡘 caption”距离;
+%    b. 然后设置 caption,在浮动体设置的基础上,补正“caption 🡘 正文”距离。
+%    c. 同时适配 subcaption、longtable 等宏包。
+%
+\@@_if_bachelor_thesis:TF {
+  % 浮动体位于正文中间时,调整浮动体与上下正文之间的距离,即"前后加上一行空白"
+  \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}
+
+  \@@_if_thesis_english:TF {
     \setlength{\belowcaptionskip}{9pt}
   } {
-    % 为了满足 “前后一行空白的问题”,需要删除 caption 下方的间距。
-    % 详见 `caption` 宏包手册和
-    % https://github.com/CTeX-org/forum/issues/86
+    % 为了满足“前后一行空白的问题”,需要删除 caption 下方的间距。
     %
     % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时,
     % 图片与上方的间距过小,因此这里只移除 5pt。
     % 当然,这样会导致文本间的图片的 caption 下方的间距微微大于一行。
     %
-    % 至于表格,虽然其caption位置在上方(而图片是在下方),
-    % 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。
+    % 至于表格,`caption`宏包已考虑布局区别,统一设置 belowskip 即可。
     \captionsetup{belowskip=-5pt}
     % 不过 longtable 宏包有另外的机制,不设置 belowskip 时间距已可较小,
     % 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。
     \captionsetup[longtable]{belowskip=0pt}
 
-    % 此外在浮动体内部,调整表格 caption 和表格本体间的距离。
-    % 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。
-    \captionsetup[table]{skip=5pt}
   }
+  \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}
+    }{}
+  }
 } {
-  % 而研究生模板不存在这个问题。
-  \setlength{\belowcaptionskip}{9pt}
+  % 保留“正文 🡘 图片本体”距离不动,缩小“表格本体 🡘 正文”实际距离,使二者相近
+  \AtBeginEnvironment{table}{
+    \setlength{\intextsep}{3bp plus 1pt minus 1pt}
+  }
+
+  % 调整“正文 🡘 表格 caption”距离
+  \captionsetup[table]{belowskip = 6bp + 0.25\baselineskip}
+
+  % 调整“图片 caption 🡘 正文”距离
+  % 这一距离是 intextsep 与 belowcaptionskip 之和。
+  % 前者在小四 ctexbook 中默认为`14.0pt plus 4.0pt minus 4.0pt`,我们未改。
+  % 计算下来,后者应设置为 14.0pt - 6bp 左右。
+  \captionsetup[figure]{belowskip = -12pt}
+  % 浮动体连续排列时,补偿以上负间距
+  \addtolength{\floatsep}{12pt}
+
+  % 适配子图
+  \captionsetup[subfigure]{aboveskip = 3bp, belowskip = 3bp}
+
+  \AtBeginDocument {
+    % longtable 宏包有另外的机制,需专门调整
+    \@ifpackageloaded{longtable}{
+      \setlength{\LTpre}{-0.8\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
+      \setlength{\LTpost}{0.1\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
+    }{}
+  }
 }
 %    \end{macrocode}
 %
-% 定义分隔字符。
+% 定义图表标题中的分隔字符。
 %    \begin{macrocode}
 \@@_if_graduate:TF {
   \tl_set:Nn \g_@@_label_divide_char_tl {.}
@@ -1676,6 +1736,16 @@
   \cs_gset:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
   \cs_gset:Npn \lstlistingname {\c_@@_label_code_tl}
 
+  % 定义算法标题
+  % 针对 algorithm 宏包
+  \tl_set:Nn \ALG at name {\l_@@_misc_autoref_algo_tl}
+  % 针对 algorithm2e 宏包
+  \tl_set:Nn \algorithmcfname {\l_@@_misc_autoref_algo_tl}
+
+  % 定义算法的 autoref
+  % algorithm2e 宏包会覆写它,所以我们必须AtBeginDocument时再修改
+  \tl_set:Nn \algorithmautorefname {\l_@@_misc_autoref_algo_tl}
+
   % 算法变成「章节号-序号」
   % 为了减少修改,我们只适配按章编号的情况。
   % 针对 algorithm 宏包

Modified: trunk/Master/texmf-dist/source/latex/bithesis/bithesis.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/bithesis/bithesis.ins	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/source/latex/bithesis/bithesis.ins	2025-03-25 19:45:50 UTC (rev 74740)
@@ -6,9 +6,9 @@
 %% conditions of the LaTeX Project Public License, either
 %% version 1.3c of this license or (at your option) any later
 %% version. This version of this license is in
-%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
+%%    https://www.latex-project.org/lppl/lppl-1-3c.txt
 %% and the latest version of this license is in
-%%    http://www.latex-project.org/lppl.txt
+%%    https://www.latex-project.org/lppl.txt
 %% and version 1.3 or later is part of all distributions of
 %% LaTeX version 2020/11/27 or later.
 %%
@@ -30,9 +30,9 @@
     conditions of the LaTeX Project Public License, either
     version 1.3c of this license or (at your option) any later
     version. This version of this license is in
-       http://www.latex-project.org/lppl/lppl-1-3c.txt
+       https://www.latex-project.org/lppl/lppl-1-3c.txt
     and the latest version of this license is in
-       http://www.latex-project.org/lppl.txt
+       https://www.latex-project.org/lppl.txt
     and version 1.3 or later is part of all distributions of
     LaTeX version 2020/11/27 or later.
 

Modified: trunk/Master/texmf-dist/tex/latex/bithesis/bitbeamer.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bithesis/bitbeamer.cls	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/tex/latex/bithesis/bitbeamer.cls	2025-03-25 19:45:50 UTC (rev 74740)
@@ -14,9 +14,9 @@
 %%     conditions of the LaTeX Project Public License, either
 %%     version 1.3c of this license or (at your option) any later
 %%     version. This version of this license is in
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
 %%     and the latest version of this license is in
-%%        http://www.latex-project.org/lppl.txt
+%%        https://www.latex-project.org/lppl.txt
 %%     and version 1.3 or later is part of all distributions of
 %%     LaTeX version 2020/11/27 or later.
 %% 
@@ -27,7 +27,7 @@
 %% 
 \RequirePackage{expl3,l3keys2e}
 \ProvidesExplClass{bitbeamer}
-{2025-01-03}{3.8.1}{BIT Thesis Templates}
+{2025-03-25}{3.8.2}{BIT Thesis Templates}
 \keys_define:nn { bitbeamer }
   {
     titlegraphic .tl_set:N = \l_bit_titlegraphic_tl,

Modified: trunk/Master/texmf-dist/tex/latex/bithesis/bithesis.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bithesis/bithesis.cls	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/tex/latex/bithesis/bithesis.cls	2025-03-25 19:45:50 UTC (rev 74740)
@@ -14,9 +14,9 @@
 %%     conditions of the LaTeX Project Public License, either
 %%     version 1.3c of this license or (at your option) any later
 %%     version. This version of this license is in
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
 %%     and the latest version of this license is in
-%%        http://www.latex-project.org/lppl.txt
+%%        https://www.latex-project.org/lppl.txt
 %%     and version 1.3 or later is part of all distributions of
 %%     LaTeX version 2020/11/27 or later.
 %% 
@@ -27,7 +27,7 @@
 %% 
 \RequirePackage{expl3,l3keys2e}
 \ProvidesExplClass{bithesis}
-{2025-01-03}{3.8.1}{BIT Thesis Templates}
+{2025-03-25}{3.8.2}{BIT Thesis Templates}
 \int_new:N \g__bithesis_thesis_type_int
 \int_new:N \g__bithesis_head_zihao_int
 \bool_new:N \g__bithesis_twoside_bool
@@ -448,19 +448,7 @@
     tabularFontSize .tl_set:N = \l__bithesis_misc_tabular_font_size_tl,
     tabularFontSize .initial:n = {5},
     arialFont .tl_set:N = \l__bithesis_misc_arial_font_path_tl,
-    autoref / algo .code:n = {
-      \AtBeginDocument{
-        % 定义算法标题
-        % 针对 algorithm 宏包
-        \tl_set:Nn \ALG at name {#1}
-        % 针对 algorithm2e 宏包
-        \tl_set:Nn \algorithmcfname {#1}
-
-        % 定义算法的 autoref
-        % algorithm2e 宏包会覆写它,所以我们必须AtBeginDocument时再修改
-        \tl_set:Nn \algorithmautorefname {#1}
-      }
-    },
+    autoref / algo .tl_set:N = \l__bithesis_misc_autoref_algo_tl,
     autoref / algo .initial:n = {\g__bithesis_const_autoref_algo_tl},
     autoref / them .tl_set:N = \themautorefname,
     autoref / them .initial:n = {\g__bithesis_const_autoref_them_tl},
@@ -727,19 +715,6 @@
     footskip = 2.6cm + 7bp - 2cm,
   }
 }
-\__bithesis_if_bachelor_thesis:T {
-  % 浮动体位于正文中间时,调整浮动体与上下正文之间的距离,即"前后加上一行空白"
-  \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}
-    }{}
-  }
-}
 \ctex_at_end_preamble:n {
   \bool_if:NTF \l__bithesis_style_better_new_roman_bool {
     \defaultfontfeatures[TeX~Gyre~Termes]
@@ -1155,33 +1130,75 @@
     }
   }
 }
-\setlength{\abovecaptionskip}{11pt}
 \__bithesis_if_bachelor_thesis:TF {
+  \setlength{\abovecaptionskip}{11pt}
+
+  % 调整表格 caption 和表格本体间的距离。
   \__bithesis_if_thesis_english:TF {
+    % 英文模板缺乏规定,只调整中文模板
+  } {
+    % 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。
+    \captionsetup[table]{skip=5pt}
+  }
+} {
+  \captionsetup[table]{skip=8bp}
+}
+\__bithesis_if_bachelor_thesis:TF {
+  % 浮动体位于正文中间时,调整浮动体与上下正文之间的距离,即"前后加上一行空白"
+  \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}
+
+  \__bithesis_if_thesis_english:TF {
     \setlength{\belowcaptionskip}{9pt}
   } {
-    % 为了满足 “前后一行空白的问题”,需要删除 caption 下方的间距。
-    % 详见 `caption` 宏包手册和
-    % https://github.com/CTeX-org/forum/issues/86
+    % 为了满足“前后一行空白的问题”,需要删除 caption 下方的间距。
     %
     % 这里实际的 skip 在 15pt 左右,但是全部移除会导致当图片置于页面顶部时,
     % 图片与上方的间距过小,因此这里只移除 5pt。
     % 当然,这样会导致文本间的图片的 caption 下方的间距微微大于一行。
     %
-    % 至于表格,虽然其caption位置在上方(而图片是在下方),
-    % 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。
+    % 至于表格,`caption`宏包已考虑布局区别,统一设置 belowskip 即可。
     \captionsetup{belowskip=-5pt}
     % 不过 longtable 宏包有另外的机制,不设置 belowskip 时间距已可较小,
     % 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。
     \captionsetup[longtable]{belowskip=0pt}
 
-    % 此外在浮动体内部,调整表格 caption 和表格本体间的距离。
-    % 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。
-    \captionsetup[table]{skip=5pt}
   }
+  \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}
+    }{}
+  }
 } {
-  % 而研究生模板不存在这个问题。
-  \setlength{\belowcaptionskip}{9pt}
+  % 保留“正文 🡘 图片本体”距离不动,缩小“表格本体 🡘 正文”实际距离,使二者相近
+  \AtBeginEnvironment{table}{
+    \setlength{\intextsep}{3bp plus 1pt minus 1pt}
+  }
+
+  % 调整“正文 🡘 表格 caption”距离
+  \captionsetup[table]{belowskip = 6bp + 0.25\baselineskip}
+
+  % 调整“图片 caption 🡘 正文”距离
+  % 这一距离是 intextsep 与 belowcaptionskip 之和。
+  % 前者在小四 ctexbook 中默认为`14.0pt plus 4.0pt minus 4.0pt`,我们未改。
+  % 计算下来,后者应设置为 14.0pt - 6bp 左右。
+  \captionsetup[figure]{belowskip = -12pt}
+  % 浮动体连续排列时,补偿以上负间距
+  \addtolength{\floatsep}{12pt}
+
+  % 适配子图
+  \captionsetup[subfigure]{aboveskip = 3bp, belowskip = 3bp}
+
+  \AtBeginDocument {
+    % longtable 宏包有另外的机制,需专门调整
+    \@ifpackageloaded{longtable}{
+      \setlength{\LTpre}{-0.8\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
+      \setlength{\LTpost}{0.1\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
+    }{}
+  }
 }
 \__bithesis_if_graduate:TF {
   \tl_set:Nn \g__bithesis_label_divide_char_tl {.}
@@ -1210,6 +1227,16 @@
   \cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
   \cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
 
+  % 定义算法标题
+  % 针对 algorithm 宏包
+  \tl_set:Nn \ALG at name {\l__bithesis_misc_autoref_algo_tl}
+  % 针对 algorithm2e 宏包
+  \tl_set:Nn \algorithmcfname {\l__bithesis_misc_autoref_algo_tl}
+
+  % 定义算法的 autoref
+  % algorithm2e 宏包会覆写它,所以我们必须AtBeginDocument时再修改
+  \tl_set:Nn \algorithmautorefname {\l__bithesis_misc_autoref_algo_tl}
+
   % 算法变成「章节号-序号」
   % 为了减少修改,我们只适配按章编号的情况。
   % 针对 algorithm 宏包

Modified: trunk/Master/texmf-dist/tex/latex/bithesis/bitreport.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bithesis/bitreport.cls	2025-03-25 15:19:57 UTC (rev 74739)
+++ trunk/Master/texmf-dist/tex/latex/bithesis/bitreport.cls	2025-03-25 19:45:50 UTC (rev 74740)
@@ -14,9 +14,9 @@
 %%     conditions of the LaTeX Project Public License, either
 %%     version 1.3c of this license or (at your option) any later
 %%     version. This version of this license is in
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
 %%     and the latest version of this license is in
-%%        http://www.latex-project.org/lppl.txt
+%%        https://www.latex-project.org/lppl.txt
 %%     and version 1.3 or later is part of all distributions of
 %%     LaTeX version 2020/11/27 or later.
 %% 
@@ -27,7 +27,7 @@
 %% 
 \RequirePackage{expl3,l3keys2e}
 \ProvidesExplClass{bitreport}
-{2025-01-03}{3.8.1}{BIT Thesis Templates}
+{2025-03-25}{3.8.2}{BIT Thesis Templates}
 \int_new:N \g__bithesis_report_type_int
 \clist_const:Nn \c__bithesis_report_type_clist
     { common, undergraduate_proposal}



More information about the tex-live-commits mailing list.