\def\smallskip{\vspace\smallskipamount}
\def\bigskip{\vspace\bigskipamount}
\newskip\smallskipamount \smallskipamount=3pt plus 1pt minus 1pt
\newskip\bigskipamount \bigskipamount =12pt plus 4pt minus 4pt
其中12pt plus 4pt minus 4pt表示以12pt为基准,允许上下浮动4pt。
MWE
旧版:
默认:
设为5em:
\documentclass[type=bachelor]{bithesis}
\BITSetup{
misc = {
algorithmSeparation = {5em},
},
}
\usepackage[ruled, algochapter]{algorithm2e}
\begin{document}
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
}}go back to the beginning of current section\;
\caption{How to write algorithms}
\end{algorithm}
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
在这里添加第二章、第三章……TeX 文件的引用
\end{document}
针对algorithm2e宏包,添加
misc/algorithmSeparation
选项,可供调整算法与文字之间的距离。与之前版本相比,默认间距会从约3点增大到约12点。
Fixes #494
默认值的依据
algorithm2e宏包原本的默认值相当于
\smallskip
,此PR的默认值相当于\bigskip
。根据
texdoc source2e
,在 LaTeX 中,这些 skip 用\vspace
实现。其中
12pt plus 4pt minus 4pt
表示以12pt
为基准,允许上下浮动4pt
。MWE
旧版:![图片](https://github.com/BITNP/BIThesis/assets/73375426/361534e5-6108-4e19-8729-da8597df1770)
默认:![图片](https://github.com/BITNP/BIThesis/assets/73375426/2a8be46f-1a39-4020-8589-4cec40e3a8b2)
设为![图片](https://github.com/BITNP/BIThesis/assets/73375426/cd33630a-8451-4a17-a700-b7056d6d8bd2)
5em
: