diff --git a/bithesis.dtx b/bithesis.dtx index fa8fd074..b7682499 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1166,6 +1166,8 @@ cover .meta:nn = { bithesis / cover } {#1}, style .meta:nn = { bithesis / style } {#1}, option .meta:nn = { bithesis / option } {#1}, + TOC .meta:nn = { bithesis / TOC } {#1}, + appendices .meta:nn = { bithesis / appendices } {#1}, } \keys_define:nn { bithesis / option } @@ -1261,7 +1263,24 @@ {4} {北京理工大学硕士学位论文} {5} {北京理工大学博士学位论文} } - } + }, +} + +\keys_define:nn { bithesis / TOC } +{ + abstract .bool_set:N = \l_@@_add_abstract_to_toc_bool, + abstract .initial:n = {true}, + abstractEn .bool_set:N = \l_@@_add_abstract_en_to_toc_bool, + abstractEn .initial:n = {true}, + symbols .bool_set:N = \l_@@_add_symbols_to_toc_bool, + symbols .initial:n = {true}, +} + +\keys_define:nn { bithesis / appendices } +{ + chapterLevel .bool_set:N = \l_@@_appendices_chapter_level_bool, + title .tl_set:N = \l_@@_appendices_title_tl, + TOCTitle .tl_set:N = \l_@@_appendix_toc_title_tl, } \ProcessKeysOptions { bithesis / option } @@ -1481,39 +1500,38 @@ {\thecontentslabel\hspace{\ccwd}}{} {\hspace{.5em}\titlerule*{.}\contentspage} - -\bool_new:N \l_@@_add_to_toc_bool -\bool_set_true:N \l_@@_add_to_toc_bool - -\keys_define:nn { bit } - { - abstract .meta:nn = { bit / abstract } {#1}, - abstract_en .meta:nn = { bit / abstract_en } {#1}, - symbols .meta:nn = { bit / symbols } {#1}, - appendices .meta:nn = { bit / appendices } {#1}, - } - -\keys_define:nn { bit / abstract } - { - addTOC .bool_set:N = \l_@@_add_to_toc_bool, - } - -\keys_define:nn { bit / abstract_en } - { - addTOC .bool_set:N = \l_@@_add_to_toc_bool, - } - -\keys_define:nn { bit / symbols } - { - addTOC .bool_set:N = \l_@@_add_to_toc_bool, - } - -\keys_define:nn { bit / appendices } - { - chapterLevel .bool_set:N = \l_@@_appendices_chapter_level_bool, - title .tl_set:N = \l_@@_appendices_title_tl, - TOCTitle .tl_set:N = \l_@@_appendix_toc_title_tl, - } +% \bool_new:N \l_@@_add_to_toc_bool +% \bool_set_true:N \l_@@_add_to_toc_bool +% +% \keys_define:nn { bit } +% { +% abstract .meta:nn = { bit / abstract } {#1}, +% abstract_en .meta:nn = { bit / abstract_en } {#1}, +% symbols .meta:nn = { bit / symbols } {#1}, +% appendices .meta:nn = { bit / appendices } {#1}, +% } +% +% \keys_define:nn { bit / abstract } +% { +% addTOC .bool_set:N = \l_@@_add_to_toc_bool, +% } +% +% \keys_define:nn { bit / abstract_en } +% { +% addTOC .bool_set:N = \l_@@_add_to_toc_bool, +% } +% +% \keys_define:nn { bit / symbols } +% { +% addTOC .bool_set:N = \l_@@_add_to_toc_bool, +% } +% +% \keys_define:nn { bit / appendices } +% { +% chapterLevel .bool_set:N = \l_@@_appendices_chapter_level_bool, +% title .tl_set:N = \l_@@_appendices_title_tl, +% TOCTitle .tl_set:N = \l_@@_appendix_toc_title_tl, +% } \RenewDocumentCommand \frontmatter {} { @@ -2332,13 +2350,9 @@ } % TODO: - \NewDocumentEnvironment {abstract} {o} + \NewDocumentEnvironment {abstract} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -2370,7 +2384,7 @@ { \@@_same_page: - \bool_if:NTF \l_@@_add_to_toc_bool { + \bool_if:NTF \l_@@_add_abstract_to_toc_bool { \chapter{\c_@@_label_abstract_tl} } { \chapter*{\c_@@_label_abstract_tl} @@ -2385,12 +2399,8 @@ \newpage } - \NewDocumentEnvironment {abstractEn} {o} + \NewDocumentEnvironment {abstractEn} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract_en } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -2435,7 +2445,7 @@ { \@@_same_page: - \bool_if:nTF {\l_@@_add_to_toc_bool} { + \bool_if:nTF {\l_@@_add_abstract_en_to_toc_bool} { \chapter{\c_@@_label_abstract_en_tl} } { \chapter*{\c_@@_label_abstract_en_tl} @@ -2494,12 +2504,8 @@ % #1: The name that used as chapter title % #2: The name that used in ToC. - \NewDocumentEnvironment {appendices} {o} + \NewDocumentEnvironment {appendices} {} { - \IfValueT {#1} { - \keys_set:nn { bit / appendices } {#1} - } - % Used in chapter, ToC. \tl_new:N \l_@@_appendix_plain_label_tl % Used before reference label. @@ -2616,13 +2622,9 @@ { } - \NewDocumentEnvironment {symbols} {o} + \NewDocumentEnvironment {symbols} {} { - \IfValueT {#1} { - \keys_set:nn { bit / symbols } {#1} - } - - \bool_if:NTF \l_@@_add_to_toc_bool { + \bool_if:NTF \l_@@_add_symbols_to_toc_bool { \chapter{\c_@@_label_symbols_tl} } { \chapter*{\c_@@_label_symbols_tl} diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index f1228d2f..d2cb4322 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -206,6 +206,8 @@ cover .meta:nn = { bithesis / cover } {#1}, style .meta:nn = { bithesis / style } {#1}, option .meta:nn = { bithesis / option } {#1}, + TOC .meta:nn = { bithesis / TOC } {#1}, + appendices .meta:nn = { bithesis / appendices } {#1}, } \keys_define:nn { bithesis / option } @@ -301,7 +303,24 @@ {4} {北京理工大学硕士学位论文} {5} {北京理工大学博士学位论文} } - } + }, +} + +\keys_define:nn { bithesis / TOC } +{ + abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, + abstract .initial:n = {true}, + abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, + abstractEn .initial:n = {true}, + symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, + symbols .initial:n = {true}, +} + +\keys_define:nn { bithesis / appendices } +{ + chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, + title .tl_set:N = \l__bithesis_appendices_title_tl, + TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, } \ProcessKeysOptions { bithesis / option } @@ -513,38 +532,6 @@ {\thecontentslabel\hspace{\ccwd}}{} {\hspace{.5em}\titlerule*{.}\contentspage} -\bool_new:N \l__bithesis_add_to_toc_bool -\bool_set_true:N \l__bithesis_add_to_toc_bool - -\keys_define:nn { bit } - { - abstract .meta:nn = { bit / abstract } {#1}, - abstract_en .meta:nn = { bit / abstract_en } {#1}, - symbols .meta:nn = { bit / symbols } {#1}, - appendices .meta:nn = { bit / appendices } {#1}, - } - -\keys_define:nn { bit / abstract } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / abstract_en } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / symbols } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / appendices } - { - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, - } \RenewDocumentCommand \frontmatter {} { @@ -1337,13 +1324,9 @@ } % TODO: - \NewDocumentEnvironment {abstract} {o} + \NewDocumentEnvironment {abstract} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1375,7 +1358,7 @@ { \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} @@ -1390,12 +1373,8 @@ \newpage } - \NewDocumentEnvironment {abstractEn} {o} + \NewDocumentEnvironment {abstractEn} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract_en } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1440,7 +1419,7 @@ { \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} @@ -1497,12 +1476,8 @@ % #1: The name that used as chapter title % #2: The name that used in ToC. - \NewDocumentEnvironment {appendices} {o} + \NewDocumentEnvironment {appendices} {} { - \IfValueT {#1} { - \keys_set:nn { bit / appendices } {#1} - } - % Used in chapter, ToC. \tl_new:N \l__bithesis_appendix_plain_label_tl % Used before reference label. @@ -1619,13 +1594,9 @@ { } - \NewDocumentEnvironment {symbols} {o} + \NewDocumentEnvironment {symbols} {} { - \IfValueT {#1} { - \keys_set:nn { bit / symbols } {#1} - } - - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} diff --git a/templates/graduate-thesis/chapters/abstract.tex b/templates/graduate-thesis/chapters/abstract.tex index 363d6724..7bd5346a 100644 --- a/templates/graduate-thesis/chapters/abstract.tex +++ b/templates/graduate-thesis/chapters/abstract.tex @@ -15,11 +15,11 @@ % % The Current Maintainer of this work is Feng Kaiyu. -\begin{abstract}[addTOC=false] +\begin{abstract} 本文......。 \textcolor{blue}{(摘要是一篇具有独立性和完整性的短文,应概括而扼要地反映出本论文的主要内容。包括研究目的、研究方法、研究结果和结论等,特别要突出研究结果和结论。中文摘要力求语言精炼准确,博士学位论文建议1000~1200字,硕士学位论文摘要建议500~800字。摘要中不可出现参考文献、图、表、化学结构式、非公知公用的符号和术语。英文摘要与中文摘要的内容应完全一致,在语法、用词上应准确无误,语言简练通顺。留学生的英文版博士学位论文中应有不少于3000字的“详细中文摘要”。)} \end{abstract} -\begin{abstractEn}[addTOC=false] +\begin{abstractEn} In order to exploit....... \end{abstractEn} diff --git a/templates/graduate-thesis/main.tex b/templates/graduate-thesis/main.tex index 8d1b2d87..49c14fd5 100644 --- a/templates/graduate-thesis/main.tex +++ b/templates/graduate-thesis/main.tex @@ -53,7 +53,15 @@ keywordsEn = shape memory properties; polyurethane; textile; synthesis; application, % 必要时置于封面右上角,并按照国家规定进行标记。 % classifiedLevel = 密级 $\bigstar$ 保密期限, - } + }, + % 在目录页中不显示摘要和主要符号对照表的标题。 + TOC = { + abstract = false, + abstractEn = false, + symbols = false, + }, + % 采用章节标题级别的附录格式 + appendices / chapterLevel = true, } \usepackage[ diff --git a/templates/graduate-thesis/misc/0_symbols.tex b/templates/graduate-thesis/misc/0_symbols.tex index 6083f3dc..9d8b0718 100644 --- a/templates/graduate-thesis/misc/0_symbols.tex +++ b/templates/graduate-thesis/misc/0_symbols.tex @@ -15,7 +15,7 @@ % % The Current Maintainer of this work is Feng Kaiyu. -\begin{symbols}[addTOC=false] +\begin{symbols} \item[BIT] 北京理工大学的英文缩写 \item[\LaTeX] 一个很棒的排版系统 \item[\LaTeXe] 一个很棒的排版系统的最新稳定版 diff --git a/templates/graduate-thesis/misc/3_appendices.tex b/templates/graduate-thesis/misc/3_appendices.tex index 14688726..24984452 100644 --- a/templates/graduate-thesis/misc/3_appendices.tex +++ b/templates/graduate-thesis/misc/3_appendices.tex @@ -15,7 +15,7 @@ % % The Current Maintainer of this work is Feng Kaiyu. -\begin{appendices}[chapterLevel=true] +\begin{appendices} \chapter{费马大定理的证明} 关于此,我确信已发现了一种美妙的证法,可惜这里空白的地方太小,写不下。 diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index f1228d2f..d2cb4322 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -206,6 +206,8 @@ cover .meta:nn = { bithesis / cover } {#1}, style .meta:nn = { bithesis / style } {#1}, option .meta:nn = { bithesis / option } {#1}, + TOC .meta:nn = { bithesis / TOC } {#1}, + appendices .meta:nn = { bithesis / appendices } {#1}, } \keys_define:nn { bithesis / option } @@ -301,7 +303,24 @@ {4} {北京理工大学硕士学位论文} {5} {北京理工大学博士学位论文} } - } + }, +} + +\keys_define:nn { bithesis / TOC } +{ + abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, + abstract .initial:n = {true}, + abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, + abstractEn .initial:n = {true}, + symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, + symbols .initial:n = {true}, +} + +\keys_define:nn { bithesis / appendices } +{ + chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, + title .tl_set:N = \l__bithesis_appendices_title_tl, + TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, } \ProcessKeysOptions { bithesis / option } @@ -513,38 +532,6 @@ {\thecontentslabel\hspace{\ccwd}}{} {\hspace{.5em}\titlerule*{.}\contentspage} -\bool_new:N \l__bithesis_add_to_toc_bool -\bool_set_true:N \l__bithesis_add_to_toc_bool - -\keys_define:nn { bit } - { - abstract .meta:nn = { bit / abstract } {#1}, - abstract_en .meta:nn = { bit / abstract_en } {#1}, - symbols .meta:nn = { bit / symbols } {#1}, - appendices .meta:nn = { bit / appendices } {#1}, - } - -\keys_define:nn { bit / abstract } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / abstract_en } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / symbols } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / appendices } - { - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, - } \RenewDocumentCommand \frontmatter {} { @@ -1337,13 +1324,9 @@ } % TODO: - \NewDocumentEnvironment {abstract} {o} + \NewDocumentEnvironment {abstract} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1375,7 +1358,7 @@ { \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} @@ -1390,12 +1373,8 @@ \newpage } - \NewDocumentEnvironment {abstractEn} {o} + \NewDocumentEnvironment {abstractEn} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract_en } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1440,7 +1419,7 @@ { \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} @@ -1497,12 +1476,8 @@ % #1: The name that used as chapter title % #2: The name that used in ToC. - \NewDocumentEnvironment {appendices} {o} + \NewDocumentEnvironment {appendices} {} { - \IfValueT {#1} { - \keys_set:nn { bit / appendices } {#1} - } - % Used in chapter, ToC. \tl_new:N \l__bithesis_appendix_plain_label_tl % Used before reference label. @@ -1619,13 +1594,9 @@ { } - \NewDocumentEnvironment {symbols} {o} + \NewDocumentEnvironment {symbols} {} { - \IfValueT {#1} { - \keys_set:nn { bit / symbols } {#1} - } - - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index f1228d2f..d2cb4322 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -206,6 +206,8 @@ cover .meta:nn = { bithesis / cover } {#1}, style .meta:nn = { bithesis / style } {#1}, option .meta:nn = { bithesis / option } {#1}, + TOC .meta:nn = { bithesis / TOC } {#1}, + appendices .meta:nn = { bithesis / appendices } {#1}, } \keys_define:nn { bithesis / option } @@ -301,7 +303,24 @@ {4} {北京理工大学硕士学位论文} {5} {北京理工大学博士学位论文} } - } + }, +} + +\keys_define:nn { bithesis / TOC } +{ + abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, + abstract .initial:n = {true}, + abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, + abstractEn .initial:n = {true}, + symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, + symbols .initial:n = {true}, +} + +\keys_define:nn { bithesis / appendices } +{ + chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, + title .tl_set:N = \l__bithesis_appendices_title_tl, + TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, } \ProcessKeysOptions { bithesis / option } @@ -513,38 +532,6 @@ {\thecontentslabel\hspace{\ccwd}}{} {\hspace{.5em}\titlerule*{.}\contentspage} -\bool_new:N \l__bithesis_add_to_toc_bool -\bool_set_true:N \l__bithesis_add_to_toc_bool - -\keys_define:nn { bit } - { - abstract .meta:nn = { bit / abstract } {#1}, - abstract_en .meta:nn = { bit / abstract_en } {#1}, - symbols .meta:nn = { bit / symbols } {#1}, - appendices .meta:nn = { bit / appendices } {#1}, - } - -\keys_define:nn { bit / abstract } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / abstract_en } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / symbols } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / appendices } - { - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, - } \RenewDocumentCommand \frontmatter {} { @@ -1337,13 +1324,9 @@ } % TODO: - \NewDocumentEnvironment {abstract} {o} + \NewDocumentEnvironment {abstract} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1375,7 +1358,7 @@ { \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} @@ -1390,12 +1373,8 @@ \newpage } - \NewDocumentEnvironment {abstractEn} {o} + \NewDocumentEnvironment {abstractEn} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract_en } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1440,7 +1419,7 @@ { \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} @@ -1497,12 +1476,8 @@ % #1: The name that used as chapter title % #2: The name that used in ToC. - \NewDocumentEnvironment {appendices} {o} + \NewDocumentEnvironment {appendices} {} { - \IfValueT {#1} { - \keys_set:nn { bit / appendices } {#1} - } - % Used in chapter, ToC. \tl_new:N \l__bithesis_appendix_plain_label_tl % Used before reference label. @@ -1619,13 +1594,9 @@ { } - \NewDocumentEnvironment {symbols} {o} + \NewDocumentEnvironment {symbols} {} { - \IfValueT {#1} { - \keys_set:nn { bit / symbols } {#1} - } - - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index f1228d2f..d2cb4322 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -206,6 +206,8 @@ cover .meta:nn = { bithesis / cover } {#1}, style .meta:nn = { bithesis / style } {#1}, option .meta:nn = { bithesis / option } {#1}, + TOC .meta:nn = { bithesis / TOC } {#1}, + appendices .meta:nn = { bithesis / appendices } {#1}, } \keys_define:nn { bithesis / option } @@ -301,7 +303,24 @@ {4} {北京理工大学硕士学位论文} {5} {北京理工大学博士学位论文} } - } + }, +} + +\keys_define:nn { bithesis / TOC } +{ + abstract .bool_set:N = \l__bithesis_add_abstract_to_toc_bool, + abstract .initial:n = {true}, + abstractEn .bool_set:N = \l__bithesis_add_abstract_en_to_toc_bool, + abstractEn .initial:n = {true}, + symbols .bool_set:N = \l__bithesis_add_symbols_to_toc_bool, + symbols .initial:n = {true}, +} + +\keys_define:nn { bithesis / appendices } +{ + chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, + title .tl_set:N = \l__bithesis_appendices_title_tl, + TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, } \ProcessKeysOptions { bithesis / option } @@ -513,38 +532,6 @@ {\thecontentslabel\hspace{\ccwd}}{} {\hspace{.5em}\titlerule*{.}\contentspage} -\bool_new:N \l__bithesis_add_to_toc_bool -\bool_set_true:N \l__bithesis_add_to_toc_bool - -\keys_define:nn { bit } - { - abstract .meta:nn = { bit / abstract } {#1}, - abstract_en .meta:nn = { bit / abstract_en } {#1}, - symbols .meta:nn = { bit / symbols } {#1}, - appendices .meta:nn = { bit / appendices } {#1}, - } - -\keys_define:nn { bit / abstract } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / abstract_en } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / symbols } - { - addTOC .bool_set:N = \l__bithesis_add_to_toc_bool, - } - -\keys_define:nn { bit / appendices } - { - chapterLevel .bool_set:N = \l__bithesis_appendices_chapter_level_bool, - title .tl_set:N = \l__bithesis_appendices_title_tl, - TOCTitle .tl_set:N = \l__bithesis_appendix_toc_title_tl, - } \RenewDocumentCommand \frontmatter {} { @@ -1337,13 +1324,9 @@ } % TODO: - \NewDocumentEnvironment {abstract} {o} + \NewDocumentEnvironment {abstract} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1375,7 +1358,7 @@ { \__bithesis_same_page: - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_abstract_to_toc_bool { \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} @@ -1390,12 +1373,8 @@ \newpage } - \NewDocumentEnvironment {abstractEn} {o} + \NewDocumentEnvironment {abstractEn} {} { - \IfValueT {#1} { - \keys_set:nn { bit / abstract_en } {#1} - } - \cleardoublepage \setstretch{1.53} @@ -1440,7 +1419,7 @@ { \__bithesis_same_page: - \bool_if:nTF {\l__bithesis_add_to_toc_bool} { + \bool_if:nTF {\l__bithesis_add_abstract_en_to_toc_bool} { \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} @@ -1497,12 +1476,8 @@ % #1: The name that used as chapter title % #2: The name that used in ToC. - \NewDocumentEnvironment {appendices} {o} + \NewDocumentEnvironment {appendices} {} { - \IfValueT {#1} { - \keys_set:nn { bit / appendices } {#1} - } - % Used in chapter, ToC. \tl_new:N \l__bithesis_appendix_plain_label_tl % Used before reference label. @@ -1619,13 +1594,9 @@ { } - \NewDocumentEnvironment {symbols} {o} + \NewDocumentEnvironment {symbols} {} { - \IfValueT {#1} { - \keys_set:nn { bit / symbols } {#1} - } - - \bool_if:NTF \l__bithesis_add_to_toc_bool { + \bool_if:NTF \l__bithesis_add_symbols_to_toc_bool { \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl}