Skip to content

Commit 0bffec6

Browse files
YDX-2147483647fky2015
authored andcommitted
feat: misc/algorithmSeparation选项调整算法与文字之间的距离(仅针对algorithm2e宏包)
Fixes #494 BREAKING CHANGE: 如果您使用了algorithm2e宏包,距离会从约3点增大到约12点。
1 parent 8673d0a commit 0bffec6

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

bithesis-doc.tex

+17
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,23 @@ \subsubsection{其他配置}
13341334

13351335
\end{function}
13361336

1337+
\begin{function}[added=2024-05-20]{misc/algorithmSeparation}
1338+
\begin{bitsyntax}[emph={[1]algorithmSeparation}]
1339+
floatSeparation = (*(12pt plus 4pt minus 4pt)|\marg{长度}*)
1340+
\end{bitsyntax}
1341+
1342+
\textit{此选项一般不需要用户自行修改。}
1343+
1344+
此选项用于调整算法与正文之间的距离。距离用\href{https://www.overleaf.com/learn/latex/Lengths_in_LaTeX}{长度}表示,例如 |0.5em| 大致是半个字高。默认值更复杂一些,它表示以12点为基准,允许上下浮动4点。
1345+
1346+
(学校既无明文规定,也无实例。)
1347+
1348+
此选项目前只支持 |algorithm2e| 宏包的 |algorithm| 环境。
1349+
1350+
\textit{请在导言区使用此选项。}
1351+
1352+
\end{function}
1353+
13371354
\begin{function}[added=2024-04-30, updated=2024-05-13]{misc/tabularRowSeparation}
13381355
\begin{bitsyntax}[emph={[1]tabularRowSeparation}]
13391356
tabularRowSeparation = (*(1)|\marg{正实数}*)

bithesis.dtx

+8
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@
736736
% 浮动体相关的各种间距
737737
floatSeparation .tl_set:N = \l_@@_misc_float_separation_tl,
738738
floatSeparation .initial:n = {0},
739+
algorithmSeparation .tl_set:N = \l_@@_misc_algorithm_separation_tl,
740+
algorithmSeparation .initial:n = {12pt plus 4pt minus 4pt},
739741
tabularRowSeparation .tl_set:N = \l_@@_misc_tabular_row_separation_tl,
740742
tabularRowSeparation .initial:n = {1},
741743
}
@@ -1648,6 +1650,12 @@
16481650
% 调整浮动体与文字之间的距离
16491651
\addtolength{\intextsep}{\l_@@_misc_float_separation_tl\baselineskip}
16501652
\addtolength{\textfloatsep}{\l_@@_misc_float_separation_tl\baselineskip}
1653+
% 调整算法与文字之间的距离
1654+
% 针对 algorithm2e 宏包
1655+
\@ifpackageloaded{algorithm2e}{
1656+
% 宏包手册介绍可自定义宏,再`\SetAlgoSkip`;我们为简洁,直接覆写。
1657+
\renewcommand{\@algoskip}{\vspace{\l_@@_misc_algorithm_separation_tl}}
1658+
}{}
16511659
}
16521660
% \end{macrocode}
16531661
% \end{macro}

0 commit comments

Comments
 (0)