diff --git a/bithesis.dtx b/bithesis.dtx index 49f46df2..a8038c7e 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -531,6 +531,12 @@ % \begin{bitsyntax}[emph={[1]twoside}] % twoside = (*<(false)|true>*) % \end{bitsyntax} +% +% 打开双页排版。对于研究生模板来说,这意味着摘要前的内容都会 +% 被插入空白页。这样,在你双面打印的时候,就可以获得单页打印 +% 效果的封面。 +% +% \textit{本科生模板一般不需要选择此选项。此选项会受到 |blindPeerReview| 的抑制。} % \end{function} % % \begin{function}{ctex} @@ -732,6 +738,14 @@ % 设置封面信息中下划线的偏移量。 % \end{function} % +% \begin{function}[added=2023-05-09]{cover/hideCoverInPeerReview} +% \begin{bitsyntax}[emph={[1]hideCoverInPeerReview}] +% hideCoverInPeerReview = (*(false)|true*) +% \end{bitsyntax} +% +% 在盲审模式下,不渲染封面。 +% \end{function} +% % \subsubsection{论文基本信息} % % \begin{function}{info} @@ -1287,6 +1301,15 @@ % 默认值会自动变成相应的英文格式(如|Figure|)。 % % \end{variable} +% +% \begin{variable}[added=2023-05-09]{const/style/substituteSymbol} +% \begin{bitsyntax}[emph={[1]substituteSymbol}] +% substituteSymbol = (*(*)|\marg{字符串}*), +% \end{bitsyntax} +% +% 盲审模式下用于替换个人信息的替换符号。 +% \end{variable} +% % \section{正文编写} % % 请注意,请在\env{document} 之内使用以下命令 。 @@ -1316,6 +1339,18 @@ % % 来指定下划线的宽度。一般情况下,我们不建议您这样做。 % \end{function} +% +% \begin{function}{\SecretInfo{}[]} +% \begin{itemize} +% \item 参数一为一般模式下显示的信息。 +% \item 参数二(可选)为盲审模式下显示的信息。 +% \end{itemize} +% +% 用于在盲审模式下隐藏个人隐私信息。 +% +% 如果传入第二个参数,则会用等量的替换符号(一般是|*|)替换内容。 +% 否则,将使用第二个参数替换内容。 +% \end{function} % % \begin{function}{\MakePaperBack} % @@ -2021,6 +2056,33 @@ % % \subsubsection{辅助函数与常量} % +% \begin{macro}[added=2023-05-06]{\@@_secret_info:nn,\@@_secret_info:N,\@@_secret_info:n,\@@_secret_info:x} +% 普通模式下显示参数一,盲审模式下显示参数二。 +% \begin{macrocode} +\cs_new:Npn \@@_hide:n #1 { + \g_@@_const_substitute_symbol_tl +} + +\cs_new:Npn \@@_secret_info:nn #1 #2 { + \bool_if:nTF \g_@@_blind_mode_bool { + #2 + } { + #1 + } +} + +\cs_new:Npn \@@_secret_info:N #1 { + \@@_secret_info:nn {#1} {\tl_map_function:NN #1 \@@_hide:n } +} +\cs_new:Npn \@@_secret_info:n #1 { + \@@_secret_info:nn {#1} {\tl_map_function:NN {#1} \@@_hide:n } +} + +\cs_generate_variant:Nn \@@_secret_info:n {x} + +% \end{macrocode} +% +% \end{macro} % % \begin{macro}[added=2023-03-16]{\@@_get_const:} % 获取标题、章节、表格、图形等的常量名称。 @@ -2432,6 +2494,8 @@ underlineThickness .initial:n = {1pt}, underlineOffset .dim_set:N = \l_@@_cover_underline_offset_dim, underlineOffset .initial:n = { -10pt }, + hideCoverInPeerReview .bool_set:N = \l_@@_style_hide_cover_in_peer_review_bool, + hideCoverInPeerReview .initial:n = {false}, } % \end{macrocode} % @@ -2478,7 +2542,7 @@ degreeEn .tl_set:N = \l_@@_value_degree_en_tl, degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l_@@_value_institute_tl, - institute .initial:n = {\c_@@_label_university_tl}, + institute .initial:n = {\tl_use:N \c_@@_label_university_tl}, defenseDate .tl_set:N = \l_@@_value_defense_date_tl, defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l_@@_value_author_en_tl, @@ -2573,6 +2637,8 @@ autoref / table .initial:n = {\@@_get_const:N {tab}}, autoref / equ .tl_set:N = \g_@@_const_autoref_equ_tl, autoref / equ .initial:n = {\@@_get_const:N {equ}}, + style / substituteSymbol .tl_set:N = \g_@@_const_substitute_symbol_tl, + style / substituteSymbol .initial:n = {*}, } % \end{macrocode} @@ -2672,6 +2738,12 @@ \PassOptionsToClass{scheme=plain}{ctexbook} } % \end{macrocode} +% 如果设置 blindPeerReview 选项,则抑制 twoside 选项。 +% \begin{macrocode} +\bool_if:NT \g_@@_blind_mode_bool { + \bool_set_false:N \g_@@_twoside_bool +} +% \end{macrocode} % % 如果没有开启双面打印选项,则在 ctexbook 中开启单面打印选项。 % 允许 chapter 直接另起一页(即使是偶数(左手)页)。 @@ -3566,7 +3638,7 @@ {\heiti\zihao{-2} \l_@@_value_title_tl} \vskip 60mm % 黑体 小三 - {\heiti \zihao{-3} \l_@@_value_author_tl} + {\heiti \zihao{-3} \@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl~\g_@@_const_substitute_symbol_tl~\g_@@_const_substitute_symbol_tl}} \vskip 10mm % 黑体 小三 {\heiti \zihao{-3} \l_@@_cover_date_tl} @@ -3592,7 +3664,7 @@ {\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl} } \vfill - {\heiti\zihao{3}\l_@@_value_author_tl} + {\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} @@ -3649,10 +3721,10 @@ % 渲染信息。 \clist_set:Nn \l_@@_input_clist { - {\c_@@_graduate_label_author_tl} {\l_@@_value_author_tl}, + {\c_@@_graduate_label_author_tl} {\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\g_@@_const_substitute_symbol_tl\g_@@_const_substitute_symbol_tl}}, {\c_@@_graduate_label_school_tl} {\l_@@_value_school_tl}, - {\c_@@_graduate_label_supervisor_tl} {\l_@@_value_supervisor_tl}, - {\c_@@_graduate_label_chairman_tl} {\l_@@_value_chairman_tl}, + {\c_@@_graduate_label_supervisor_tl} {\@@_secret_info:x{\l_@@_value_supervisor_tl}}, + {\c_@@_graduate_label_chairman_tl} {\@@_secret_info:x{\l_@@_value_chairman_tl}}, {\c_@@_graduate_label_degree_tl} {\l_@@_value_degree_tl}, {\c_@@_graduate_label_major_tl} {\l_@@_value_major_tl}, {\c_@@_graduate_label_institute_tl} {\l_@@_value_institute_tl}, @@ -3706,10 +3778,10 @@ % 渲染信息。 \clist_set:Nn \l_@@_input_clist { - {\c_@@_graduate_label_author_en_tl} {\l_@@_value_author_en_tl}, + {\c_@@_graduate_label_author_en_tl} {\@@_secret_info:x{\l_@@_value_author_en_tl}}, {\c_@@_graduate_label_school_en_tl} {\l_@@_value_school_en_tl}, - {\c_@@_graduate_label_supervisor_en_tl} {\l_@@_value_supervisor_en_tl}, - {\c_@@_graduate_label_chairman_en_tl} {\l_@@_value_chairman_en_tl}, + {\c_@@_graduate_label_supervisor_en_tl} {\@@_secret_info:x{\l_@@_value_supervisor_en_tl}}, + {\c_@@_graduate_label_chairman_en_tl} {\@@_secret_info:x{\l_@@_value_chairman_en_tl}}, {\c_@@_graduate_label_degree_en_tl} {\l_@@_value_degree_en_tl}, {\c_@@_graduate_label_major_en_tl} {\l_@@_value_major_en_tl}, {\c_@@_graduate_label_institute_en_tl} {\l_@@_value_institute_en_tl}, @@ -3853,12 +3925,26 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\SecretInfo} +% 用于包裹涉及个人信息的内容。 +% \begin{macrocode} +\DeclareDocumentCommand \SecretInfo { m o } + { + \IfValueTF {#2} { + \@@_secret_info:nn {#1} {#2} + } { + \@@_secret_info:x {#1} + } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\MakeCover} % 制作封面。 % \begin{macrocode} \DeclareDocumentCommand \MakeCover {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l_@@_style_hide_cover_in_peer_review_bool] \group_begin: \int_case:nn {\g_@@_thesis_type_int} @@ -3909,11 +3995,11 @@ \clist_set:Nn \l_@@_input_clist { {\c_@@_label_school_tl} {\l_@@_value_school_tl}, {\c_@@_label_major_tl} {\l_@@_value_major_tl}, - {\c_@@_label_class_tl} {\l_@@_value_class_tl}, - {\c_@@_label_author_tl} {\l_@@_value_author_tl}, - {\c_@@_label_student_id_tl} {\l_@@_value_student_id_tl}, - {\c_@@_label_supervisor_tl} {\l_@@_value_supervisor_tl}, - {\c_@@_label_co_supervisor_tl} {\l_@@_value_external_supervisor_tl}, + {\c_@@_label_class_tl} {\@@_secret_info:N \l_@@_value_class_tl}, + {\c_@@_label_author_tl} {\@@_secret_info:N \l_@@_value_author_tl}, + {\c_@@_label_student_id_tl} {\@@_secret_info:N \l_@@_value_student_id_tl}, + {\c_@@_label_supervisor_tl} {\@@_secret_info:N \l_@@_value_supervisor_tl}, + {\c_@@_label_co_supervisor_tl} {\@@_secret_info:N \l_@@_value_external_supervisor_tl}, } \zihao{3} @@ -4006,11 +4092,11 @@ \clist_set:Nn \l_@@_input_clist { {\c_@@_label_school_tl} {\l_@@_value_school_tl}, {\c_@@_label_major_tl} {\l_@@_value_major_tl}, - {\c_@@_label_class_tl} {\l_@@_value_class_tl}, - {\c_@@_label_author_tl} {\l_@@_value_author_tl}, - {\c_@@_label_student_id_tl} {\l_@@_value_student_id_tl}, - {\c_@@_label_supervisor_tl} {\l_@@_value_supervisor_tl}, - {\c_@@_label_co_supervisor_tl} {\l_@@_value_external_supervisor_tl}, + {\c_@@_label_class_tl} {\@@_secret_info:N \l_@@_value_class_tl}, + {\c_@@_label_author_tl} {\@@_secret_info:N \l_@@_value_author_tl}, + {\c_@@_label_student_id_tl} {\@@_secret_info:N \l_@@_value_student_id_tl}, + {\c_@@_label_supervisor_tl} {\@@_secret_info:N \l_@@_value_supervisor_tl}, + {\c_@@_label_co_supervisor_tl} {\@@_secret_info:N \l_@@_value_external_supervisor_tl}, } \@@_render_cover_entry:n \l_@@_input_clist @@ -4104,7 +4190,7 @@ \NewDocumentCommand \MakeOriginality {} { \group_begin: - \begin{blindPeerReview} + \begin{blindPeerReview}[\l_@@_style_hide_cover_in_peer_review_bool] \int_case:nn {\g_@@_thesis_type_int} { {1} @@ -4212,7 +4298,7 @@ % \begin{macrocode} \NewDocumentCommand \MakePaperBack {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l_@@_style_hide_cover_in_peer_review_bool] \make_paper_back: \end{blindPeerReview} } @@ -4224,7 +4310,7 @@ % \begin{macrocode} \NewDocumentCommand \MakeTitle {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l_@@_style_hide_cover_in_peer_review_bool] \@@_make_chinese_title_page: \@@_make_english_title_page: \end{blindPeerReview} @@ -6148,7 +6234,7 @@ footskip=0.7cm% 页脚 1.8cm % % ==================================对于openright 选项,必须保证章页右开,且如果前章末页内容须清空其页眉页脚。=================== \let\BIT@cleardoublepage\cleardoublepage \newcommand{\BIT@clearemptydoublepage}{% - \clearpage{\pagestyle{BIT@empty}\BIT@cleardoublepage}} + \clearpage{\pagestyle{BIT@empty}\BIT@cleardoublepage}} \let\cleardoublepage\BIT@clearemptydoublepage % ================修该frontmatter 的页码为大写罗马格式,并调整页面风格=============== @@ -6404,7 +6490,7 @@ footskip=0.7cm% 页脚 1.8cm % \def\tabcolsep{1pt} \def\arraystretch{1.5} - % 黑体 小三 + % 黑体 小三 {\heiti\zihao{-3} \begin{tabular}{l p{3mm} c} \BIT@label@author & &\BITunderline[180pt]{\BIT@value@author} diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 77cbb93b..d8e79faf 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -37,6 +37,27 @@ \tl_new:N \g__bithesis_label_divide_char_tl \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq +\cs_new:Npn \__bithesis_hide:n #1 { + \g__bithesis_const_substitute_symbol_tl +} + +\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { + \bool_if:nTF \g__bithesis_blind_mode_bool { + #2 + } { + #1 + } +} + +\cs_new:Npn \__bithesis_secret_info:N #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } +} +\cs_new:Npn \__bithesis_secret_info:n #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } +} + +\cs_generate_variant:Nn \__bithesis_secret_info:n {x} + \cs_new:Npn \__bithesis_get_const:N #1 { \__bithesis_if_thesis_english:TF { \use:c {c__bithesis_label_ #1 _en_tl} @@ -316,6 +337,8 @@ underlineThickness .initial:n = {1pt}, underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, underlineOffset .initial:n = { -10pt }, + hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, + hideCoverInPeerReview .initial:n = {false}, } \keys_define:nn { bithesis / info } { @@ -358,7 +381,7 @@ degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\c__bithesis_label_university_tl}, + institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l__bithesis_value_author_en_tl, @@ -445,6 +468,8 @@ autoref / table .initial:n = {\__bithesis_get_const:N {tab}}, autoref / equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, autoref / equ .initial:n = {\__bithesis_get_const:N {equ}}, + style / substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, + style / substituteSymbol .initial:n = {*}, } \keys_define:nn { bithesis / style } @@ -517,6 +542,9 @@ \__bithesis_if_thesis_english:T { \PassOptionsToClass{scheme=plain}{ctexbook} } +\bool_if:NT \g__bithesis_blind_mode_bool { + \bool_set_false:N \g__bithesis_twoside_bool +} \bool_if:NTF \g__bithesis_twoside_bool {} { \PassOptionsToClass{oneside}{ctexbook} } @@ -1144,7 +1172,7 @@ {\heiti\zihao{-2} \l__bithesis_value_title_tl} \vskip 60mm % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_value_author_tl} + {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} \vskip 10mm % 黑体 小三 {\heiti \zihao{-3} \l__bithesis_cover_date_tl} @@ -1164,7 +1192,7 @@ {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} } \vfill - {\heiti\zihao{3}\l__bithesis_value_author_tl} + {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} \vfill {\heiti\zihao{3}\c__bithesis_label_university_tl} \end{center} @@ -1215,10 +1243,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, + {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, @@ -1266,10 +1294,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, - {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, + {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, @@ -1365,9 +1393,17 @@ { \hbox:n { } \thispagestyle { empty } \newpage } } } +\DeclareDocumentCommand \SecretInfo { m o } + { + \IfValueTF {#2} { + \__bithesis_secret_info:nn {#1} {#2} + } { + \__bithesis_secret_info:x {#1} + } + } \DeclareDocumentCommand \MakeCover {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \group_begin: \int_case:nn {\g__bithesis_thesis_type_int} @@ -1417,11 +1453,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \zihao{3} @@ -1514,11 +1550,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \__bithesis_render_cover_entry:n \l__bithesis_input_clist @@ -1605,7 +1641,7 @@ \NewDocumentCommand \MakeOriginality {} { \group_begin: - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \int_case:nn {\g__bithesis_thesis_type_int} { {1} @@ -1707,13 +1743,13 @@ } \NewDocumentCommand \MakePaperBack {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \make_paper_back: \end{blindPeerReview} } \NewDocumentCommand \MakeTitle {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \__bithesis_make_chinese_title_page: \__bithesis_make_english_title_page: \end{blindPeerReview} diff --git a/templates/graduate-thesis/main.tex b/templates/graduate-thesis/main.tex index a028ee88..ad2b32d3 100644 --- a/templates/graduate-thesis/main.tex +++ b/templates/graduate-thesis/main.tex @@ -50,8 +50,11 @@ % 如需覆盖竖排标题,请配置以下选项。 % 下面的例子展示了如何在竖排标题中使用垂直或者旋转的英文。 % verticalTitle = {形状记忆聚氨酯{L } {T } {X }的合成 \rotatebox[origin=c]{-90}{Feng Kaiyu} 及其在织物中的应用}, - titleEn = Synthesisand Application on textile of the Shape Memory Polyurethane, + titleEn = Synthesis and Application on textile of the Shape Memory Polyurethane, author = 张三, + % 如果想要手动控制盲审模式下的隐藏信息,可以使用宏 \SecretInfo{}。使用方式有两种,如: + % major = \SecretInfo{材料科学与工程} 可以得到 ******* (用等量的替换符号替代) + % major = \SecretInfo{材料科学与工程}[ABCDEF] 可以得到 ABCDEF (用你自定义的内容替代) major = 材料科学与工程, school = 材料学院, degree = 工学硕士, diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 77cbb93b..d8e79faf 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -37,6 +37,27 @@ \tl_new:N \g__bithesis_label_divide_char_tl \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq +\cs_new:Npn \__bithesis_hide:n #1 { + \g__bithesis_const_substitute_symbol_tl +} + +\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { + \bool_if:nTF \g__bithesis_blind_mode_bool { + #2 + } { + #1 + } +} + +\cs_new:Npn \__bithesis_secret_info:N #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } +} +\cs_new:Npn \__bithesis_secret_info:n #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } +} + +\cs_generate_variant:Nn \__bithesis_secret_info:n {x} + \cs_new:Npn \__bithesis_get_const:N #1 { \__bithesis_if_thesis_english:TF { \use:c {c__bithesis_label_ #1 _en_tl} @@ -316,6 +337,8 @@ underlineThickness .initial:n = {1pt}, underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, underlineOffset .initial:n = { -10pt }, + hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, + hideCoverInPeerReview .initial:n = {false}, } \keys_define:nn { bithesis / info } { @@ -358,7 +381,7 @@ degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\c__bithesis_label_university_tl}, + institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l__bithesis_value_author_en_tl, @@ -445,6 +468,8 @@ autoref / table .initial:n = {\__bithesis_get_const:N {tab}}, autoref / equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, autoref / equ .initial:n = {\__bithesis_get_const:N {equ}}, + style / substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, + style / substituteSymbol .initial:n = {*}, } \keys_define:nn { bithesis / style } @@ -517,6 +542,9 @@ \__bithesis_if_thesis_english:T { \PassOptionsToClass{scheme=plain}{ctexbook} } +\bool_if:NT \g__bithesis_blind_mode_bool { + \bool_set_false:N \g__bithesis_twoside_bool +} \bool_if:NTF \g__bithesis_twoside_bool {} { \PassOptionsToClass{oneside}{ctexbook} } @@ -1144,7 +1172,7 @@ {\heiti\zihao{-2} \l__bithesis_value_title_tl} \vskip 60mm % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_value_author_tl} + {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} \vskip 10mm % 黑体 小三 {\heiti \zihao{-3} \l__bithesis_cover_date_tl} @@ -1164,7 +1192,7 @@ {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} } \vfill - {\heiti\zihao{3}\l__bithesis_value_author_tl} + {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} \vfill {\heiti\zihao{3}\c__bithesis_label_university_tl} \end{center} @@ -1215,10 +1243,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, + {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, @@ -1266,10 +1294,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, - {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, + {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, @@ -1365,9 +1393,17 @@ { \hbox:n { } \thispagestyle { empty } \newpage } } } +\DeclareDocumentCommand \SecretInfo { m o } + { + \IfValueTF {#2} { + \__bithesis_secret_info:nn {#1} {#2} + } { + \__bithesis_secret_info:x {#1} + } + } \DeclareDocumentCommand \MakeCover {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \group_begin: \int_case:nn {\g__bithesis_thesis_type_int} @@ -1417,11 +1453,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \zihao{3} @@ -1514,11 +1550,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \__bithesis_render_cover_entry:n \l__bithesis_input_clist @@ -1605,7 +1641,7 @@ \NewDocumentCommand \MakeOriginality {} { \group_begin: - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \int_case:nn {\g__bithesis_thesis_type_int} { {1} @@ -1707,13 +1743,13 @@ } \NewDocumentCommand \MakePaperBack {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \make_paper_back: \end{blindPeerReview} } \NewDocumentCommand \MakeTitle {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \__bithesis_make_chinese_title_page: \__bithesis_make_english_title_page: \end{blindPeerReview} diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 77cbb93b..d8e79faf 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -37,6 +37,27 @@ \tl_new:N \g__bithesis_label_divide_char_tl \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq +\cs_new:Npn \__bithesis_hide:n #1 { + \g__bithesis_const_substitute_symbol_tl +} + +\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { + \bool_if:nTF \g__bithesis_blind_mode_bool { + #2 + } { + #1 + } +} + +\cs_new:Npn \__bithesis_secret_info:N #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } +} +\cs_new:Npn \__bithesis_secret_info:n #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } +} + +\cs_generate_variant:Nn \__bithesis_secret_info:n {x} + \cs_new:Npn \__bithesis_get_const:N #1 { \__bithesis_if_thesis_english:TF { \use:c {c__bithesis_label_ #1 _en_tl} @@ -316,6 +337,8 @@ underlineThickness .initial:n = {1pt}, underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, underlineOffset .initial:n = { -10pt }, + hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, + hideCoverInPeerReview .initial:n = {false}, } \keys_define:nn { bithesis / info } { @@ -358,7 +381,7 @@ degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\c__bithesis_label_university_tl}, + institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l__bithesis_value_author_en_tl, @@ -445,6 +468,8 @@ autoref / table .initial:n = {\__bithesis_get_const:N {tab}}, autoref / equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, autoref / equ .initial:n = {\__bithesis_get_const:N {equ}}, + style / substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, + style / substituteSymbol .initial:n = {*}, } \keys_define:nn { bithesis / style } @@ -517,6 +542,9 @@ \__bithesis_if_thesis_english:T { \PassOptionsToClass{scheme=plain}{ctexbook} } +\bool_if:NT \g__bithesis_blind_mode_bool { + \bool_set_false:N \g__bithesis_twoside_bool +} \bool_if:NTF \g__bithesis_twoside_bool {} { \PassOptionsToClass{oneside}{ctexbook} } @@ -1144,7 +1172,7 @@ {\heiti\zihao{-2} \l__bithesis_value_title_tl} \vskip 60mm % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_value_author_tl} + {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} \vskip 10mm % 黑体 小三 {\heiti \zihao{-3} \l__bithesis_cover_date_tl} @@ -1164,7 +1192,7 @@ {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} } \vfill - {\heiti\zihao{3}\l__bithesis_value_author_tl} + {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} \vfill {\heiti\zihao{3}\c__bithesis_label_university_tl} \end{center} @@ -1215,10 +1243,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, + {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, @@ -1266,10 +1294,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, - {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, + {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, @@ -1365,9 +1393,17 @@ { \hbox:n { } \thispagestyle { empty } \newpage } } } +\DeclareDocumentCommand \SecretInfo { m o } + { + \IfValueTF {#2} { + \__bithesis_secret_info:nn {#1} {#2} + } { + \__bithesis_secret_info:x {#1} + } + } \DeclareDocumentCommand \MakeCover {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \group_begin: \int_case:nn {\g__bithesis_thesis_type_int} @@ -1417,11 +1453,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \zihao{3} @@ -1514,11 +1550,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \__bithesis_render_cover_entry:n \l__bithesis_input_clist @@ -1605,7 +1641,7 @@ \NewDocumentCommand \MakeOriginality {} { \group_begin: - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \int_case:nn {\g__bithesis_thesis_type_int} { {1} @@ -1707,13 +1743,13 @@ } \NewDocumentCommand \MakePaperBack {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \make_paper_back: \end{blindPeerReview} } \NewDocumentCommand \MakeTitle {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \__bithesis_make_chinese_title_page: \__bithesis_make_english_title_page: \end{blindPeerReview} diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 77cbb93b..d8e79faf 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -37,6 +37,27 @@ \tl_new:N \g__bithesis_label_divide_char_tl \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq +\cs_new:Npn \__bithesis_hide:n #1 { + \g__bithesis_const_substitute_symbol_tl +} + +\cs_new:Npn \__bithesis_secret_info:nn #1 #2 { + \bool_if:nTF \g__bithesis_blind_mode_bool { + #2 + } { + #1 + } +} + +\cs_new:Npn \__bithesis_secret_info:N #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN #1 \__bithesis_hide:n } +} +\cs_new:Npn \__bithesis_secret_info:n #1 { + \__bithesis_secret_info:nn {#1} {\tl_map_function:NN {#1} \__bithesis_hide:n } +} + +\cs_generate_variant:Nn \__bithesis_secret_info:n {x} + \cs_new:Npn \__bithesis_get_const:N #1 { \__bithesis_if_thesis_english:TF { \use:c {c__bithesis_label_ #1 _en_tl} @@ -316,6 +337,8 @@ underlineThickness .initial:n = {1pt}, underlineOffset .dim_set:N = \l__bithesis_cover_underline_offset_dim, underlineOffset .initial:n = { -10pt }, + hideCoverInPeerReview .bool_set:N = \l__bithesis_style_hide_cover_in_peer_review_bool, + hideCoverInPeerReview .initial:n = {false}, } \keys_define:nn { bithesis / info } { @@ -358,7 +381,7 @@ degreeEn .tl_set:N = \l__bithesis_value_degree_en_tl, degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l__bithesis_value_institute_tl, - institute .initial:n = {\c__bithesis_label_university_tl}, + institute .initial:n = {\tl_use:N \c__bithesis_label_university_tl}, defenseDate .tl_set:N = \l__bithesis_value_defense_date_tl, defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l__bithesis_value_author_en_tl, @@ -445,6 +468,8 @@ autoref / table .initial:n = {\__bithesis_get_const:N {tab}}, autoref / equ .tl_set:N = \g__bithesis_const_autoref_equ_tl, autoref / equ .initial:n = {\__bithesis_get_const:N {equ}}, + style / substituteSymbol .tl_set:N = \g__bithesis_const_substitute_symbol_tl, + style / substituteSymbol .initial:n = {*}, } \keys_define:nn { bithesis / style } @@ -517,6 +542,9 @@ \__bithesis_if_thesis_english:T { \PassOptionsToClass{scheme=plain}{ctexbook} } +\bool_if:NT \g__bithesis_blind_mode_bool { + \bool_set_false:N \g__bithesis_twoside_bool +} \bool_if:NTF \g__bithesis_twoside_bool {} { \PassOptionsToClass{oneside}{ctexbook} } @@ -1144,7 +1172,7 @@ {\heiti\zihao{-2} \l__bithesis_value_title_tl} \vskip 60mm % 黑体 小三 - {\heiti \zihao{-3} \l__bithesis_value_author_tl} + {\heiti \zihao{-3} \__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl~\g__bithesis_const_substitute_symbol_tl}} \vskip 10mm % 黑体 小三 {\heiti \zihao{-3} \l__bithesis_cover_date_tl} @@ -1164,7 +1192,7 @@ {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl} } \vfill - {\heiti\zihao{3}\l__bithesis_value_author_tl} + {\heiti\zihao{3}\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl\quad\g__bithesis_const_substitute_symbol_tl}} \vfill {\heiti\zihao{3}\c__bithesis_label_university_tl} \end{center} @@ -1215,10 +1243,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_tl} {\l__bithesis_value_author_tl}, + {\c__bithesis_graduate_label_author_tl} {\__bithesis_secret_info:nn{\l__bithesis_value_author_tl}{\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl\g__bithesis_const_substitute_symbol_tl}}, {\c__bithesis_graduate_label_school_tl} {\l__bithesis_value_school_tl}, - {\c__bithesis_graduate_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_graduate_label_chairman_tl} {\l__bithesis_value_chairman_tl}, + {\c__bithesis_graduate_label_supervisor_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_tl}}, + {\c__bithesis_graduate_label_chairman_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_tl}}, {\c__bithesis_graduate_label_degree_tl} {\l__bithesis_value_degree_tl}, {\c__bithesis_graduate_label_major_tl} {\l__bithesis_value_major_tl}, {\c__bithesis_graduate_label_institute_tl} {\l__bithesis_value_institute_tl}, @@ -1266,10 +1294,10 @@ % 渲染信息。 \clist_set:Nn \l__bithesis_input_clist { - {\c__bithesis_graduate_label_author_en_tl} {\l__bithesis_value_author_en_tl}, + {\c__bithesis_graduate_label_author_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_author_en_tl}}, {\c__bithesis_graduate_label_school_en_tl} {\l__bithesis_value_school_en_tl}, - {\c__bithesis_graduate_label_supervisor_en_tl} {\l__bithesis_value_supervisor_en_tl}, - {\c__bithesis_graduate_label_chairman_en_tl} {\l__bithesis_value_chairman_en_tl}, + {\c__bithesis_graduate_label_supervisor_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_supervisor_en_tl}}, + {\c__bithesis_graduate_label_chairman_en_tl} {\__bithesis_secret_info:x{\l__bithesis_value_chairman_en_tl}}, {\c__bithesis_graduate_label_degree_en_tl} {\l__bithesis_value_degree_en_tl}, {\c__bithesis_graduate_label_major_en_tl} {\l__bithesis_value_major_en_tl}, {\c__bithesis_graduate_label_institute_en_tl} {\l__bithesis_value_institute_en_tl}, @@ -1365,9 +1393,17 @@ { \hbox:n { } \thispagestyle { empty } \newpage } } } +\DeclareDocumentCommand \SecretInfo { m o } + { + \IfValueTF {#2} { + \__bithesis_secret_info:nn {#1} {#2} + } { + \__bithesis_secret_info:x {#1} + } + } \DeclareDocumentCommand \MakeCover {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \group_begin: \int_case:nn {\g__bithesis_thesis_type_int} @@ -1417,11 +1453,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \zihao{3} @@ -1514,11 +1550,11 @@ \clist_set:Nn \l__bithesis_input_clist { {\c__bithesis_label_school_tl} {\l__bithesis_value_school_tl}, {\c__bithesis_label_major_tl} {\l__bithesis_value_major_tl}, - {\c__bithesis_label_class_tl} {\l__bithesis_value_class_tl}, - {\c__bithesis_label_author_tl} {\l__bithesis_value_author_tl}, - {\c__bithesis_label_student_id_tl} {\l__bithesis_value_student_id_tl}, - {\c__bithesis_label_supervisor_tl} {\l__bithesis_value_supervisor_tl}, - {\c__bithesis_label_co_supervisor_tl} {\l__bithesis_value_external_supervisor_tl}, + {\c__bithesis_label_class_tl} {\__bithesis_secret_info:N \l__bithesis_value_class_tl}, + {\c__bithesis_label_author_tl} {\__bithesis_secret_info:N \l__bithesis_value_author_tl}, + {\c__bithesis_label_student_id_tl} {\__bithesis_secret_info:N \l__bithesis_value_student_id_tl}, + {\c__bithesis_label_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_supervisor_tl}, + {\c__bithesis_label_co_supervisor_tl} {\__bithesis_secret_info:N \l__bithesis_value_external_supervisor_tl}, } \__bithesis_render_cover_entry:n \l__bithesis_input_clist @@ -1605,7 +1641,7 @@ \NewDocumentCommand \MakeOriginality {} { \group_begin: - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \int_case:nn {\g__bithesis_thesis_type_int} { {1} @@ -1707,13 +1743,13 @@ } \NewDocumentCommand \MakePaperBack {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \make_paper_back: \end{blindPeerReview} } \NewDocumentCommand \MakeTitle {} { - \begin{blindPeerReview} + \begin{blindPeerReview}[\l__bithesis_style_hide_cover_in_peer_review_bool] \__bithesis_make_chinese_title_page: \__bithesis_make_english_title_page: \end{blindPeerReview}