Skip to content

Commit b356dc0

Browse files
committed
Fix bachelor cover problem (#270)
1 parent a6f28da commit b356dc0

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

whu-thesis.cls

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,30 @@
261261
}
262262
\group_end:
263263
}
264+
%tag 删除章标题中的-\quad
265+
\cs_new_protected:Npn \__whu_sanitize_chapter_title:n #1
266+
{
267+
\tl_clear:N \l__whu_tmpa_tl
268+
\tl_set:No \l__whu_tmpa_tl {#1}
269+
\tl_remove_all:Nn \l__whu_tmpa_tl { \quad }
270+
}
271+
%tag 手动生成章的标题,用于摘要、参考文献等
272+
\cs_new_protected:Npn \__whu_chapter:n #1
273+
{
274+
\__whu_sanitize_chapter_title:n {#1}
275+
\group_begin:
276+
\ctexset { chapter / numbering = false }
277+
\chapter [ \l__whu_tmpa_tl ] {#1}
278+
\group_end:
279+
\__whu_chapter_header:n {#1}
280+
}
281+
\cs_generate_variant:Nn \__whu_chapter:n { V }
282+
\cs_new_protected:Npn \__whu_chapter_header:n #1
283+
{
284+
\bool_if:NTF \g__whu_twoside_bool
285+
{ \markboth {#1} {#1} }
286+
{ \markboth { \hfill #1 \hfill } { } }
287+
}
264288
%endregion 基本函数
265289

266290
%region 处理文档类的选项
@@ -1425,7 +1449,8 @@
14251449
%tag logo-and-type
14261450
\cs_new_protected:Npn \__whu_bachelor_cover_i_logo_and_type:
14271451
{
1428-
\skip_vertical:n { 2.01 cm }\setlength{\fboxsep}{0pt}
1452+
\mode_leave_vertical:
1453+
\skip_vertical:n { 2.01 cm }
14291454
\noindent
14301455
\begin{minipage}[t][3.85cm]{\textwidth}
14311456
\centering
@@ -2893,39 +2918,12 @@
28932918
}
28942919
%endregion 定理类环境
28952920

2896-
% 删除章标题中的 \quad
2897-
\cs_new_protected:Npn \__whu_sanitize_chapter_title:n #1
2898-
{
2899-
\tl_clear:N \l__whu_tmpa_tl
2900-
\tl_set:No \l__whu_tmpa_tl {#1}
2901-
\tl_remove_all:Nn \l__whu_tmpa_tl { \quad }
2902-
}
2903-
% 手动生成章的标题,用于摘要、参考文献等。
2904-
\cs_new_protected:Npn \__whu_chapter:n #1
2905-
{
2906-
\__whu_sanitize_chapter_title:n {#1}
2907-
\group_begin:
2908-
\ctexset { chapter / numbering = false }
2909-
\chapter [ \l__whu_tmpa_tl ] {#1}
2910-
\group_end:
2911-
\__whu_chapter_header:n {#1}
2912-
}
2913-
\cs_generate_variant:Nn \__whu_chapter:n { V }
2914-
\cs_new_protected:Npn \__whu_chapter_header:n #1
2915-
{
2916-
\bool_if:NTF \g__whu_twoside_bool
2917-
{ \markboth {#1} {#1} }
2918-
{ \markboth { \hfill #1 \hfill } { } }
2919-
}
2920-
29212921
% 封装 LaTeX 的钩子管理机制。本模板中的字体加载命令位于
29222922
% begindocument/before 钩子中,需确保在 xeCJK 之前执行。
29232923
\cs_new_protected:Npn \__whu_gadd_ltxhook:nn #1#2
29242924
{ \hook_gput_code:nnn {#1} { . } {#2} }
29252925
\hook_gset_rule:nnnn { begindocument/before } { . } { < } { xeCJK }
29262926

2927-
2928-
29292927
%region 参考文献 (bibliography)
29302928
%tag 定义变量
29312929
\tl_new:N \l__whu_bib_backend_tl % 参考文献后端

0 commit comments

Comments
 (0)