From c838409227463780c18e57ff86608905024e5c64 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 10 Apr 2022 20:45:18 +0000 Subject: njuthesis git-svn-id: svn://tug.org/texlive/trunk@62995 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/njuthesis/njuthesis-graduate.def | 357 +++++++++++++++------ .../latex/njuthesis/njuthesis-undergraduate.def | 115 ++++--- .../texmf-dist/tex/latex/njuthesis/njuthesis.cls | 356 +++++++++++--------- 3 files changed, 531 insertions(+), 297 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def index b9dcd1d837a..dcfd97ffa0e 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 0.16.1 2022-03-27 13:00:00 +0800 NJU LUG $ +\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG $ {Graduate definition file for njuthesis} \ProvidesExplFile{njuthesis-graduate.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -41,29 +41,30 @@ \__nju_declare_element:nn { cover / g / type } { content = - \__nju_spread_box:nnV { 9 em } { } \l__nju_info_type_tl, + \__nju_spread_box:nnV { 9 em } { } \g__nju_info_type_tl, format = \zihao { -1 } \bfseries, bottom-skip = 1 cm } \__nju_declare_element:nn { cover / g / degree } { - content = \c__nju_name_apply_tl, + content = \g__nju_name_apply_tl, format = \zihao { -1 } \bfseries, bottom-skip = 1 cm plus 1.5 fil } \__nju_declare_element:nn { cover / g / info } { - content = \__nju_cover_info_g:nn { 6.2 em } { 18 em }, + content = + \__nju_cover_info_g:NN \g__nju_coverlabel_dim \g__nju_coveruline_dim, bottom-skip = 0 pt plus 1.5 fil } \__nju_declare_element:nn { cover / g / date } - { content = \l__nju_info_sm_date_tl } -\cs_new_protected:Npn \__nju_cover_info_g:nn #1#2 + { content = \g__nju_info_submitdate_tl } +\cs_new_protected:Npn \__nju_cover_info_g:NN #1#2 { - \begin{minipage} { #1 + #2 + 0.3 em } - \raggedleft - \__nju_multiline_title:nnn { } { #1 } { #2 } - \clist_map_inline:nn { author, major, field, supv_full } + \begin{minipage} { #1 + #2 + \g__nju_smallhskip_dim } + \dim_set_eq:NN \baselineskip \g__nju_coverlineskip_dim + \__nju_cover_entry_title:nnn { } { #1 } { #2 } + \clist_map_inline:nn { author, major, field, supvfull } { \__nju_cover_entry:nnn { ##1 } { #1 } { #2 } } \end{minipage} } @@ -74,18 +75,18 @@ } \cs_new_protected:Npn \__nju_cover_back_g: { - \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_id_tl - { : \__nju_quad: } \l__nju_info_id_tl + \__nju_spread_box:nnV { 6.2 em } { \kaishu } \g__nju_name_id_tl + { : \__nju_quad: } \g__nju_info_id_tl \__nju_vskip: - \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_df_date_tl - { : \__nju_quad: } \l__nju_info_df_date_tl + \__nju_spread_box:nnV { 6.2 em } { \kaishu } \g__nju_name_defenddate_tl + { : \__nju_quad: } \g__nju_info_defenddate_tl \__nju_vskip: - \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_supv_full_tl - { : \__nju_quad: } \skip_horizontal:n { 8 em } \c__nju_name_sign_tl + \__nju_spread_box:nnV { 6.2 em } { \kaishu } \g__nju_name_supvfull_tl + { : \__nju_quad: } \skip_horizontal:n { 8 em } \g__nju_name_sign_tl } \__nju_declare_element:nn { cover / g / en / title } { - content = \l__nju_info_title_en_tl, + content = \g__nju_info_title_en_tl, format = \bf \sffamily \zihao { 2 }, bottom-skip = 2 cm } @@ -94,22 +95,22 @@ content = { by } \skip_vertical:N \c_zero_skip - \textbf { \sffamily \l__nju_info_author_en_tl } + \textbf { \sffamily \g__nju_info_author_en_tl } \skip_vertical:n { .5 cm } { Supervised~ by } \skip_vertical:N \c_zero_skip - \textsf { \l__nju_info_supv_full_en_tl }, + \textsf { \g__nju_info_supvfull_en_tl }, format = \zihao { 4 }, bottom-skip = 0 pt plus 1.2 fil } \__nju_declare_element:nn { cover / g / en / middle } { content = - \c__nju_cover_en_text_tl \__nju_vskip: - \textsc { \clist_item:Nn \c__nju_name_degree_en_clist + \g__nju_text_cover_en_tl \__nju_vskip: + \textsc { \clist_item:Nn \g__nju_name_degree_en_clist { \g__nju_info_degree_int } } \__nju_vskip: { in } \__nju_vskip: - \l__nju_info_major_en_tl, + \g__nju_info_major_en_tl, bottom-skip = 2 cm } \__nju_declare_element:nn { cover / g / en / emblem-img } @@ -120,9 +121,9 @@ \__nju_declare_element:nn { cover / g / en / bottom } { content = - \l__nju_info_dept_en_tl \skip_vertical:N \c_zero_skip - \c__nju_name_nju_en_tl \skip_vertical:n { 1 cm } - \l__nju_info_sm_date_en_tl + \g__nju_info_dept_en_tl \skip_vertical:N \c_zero_skip + \g__nju_name_nju_en_tl \skip_vertical:n { 1 cm } + \g__nju_info_submitdate_en_tl } \__nju_declare_element:nn { cover / nl / top } { @@ -132,15 +133,15 @@ \__nju_declare_element:nn { cover / nl / name } { content = - \__nju_spread_box:nnV { 6 em } { } \c__nju_name_title_tl, + \__nju_spread_box:nnV { 6 em } { } \g__nju_name_title_tl, format = \zihao { -0 }, - bottom-skip = 0 pt plus 1.2 fil + bottom-skip = 0 pt plus 1 fil } \__nju_declare_element:nn { cover / nl / title } { content = \__nju_cover_title_nl:, format = \zihao { 1 }, - bottom-skip = 1 cm + bottom-skip = 0 pt plus 1 fil } \__nju_declare_element:nn { cover / nl / middle } { @@ -161,39 +162,38 @@ } \cs_new_protected:Npn \__nju_cover_top_nl: { - \__nju_spread_box:nnV { 3.2 em } { } \c__nju_name_clc_tl \__nju_hskip: - \__nju_ulined_center_box:nn { 9 em } { \l__nju_info_clc_tl } \hfill - \__nju_spread_box:nnV { 3.2 em } { } \c__nju_name_seclv_tl \__nju_hskip: - \__nju_ulined_center_box:nn { 9 em } { \l__nju_info_seclv_tl } \\ - \__nju_spread_box:nnV { 3.2 em } { } \c__nju_name_udc_tl \__nju_hskip: - \__nju_ulined_center_box:nn { 9 em } { \l__nju_info_udc_tl } \hfill \null + \__nju_spread_box:nnV { 3.2 em } { } \g__nju_name_clc_tl \__nju_hskip: + \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_clc_tl } \hfill + \__nju_spread_box:nnV { 3.2 em } { } \g__nju_name_secretlv_tl \__nju_hskip: + \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_secretlv_tl } \\ + \__nju_spread_box:nnV { 3.2 em } { } \g__nju_name_udc_tl \__nju_hskip: + \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_udc_tl } \hfill \null } \cs_new_protected:Npn \__nju_cover_title_nl: { - \__nju_split_title:V \l__nju_info_title_tl - \__nju_multiline_box:nnnn { \l__nju_tmp_int } \l__nju_tmp_clist { 3 } { 15 em } + \parbox [ b ] { 15 em } { \__nju_uline_title: } \par \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } \c__nju_name_title_b_tl } + { \zihao { 4 } \g__nju_name_title_b_tl } \skip_vertical:N \c_zero_skip - \__nju_ulined_center_box:nn { 4.5 em } { \l__nju_info_author_tl } + \__nju_ulined_center_box:nn { 4.5 em } { \g__nju_info_author_tl } \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } { ( } \c__nju_name_author_tl { ) } } + { \zihao { 4 } { ( } \g__nju_name_author_tl { ) } } } \cs_new_protected:Npn \__nju_cover_info_nl: { - \tl_set:Nn \l__nju_info_supv_tl - { \clist_item:Nn \l__nju_info_supv_clist { 1 } } - \tl_set:Nn \l__nju_info_supv_ttl_tl - { \clist_item:Nn \l__nju_info_supv_clist { 2 } } - \__nju_uline_entry:Nnnn \l__nju_tmp_dim { supv_info } { supv } { } \\ - \__nju_ulined_center_box:nn { \textwidth } { \__nju_info:n { supv_ttl } - \__nju_quad: \__nju_info:n { supv_cont } } \\ - \__nju_uline_bientry:Nnnn \l__nju_tmp_dim { degree } { degree } { } - \__nju_uline_bientry:Nnnn \l__nju_tmp_dim { major_b } { major } { } \\ - \__nju_uline_bientry:Nnnn \l__nju_tmp_dim { sm_date } { sm_date } { } - \__nju_uline_bientry:Nnnn \l__nju_tmp_dim { df_date } { df_date } { } \\ - \__nju_full_uline:Nn \l__nju_tmp_dim { \c__nju_name_confer_tl } - \__nju_uline:n { \l__nju_tmp_dim } + \__nju_uline_list:nnn { \g__nju_name_supvinfo_tl } + { + \clist_use:Nn \g__nju_info_supv_clist { ~ } + \clist_use:Nn \g__nju_info_supv_ii_clist { ~ } ~ + \g__nju_info_supv_cont_tl + } + { 1 em plus 1 fill } + \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { degree } { degree } { } + \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { major_b } { major } { } \\ + \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { submitdate } { submitdate } { } + \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { defenddate } { defenddate } { } \\ + \__nju_full_uline:Nn \l__nju_tmpa_dim { \g__nju_name_confer_tl } + \__nju_uline:n { \l__nju_tmpa_dim } } \cs_new_protected:Npn \__nju_cover_bottom_nl: { @@ -201,7 +201,85 @@ \__nju_ulined_center_box:nn { 9 em } { \__nju_info:n { chairman } } \\ \__nju_name:n { reviewer } \__nju_hskip: \__nju_multiline_box:nnnn { \l__nju_tmp_int } - { \l__nju_info_reviewer_clist } { 4 } { 9 em } + { \g__nju_info_reviewer_clist } { 4 } { 9 em } + } +\__nju_declare_element:nn { authdecl / g / title } + { + content = \g__nju_name_authdecl_tl, + format = \g__nju_fmt_chapter_tl, + bottom-skip = 3 cm + } +\__nju_declare_element:nn { authdecl / g / text } + { + content = \g__nju_text_authdecl_tl, + align = n, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { authdecl / g / sign } + { + content = \__nju_authdecl_sign_g:, + align = r, + bottom-skip = 0pt plus 1 fill + } +\__nju_declare_element:nn { authdecl / g / info } + { + content = \__nju_authdecl_info_g:, + format = \zihao { 5 } , + align = l, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { authdecl / g / date } + { + content = \__nju_authdecl_secretlv_g:, + format = \zihao { 5 } , + align = l + } +\cs_new_protected:Npn \__nju_degree_checkbox:n #1 + { + \int_compare:nNnTF { #1 } { = } { \g__nju_info_degree_int } + { + \makebox [ 0 pt ] [l] { \ensuremath { \mdwhtsquare } } + \hspace { 0.1 em } \ensuremath { \checkmark } + } + { \ensuremath { \mdwhtsquare } } + } +\cs_new_protected:Npn \__nju_authdecl_info_g: + { + \begin{tblr} + { + hlines, vlines, hspan=minimal, + colspec = {cX[c]cX[c]cX[c]}, + cell{1}{2} = {c=5}{m}, cell{3}{2} = {c=5}{m}, + cell{4}{2} = {c=5}{m}, cell{5}{2} = {c=5}{m} + } + \g__nju_name_title_c_tl & \g__nju_info_title_tl \\ + \g__nju_name_id_a_tl & \g__nju_info_id_tl & + \g__nju_name_dept_a_tl & \g__nju_info_dept_tl & + \g__nju_name_year_tl & + \tl_range:Nnn \g__nju_info_submitdate_raw_tl {1} {4} \\ + \g__nju_name_degree_a_tl & + { + \__nju_degree_checkbox:n { 2 } 学术学位硕士 \qquad{} + \__nju_degree_checkbox:n { 3 } 专业学位硕士 \\ + \__nju_degree_checkbox:n { 4 } 学术学位博士 \qquad{} + \__nju_degree_checkbox:n { 5 } 专业学位博士 + } \\ + \g__nju_name_email_tl & \g__nju_info_email_tl \\ + \g__nju_name_supv_b_tl & + \clist_item:Nn \g__nju_info_supv_clist {1} + \clist_item:Nn \g__nju_info_supv_ii_clist {1} \\ + \end{tblr} + } +\cs_new_protected:Npn \__nju_authdecl_sign_g: + { + \g__nju_name_authsign_tl \par + \g__nju_name_blankdate_tl + } +\cs_new_protected:Npn \__nju_authdecl_secretlv_g: + { + \g__nju_name_secretstatus_tl \par + \ensuremath { \mdwhtsquare } \g__nju_name_secretfree_tl \par + \ensuremath { \mdwhtsquare } \g__nju_name_secretdate_tl } \__nju_declare_page:nn { cover-g-front-default } { @@ -229,6 +307,13 @@ prefix = cover / nl /, format = \kaishu } +\__nju_declare_page:nn { authdecl-g-default } + { + element = { title, text, sign, info, date }, + prefix = authdecl / g /, + top-skip = 1 cm, + bottom-skip = 0.5 cm plus 1.5 fill + } \cs_new_protected:Npn \__nju_make_cover: { \clist_map_inline:nn { front, back, en } @@ -236,21 +321,27 @@ } \cs_new_protected:Npn \__nju_make_cover_nl: { \UseInstance { nju } { cover-nl-default } } -\cs_new_protected:Npn \__nju_make_orig_decl: +\cs_new_protected:Npn \__nju_make_origdecl: { - \chapter* { \c__nju_name_orig_decl_tl } + \chapter* { \g__nju_name_origdecl_tl } \thispagestyle { empty } - \c__nju_orig_decl_text_tl + \g__nju_text_origdecl_tl \vfil \begin{flushright} - \clist_map_inline:nn { orig_sign, orig_date } + \clist_map_inline:nn { origsign, origdate } { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } } \end{flushright} \vfil } +\cs_new_protected:Npn \__nju_make_authdecl: + { + \thispagestyle{empty} + \UseInstance { nju } { authdecl-g-default } + \cleardoublepage + } \__nju_declare_element:nn { abstract / title } { - content = \__nju_abs_title:V \c__nju_name_abstract_title_tl, + content = \__nju_abs_title:V \g__nju_name_abstracttitle_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -263,7 +354,7 @@ } \__nju_declare_element:nn { abstract / en / title } { - content = \__nju_abs_title:V \c__nju_name_abstract_title_en_tl, + content = \__nju_abs_title:V \g__nju_name_abstracttitle_en_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -276,13 +367,13 @@ } \__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 } @@ -290,31 +381,31 @@ { \__nju_uline_list:xnn { - \clist_item:Nn \c__nju_name_type_clist { \g__nju_info_type_int } - \c__nju_name_title_a_tl #1 + \clist_item:Nn \g__nju_name_type_clist { \g__nju_info_type_int } + \g__nju_name_title_a_tl #1 } - { \l__nju_info_title_tl } { \g__nju_abs_title_left_skip } - \__nju_full_uline:NV \l__nju_tmp_dim + { \g__nju_info_title_tl } { \g__nju_abs_title_left_skip } + \__nju_full_uline:NV \l__nju_tmpa_dim { - \__nju_ulined_center_box:nn { 11 em } { \l__nju_info_major_tl } - \c__nju_name_major_a_tl - \__nju_ulined_center_box:nn { 4 em } { \l__nju_info_grade_tl } - \c__nju_name_grade_tl \c__nju_name_author_a_tl #1 + \__nju_ulined_center_box:nn { 11 em } { \g__nju_info_major_tl } + \g__nju_name_major_a_tl + \__nju_ulined_center_box:nn { 4 em } { \g__nju_info_grade_tl } + \g__nju_name_grade_tl \g__nju_name_author_a_tl #1 } - \__nju_ulined_center_box:nn { \l__nju_tmp_dim } - { \l__nju_info_author_tl } \\ - \__nju_full_uline:NV \l__nju_tmp_dim - { \c__nju_name_supv_a_tl #1 } - \__nju_ulined_center_box:nn { \l__nju_tmp_dim } - { \l__nju_info_supv_full_tl } + \__nju_ulined_center_box:nn { \l__nju_tmpa_dim } + { \g__nju_info_author_tl } \\ + \__nju_full_uline:NV \l__nju_tmpa_dim + { \g__nju_name_supv_a_tl #1 } + \__nju_ulined_center_box:nn { \l__nju_tmpa_dim } + { \g__nju_info_supvfull_tl } } \cs_new_protected:Npn \__nju_abs_info_en_g:n #1 { - \__nju_uline_list:xnn { \l__nju_info_type_en_tl #1 } - { \l__nju_info_title_en_tl } { \g__nju_abs_title_left_skip } - \clist_map_inline:nn { major, author, supv_full } + \__nju_uline_list:xnn { \g__nju_info_type_en_tl #1 } + { \g__nju_info_title_en_tl } { \g__nju_abs_title_left_skip } + \clist_map_inline:nn { major, author, supvfull } { - \__nju_uline_entry:Nnnn \l__nju_tmp_dim + \__nju_uline_entry:Nnnn \l__nju_tmpa_dim { ##1 _en } { ##1 _en } { #1 } \par } } @@ -332,13 +423,16 @@ } \clist_map_inline:nn { - { acknowledgement } { 致\hspace{2em}谢 }, + { acknowledgement } { 致 \qquad{} 谢 }, + { tableofcontents } { 目 \qquad{} 录 }, { id } { 学号 }, + { listoffigures } { 插图目录 }, + { listoftables } { 表格目录 }, { notation } { 符号表 }, - { orig_date } { 日期 }, + { origdate } { 日期 }, { paperlist } { 发表文章目录 }, - { pdf_creator } { LaTeX~ with~ njuthesis~ class }, - { preface } { 前\hspace{2em}言 }, + { pdfcreator } { LaTeX~ with~ njuthesis~ class }, + { preface } { 前 \qquad{} 言 }, { supv_ii } { 第二导师 }, { supv_ttl } { 职称 } } @@ -361,61 +455,74 @@ { \__nju_define_name:nnn #1 } \clist_map_inline:nn { - % 用于摘要的作者名称字样 + { apply } {(申请 \g__nju_info_degree_tl 学位)}, + { authdecl } { 学位论文出版授权书 }, { author_a } - { \tl_item:Nn \l__nju_info_degree_tl { 1 } 士生姓名 }, + { \tl_item:Nn \g__nju_info_degree_tl { 1 } 士生姓名 }, + { authsign } { 作者签名:\njuline{\hspace{6em}} }, + { blankdate } { \njuline{\qquad\qquad} 年 + \njuline{\qquad} 月 \njuline{\qquad} 日 }, + % 用于摘要的作者名称字样 { chairman } { 答辩委员会主席: }, { clc } { 分类号 }, { confer } { 学位授予单位和日期 }, - { df_date } { 论文答辩日期 }, + { defenddate } { 论文答辩日期 }, { degree } { 申请学位级别 }, - { apply } - { (申请 \l__nju_info_degree_tl 学位) }, + % 用于出版授权书的学位名称字样 + { degree_a } { 论文级别 }, + % 用于出版授权书的院系名称字样 + { dept_a } { 所在院系 }, + { email } { 作者 Email }, { field } { 研究方向 }, { g } { 研究生 }, { grade } { 级 }, + % 用于出版授权书的学号名称字样 + { id_a } { 研究生学号 }, % 用于摘要的专业名称字样 { major_a } { 专业 }, % 用于国家图书馆封面的专业名称字样 { major_b } { 专业名称 }, - { orig_decl } - { \c__nju_name_nju_tl 学位论文原创性声明 }, - { orig_sign } { 研究生签名 }, + { origdecl } { 南京大学学位论文原创性声明 }, + { origsign } { 研究生签名 }, { reviewer } { 评阅人: }, - { seclv } { 密级 }, + { secretlv } { 密级 }, + { secretstatus } { 论文涉密情况: }, + { secretfree } { 不保密 }, + { secretdate } + { 保密,保密期( \g__nju_name_blankdate_tl 至 + \g__nju_name_blankdate_tl ) }, { sign } { (签字) }, - { sm_date } { 论文提交日期 }, + { submitdate } { 论文提交日期 }, { supv } { 导师 }, % 用于摘要的导师名称字样 { supv_a } { 指导教师(姓名、职称) }, - { supv_info } + % 用于出版授权书的导师名称字样 + { supv_b } { 导师姓名 }, + { supvinfo } { 指导教师姓名、职务、职称、学位、单位名称及地址 }, % 用于普通封面的标题名称字样 { title } { 论文题目 }, % 用于摘要的标题名称字样 { title_a } { 题目 }, % 用于国家图书馆封面的标题名称字样 - { title_b } { (题名和副题名) }, - { udc } { U D C } + { title_b } { (题名和副题名) }, + % 用于出版授权书的标题名称字样 + { title_c } { 论文题名 }, + { udc } { U D C }, + { year } { 学位年度 } } { \__nju_define_name:nn #1 } \clist_map_inline:nn { - { abstract_title } - { 南京大学 \l__nju_info_type_tl 中文摘要首页用纸 } - { 南京大学 \l__nju_info_type_tl 英文摘要首页用纸 }, + { abstracttitle } + { 南京大学 \g__nju_info_type_tl 中文摘要首页用纸 } + { 南京大学 \g__nju_info_type_tl 英文摘要首页用纸 }, { author } { 作者姓名 } { POSTGRADUATE }, { major } { 专业方向 } { SPECIALIZATION }, - { supv_full } { 指导教师 } { MENTOR } + { supvfull } { 指导教师 } { MENTOR } } { \__nju_define_name:nnn #1 } -\tl_const:Nn \c__nju_cover_en_text_tl - { - A~ dissertation~ submitted~ to \\ - the~ graduate~ school~ of~ Nanjing~ University \\ - in~ partial~ fulfilment~ of~ the~ requirements~ for~ the~ degree~ of - } -\tl_const:Nn \c__nju_orig_decl_text_tl +\tl_const:Nn \g__nju_text_origdecl_tl { 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作 所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或 @@ -423,6 +530,23 @@ 的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已 在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 } +\tl_gset:Nn \g__nju_text_authdecl_tl + { + 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》 + (以下简称“章程”),愿意将本人的学位论文提交“中国学术期刊 + (光盘版)电子杂志社”在《中国博士学位论文全文数据库》、 + 《中国优秀硕士学位论文全文数据库》中全文发表。《中国博士 + 学位论文全文数据库》、《中国优秀硕士学位论文全文数据库》 + 可以以电子、网络及其他数字媒体形式公开出版,并同意编入 + 《中国知识资源总库》,在《中国博硕士学位论文评价数据库》 + 中使用和在互联网上传播,同意按“章程”规定享受相关权益。 + } +\tl_gset:Nn \g__nju_text_cover_en_tl + { + A~ dissertation~ submitted~ to \\ + the~ graduate~ school~ of~ Nanjing~ University \\ + in~ partial~ fulfilment~ of~ the~ requirements~ for~ the~ degree~ of + } \clist_map_inline:nn { { axiom } { 公理 } { Axiom }, @@ -434,6 +558,25 @@ { theorem } { 定理 } { Theorem } } { \__nju_add_theorem_type:nnn #1 } +\clist_map_inline:nn + { + { coverlabel } { 100 pt }, + { coverlineskip } { 40 pt }, + { coveruline } { 270 pt }, + { smallhskip } { 5 pt }, + { smallvskip } { 1 ex } + } + { \__nju_define_dim:nn #1 } +\clist_map_inline:nn + { + { chapterintoc } { \large \normalfont \sffamily }, + { chapter } { \large \normalfont \sffamily \centering }, + { section } { \large \normalfont \sffamily }, + { subsection } { \large \normalfont \sffamily }, + { subsubsection } { \large \normalfont \sffamily }, + { toctitle } { \centering \zihao { 3 } \bfseries } + } + { \__nju_define_fmt:nn #1 } \endinput %% %% End of file `njuthesis-graduate.def'. diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def index bdbf15f9ae5..8fbc37def77 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 0.16.1 2022-03-27 13:00:00 +0800 NJU LUG $ +\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG $ {Undergraduate definition file for njuthesis} \ProvidesExplFile{njuthesis-undergraduate.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -42,29 +42,30 @@ \__nju_declare_element:nn { cover / ug / title } { content = - \__nju_spread_box:nnV { 9 em } { \bf } \l__nju_info_type_tl, + \__nju_spread_box:nnV { 9 em } { \bf } \g__nju_info_type_tl, format = \zihao { -1 }, bottom-skip = 0 pt plus 1.5 fill } \__nju_declare_element:nn { cover / ug / info } { content = - \__nju_cover_info_ug:nnn { 4.2 em } { 16 em } { 5.5 em }, + \__nju_cover_info_ug:NN \g__nju_coverlabel_dim \g__nju_coveruline_dim, format = \zihao { 3 } } -\cs_new_protected:Npn \__nju_cover_info_ug:nnn #1#2#3 +\cs_new_protected:Npn \__nju_cover_info_ug:NN #1#2 { - \begin{minipage} { #1 + #2 + 0.3 em } - \raggedleft + \begin{minipage} { #1 + #2 + \g__nju_smallhskip_dim } + \dim_set_eq:NN \baselineskip \g__nju_coverlineskip_dim + \dim_set:Nn \l__nju_tmpb_dim { .5 #2 - .5 #1 - \g__nju_smallhskip_dim } \__nju_cover_entry:nnn { dept } { #1 } { #2 } \__nju_cover_entry:nnn { major } { #1 } { #2 } - \__nju_multiline_title:nnn { \bf } { #1 } { #2 } - \__nju_cover_bientry:nnnn { grade } { id } { #1 } { #3 } + \__nju_cover_entry_title:nnn { \bf } { #1 } { #2 } + \__nju_cover_bientry:nnnn { grade } { id } { #1 } { \l__nju_tmpb_dim } \__nju_cover_entry:nnn { author } { #1 } { #2 } - \__nju_cover_supv_entry:nnn { supv } { #1 } { #3 } + \__nju_cover_entry_supv:nnn { supv } { #1 } { \l__nju_tmpb_dim } \bool_if:NT \l__nju_second_supv_bool - { \__nju_cover_supv_entry:nnn { supv_ii } { #1 } { #3 } } - \__nju_cover_entry:nnn { sm_date } { #1 } { #2 } + { \__nju_cover_entry_supv:nnn { supv_ii } { #1 } { \l__nju_tmpb_dim } } + \__nju_cover_entry:nnn { submitdate } { #1 } { #2 } \end{minipage} } \__nju_declare_page:nn { cover-ug-default } @@ -77,21 +78,25 @@ { \UseInstance { nju } { cover-ug-default } } -\cs_new_protected:Npn \__nju_make_orig_decl: +\cs_new_protected:Npn \__nju_make_origdecl: { - \chapter* { \c__nju_name_orig_decl_tl } + \chapter* { \g__nju_name_origdecl_tl } \thispagestyle { empty } - \c__nju_orig_decl_text_tl + \g__nju_text_origdecl_tl \vfil \begin{flushright} - \clist_map_inline:nn { orig_sign, id, orig_date } + \clist_map_inline:nn { origsign, id, origdate } { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } } \end{flushright} \vfil } +\cs_new_protected:Npn \__nju_make_authdecl: + { + \prg_do_nothing: + } \__nju_declare_element:nn { abstract / title } { - content = \__nju_abs_title:V \c__nju_name_abstract_title_tl, + content = \__nju_abs_title:V \g__nju_name_abstracttitle_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -104,7 +109,7 @@ } \__nju_declare_element:nn { abstract / en / title } { - content = \__nju_abs_title:V \c__nju_name_abstract_title_en_tl, + content = \__nju_abs_title:V \g__nju_name_abstracttitle_en_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -118,23 +123,23 @@ \cs_new_protected:Npn \__nju_abs_info_ug:nn #1#2 { \tl_if_blank:eTF { #1 } - { \c__nju_name_title_tl } - { \clist_item:Nn \c__nju_name_type_en_clist { \g__nju_info_type_int } } - #2 \tl_use:c { l__nju_info_title #1 _tl } \\ - \tl_set_eq:NN \c__nju_name_author_tl \c__nju_name_author_a_tl - \clist_map_inline:nn { dept, major, author, supv_full } + { \g__nju_name_title_tl } + { \clist_item:Nn \g__nju_name_type_en_clist { \g__nju_info_type_int } } + #2 \tl_use:c { g__nju_info_title #1 _tl } \\ + \tl_set_eq:NN \g__nju_name_author_tl \g__nju_name_author_a_tl + \clist_map_inline:nn { dept, major, author, supvfull } { \__nju_name:n { ##1 #1 } #2 \__nju_info:n { ##1 #1 } \\ } \__nju_name:n { abstract #1 } #2 } \__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 } @@ -150,13 +155,16 @@ } \clist_map_inline:nn { - { acknowledgement } { 致\hspace{2em}谢 }, + { acknowledgement } { 致 \qquad{} 谢 }, + { tableofcontents } { 目 \qquad{} 录 }, { id } { 学号 }, + { listoffigures } { 插图目录 }, + { listoftables } { 表格目录 }, { notation } { 符号表 }, - { orig_date } { 日期 }, + { origdate } { 日期 }, { paperlist } { 发表文章目录 }, - { pdf_creator } { LaTeX~ with~ njuthesis~ class }, - { preface } { 前\hspace{2em}言 }, + { pdfcreator } { LaTeX~ with~ njuthesis~ class }, + { preface } { 前 \qquad{} 言 }, { supv_ii } { 第二导师 }, { supv_ttl } { 职称 } } @@ -182,10 +190,10 @@ % 用于摘要的作者名称字样 { author_a } { 本科生姓名 }, { grade } { 年级 }, - { orig_decl } - { \c__nju_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, - { orig_sign } { 作者签名 }, - { sm_date } { 提交日期 }, + { origdecl } + { \g__nju_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, + { origsign } { 作者签名 }, + { submitdate } { 提交日期 }, { supv } { 导师 }, { title } { 题目 }, { type } { 本科生毕业论文(设计、作品) }, @@ -194,27 +202,27 @@ { \__nju_define_name:nn #1 } \clist_map_inline:nn { - { abstract_title } + { abstracttitle } { - \c__nju_name_nju_tl \c__nju_name_type_tl - \c__nju_name_lang_tl \c__nju_name_abstract_tl + \g__nju_name_nju_tl \g__nju_name_type_tl + \g__nju_name_lang_tl \g__nju_name_abstract_tl } { - \c__nju_name_nju_tl \c__nju_name_type_tl - \c__nju_name_lang_en_tl \c__nju_name_abstract_tl + \g__nju_name_nju_tl \g__nju_name_type_tl + \g__nju_name_lang_en_tl \g__nju_name_abstract_tl }, { author } { 学生姓名 } { UNDERGRADUATE }, { major } { 专业 } { SPECIALIZATION }, - { supv_full } { 指导教师(姓名、职称) } { MENTOR } + { supvfull } { 指导教师(姓名、职称) } { MENTOR } } { \__nju_define_name:nnn #1 } -\tl_const:Nn \c__nju_orig_decl_text_tl +\tl_const:Nn \g__nju_text_origdecl_tl { - 本人郑重承诺:所呈交的毕业论文(设计)(题目:)是在指导教师的指导下 - 严格按照学校和院系有关规定由本人独立完成的。本毕业论文(设计)中引用 - 他人观点及参考资源的内容均已标注引用,如出现侵犯他人知识产权的行为, - 由本人承担相应法律责任。本人承诺不存在抄袭、伪造、篡改、代写、买卖毕 - 业论文(设计)等违纪行为。 + 本人郑重承诺:所呈交的毕业论文(设计)(题目: \g__nju_info_title_tl ) + 是在指导教师的指导下严格按照学校和院系有关规定由本人独立完成的。 + 本毕业论文(设计)中引用他人观点及参考资源的内容均已标注引用, + 如出现侵犯他人知识产权的行为,由本人承担相应法律责任。 + 本人承诺不存在抄袭、伪造、篡改、代写、买卖毕业论文(设计)等违纪行为。 } \clist_map_inline:nn { @@ -227,6 +235,25 @@ { theorem } { 定理 } { Theorem } } { \__nju_add_theorem_type:nnn #1 } +\clist_map_inline:nn + { + { coverlabel } { 68 pt }, + { coverlineskip } { 40 pt }, + { coveruline } { 270 pt }, + { smallhskip } { 5 pt }, + { smallvskip } { 1 ex } + } + { \__nju_define_dim:nn #1 } +\clist_map_inline:nn + { + { chapterintoc } { \large \normalfont \sffamily }, + { chapter } { \large \normalfont \sffamily \centering }, + { section } { \large \normalfont \sffamily }, + { subsection } { \large \normalfont \sffamily }, + { subsubsection } { \large \normalfont \sffamily }, + { toctitle } { \centering \zihao { 3 } \bfseries } + } + { \__nju_define_fmt:nn #1 } \endinput %% %% End of file `njuthesis-undergraduate.def'. 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 $ +\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG $ {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 } -- cgit v1.2.3