diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls | 356 |
1 files changed, 210 insertions, 146 deletions
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls index 8d68ed28e3a..76fedcae47e 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls @@ -24,7 +24,7 @@ %% `.dtx' through XeTeX. %% \NeedsTeXFormat{LaTeX2e} -\GetIdInfo $Id: njuthesis.dtx 0.16.1 2022-03-27 13:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ +\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Thesis template for Nanjing University} \ProvidesExplClass{njuthesis} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -55,42 +55,44 @@ { \msg_fatal:nnx { njuthesis } { unsupported-engine } { \c_sys_engine_str } } \box_new:N \l__nju_tmp_box \clist_new:N \l__nju_tmp_clist -\dim_new:N \l__nju_tmp_dim +\dim_new:N \l__nju_tmpa_dim +\dim_new:N \l__nju_tmpb_dim \int_new:N \l__nju_tmp_int \seq_new:N \l__nju_tmp_seq -\tl_new:N \l__nju_tmp_tl +\tl_new:N \l__nju_tmpa_tl +\tl_new:N \l__nju_tmpb_tl \int_new:N \g__nju_info_degree_int -\int_new:N \l__nju_info_diploma_int +\int_new:N \g__nju_info_diploma_int \int_new:N \g__nju_info_type_int -\tl_new:N \l__nju_info_degree_tl -\tl_new:N \l__nju_info_diploma_tl -\tl_new:N \l__nju_info_type_tl -\tl_new:N \l__nju_info_type_en_tl +\tl_new:N \g__nju_info_degree_tl +\tl_new:N \g__nju_info_diploma_tl +\tl_new:N \g__nju_info_type_tl +\tl_new:N \g__nju_info_type_en_tl \bool_new:N \g__nju_twoside_bool \bool_set_true:N \g__nju_twoside_bool \bool_new:N \l__nju_second_supv_bool -\tl_new:N \l__nju_info_supv_full_tl -\tl_new:N \l__nju_info_supv_full_en_tl +\tl_new:N \g__nju_info_supvfull_tl +\tl_new:N \g__nju_info_supvfull_en_tl \tl_new:N \g__nju_latin_font_tl \tl_new:N \g__nju_cjk_font_tl \tl_new:N \g__nju_config_tl \clist_new:N \g__nju_theorem_type_clist -\tl_new:N \l__nju_info_sm_date_tl -\tl_new:N \l__nju_info_sm_date_en_tl -\tl_new:N \l__nju_info_df_date_tl +\tl_new:N \g__nju_info_submitdate_tl +\tl_new:N \g__nju_info_submitdate_en_tl +\tl_new:N \g__nju_info_defenddate_tl \tl_const:Nx \c__nju_today_tl { \int_to_arabic:n { \c_sys_year_int } - \int_to_arabic:n { \c_sys_month_int } - \int_to_arabic:n { \c_sys_day_int } } -\clist_const:Nn \c__nju_name_type_clist +\clist_const:Nn \g__nju_name_type_clist { 毕业论文, 毕业设计 } -\clist_const:Nn \c__nju_name_type_en_clist +\clist_const:Nn \g__nju_name_type_en_clist { THESIS, DESIGN } -\clist_const:Nn \c__nju_name_degree_clist +\clist_const:Nn \g__nju_name_degree_clist { 学士, 硕士, 硕士专业, 博士 } -\clist_const:Nn \c__nju_name_degree_en_clist +\clist_const:Nn \g__nju_name_degree_en_clist { Bachelor, Master, Master, Doctor~of~Philosophy } \clist_const:Nn \c__nju_month_en_clist { @@ -99,8 +101,8 @@ } \cs_new:Nn \__nju_quad: { \skip_horizontal:n { 1 em } } \cs_new:Nn \__nju_qquad: { \skip_horizontal:n { 2 em } } -\cs_new:Nn \__nju_vskip: { \skip_vertical:n { 1 ex } } -\cs_new:Nn \__nju_hskip: { \skip_horizontal:n { 0.3 em } } +\cs_new:Nn \__nju_vskip: { \skip_vertical:N \g__nju_smallvskip_dim } +\cs_new:Nn \__nju_hskip: { \skip_horizontal:N \g__nju_smallhskip_dim } \cs_new_protected:Npn \__nju_vskip:N #1 { \hrule height \c_zero_dim @@ -109,19 +111,39 @@ \skip_vertical:N #1 } \cs_new_protected:Npn \__nju_define_name:nn #1#2 - { \tl_const:cn { c__nju_name_ #1 _tl } { #2 } } + { + \tl_new:c { g__nju_name_ #1 _tl } + \tl_gset:cn { g__nju_name_ #1 _tl } { #2 } + } \cs_new_protected:Npn \__nju_define_name:nnn #1#2#3 { - \tl_const:cn { c__nju_name_ #1 _tl } { #2 } - \tl_const:cn { c__nju_name_ #1 _en_tl } { #3 } + \tl_new:c { g__nju_name_ #1 _tl } + \tl_gset:cn { g__nju_name_ #1 _tl } { #2 } + \tl_new:c { g__nju_name_ #1 _en_tl } + \tl_gset:cn { g__nju_name_ #1 _en_tl } { #3 } + } +\cs_new_protected:Npn \__nju_define_fmt:nn #1#2 + { + \tl_new:c { g__nju_fmt_ #1 _tl } + \tl_gset:cn { g__nju_fmt_ #1 _tl } { #2 } + } +\cs_new_protected:Npn \__nju_define_dim:nn #1#2 + { + \dim_new:c { g__nju_ #1 _dim } + \dim_gset:cn { g__nju_ #1 _dim } { #2 } + } +\cs_new_protected:Npn \__nju_define_skip:nn #1#2 + { + \skip_new:c { g__nju_ #1 _skip } + \skip_gset:cn { g__nju_ #1 _skip } { #2 } } \cs_new_protected:Npn \__nju_add_theorem_type:nnn #1#2#3 { \clist_gput_right:Nn \g__nju_theorem_type_clist { #1 } \__nju_define_name:nnn { #1 } { #2 } { #3 } } -\cs_new:Npn \__nju_name:n #1 { \tl_use:c { c__nju_name_ #1 _tl } } -\cs_new:Npn \__nju_info:n #1 { \tl_use:c { l__nju_info_ #1 _tl } } +\cs_new:Npn \__nju_name:n #1 { \tl_use:c { g__nju_name_ #1 _tl } } +\cs_new:Npn \__nju_info:n #1 { \tl_use:c { g__nju_info_ #1 _tl } } \cs_new_protected:Npn \__nju_ulined_center_box:nn #1#2 { \mode_leave_vertical: @@ -149,10 +171,10 @@ } \cs_new_protected:Npn \__nju_put_inempty_seg:nnn #1#2#3 { - \tl_set:Nx \l__nju_tmp_tl + \tl_set:Nx \l__nju_tmpa_tl { \tl_range:Nnn { #1 } { #2 } { #2 + #3 - 1 } } - \tl_if_empty:NF \l__nju_tmp_tl - { \clist_put_right:NV \l__nju_tmp_clist { \l__nju_tmp_tl } } + \tl_if_empty:NF \l__nju_tmpa_tl + { \clist_put_right:NV \l__nju_tmp_clist { \l__nju_tmpa_tl } } } \cs_new_protected:Npn \__nju_uline:n #1 { @@ -201,60 +223,65 @@ Please~ check~ whether~ you~ have~ fill~ in~ both~ Chinese~ and~ English~ titles. } -\cs_new_protected:Npn \__nju_split_title:n #1 +\cs_new_protected:Npn \__nju_uline_title: { - \tl_if_in:nnTF { #1 } { \\ } - { - \seq_set_split:Nnn \l__nju_tmp_seq { \\ } { #1 } - \clist_set_from_seq:NN \l__nju_tmp_clist \l__nju_tmp_seq - } - { - \__nju_put_inempty_seg:nnn { #1 } { 1 } { 15 } - \__nju_put_inempty_seg:nnn { #1 } { 16 } { 15 } - \__nju_put_inempty_seg:nnn { #1 } { 31 } { 15 } + \setbox0 = \vbox{ + \leftskip=0.5em plus 1 fill + \rightskip=\leftskip \parskip=1cm + \parindent=\z@ \g__nju_info_title_tl \par + \global\setbox2=\hbox{} + \loop + \setbox1=\lastbox \unskip\unpenalty + \unless\ifvoid1 + \global\setbox2=\hbox{\__nju_uline_box:\penalty0\unhbox2} + \repeat } + { \noindent \unhbox2 \par } } -\cs_generate_variant:Nn \__nju_split_title:n { V } -\cs_new_protected:Npn \__nju_multiline_title:nnn #1#2#3 +\cs_new_protected:Npn \__nju_cover_entry_title:nnn #1#2#3 { - \tl_if_empty:NT \l__nju_info_title_tl + \tl_if_empty:NT \g__nju_info_title_tl { \msg_error:nn { njuthesis } { missing-title } } - \__nju_split_title:V \l__nju_info_title_tl - \__nju_spread_box:nnV { #2 } { \kaishu } \c__nju_name_title_tl - \__nju_hskip: - \clist_map_inline:Nn \l__nju_tmp_clist - { \__nju_ulined_center_box:nn { #3 } { #1 ##1 } \__nju_vskip: } + \__nju_spread_box:nnV { #2 } { \kaishu } \g__nju_name_title_tl + \mode_leave_vertical: \__nju_hskip: + \parbox [ t ] { #3 } + { + \dim_set_eq:NN \baselineskip \g__nju_coverlineskip_dim + #1 \__nju_uline_title: + \dim_set_eq:NN \l__nju_tmpa_dim \prevdepth + } + \par \prevdepth \l__nju_tmpa_dim } \cs_new_protected:Npn \__nju_cover_entry:nnn #1#2#3 { \__nju_spread_box:nnx { #2 } { \kaishu } { \__nju_name:n { #1 } } \__nju_hskip: \__nju_ulined_center_box:nn { #3 } { \__nju_info:n { #1 } } - \__nju_vskip: + \par } \cs_new_protected:Npn \__nju_cover_bientry:nnnn #1#2#3#4 { \__nju_spread_box:nnx { #3 } { \kaishu } { \__nju_name:n { #1 } } \__nju_hskip: \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #1 } } - \skip_horizontal:n { 0.5 em } + \__nju_hskip: \__nju_spread_box:nnx { #3 } { \kaishu } { \__nju_name:n { #2 } } \__nju_hskip: \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #2 } } - \__nju_vskip: + \par } -\cs_new_protected:Npn \__nju_cover_supv_entry:nnn #1#2#3 +\cs_new_protected:Npn \__nju_cover_entry_supv:nnn #1#2#3 { \__nju_spread_box:nnx { #2 } { \kaishu } { \__nju_name:n { #1 } } \__nju_hskip: \__nju_ulined_center_box:nn { #3 } - { \clist_item:cn { l__nju_info_ #1 _clist } { 1 } } - \skip_horizontal:n { 0.5 em } - \__nju_spread_box:nnV { #2 } { \kaishu } \c__nju_name_supv_ttl_tl + { \clist_item:cn { g__nju_info_ #1 _clist } { 1 } } + \__nju_hskip: + \__nju_spread_box:nnV { #2 } { \kaishu } \g__nju_name_supv_ttl_tl \__nju_hskip: \__nju_ulined_center_box:nn { #3 } - { \clist_item:cn { l__nju_info_ #1 _clist } { 2 } } - \__nju_vskip: + { \clist_item:cn { g__nju_info_ #1 _clist } { 2 } } + \par } \cs_new_protected:Npn \__nju_abs_bookmark:nn #1#2 { @@ -267,8 +294,8 @@ \cs_generate_variant:Nn \__nju_abs_bookmark:nn { Vn } \cs_new_protected:Npn \__nju_abs_title:n #1 { - \__nju_get_text_width:Nn \l__nju_tmp_dim {#1} - \__nju_uuline:n { \l__nju_tmp_dim } #1 + \__nju_get_text_width:Nn \l__nju_tmpa_dim {#1} + \__nju_uuline:n { \l__nju_tmpa_dim } #1 } \cs_generate_variant:Nn \__nju_abs_title:n { V } \cs_new_protected:Npn \__nju_uline_box: @@ -285,7 +312,7 @@ \cs_new_protected:Npn \__nju_uline_list:nnn #1#2#3 { \hbox_set:Nn \l__nju_tmp_box {#1} - \setbox0=\vbox{\hangindent=\wd\l__nju_tmp_box \hangafter=-1 + \setbox0 = \vbox{\hangindent=\wd\l__nju_tmp_box \hangafter=-1 \leftskip=#3 \rightskip=\leftskip \parindent=\z@ #2\par \global\setbox2=\hbox{} \int_gzero:N \l__nju_tmp_int @@ -392,7 +419,7 @@ type .initial:n = thesis, nlcover .bool_set:N = \g__nju_nlcover_bool, nlcover .initial:n = false, - decl-page .bool_set:N = \g__nju_orig_decl_bool, + decl-page .bool_set:N = \g__nju_decl_bool, decl-page .initial:n = false, draft .bool_gset:N = \g__nju_draft_bool, draft .initial:n = false, @@ -415,6 +442,28 @@ style .meta:nn = { nju / style } { #1 } } \NewDocumentCommand \njusetup { m } { \keys_set:nn { nju } { #1 } } +\NewDocumentCommand \njusetformat { m m } + { \tl_gset:cn { g__nju_fmt_ #1 _tl } { #2 } } +\NewDocumentCommand \njusetlength { s m m } + { + \bool_if:nTF { #1 } + { \skip_gset:cn { g__nju_ #2 _skip } { #3 } } + { \dim_gset:cn { g__nju_ #2 _dim } { #3 } } + } +\NewDocumentCommand \njusetname { s m o m } + { \__nju_set_tokenlist:nnnnn {#1} {#2} {#3} {#4} { name } } +\NewDocumentCommand \njusettext { s m o m } + { \__nju_set_tokenlist:nnnnn {#1} {#2} {#3} {#4} { text } } +\cs_new_protected:Npn \__nju_set_tokenlist:nnnnn #1#2#3#4#5 + { + \tl_if_novalue:nTF { #3 } + { \tl_clear:N \l__nju_tmpa_tl } + { \tl_set:Nn \l__nju_tmpa_tl { _ #3 } } + \bool_if:nTF { #1 } + { \tl_set:Nn \l__nju_tmpb_tl { _en } } + { \tl_clear:N \l__nju_tmpb_tl } + \tl_gset:cn { g__nju_ #5 _ #2 \l__nju_tmpa_tl \l__nju_tmpb_tl _tl } {#4} + } \PassOptionsToClass { a4paper, @@ -466,6 +515,10 @@ \RequirePackage{lua-ul} \NewDocumentCommand \njuline { m } { \underLine{#1} \null } } +\bool_lazy_and:nnT + { \g__nju_decl_bool } + { !\int_compare_p:n { \g__nju_info_degree_int == 1 } } + { \RequirePackage { tabularray } } \msg_new:nnn { njuthesis } { package-too-old } { Package~ "#1"~ is~ too~ old.\\ @@ -493,86 +546,87 @@ } \keys_define:nn { nju / info } { - title .tl_set:N = \l__nju_info_title_tl, + title .tl_set:N = \g__nju_info_title_tl, title .initial:n = { 空 }, - title* .tl_set:N = \l__nju_info_title_en_tl, + title* .tl_set:N = \g__nju_info_title_en_tl, title* .initial:n = { Empty }, - keywords .clist_set:N = \l__nju_info_keywords_clist, - keywords* .clist_set:N = \l__nju_info_keywords_en_clist, - grade .tl_set:N = \l__nju_info_grade_tl, - student-id .tl_set:N = \l__nju_info_id_tl, - author .tl_set:N = \l__nju_info_author_tl, - author* .tl_set:N = \l__nju_info_author_en_tl, - department .tl_set:N = \l__nju_info_dept_tl, - department* .tl_set:N = \l__nju_info_dept_en_tl, - major .tl_set:N = \l__nju_info_major_tl, - major* .tl_set:N = \l__nju_info_major_en_tl, - field .tl_set:N = \l__nju_info_field_tl, - field* .tl_set:N = \l__nju_info_field_en_tl, - supervisor .clist_set:N = \l__nju_info_supv_clist, - supervisor* .tl_set:N = \l__nju_info_supv_en_tl, - supervisor-ii .clist_set:N = \l__nju_info_supv_ii_clist, - supervisor-ii* .tl_set:N = \l__nju_info_supv_ii_en_tl, - submit-date .tl_set:N = \l__nju_info_sm_date_raw_tl, + keywords .clist_set:N = \g__nju_info_keywords_clist, + keywords* .clist_set:N = \g__nju_info_keywords_en_clist, + grade .tl_set:N = \g__nju_info_grade_tl, + student-id .tl_set:N = \g__nju_info_id_tl, + author .tl_set:N = \g__nju_info_author_tl, + author* .tl_set:N = \g__nju_info_author_en_tl, + department .tl_set:N = \g__nju_info_dept_tl, + department* .tl_set:N = \g__nju_info_dept_en_tl, + major .tl_set:N = \g__nju_info_major_tl, + major* .tl_set:N = \g__nju_info_major_en_tl, + field .tl_set:N = \g__nju_info_field_tl, + field* .tl_set:N = \g__nju_info_field_en_tl, + supervisor .clist_set:N = \g__nju_info_supv_clist, + supervisor* .tl_set:N = \g__nju_info_supv_en_tl, + supervisor-ii .clist_set:N = \g__nju_info_supv_ii_clist, + supervisor-ii* .tl_set:N = \g__nju_info_supv_ii_en_tl, + submit-date .tl_set:N = \g__nju_info_submitdate_raw_tl, submit-date .initial:V = \c__nju_today_tl, - defend-date .tl_set:N = \l__nju_info_df_date_raw_tl, + defend-date .tl_set:N = \g__nju_info_defenddate_raw_tl, defend-date .initial:V = \c__nju_today_tl, - chairman .tl_set:N = \l__nju_info_chairman_tl, - reviewer .clist_set:N = \l__nju_info_reviewer_clist, - clc .tl_set:N = \l__nju_info_clc_tl, - secret-level .tl_set:N = \l__nju_info_seclv_tl, - udc .tl_set:N = \l__nju_info_udc_tl, - supervisor-contact .tl_set:N = \l__nju_info_supv_cont_tl, + chairman .tl_set:N = \g__nju_info_chairman_tl, + reviewer .clist_set:N = \g__nju_info_reviewer_clist, + clc .tl_set:N = \g__nju_info_clc_tl, + secret-level .tl_set:N = \g__nju_info_secretlv_tl, + udc .tl_set:N = \g__nju_info_udc_tl, + supervisor-contact .tl_set:N = \g__nju_info_supv_cont_tl, + email .tl_set:N = \g__nju_info_email_tl } -\tl_set:Nx \l__nju_info_degree_tl +\tl_set:Nx \g__nju_info_degree_tl { - \clist_item:Nn \c__nju_name_degree_clist + \clist_item:Nn \g__nju_name_degree_clist { \g__nju_info_degree_int } } \int_compare:nTF { \g__nju_info_degree_int == 1 } - { \tl_set:Nn \l__nju_info_diploma_tl { ug } } - { \tl_set:Nn \l__nju_info_diploma_tl { g } } -\tl_set:Nx \l__nju_info_type_tl - { \clist_item:Nn \c__nju_name_type_clist { \g__nju_info_type_int } } -\tl_set:Nx \l__nju_info_type_en_tl - { \clist_item:Nn \c__nju_name_type_en_clist { \g__nju_info_type_int } } -\tl_put_left:Nx \l__nju_info_type_tl - { \tl_use:c { c__nju_name_ \l__nju_info_diploma_tl _tl } } + { \tl_set:Nn \g__nju_info_diploma_tl { ug } } + { \tl_set:Nn \g__nju_info_diploma_tl { g } } +\tl_set:Nx \g__nju_info_type_tl + { \clist_item:Nn \g__nju_name_type_clist { \g__nju_info_type_int } } +\tl_set:Nx \g__nju_info_type_en_tl + { \clist_item:Nn \g__nju_name_type_en_clist { \g__nju_info_type_int } } +\tl_put_left:Nx \g__nju_info_type_tl + { \tl_use:c { g__nju_name_ \g__nju_info_diploma_tl _tl } } \ctex_at_end_preamble:n { \bool_set:Nn \l__nju_second_supv_bool - { ! \clist_if_empty_p:N \l__nju_info_supv_ii_clist } - \tl_set:Nx \l__nju_info_supv_full_tl + { ! \clist_if_empty_p:N \g__nju_info_supv_ii_clist } + \tl_set:Nx \g__nju_info_supvfull_tl { - \clist_use:Nn \l__nju_info_supv_clist { \__nju_hskip: } + \clist_use:Nn \g__nju_info_supv_clist { \__nju_hskip: } \bool_if:NT \l__nju_second_supv_bool { \__nju_quad: - \clist_use:Nn \l__nju_info_supv_ii_clist { \__nju_hskip: } + \clist_use:Nn \g__nju_info_supv_ii_clist { \__nju_hskip: } } } - \tl_set:Nx \l__nju_info_supv_full_en_tl + \tl_set:Nx \g__nju_info_supvfull_en_tl { - \l__nju_info_supv_en_tl + \g__nju_info_supv_en_tl \bool_if:NT \l__nju_second_supv_bool - { \__nju_quad: \l__nju_info_supv_ii_en_tl } + { \__nju_quad: \g__nju_info_supv_ii_en_tl } } - \tl_set:Nn \l__nju_info_sm_date_tl + \tl_set:Nn \g__nju_info_submitdate_tl { \exp_last_unbraced:NV - \__nju_date:www \l__nju_info_sm_date_raw_tl \q_stop + \__nju_date:www \g__nju_info_submitdate_raw_tl \q_stop } \int_compare:nF { \g__nju_info_degree_int == 1 } { - \tl_set:Nn \l__nju_info_sm_date_en_tl + \tl_set:Nn \g__nju_info_submitdate_en_tl { \exp_last_unbraced:NV - \__nju_date_en:www \l__nju_info_sm_date_raw_tl \q_stop + \__nju_date_en:www \g__nju_info_submitdate_raw_tl \q_stop } - \tl_set:Nn \l__nju_info_df_date_tl + \tl_set:Nn \g__nju_info_defenddate_tl { \exp_last_unbraced:NV - \__nju_date:www \l__nju_info_df_date_raw_tl \q_stop + \__nju_date:www \g__nju_info_defenddate_raw_tl \q_stop } } } @@ -839,9 +893,9 @@ } } \cs_new_protected:Npn \__nju_header:nn #1#2 - { \fancyhead [#1] { \g__nju_header_format_tl #2 } } + { \fancyhead [#1] { \g__nju_header_format_tl \nouppercase {#2} } } \cs_new_protected:Npn \__nju_footer:nn #1#2 - { \fancyfoot [#1] { \g__nju_footer_format_tl #2 } } + { \fancyfoot [#1] { \g__nju_footer_format_tl \nouppercase {#2} } } \fancypagestyle { plain } { \fancyhf { } @@ -883,9 +937,8 @@ \exp_args:NV \pagestyle \c__nju_pagestyle_tl \pagenumbering { Roman } } -\tl_const:Nn \c__nju_sec_format_tl { \large \normalfont \sffamily } \cs_new_protected:Npn \__nju_add_tocline:n #1 - { \addcontentsline { toc } { chapter } { \c__nju_sec_format_tl #1 } } + { \addcontentsline { toc } { chapter } { \g__nju_fmt_chapterintoc_tl #1 } } \cs_generate_variant:Nn \__nju_add_tocline:n { V } \cs_new_protected:Npn \__nju_chapter:n #1 { @@ -905,14 +958,14 @@ { chapter / beforeskip = 10 pt, chapter / afterskip = 60 pt, - chapter / format = \c__nju_sec_format_tl \centering, - section / format = \c__nju_sec_format_tl, - subsection / format = \c__nju_sec_format_tl, - subsubsection / format = \c__nju_sec_format_tl, - contentsname = { 目\hspace{2em}录 }, - listfigurename = { 插图目录 }, - listtablename = { 表格目录 }, - chapter / tocline = \c__nju_sec_format_tl \CTEXnumberline { #1 } #2 + chapter / format = \g__nju_fmt_chapter_tl, + section / format = \g__nju_fmt_section_tl, + subsection / format = \g__nju_fmt_subsection_tl, + subsubsection / format = \g__nju_fmt_subsubsection_tl, + contentsname = \g__nju_name_tableofcontents_tl, + listfigurename = \g__nju_name_listoffigures_tl, + listtablename = \g__nju_name_listoftables_tl, + chapter / tocline = \g__nju_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2 } \keys_define:nn { nju / style } { @@ -923,7 +976,7 @@ { \group_begin: \keys_set:nn { ctex } - { chapter/format = \centering \zihao { 3 } \bfseries } + { chapter/format = \g__nju_fmt_toctitle_tl } \bool_if:NTF \g__nju_toc_in_toc_bool { \__nju_chapter:n { #1 } } { @@ -1009,17 +1062,21 @@ \ctex_at_end_preamble:n { \pdfstringdefDisableCommands - { \cs_set_eq:NN \\ \prg_do_nothing: } + { + \cs_set_eq:NN \\ \prg_do_nothing: + \cs_set_eq:NN \quad \prg_do_nothing: + \cs_set_eq:NN \qquad \prg_do_nothing: + } \hypersetup { bookmarksnumbered = true, psdextra = true, unicode = true, hidelinks, - pdftitle = \l__nju_info_title_tl, - pdfauthor = \l__nju_info_author_tl, - pdfkeywords = \l__nju_info_keywords_clist, - pdfcreator = \c__nju_name_pdf_creator_tl + pdftitle = \g__nju_info_title_tl, + pdfauthor = \g__nju_info_author_tl, + pdfkeywords = \g__nju_info_keywords_clist, + pdfcreator = \g__nju_name_pdfcreator_tl } } \cs_new_protected:Npn \__nju_cref_name:n #1 @@ -1058,7 +1115,7 @@ { \newtheorem { ##1 } { \__nju_name:n { ##1 } } } } \theoremsymbol { \ensuremath { \mdwhtsquare } } -\newtheorem* { proof } { \c__nju_name_proof_tl } +\newtheorem* { proof } { \g__nju_name_proof_tl } \group_begin: \clist_remove_all:Nn \g__nju_theorem_type_clist { proof } \__nju_new_theorem:N \g__nju_theorem_type_clist @@ -1100,44 +1157,51 @@ { \bool_if:NF \g__nju_draft_bool { - \pagestyle { empty } \pagenumbering { gobble } \bool_if:NTF \g__nju_nlcover_bool { \__nju_make_cover_nl: } { \__nju_make_cover: } - \bool_if:NT \g__nju_orig_decl_bool { \__nju_make_orig_decl: } } - \tl_remove_all:Nn \l__nju_info_title_tl { \\ } + \tl_remove_all:Nn \g__nju_info_title_tl { \\ } +\bool_if:NF \g__nju_draft_bool + { + \bool_if:NT \g__nju_decl_bool + { + \__nju_make_origdecl: + \AtEndEnvironment { document } + { \__nju_make_authdecl: } + } + } \cleardoublepage \exp_args:NV \pagestyle \c__nju_pagestyle_tl \pagenumbering { Roman } } \__nju_declare_element:nn { abstract / mark } { - content = \c__nju_name_abstract_b_tl, + content = \g__nju_name_abstract_b_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } \__nju_declare_element:nn { abstract / en / mark } { - content = \c__nju_name_abstract_b_en_tl, + content = \g__nju_name_abstract_b_en_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } \cs_new_protected:Npn \__nju_print_keywords:nn #1#2 { - \tl_set:Nv \l__nju_tmp_tl { c__nju_name_keywords #1 _tl } - \__nju_get_text_width:NV \l__nju_tmp_dim \l__nju_tmp_tl - \list { \l__nju_tmp_tl } + \tl_set:Nv \l__nju_tmpa_tl { g__nju_name_keywords #1 _tl } + \__nju_get_text_width:NV \l__nju_tmpa_dim \l__nju_tmpa_tl + \list { \l__nju_tmpa_tl } { - \labelwidth \l__nju_tmp_dim + \labelwidth \l__nju_tmpa_dim \labelsep \c_zero_dim \leftmargin \c_zero_dim \rightmargin \c_zero_dim - \advance \leftmargin \l__nju_tmp_dim + \advance \leftmargin \l__nju_tmpa_dim \cs_set_eq:NN \makelabel \textbf } - \item \clist_use:cn { l__nju_info_keywords #1 _clist } { #2 } + \item \clist_use:cn { g__nju_info_keywords #1 _clist } { #2 } \endlist } \skip_new:N \g__nju_abs_title_left_skip @@ -1167,7 +1231,7 @@ { \cleardoublepage \thispagestyle { plain } - \__nju_abs_bookmark:Vn \c__nju_name_abstract_a_tl { abstract } + \__nju_abs_bookmark:Vn \g__nju_name_abstract_a_tl { abstract } \__nju_make_abstract: \group_begin: \kaishu \zihao { -4 } #1 } @@ -1176,17 +1240,17 @@ { \cleardoublepage \thispagestyle { plain } - \__nju_abs_bookmark:Vn \c__nju_name_abstract_a_en_tl { abstract-en } + \__nju_abs_bookmark:Vn \g__nju_name_abstract_a_en_tl { abstract-en } \__nju_make_abstract_en: \group_begin: \zihao { -4 } #1 } { \__nju_print_keywords:nn { _en } { ;~ } \group_end: } \NewDocumentEnvironment { preface } { +b } - { \__nju_chapter:V \c__nju_name_preface_tl #1 } { } + { \__nju_chapter:V \g__nju_name_preface_tl #1 } { } \NewDocumentEnvironment { acknowledgement } { +b } - { \__nju_chapter:V \c__nju_name_acknowledgement_tl #1 } { } + { \__nju_chapter:V \g__nju_name_acknowledgement_tl #1 } { } \NewDocumentCommand \njupaperlist - { O { \c__nju_name_paperlist_tl } m } + { O { \g__nju_name_paperlist_tl } m } { \group_begin: \RenewDocumentCommand \mkbibnamegiven { m } @@ -1206,14 +1270,14 @@ \cs_new_protected:Npn \__nju_notation_label:n #1 { #1 \hfil } \cs_new_protected:Npn \__nju_make_notation:nn #1#2 { - \dim_set:Nn \l__nju_tmp_dim { \textwidth - #1 - #2 } + \dim_set:Nn \l__nju_tmpa_dim { \textwidth - #1 - #2 } \list { } { \labelwidth #2 \labelsep \c_zero_dim \itemsep \c_zero_dim \parsep \c_zero_dim - \leftmargin .5\l__nju_tmp_dim + \leftmargin .5\l__nju_tmpa_dim \rightmargin \leftmargin \advance \leftmargin #2 \cs_set_eq:NN \makelabel \__nju_notation_label:n @@ -1221,13 +1285,13 @@ } \NewDocumentEnvironment { notation } { O { 10 em } O { 5 em } } { - \__nju_chapter:V \c__nju_name_notation_tl + \__nju_chapter:V \g__nju_name_notation_tl \__nju_make_notation:nn { #1 } { #2 } } { \endlist } \NewDocumentEnvironment { notation* } { O { 10 em } O { 5 em } } { - \chapter * { \c__nju_name_notation_tl } + \chapter * { \g__nju_name_notation_tl } \__nju_make_notation:nn { #1 } { #2 } } { \endlist } |