summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-05-28 03:01:30 +0000
committerNorbert Preining <norbert@preining.info>2024-05-28 03:01:30 +0000
commit826dbb913054494fcdd030223ae0f84963181c8f (patch)
treebe26343826ddc90490f6fa270e8771eedbbb51d2 /macros/unicodetex/latex
parent8a97eb7a3ad6add356f21bb8a91fbacd4a81f284 (diff)
CTAN sync 202405280301
Diffstat (limited to 'macros/unicodetex/latex')
-rw-r--r--macros/unicodetex/latex/bithesis/bithesis.dtx96
-rw-r--r--macros/unicodetex/latex/bithesis/bithesis.pdfbin752015 -> 753733 bytes
2 files changed, 72 insertions, 24 deletions
diff --git a/macros/unicodetex/latex/bithesis/bithesis.dtx b/macros/unicodetex/latex/bithesis/bithesis.dtx
index 17114c06dd..d510b85b78 100644
--- a/macros/unicodetex/latex/bithesis/bithesis.dtx
+++ b/macros/unicodetex/latex/bithesis/bithesis.dtx
@@ -21,10 +21,10 @@
%<thesis>\ProvidesExplClass{bithesis}
%<report>\ProvidesExplClass{bitreport}
%<beamer>\ProvidesExplClass{bitbeamer}
-%<cls>{2024-05-04}{3.7.7}{BIT Thesis Templates}
+%<cls>{2024-05-27}{3.7.8}{BIT Thesis Templates}
%
%<*driver>
-\ProvidesFile{bithesis.dtx}[2024/05/04 3.7.7 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2024/05/27 3.7.8 BIT Thesis Templates]
\documentclass[letterpaper]{l3doc}
\usepackage{dtx-style}
@@ -736,6 +736,8 @@
% 浮动体相关的各种间距
floatSeparation .tl_set:N = \l_@@_misc_float_separation_tl,
floatSeparation .initial:n = {0},
+ algorithmSeparation .tl_set:N = \l_@@_misc_algorithm_separation_tl,
+ algorithmSeparation .initial:n = {12pt plus 4pt minus 4pt},
tabularRowSeparation .tl_set:N = \l_@@_misc_tabular_row_separation_tl,
tabularRowSeparation .initial:n = {1},
}
@@ -1026,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}
%
@@ -1461,6 +1470,8 @@
{\hspace{.5em}\titlerule*{.}\contentspage}
% \end{macrocode}
%
+% \subsubsection{定义样式相关函数}
+%
% \begin{macro}{\frontmatter}
% 定义前置内容的页面样式。
% \begin{macrocode}
@@ -1481,7 +1492,7 @@
\linespread{1.53}\selectfont
\pagestyle{BIThesis}
- % 表格内容默认使用五号字。
+ % 调整表格内容字号(默认五号)和各行之间的距离。
%
% 由于这种方式会影响所有的表格,
% 所以我们尽可能延迟这种影响。
@@ -1489,9 +1500,24 @@
% 不过,在目前的代码实现中没有在封面
% 之类的地方使用表格,所以目前即使放在
% preamble 中也不会有影响。
- \AtBeginEnvironment{tabular}{\zihao{\l_@@_misc_tabular_font_size_tl}}
- \AtBeginEnvironment{tabular*}{\zihao{\l_@@_misc_tabular_font_size_tl}}
- \AtBeginEnvironment{tabularx}{\zihao{\l_@@_misc_tabular_font_size_tl}}
+ %
+ % 支持标准tabular、tabular*环境和宏包tabularx、longtable。
+ %
+ % 为保证各种表格效果一致,要先手动重置setspace宏包漏掉的longtable;
+ \AtBeginEnvironment {longtable} {\singlespacing}
+ % 之后再统一设置。
+ \clist_map_inline:nn
+ {tabular, tabular*, tabularx, longtable}
+ {
+ \AtBeginEnvironment {##1} {
+ % 字号只想设置表格内容,不想影响caption。
+ % 一般caption在环境之外,自然不受影响;
+ % 而longtable的caption虽在环境内,但caption宏包能正常处理。
+ \zihao{\l_@@_misc_tabular_font_size_tl}
+ % 各行间距只想影响表格,不想影响矩阵,因此也必须在钩子中设置。
+ \cs_set:Npn \arraystretch {\l_@@_misc_tabular_row_separation_tl}
+ }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -1561,6 +1587,9 @@
% 至于表格,虽然其caption位置在上方(而图片是在下方),
% 但 `caption` 宏包已考虑这种区别,统一设置 `belowskip` 即可。
\captionsetup{belowskip=-5pt}
+ % 不过 longtable 宏包有另外的机制,不设置 belowskip 时间距已可较小,
+ % 设置成负数还导致 caption 和表格本体的距离变大。因此我们撤销更改。
+ \captionsetup[longtable]{belowskip=0pt}
% 此外在浮动体内部,调整表格 caption 和表格本体间的距离。
% 本来默认有一定空隙,现改为紧贴,这样更接近Word模板实作。
@@ -1632,8 +1661,17 @@
% 调整浮动体与文字之间的距离
\addtolength{\intextsep}{\l_@@_misc_float_separation_tl\baselineskip}
\addtolength{\textfloatsep}{\l_@@_misc_float_separation_tl\baselineskip}
- % 调整表格各行之间的距离
- \cs_set:Npn \arraystretch {\l_@@_misc_tabular_row_separation_tl}
+ % longtable 宏包有另外的机制,需专门调整
+ \@ifpackageloaded{longtable}{
+ \addtolength{\LTpre}{\l_@@_misc_float_separation_tl\baselineskip}
+ \addtolength{\LTpost}{\l_@@_misc_float_separation_tl\baselineskip}
+ }{}
+ % 调整算法与文字之间的距离
+ % 针对 algorithm2e 宏包
+ \@ifpackageloaded{algorithm2e}{
+ % 宏包手册介绍可自定义宏,再`\SetAlgoSkip`;我们为简洁,直接覆写。
+ \renewcommand{\@algoskip}{\vspace{\l_@@_misc_algorithm_separation_tl}}
+ }{}
}
% \end{macrocode}
% \end{macro}
@@ -1902,24 +1940,23 @@
\cleardoublepage
\currentpdfbookmark{书脊}{frontmatter:paperback}
\begin{titlepage}
- \vskip 5cm
- \begin{center}
+ \centering
+ % 实现竖排——将水平宽度设得很窄,让文字自动换行,并改小行距
\linespread{1.1}\selectfont
- \begin{minipage}[t][19.7cm]{2em}
- \begin{center}
- {
- \heiti\zihao{3}
- \tl_if_blank:VTF \l_@@_value_vertical_title_tl
- {\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
- }
- \vfill
- {\heiti\zihao{3}\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl}}
- \vfill
- {\heiti\zihao{3}\c_@@_label_university_tl}
- \end{center}
+ \begin{minipage}[c][19.7cm]{2em}
+ \centering
+ {
+ \heiti\zihao{3}
+ \tl_if_blank:VTF \l_@@_value_vertical_title_tl
+ {\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
+ }
+ \par
+ \vspace{1em plus 1fill}
+ {\heiti\zihao{3}\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl}}
+ \par
+ \vspace{1em plus 1fill}
+ {\heiti\zihao{3}\c_@@_label_university_tl}
\end{minipage}
- \end{center}
- % \vskip 5cm
\end{titlepage}
}
% \end{macrocode}
@@ -2598,9 +2635,20 @@
% \begin{macrocode}
\NewDocumentCommand \MakePaperBack {}
{
+ % 上下各留出规定的边距,到下一页再恢复。
+ % 若标题超长,自然会向上下溢出。
+ %
+ % 必须在顶层操作,不然影响不确定。
+ % https://tex.stackexchange.com/q/718581
+ %
+ % 单纯`\newgeometry`再`\restoregeometry`相当于仅仅`\clearpage`,也无问题。
+ \newgeometry{
+ vmargin = 5cm,
+ }
\begin{blindPeerReview}[\l_@@_cover_hide_cover_in_peer_review_bool]
\make_paper_back:
\end{blindPeerReview}
+ \restoregeometry
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/unicodetex/latex/bithesis/bithesis.pdf b/macros/unicodetex/latex/bithesis/bithesis.pdf
index 42618f69db..18d91aa9f7 100644
--- a/macros/unicodetex/latex/bithesis/bithesis.pdf
+++ b/macros/unicodetex/latex/bithesis/bithesis.pdf
Binary files differ