Skip to content

Commit 1b662f6

Browse files
committed
feat: align content to top by default.
Add an option `pageVerticalAlign=[top|scattered]`.
1 parent 7f5798b commit 1b662f6

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed

Diff for: bithesis.dtx

+25
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,18 @@
935935
% 是因为在 Word 模板中参考文献的格式要求首行之后的行不缩进。
936936
% 但是国标要求首行之后的行缩进。
937937
% \end{function}
938+
%
939+
% \begin{function}[added=2023-03-19]{style/pageVerticalAlign}
940+
% \begin{bitsyntax}[emph={[1]pageVerticalAlign}]
941+
% pageVerticalAlign = (*(top)|scattered*)
942+
% \end{bitsyntax}
943+
% 设置页面垂直方向的对齐方式。
944+
% \begin{optdesc}
945+
% \item[top] 顶部对齐。\textit{默认}。页面中的内容保持它的自然高度,
946+
% 每一页的页面底部用空白填满。
947+
% \item[scattered] 分散对齐。页面高度均匀地填满,使每一页的底部直接对齐。
948+
% \end{optdesc}
949+
% \end{function}
938950
%
939951
% \subsubsection{目录选项}
940952
%
@@ -2275,6 +2287,12 @@
22752287
},
22762288
bibliographyIndent .bool_set:N = \l_@@_style_bibliography_indent_bool,
22772289
bibliographyIndent .initial:n = {true},
2290+
pageVerticalAlign .choices:nn = {top, scattered} {
2291+
\tl_if_eq:NnTF \l_keys_choice_tl {top}
2292+
{ \raggedbottom }
2293+
{ \flushbottom }
2294+
},
2295+
pageVerticalAlign .initial:n = {top},
22782296
}
22792297
% \end{macrocode}
22802298
%
@@ -6570,6 +6588,13 @@ footskip=0.7cm% 页脚 1.8cm %
65706588
}
65716589
}
65726590

6591+
%% from \pkg{ctxdoc}
6592+
\newlist{optdesc}{description}{3}
6593+
%% 设置间距为 \marginparsep,与 l3doc 一致
6594+
\setlist[optdesc]{%
6595+
font=\mdseries\small\ttfamily,align=right,listparindent=\parindent,
6596+
labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=0pt}
6597+
65736598
\makeatother
65746599

65756600
%</dtx-style>

Diff for: templates/graduate-thesis/bithesis.cls

+6
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,12 @@
383383
},
384384
bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool,
385385
bibliographyIndent .initial:n = {true},
386+
pageVerticalAlign .choices:nn = {top, scattered} {
387+
\tl_if_eq:NnTF \l_keys_choice_tl {top}
388+
{ \raggedbottom }
389+
{ \flushbottom }
390+
},
391+
pageVerticalAlign .initial:n = {top},
386392
}
387393
\keys_define:nn { bithesis / TOC }
388394
{

Diff for: templates/graduate-thesis/main.tex

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
abstractEn = false,
7272
symbols = false,
7373
},
74+
style = {
75+
pageVerticalAlign = scattered,
76+
},
7477
% 采用章节标题级别的附录格式
7578
appendices / chapterLevel = true,
7679
}

Diff for: templates/paper-translation/bithesis.cls

+6
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,12 @@
383383
},
384384
bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool,
385385
bibliographyIndent .initial:n = {true},
386+
pageVerticalAlign .choices:nn = {top, scattered} {
387+
\tl_if_eq:NnTF \l_keys_choice_tl {top}
388+
{ \raggedbottom }
389+
{ \flushbottom }
390+
},
391+
pageVerticalAlign .initial:n = {top},
386392
}
387393
\keys_define:nn { bithesis / TOC }
388394
{

Diff for: templates/undergraduate-thesis-en/bithesis.cls

+6
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,12 @@
383383
},
384384
bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool,
385385
bibliographyIndent .initial:n = {true},
386+
pageVerticalAlign .choices:nn = {top, scattered} {
387+
\tl_if_eq:NnTF \l_keys_choice_tl {top}
388+
{ \raggedbottom }
389+
{ \flushbottom }
390+
},
391+
pageVerticalAlign .initial:n = {top},
386392
}
387393
\keys_define:nn { bithesis / TOC }
388394
{

Diff for: templates/undergraduate-thesis/bithesis.cls

+6
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,12 @@
383383
},
384384
bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool,
385385
bibliographyIndent .initial:n = {true},
386+
pageVerticalAlign .choices:nn = {top, scattered} {
387+
\tl_if_eq:NnTF \l_keys_choice_tl {top}
388+
{ \raggedbottom }
389+
{ \flushbottom }
390+
},
391+
pageVerticalAlign .initial:n = {top},
386392
}
387393
\keys_define:nn { bithesis / TOC }
388394
{

0 commit comments

Comments
 (0)