Skip to content

Commit 3f5f938

Browse files
feat: 目录标题支持用TOC/title调整
1 parent aa2fa1e commit 3f5f938

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

Diff for: bithesis-doc.tex

+10
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,16 @@ \subsubsection{目录选项}
10851085
该选项包含许多子项目,用于调整其他选项。具体内容见下:
10861086
\end{function}
10871087

1088+
\begin{function}[added=2024-07-09]{TOC/title}
1089+
\begin{bitsyntax}[emph={[1]title}]
1090+
title = (*目录 | Table~of~Contents | \meta{字符串}*)
1091+
\end{bitsyntax}
1092+
1093+
目录的标题。默认会按论文类型自动设置为「目录」、「目\quad{}录」或“Table~of~Contents”。
1094+
1095+
有的学院要求改为“Contents”,这时请自行修改。
1096+
\end{function}
1097+
10881098
\begin{function}{TOC/abstract,TOC/abstractEn}
10891099
\begin{bitsyntax}[emph={[1]abstract,abstractEn}]
10901100
abstract = (*(true)|false*)

Diff for: bithesis.dtx

+6-8
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
%
161161
% \end{macro}
162162
%
163-
% \begin{macro}[added=2023-03-16]{\@@_get_const:}
163+
% \begin{macro}[added=2023-03-16]{\@@_get_const:N}
164164
% 获取标题、章节、表格、图形等的常量名称。
165165
% 会区别英文模式和中文模式。
166166
% \begin{macrocode}
@@ -873,6 +873,10 @@
873873
% \begin{macrocode}
874874
\keys_define:nn { bithesis / TOC }
875875
{
876+
title .tl_set:N = \l_@@_toc_title_tl,
877+
title .initial:n = {
878+
\@@_get_const:N {toc}
879+
},
876880
abstract .bool_set:N = \l_@@_add_abstract_to_toc_bool,
877881
abstract .initial:n = {true},
878882
abstractEn .bool_set:N = \l_@@_add_abstract_en_to_toc_bool,
@@ -2700,12 +2704,6 @@
27002704
\renewcommand{\baselinestretch}{1.56}
27012705
}
27022706

2703-
\@@_if_thesis_english:TF {
2704-
\tl_set:Nn \l_@@_toc_title_tl {\c_@@_label_toc_en_tl}
2705-
} {
2706-
\tl_set:Nn \l_@@_toc_title_tl {\c_@@_label_toc_tl}
2707-
}
2708-
27092707
% 自定义目录样式
27102708
\cs_set:Npn \contentsname {
27112709
\fontsize{16pt}{\baselineskip}
@@ -2722,7 +2720,7 @@
27222720
\addcontentsline{toc}{chapter}{\c_@@_label_toc_en_tl}
27232721
} {
27242722
% 手动添加目录书签
2725-
\currentpdfbookmark{\c_@@_label_toc_tl}{ch:toc}
2723+
\currentpdfbookmark{\l_@@_toc_title_tl}{ch:toc}
27262724
}
27272725

27282726
% 制作目录

Diff for: templates/undergraduate-thesis-en/main.tex

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@
7373
% info/major = {Major},
7474
},
7575
%
76-
% 若要将“Appendices”改为单数,请解除以下两行的注释:
76+
% 标题若要按经管学院的要求,请解除以下几行的注释。
77+
% % 将“Appendices”改为单数:
7778
% appendices/title = {Appendix},
7879
% appendices/TOCTitle = {Appendix},
80+
% % 删掉“Table of ”:
81+
% TOC/title = {Contents},
7982
}
8083

8184
% 使用 listings 宏包进行代码块使用,并使用了预定义的样式,

0 commit comments

Comments
 (0)