From 930fbd580e43b434b0b0d0e7ff57e3bf071a03af Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Sat, 10 Sep 2022 10:00:39 +0800 Subject: [PATCH 01/10] fix: bump cls version in packages. --- templates/graduate-thesis/bithesis.cls | 2 +- templates/lab-report/bitreport.cls | 2 +- templates/paper-translation/bithesis.cls | 2 +- templates/presentation-slide/bitbeamer.cls | 2 +- templates/undergraduate-proposal-report/bitreport.cls | 2 +- templates/undergraduate-thesis-en/bithesis.cls | 2 +- templates/undergraduate-thesis/bithesis.cls | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 7521e919..d63d15bd 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/lab-report/bitreport.cls b/templates/lab-report/bitreport.cls index 5161659e..e75fd27a 100644 --- a/templates/lab-report/bitreport.cls +++ b/templates/lab-report/bitreport.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitreport} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_report_type_int diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 7521e919..d63d15bd 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/presentation-slide/bitbeamer.cls b/templates/presentation-slide/bitbeamer.cls index 235aa8c8..c07f0779 100644 --- a/templates/presentation-slide/bitbeamer.cls +++ b/templates/presentation-slide/bitbeamer.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitbeamer} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \keys_define:nn { bitbeamer } diff --git a/templates/undergraduate-proposal-report/bitreport.cls b/templates/undergraduate-proposal-report/bitreport.cls index 5161659e..e75fd27a 100644 --- a/templates/undergraduate-proposal-report/bitreport.cls +++ b/templates/undergraduate-proposal-report/bitreport.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitreport} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_report_type_int diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 7521e919..d63d15bd 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 7521e919..d63d15bd 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-06-10}{3.0.0}{BIT Thesis Templates} +{2022-09-03}{3.0.0}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int From e2083f0712222a680e56652964506ebccd002fe7 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Mon, 12 Sep 2022 10:42:52 +0800 Subject: [PATCH 02/10] docs: Add more precise description on `ctex`. --- bithesis.dtx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bithesis.dtx b/bithesis.dtx index 4d8499b6..ee6f51bd 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -293,10 +293,16 @@ % % \begin{function}{ctex} % \begin{bitsyntax}[emph={[1]ctex}] -% ctex = (*传给 ctexbook 的模板选项*) +% ctex = (*{传给 ctexbook 的模板选项}*) % \end{bitsyntax} % % 该选项用于传入模板选项至 ctexbook。 +% +% 例如:想要同时修改 ctex 的字体参数和标点符号处理格式(更多选项请参考 ctex 手册)。 +% +% \begin{latex}[emph={[1]type,master,ctex,fontset,fandol,punct,banjiao,bithesis}] +% \documentclass[type=master,ctex={fontset=fandol,punct=banjiao}]{bithesis} +% \end{latex} % \end{function} % % \subsection{参数设置} @@ -1030,6 +1036,12 @@ % \end{bitsyntax} % % 该选项用于传入模板选项至 ctexbook。 +% +% 例如:想要同时修改 ctex 的字体参数和标点符号处理格式(更多选项请参考 ctex 手册)。 +% +% \begin{latex}[emph={[1]type,common,ctex,fontset,fandol,punct,banjiao,bitreport}] +% \documentclass[type=common,ctex={fontset=fandol,punct=banjiao}]{bitreport} +% \end{latex} % \end{function} % % \subsection{参数设置} From 74a27802ad2c8c2f2d4144951f699f303f80d167 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Wed, 14 Sep 2022 10:24:53 +0800 Subject: [PATCH 03/10] docs: update manual. --- bithesis.dtx | 167 +++++++++++++++--- templates/graduate-thesis/bithesis.cls | 1 - templates/paper-translation/bithesis.cls | 1 - .../undergraduate-thesis-en/bithesis.cls | 1 - templates/undergraduate-thesis/bithesis.cls | 1 - 5 files changed, 142 insertions(+), 29 deletions(-) diff --git a/bithesis.dtx b/bithesis.dtx index ee6f51bd..ba089d10 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1232,56 +1232,125 @@ %<*thesis> % \end{macrocode} -% Define Global Variables +% \subsection{全局变量与临时变量} +% 定义全局变量。 +% \begin{variable}{\g_@@_thesis_type_int} +% 论文类型,取值从 1 开始,分别对应: +% \begin{enumerate} +% \item 本科生毕业设计(论文) +% \item 本科生毕业设计(论文)外文翻译 +% \item 本科生全英文专业毕业设计(论文) +% \item 硕士学位论文 +% \item 博士学位论文 +% \end{enumerate} % \begin{macrocode} \int_new:N \g_@@_thesis_type_int +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_head_zihao_int} +% 页眉字号。研究生论文使用 5 号字,本科生论文使用 4 号字。 +% \begin{macrocode} \int_new:N \g_@@_head_zihao_int +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_twoside_bool} +% 是否双面打印。默认单面打印。 +% \begin{macrocode} \bool_new:N \g_@@_twoside_bool +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_thesis_type_english_bool} +% 是否为英文模板。目前只有本科生全英文专业的模板会将此变量设置为 true。 +% \begin{macrocode} \bool_new:N \g_@@_thesis_type_english_bool +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_blind_mode_bool} +% 是否为盲审模式。默认为 false。 +% \begin{macrocode} \bool_new:N \g_@@_blind_mode_bool +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_label_divide_char_tl} +% 用于分隔标签的字符。默认为「-」或者「.」。 +% \begin{macrocode} \tl_new:N \g_@@_label_divide_char_tl - -% \bool_new:N \l_@@_cover_auto_width_bool -% \bool_set_true:N \l_@@_cover_auto_width_bool -% -% Define tmp Variables +% \end{macrocode} +% \end{variable} +% \begin{variable}{\l_@@_right_seq, \l_@@_left_seq} +% 定义临时变量。 +% \begin{macrocode} \seq_new:N \l_@@_right_seq \seq_new:N \l_@@_left_seq +% \end{macrocode} +% \end{variable} -% helper functions - +% \subsection{辅助函数与常量} +% \begin{macro}{\tl_if_empty:xTF,\seq_set_split:Nnx} +% 生成变体。 +% \begin{macrocode} \cs_generate_variant:Nn \tl_if_empty:nTF {x} \cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} - +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_same_page:} +% 取消换页。 +% \begin{macrocode} \cs_new:Npn \@@_same_page: { \let\clearpage\relax \let\cleardoublepage\relax } - -% 是否为研究生学位论文 +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_if_graduate:TF} +% 是否为研究生学位论文。 +% \begin{macrocode} \cs_new:Npn \@@_if_graduate:TF #1#2 { \int_compare:nNnTF {3} < {\g_@@_thesis_type_int} {#1} {#2} } +% \end{macrocode} +% \end{macro} -% 是否某一特定模板 +% \begin{macro}{\@@_if_thesis_int_type:nT,\@@_if_thesis_int_type:nTF} +% 是否某一特定模板。 +% \begin{macrocode} \cs_new:Npn \@@_if_thesis_int_type:nTF #1#2#3 {\int_compare:nNnTF {\g_@@_thesis_type_int} = {#1} {#2} {#3}} \cs_new:Npn \@@_if_thesis_int_type:nT #1#2 {\@@_if_thesis_int_type:nTF {#1} {#2} {}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_if_thesis_english:T,\@@_if_thesis_english:TF} % 是否为英文模板,这里包括全英文专业和研究生模板的英文模式。 +% \begin{macrocode} \cs_new:Npn \@@_if_thesis_english:TF #1#2 {\bool_if:nTF {\g_@@_thesis_type_english_bool} {#1} {#2}} \cs_new:Npn \@@_if_thesis_english:T #1 {\@@_if_thesis_english:TF {#1}{}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_if_bachelor_thesis:TF,\@@_if_bachelor_thesis:T,\@@_if_master_thesis:TF,\@@_if_doctor_thesis:TF} +% 是否为本科、硕士、博士学位论文。 +% \begin{macrocode} \cs_new:Npn \@@_if_bachelor_thesis:TF #1#2 {\int_compare:nNnTF {\g_@@_thesis_type_int} < {4} {#1} {#2}} \cs_new:Npn \@@_if_bachelor_thesis:T #1 {\@@_if_bachelor_thesis:TF {#1} {}} \cs_new:Npn \@@_if_master_thesis:TF #1#2 {\int_compare:nNnTF {\g_@@_thesis_type_int} = {4} {#1} {#2}} \cs_new:Npn \@@_if_doctor_thesis:TF #1#2 {\int_compare:nNnTF {\g_@@_thesis_type_int} = {5} {#1} {#2}} +% \end{macrocode} +% \end{macro} -% Define Consts. + +% \begin{variable}{\c_@@_thesis_type_clist} +% 定义论文类型的列表。 +% \begin{macrocode} \clist_const:Nn \c_@@_thesis_type_clist { bachelor, bachelor_translation, bachelor_english, master, docter} +% \end{macrocode} +% \end{variable} +% \begin{macro}{\@@_define_label:nn,\@@_define_label_by_thesis_type:nnn,\@@_define_label:nnn,\@@_define_label_by_thesis_type:nnnn} +% 定义常量(标签)的辅助函数。 +% \begin{macrocode} \cs_new_protected:Npn \@@_define_label:nn #1#2 { \tl_const:cn { c_@@_label_ #1 _tl } {#2} } @@ -1301,7 +1370,33 @@ \tl_const:cn { c_@@_ #1 _label_ #2 _tl } {#3} \tl_const:cn { c_@@_ #1 _label_ #2 _en_tl } {#4} } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\smallgap:} +% 标签文字之间的间距。 +% \begin{macrocode} +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\label_space:} +% 标签与内容之间的空白间距。 +% \begin{macrocode} +\cs_new:Npn \label_space: { + \@@_if_bachelor_thesis:T { + \quad + } +} +% \end{macrocode} +% \end{macro} +% \begin{variable}{\c_@@_label_code_tl,\c_@@_label_udc_tl, +% \c_@@_label_classification_tl,\c_@@_label_classified_level_tl,\c_@@_label_type_tl} +% 没有对应英文的常量。 +% \begin{macrocode} \clist_map_inline:nn { {code} {代码}, @@ -1311,7 +1406,12 @@ {type} {种类}, } {\@@_define_label:nn #1} +% \end{macrocode} +% \end{variable} +% \begin{variable}{\c_@@_bachelor_label_xxx_tl} +% 本科毕设的常量。 +% \begin{macrocode} % bachelor \clist_map_inline:nn { @@ -1323,8 +1423,12 @@ {originality_author_signature} {本人签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{13mm}年\hspace{8mm}月\hspace{8mm}日}, } {\@@_define_label_by_thesis_type:nnn {bachelor} #1} +% \end{macrocode} +% \end{variable} -% % bachelor english +% \begin{variable}{\c_@@_bachelor_english_label_xxx_tl} +% 全英文专业的常量。 +% \begin{macrocode} \clist_map_inline:nn { {title} {}, @@ -1345,17 +1449,12 @@ I~fully~understand~the~regulations~on~the~storage,~use~of~graduation~design~(thesis)~in~Beijing~Institute~of~Technology.~Beijing~Institute~of~Technology~has~the~right~to~(1)~keep,~and~to~the~relevant~departments~to~send~the~original~or~copy~of~this~graduation~design~(thesis);~(2)~copy~and~preserve~this~graduation~design~(thesis)~by~photocopying,~miniature~or~other~means~of~reproduction;~(3)~allow~this~graduation~design~(thesis)~to~be~read~or~borrowed;~(4)~for~the~purpose~of~academic~exchange,~copy,~give~and~exchange~this~graduation~design~(thesis);~(5)~publish~all~or~part~of~the~contents~of~this~graduation~design~(thesis).~ }, } {\@@_define_label_by_thesis_type:nnn {bachelor_english} #1} +% \end{macrocode} +% \end{variable} -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} - -\cs_new:Npn \label_space: { - \@@_if_bachelor_thesis:T { - \quad - } -} - +% \begin{variable}{\c_@@_graduate_label_xxx_tl} +% 研究生模板的常量。 +% \begin{macrocode} % graduate \clist_map_inline:nn { @@ -1366,7 +1465,12 @@ {originality_author_signature} {签\qquad 名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, {originality_supervisor_signature} {指导老师签名:\hspace{40mm}日\hspace{2.5mm}期:\hspace{30mm}\quad}, } {\@@_define_label_by_thesis_type:nnn {graduate} #1} +% \end{macrocode} +% \end{variable} +% \begin{variable}{\c_@@_graduate_label_xxx_tl,\c_@@_graduate_label_xxx_en_tl} +% 研究生模板的中英常量。 +% \begin{macrocode} \clist_map_inline:nn { {author} {作\quad 者\quad 姓\quad 名} {Candidate~Name}, @@ -1378,7 +1482,12 @@ {institute} {学\smallgap: 位\smallgap: 授\smallgap: 予\smallgap: 单\smallgap: 位} {Degree~by}, {defense_date} {论\smallgap: 文\smallgap: 答\smallgap: 辩\smallgap: 日\smallgap: 期} {The~Date~of~Defence}, } {\@@_define_label_by_thesis_type:nnnn {graduate} #1} +% \end{macrocode} +% \end{variable} +% \begin{variable}{\c_@@_label_xxx_tl,\c_@@_label_xxx_en_tl} +% 常用的中英常量。 +% \begin{macrocode} \clist_map_inline:nn { {school} {学\qquad 院} {School}, @@ -1404,8 +1513,12 @@ {symbols} {主要符号对照表} {}, } {\@@_define_label:nnn #1} +% \end{macrocode} +% \end{variable} -% TODO: \clist_item:Nn +% \begin{variable}{\c_@@_bachelor_thesis_header_clist,\c_@@_bachelor_thesis_cover_title_clist} +% 本科生模板的封面标题与页眉标题常量列表。 +% \begin{macrocode} \clist_const:Nn \c_@@_bachelor_thesis_header_clist {北京理工大学本科生毕业设计(论文), 北京理工大学本科生毕业设计(论文)外文翻译, Beijing~Institute~of~Technology~Bachelor's~Thesis } \clist_const:Nn \c_@@_bachelor_thesis_cover_title_clist @@ -1414,8 +1527,12 @@ 本科生毕业设计(论文)外文翻译, Beijing\nobreak{~}Institute\nobreak{~}of\nobreak{~}Technology~Bachelor's~Thesis, } +% \end{macrocode} +% \end{variable} +% \subsection{l3keys 接口键值对定义} +% \begin{macrocode} % key-value interface definition. \keys_define:nn { bithesis } { diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index d63d15bd..9291dfb1 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -36,7 +36,6 @@ \bool_new:N \g__bithesis_thesis_type_english_bool \bool_new:N \g__bithesis_blind_mode_bool \tl_new:N \g__bithesis_label_divide_char_tl - \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index d63d15bd..9291dfb1 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -36,7 +36,6 @@ \bool_new:N \g__bithesis_thesis_type_english_bool \bool_new:N \g__bithesis_blind_mode_bool \tl_new:N \g__bithesis_label_divide_char_tl - \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index d63d15bd..9291dfb1 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -36,7 +36,6 @@ \bool_new:N \g__bithesis_thesis_type_english_bool \bool_new:N \g__bithesis_blind_mode_bool \tl_new:N \g__bithesis_label_divide_char_tl - \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index d63d15bd..9291dfb1 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -36,7 +36,6 @@ \bool_new:N \g__bithesis_thesis_type_english_bool \bool_new:N \g__bithesis_blind_mode_bool \tl_new:N \g__bithesis_label_divide_char_tl - \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq From 411cedfce1ac9ea2f97b1d88a43321dfdb122529 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 10:04:33 +0800 Subject: [PATCH 04/10] feat: add verticalTitle option in book spine. Also, adding more examples in both docs and comments. --- bithesis.dtx | 26 ++++++++++++++++++- templates/graduate-thesis/bithesis.cls | 26 +++++++++---------- templates/graduate-thesis/main.tex | 3 +++ templates/paper-translation/bithesis.cls | 26 +++++++++---------- .../undergraduate-thesis-en/bithesis.cls | 26 +++++++++---------- templates/undergraduate-thesis/bithesis.cls | 26 +++++++++---------- 6 files changed, 76 insertions(+), 57 deletions(-) diff --git a/bithesis.dtx b/bithesis.dtx index ba089d10..244135ba 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -487,6 +487,28 @@ % 论文标题。 % \end{function} % +% \begin{function}{info/verticalTitle} +% \begin{bitsyntax}[emph={[1]verticalTitle}] +% verticalTitle = (*\marg{字符串}*) +% \end{bitsyntax} +% +% 书籍页竖排标题。此选项默认为空。为空时,会被 \kvopt{info/title}{字符串} 替代。 +% +% 如想要使用竖排英文,可以使用 \lstinline|{X }|。其中 X 为英文字符,每个竖排英文间需要空一格。 +% 比如,想要竖排「LaTeX」,可以使用: +% +% \begin{latex}[emph={[1]}] +% verticalTitle = {其他文字{L } {a } {T } {e } {X }其他文字} +% \end{latex} +% +% 如果想要使用旋转竖排英文,可以使用 \lstinline|\rotatebox[origin=c]{-90}{English text}|。 +% +% \begin{latex}[emph={[1]}] +% verticalTitle = {其他文字 \lstinline{\rotatebox[origin=c]{-90}{English text}} 其他文字} +% \end{latex} +% +% \end{function} +% % \begin{function}{info/school,info/schoolEn} % \begin{bitsyntax}[emph={[1]school,schoolEn}] % school = (*\marg{字符串}*) @@ -1590,6 +1612,7 @@ { title .tl_set:N = \l_@@_value_title_tl, titleEn .tl_set:N = \l_@@_value_title_en_tl, + verticalTitle .tl_set:N = \l_@@_value_vertical_title_tl, school .tl_set:N = \l_@@_value_school_tl, major .tl_set:N = \l_@@_value_major_tl, author .tl_set:N = \l_@@_value_author_tl, @@ -2184,7 +2207,7 @@ \setstretch{1.1} \begin{minipage}[t][19.7cm]{2em} \begin{center} - {\heiti\zihao{3}\l_@@_value_title_tl} + {\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}\l_@@_value_author_tl} \vfill @@ -5026,3 +5049,4 @@ footskip=0.7cm% 页脚 1.8cm % % TeX-master: t % End: % \fi + diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 9291dfb1..79a2b67b 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -39,15 +39,12 @@ \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq - \cs_generate_variant:Nn \tl_if_empty:nTF {x} \cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} - \cs_new:Npn \__bithesis_same_page: { \let\clearpage\relax \let\cleardoublepage\relax } - \cs_new:Npn \__bithesis_if_graduate:TF #1#2 { \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} {#1} @@ -88,6 +85,16 @@ \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} } +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + \clist_map_inline:nn { {code} {代码}, @@ -130,16 +137,6 @@ }, } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} - -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} - \clist_map_inline:nn { {originality} {研究成果声明}, @@ -253,6 +250,7 @@ { title .tl_set:N = \l__bithesis_value_title_tl, titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, school .tl_set:N = \l__bithesis_value_school_tl, major .tl_set:N = \l__bithesis_value_major_tl, author .tl_set:N = \l__bithesis_value_author_tl, @@ -784,7 +782,7 @@ \setstretch{1.1} \begin{minipage}[t][19.7cm]{2em} \begin{center} - {\heiti\zihao{3}\l__bithesis_value_title_tl} + {\heiti\zihao{3} \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl}} \vfill {\heiti\zihao{3}\l__bithesis_value_author_tl} \vfill diff --git a/templates/graduate-thesis/main.tex b/templates/graduate-thesis/main.tex index a77341a9..d5c9341e 100644 --- a/templates/graduate-thesis/main.tex +++ b/templates/graduate-thesis/main.tex @@ -35,6 +35,9 @@ classification = TQ028.1, UDC = 540, title = 形状记忆聚氨酯的合成及其在织物中的应用, + % 如需覆盖竖排标题,请配置以下选项。 + % 下面的例子展示了如何在竖排标题中使用垂直或者旋转的英文。 + % verticalTitle = {形状记忆聚氨酯{L } {T } {X }的合成 \rotatebox[origin=c]{-90}{Feng Kaiyu} 及其在织物中的应用}, titleEn = Synthesisand Application on textile of the Shape Memory Polyurethane, author = 张三, major = 材料科学与工程, diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 9291dfb1..79a2b67b 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -39,15 +39,12 @@ \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq - \cs_generate_variant:Nn \tl_if_empty:nTF {x} \cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} - \cs_new:Npn \__bithesis_same_page: { \let\clearpage\relax \let\cleardoublepage\relax } - \cs_new:Npn \__bithesis_if_graduate:TF #1#2 { \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} {#1} @@ -88,6 +85,16 @@ \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} } +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + \clist_map_inline:nn { {code} {代码}, @@ -130,16 +137,6 @@ }, } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} - -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} - \clist_map_inline:nn { {originality} {研究成果声明}, @@ -253,6 +250,7 @@ { title .tl_set:N = \l__bithesis_value_title_tl, titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, school .tl_set:N = \l__bithesis_value_school_tl, major .tl_set:N = \l__bithesis_value_major_tl, author .tl_set:N = \l__bithesis_value_author_tl, @@ -784,7 +782,7 @@ \setstretch{1.1} \begin{minipage}[t][19.7cm]{2em} \begin{center} - {\heiti\zihao{3}\l__bithesis_value_title_tl} + {\heiti\zihao{3} \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl}} \vfill {\heiti\zihao{3}\l__bithesis_value_author_tl} \vfill diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 9291dfb1..79a2b67b 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -39,15 +39,12 @@ \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq - \cs_generate_variant:Nn \tl_if_empty:nTF {x} \cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} - \cs_new:Npn \__bithesis_same_page: { \let\clearpage\relax \let\cleardoublepage\relax } - \cs_new:Npn \__bithesis_if_graduate:TF #1#2 { \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} {#1} @@ -88,6 +85,16 @@ \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} } +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + \clist_map_inline:nn { {code} {代码}, @@ -130,16 +137,6 @@ }, } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} - -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} - \clist_map_inline:nn { {originality} {研究成果声明}, @@ -253,6 +250,7 @@ { title .tl_set:N = \l__bithesis_value_title_tl, titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, school .tl_set:N = \l__bithesis_value_school_tl, major .tl_set:N = \l__bithesis_value_major_tl, author .tl_set:N = \l__bithesis_value_author_tl, @@ -784,7 +782,7 @@ \setstretch{1.1} \begin{minipage}[t][19.7cm]{2em} \begin{center} - {\heiti\zihao{3}\l__bithesis_value_title_tl} + {\heiti\zihao{3} \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl}} \vfill {\heiti\zihao{3}\l__bithesis_value_author_tl} \vfill diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 9291dfb1..79a2b67b 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -39,15 +39,12 @@ \seq_new:N \l__bithesis_right_seq \seq_new:N \l__bithesis_left_seq - \cs_generate_variant:Nn \tl_if_empty:nTF {x} \cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} - \cs_new:Npn \__bithesis_same_page: { \let\clearpage\relax \let\cleardoublepage\relax } - \cs_new:Npn \__bithesis_if_graduate:TF #1#2 { \int_compare:nNnTF {3} < {\g__bithesis_thesis_type_int} {#1} @@ -88,6 +85,16 @@ \tl_const:cn { c__bithesis_ #1 _label_ #2 _en_tl } {#4} } +\cs_new:Npn \smallgap: { + \hspace{0.45ex} +} + +\cs_new:Npn \label_space: { + \__bithesis_if_bachelor_thesis:T { + \quad + } +} + \clist_map_inline:nn { {code} {代码}, @@ -130,16 +137,6 @@ }, } {\__bithesis_define_label_by_thesis_type:nnn {bachelor_english} #1} -\cs_new:Npn \smallgap: { - \hspace{0.45ex} -} - -\cs_new:Npn \label_space: { - \__bithesis_if_bachelor_thesis:T { - \quad - } -} - \clist_map_inline:nn { {originality} {研究成果声明}, @@ -253,6 +250,7 @@ { title .tl_set:N = \l__bithesis_value_title_tl, titleEn .tl_set:N = \l__bithesis_value_title_en_tl, + verticalTitle .tl_set:N = \l__bithesis_value_vertical_title_tl, school .tl_set:N = \l__bithesis_value_school_tl, major .tl_set:N = \l__bithesis_value_major_tl, author .tl_set:N = \l__bithesis_value_author_tl, @@ -784,7 +782,7 @@ \setstretch{1.1} \begin{minipage}[t][19.7cm]{2em} \begin{center} - {\heiti\zihao{3}\l__bithesis_value_title_tl} + {\heiti\zihao{3} \tl_if_blank:VTF \l__bithesis_value_vertical_title_tl {\l__bithesis_value_title_tl}{\l__bithesis_value_vertical_title_tl}} \vfill {\heiti\zihao{3}\l__bithesis_value_author_tl} \vfill From 5ec5c1ec555e828c92232a4875214d69578eeb1e Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 10:05:34 +0800 Subject: [PATCH 05/10] refactor: uncomment default value for cover/date. --- templates/graduate-thesis/main.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graduate-thesis/main.tex b/templates/graduate-thesis/main.tex index d5c9341e..9e4f2ae0 100644 --- a/templates/graduate-thesis/main.tex +++ b/templates/graduate-thesis/main.tex @@ -26,7 +26,7 @@ \BITSetup{ cover = { %% 使用以下参数来自定义封面日期 - % date = 2022年6月, + date = 2022年6月, }, info = { % 想要删除某项封面信息,直接删除该项即可。 From 5470390075fc6ec7b57e6b4eaabe8274b67a95df Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 10:07:47 +0800 Subject: [PATCH 06/10] chore: bump version. --- bithesis.dtx | 4 ++-- templates/graduate-thesis/bithesis.cls | 2 +- templates/lab-report/bitreport.cls | 2 +- templates/paper-translation/bithesis.cls | 2 +- templates/presentation-slide/bitbeamer.cls | 2 +- templates/undergraduate-proposal-report/bitreport.cls | 2 +- templates/undergraduate-thesis-en/bithesis.cls | 2 +- templates/undergraduate-thesis/bithesis.cls | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bithesis.dtx b/bithesis.dtx index 244135ba..07d4833b 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -21,7 +21,7 @@ %\ProvidesExplClass{bithesis} %\ProvidesExplClass{bitreport} %\ProvidesExplClass{bitbeamer} -%{2022-09-03}{3.0.0}{BIT Thesis Templates} +%{2022-09-15}{3.0.1}{BIT Thesis Templates} % %\NeedsTeXFormat{LaTeX2e}[2020/10/01] %\ProvidesClass{bitbook} @@ -30,7 +30,7 @@ % [2022/05/09 v2.1.1 BIT Thesis Templates] % %<*driver> -\ProvidesFile{bithesis.dtx}[2022/09/03 3.0.0 BIT Thesis Templates] +\ProvidesFile{bithesis.dtx}[2022/09/15 3.0.1 BIT Thesis Templates] \documentclass[letterpaper]{l3doc} \usepackage{dtx-style} diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 79a2b67b..e7ca9704 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/lab-report/bitreport.cls b/templates/lab-report/bitreport.cls index e75fd27a..fde2f8f7 100644 --- a/templates/lab-report/bitreport.cls +++ b/templates/lab-report/bitreport.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitreport} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_report_type_int diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 79a2b67b..e7ca9704 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/presentation-slide/bitbeamer.cls b/templates/presentation-slide/bitbeamer.cls index c07f0779..c321add6 100644 --- a/templates/presentation-slide/bitbeamer.cls +++ b/templates/presentation-slide/bitbeamer.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitbeamer} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \keys_define:nn { bitbeamer } diff --git a/templates/undergraduate-proposal-report/bitreport.cls b/templates/undergraduate-proposal-report/bitreport.cls index e75fd27a..fde2f8f7 100644 --- a/templates/undergraduate-proposal-report/bitreport.cls +++ b/templates/undergraduate-proposal-report/bitreport.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bitreport} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_report_type_int diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 79a2b67b..e7ca9704 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 79a2b67b..e7ca9704 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -27,7 +27,7 @@ %% \RequirePackage{expl3,l3keys2e} \ProvidesExplClass{bithesis} -{2022-09-03}{3.0.0}{BIT Thesis Templates} +{2022-09-15}{3.0.1}{BIT Thesis Templates} \int_new:N \g__bithesis_thesis_type_int From 78c9a85c99de232e57daf4bd81b9b4a33dd441d9 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 15:54:54 +0800 Subject: [PATCH 07/10] feat: provide a option to custom the indent for bibliography. fix: #169. --- bithesis.dtx | 65 +++++++++++-------- templates/graduate-thesis/bithesis.cls | 65 +++++++++++-------- templates/paper-translation/bithesis.cls | 65 +++++++++++-------- .../undergraduate-thesis-en/bithesis.cls | 65 +++++++++++-------- templates/undergraduate-thesis/bithesis.cls | 65 +++++++++++-------- templates/undergraduate-thesis/main.tex | 5 ++ 6 files changed, 190 insertions(+), 140 deletions(-) diff --git a/bithesis.dtx b/bithesis.dtx index 07d4833b..a218cc47 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -1662,6 +1662,8 @@ {5} {北京理工大学博士学位论文} } }, + bibliographyIndent .bool_set:N = \l_@@_style_bibliography_indent_bool, + bibliographyIndent .initial:n = {true}, } \keys_define:nn { bithesis / TOC } @@ -2886,21 +2888,25 @@ } % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l_@@_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } + \@@_if_thesis_english:TF { \chapter{\c_@@_label_reference_en_tl} } { @@ -2995,20 +3001,23 @@ \renewcommand{\baselinestretch}{1.2} % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l_@@_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } % ===== 上方定义与「参考文献」部分相同 diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index e7ca9704..60488724 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -300,6 +300,8 @@ {5} {北京理工大学博士学位论文} } }, + bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, + bibliographyIndent .initial:n = {true}, } \keys_define:nn { bithesis / TOC } @@ -1456,21 +1458,25 @@ } % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } + \__bithesis_if_thesis_english:TF { \chapter{\c__bithesis_label_reference_en_tl} } { @@ -1565,20 +1571,23 @@ \renewcommand{\baselinestretch}{1.2} % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } % ===== 上方定义与「参考文献」部分相同 diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index e7ca9704..60488724 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -300,6 +300,8 @@ {5} {北京理工大学博士学位论文} } }, + bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, + bibliographyIndent .initial:n = {true}, } \keys_define:nn { bithesis / TOC } @@ -1456,21 +1458,25 @@ } % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } + \__bithesis_if_thesis_english:TF { \chapter{\c__bithesis_label_reference_en_tl} } { @@ -1565,20 +1571,23 @@ \renewcommand{\baselinestretch}{1.2} % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } % ===== 上方定义与「参考文献」部分相同 diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index e7ca9704..60488724 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -300,6 +300,8 @@ {5} {北京理工大学博士学位论文} } }, + bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, + bibliographyIndent .initial:n = {true}, } \keys_define:nn { bithesis / TOC } @@ -1456,21 +1458,25 @@ } % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } + \__bithesis_if_thesis_english:TF { \chapter{\c__bithesis_label_reference_en_tl} } { @@ -1565,20 +1571,23 @@ \renewcommand{\baselinestretch}{1.2} % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } % ===== 上方定义与「参考文献」部分相同 diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index e7ca9704..60488724 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -300,6 +300,8 @@ {5} {北京理工大学博士学位论文} } }, + bibliographyIndent .bool_set:N = \l__bithesis_style_bibliography_indent_bool, + bibliographyIndent .initial:n = {true}, } \keys_define:nn { bithesis / TOC } @@ -1456,21 +1458,25 @@ } % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } + \__bithesis_if_thesis_english:TF { \chapter{\c__bithesis_label_reference_en_tl} } { @@ -1565,20 +1571,23 @@ \renewcommand{\baselinestretch}{1.2} % 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距 \setlength{\biblabelsep}{1.7mm} - % 设置参考文献后文缩进为 0(与 Word 模板保持一致) - % See: https://github.com/hushidong/biblatex-gb7714-2015 - % 如何修参考文献表的缩进? - \cs_set:Npn \itemcmd { - \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} - %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 - \setlength{\lengthid}{0pt} - \addtolength{\lengthid}{-\biblabelsep} - \setlength{\lengthlw}{\textwidth} - \addtolength{\lengthlw}{-\lengthid} - \addvspace{\bibitemsep}%恢复\bibitemsep的作用 - \hangindent\lengthid - \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% - \hspace{\biblabelsep} + + \bool_if:NF \l__bithesis_style_bibliography_indent_bool { + % 设置参考文献后文缩进为 0(与 Word 模板保持一致) + % See: https://github.com/hushidong/biblatex-gb7714-2015 + % 如何修参考文献表的缩进? + \cs_set:Npn \itemcmd { + \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} + %%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 + \setlength{\lengthid}{0pt} + \addtolength{\lengthid}{-\biblabelsep} + \setlength{\lengthlw}{\textwidth} + \addtolength{\lengthlw}{-\lengthid} + \addvspace{\bibitemsep}%恢复\bibitemsep的作用 + \hangindent\lengthid + \leavevmode\mkgbnumlabel{\printfield{labelnumber}}% + \hspace{\biblabelsep} + } } % ===== 上方定义与「参考文献」部分相同 diff --git a/templates/undergraduate-thesis/main.tex b/templates/undergraduate-thesis/main.tex index f142e730..5238ffe7 100644 --- a/templates/undergraduate-thesis/main.tex +++ b/templates/undergraduate-thesis/main.tex @@ -48,6 +48,11 @@ % 如果你的毕设为校外毕设,请将下面这一行语句解除注释(删除第一个百分号字符)并填写你的校外毕设导师名字 % externalSupervisor = 左偏树, }, + style = { + % 保持参考文献的缩进样式与 Word 模板一致。 + % 如果你不需要此样式,请将此行注释掉。 + bibliographyIndent = false, + } } % 使用 listings 宏包进行代码块使用,并使用了预定义的样式, From 329d1aef2c8c94a28043e6845a7b0eeab2a2fb20 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 15:57:55 +0800 Subject: [PATCH 08/10] fix: refine example. --- templates/graduate-thesis/reference/main.bib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graduate-thesis/reference/main.bib b/templates/graduate-thesis/reference/main.bib index 5cf57c99..ffea4bae 100644 --- a/templates/graduate-thesis/reference/main.bib +++ b/templates/graduate-thesis/reference/main.bib @@ -27,7 +27,7 @@ @article{Jiang2005Size } @article{Takahashi1996Structure, - title={Structure and properties of shape‐memory polyurethane block copolymers}, + title={Structure and properties of {shape-memory} polyurethane block copolymers}, author={Takahashi, Toshisada and Hayashi, Noriya and Hayashi, Shunichi}, journal={Journal of Applied Polymer Science}, volume={60}, From 193fa8fdaa5a8c8438f34f08c6c59760dec58b6d Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 16:07:05 +0800 Subject: [PATCH 09/10] docs: docs on bibliographyIndent. --- bithesis.dtx | 14 ++++++++++++++ templates/paper-translation/main.tex | 3 +++ templates/undergraduate-thesis-en/main.tex | 3 +++ 3 files changed, 20 insertions(+) diff --git a/bithesis.dtx b/bithesis.dtx index a218cc47..caadd242 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -667,6 +667,20 @@ % 页眉文字。 % \end{function} % +% \begin{function}{style/bibliographyIndent} +% \begin{bitsyntax}[emph={[1]bibliographyIndent}] +% bibliographyIndent = (*(true)|false*) +% \end{bitsyntax} +% +% \textit{此选项一般不需要用户自行修改。} +% +% 控制参考文献的每一项中,首行之后的行是否缩进。 +% +% 之所以提供这个选项, +% 是因为在 Word 模板中参考文献的格式要求首行之后的行不缩进。 +% 但是国标要求首行之后的行缩进。 +% \end{function} +% % \subsubsection{目录选项} % % \begin{function}{TOC} diff --git a/templates/paper-translation/main.tex b/templates/paper-translation/main.tex index 2b0c6ae1..0b411192 100644 --- a/templates/paper-translation/main.tex +++ b/templates/paper-translation/main.tex @@ -48,6 +48,9 @@ % externalSupervisor = 左偏树, }, style = { + % 保持参考文献的缩进样式与 Word 模板一致。 + % 如果你不需要此样式,请将此行注释掉。 + bibliographyIndent = false, % head = {自定义页眉文字} } } diff --git a/templates/undergraduate-thesis-en/main.tex b/templates/undergraduate-thesis-en/main.tex index fad496d1..bca23026 100644 --- a/templates/undergraduate-thesis-en/main.tex +++ b/templates/undergraduate-thesis-en/main.tex @@ -44,6 +44,9 @@ % externalSupervisor = 左偏树, }, style = { + % 保持参考文献的缩进样式与 Word 模板一致。 + % 如果你不需要此样式,请将此行注释掉。 + bibliographyIndent = false, % 如无必要请勿修改该项。 % head = {自定义页眉文字} } From 4ccca4abd15ad67a1d48b9a53c468820b4fb1278 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Thu, 15 Sep 2022 16:11:40 +0800 Subject: [PATCH 10/10] update changelog. --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc6fc5b6..1a9e0158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,34 @@ Acronyms: **Bolded text highlights its importance.** +## [3.0.1] - 2022-09-15 + +[dea1ac9](dea1ac9177bd040d83a8d09c831687a9a8f91881)...[193fa8f](193fa8fdaa5a8c8438f34f08c6c59760dec58b6d) + +### Bug Fixes + +- Bump cls version in packages. ([930fbd5](930fbd580e43b434b0b0d0e7ff57e3bf071a03af)) +- Refine example. ([329d1ae](329d1aef2c8c94a28043e6845a7b0eeab2a2fb20)) + +### Documentation + +- Add more precise description on `ctex`. ([e2083f0](e2083f0712222a680e56652964506ebccd002fe7)) +- Update manual. ([74a2780](74a27802ad2c8c2f2d4144951f699f303f80d167)) +- Docs on bibliographyIndent. ([193fa8f](193fa8fdaa5a8c8438f34f08c6c59760dec58b6d)) + +### Features + +- Add verticalTitle option in book spine. ([411cedf](411cedfce1ac9ea2f97b1d88a43321dfdb122529)) +- Provide a option to custom the indent for bibliography. ([78c9a85](78c9a85c99de232e57daf4bd81b9b4a33dd441d9)) + +### Miscellaneous Tasks + +- Bump version. ([5470390](5470390075fc6ec7b57e6b4eaabe8274b67a95df)) + +### Refactor + +- Uncomment default value for cover/date. ([5ec5c1e](5ec5c1ec555e828c92232a4875214d69578eeb1e)) + ## [3.0.0] - 2022-09-04 [145b669](145b6694f130e0af3e5b5fa5d21ce68016c39764)...[a3f4f45](a3f4f4511558d8b042544623ec0c03e9c81a107a)