diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/njuthesis')
5 files changed, 542 insertions, 248 deletions
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls new file mode 100644 index 00000000000..d5f9ff816f0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls @@ -0,0 +1,301 @@ +%% +%% This is file `njuthesis-doc.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% njuthesis.dtx (with options: `doc-cls') +%% +%% Copyright (C) 2021 - 2023 +%% by Nanjing University Linux User Group +%% <git+nju-lug-email-3104-issue-@yaoge123.cn> +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3c of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%% To produce the documentation run the original source files ending with +%% `.dtx' through XeTeX. +%% +\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00 + +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ + {Documentation style for njuthesis} +\ProvidesExplFile{njuthesis-doc.cls} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} + +\RequirePackage { l3keys2e } +\keys_define:nn { njudoc } + { + codehigh .bool_set:N = \g__njudoc_codehigh_bool, + codehigh .initial:n = false + } +\ProcessKeysOptions { njudoc } +\PassOptionsToPackage { fontset = fandol } { ctex } +\PassOptionsToPackage { firstpage = true } { background } +\LoadClass { ctxdoc } +\RequirePackage + { + background, + codehigh, + listings, + njuvisual, + tabularray, + unicode-math, + zhlineskip + } +\sys_if_engine_xetex:TF + { + \RequirePackage { xeCJKfntef } + \renewcommand\emph[1]{\CJKunderdot[textformat=\itshape]{#1}} + } + { + \RequirePackage { lua-ul } + \NewDocumentCommand \CJKunderline { o m } { \underLine {#1} } + \NewDocumentCommand \CJKunderdot { o m } { \underLine {#1} } + \NewDocumentCommand \CJKsout { o m } + { \textcolor { black!50 } {#1} } + } +\backgroundsetup{ + contents={\njuemblem[white!85!gray]{22cm}{!}}, + scale=1, angle=0, hshift=-4cm +} +\definecolor{tpblue}{HTML}{495A80} +\newcommand\tpbutton[1]{\textcolor{tpblue}{\bfseries #1}} +\newcommand\tikzlogo{Ti\emph{k}Z} +\newcommand\OPT[1]{\textcolor{njuyellow}{\bfseries#1}} +\hypersetup{ + pdftitle = { + The~ njuthesis~ class~ -~ + LaTeX~ thesis~ template~ for~ Nanjing~ University}, + citecolor = njublue, + linkcolor = njuviolet, + urlcolor = njumagenta} +\UseTblrLibrary{booktabs,siunitx} +\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable} +\SetTblrStyle{caption-tag}{font=\bfseries} +\SetTblrInner{row{1}={font=\bfseries}} +\SetTblrInner[talltblr]{row{1}={font=\bfseries}} +\DefTblrTemplate{caption-sep}{default}{\quad} +\def\TA{\TblrNote{a}} +\def\TB{\TblrNote{b}} +\def\TC{\TblrNote{c}} +\def\TD{\TblrNote{d}} +\def\TE{\TblrNote{e}} +\def\TL{\TeX~Live} +\def\MacTeX{Mac\TeX} +\def\biber{\hologo{biber}} +\def\LaTeXe{\hologo{LaTeX2e}} +\SetTextEnvironmentSinglespace{1.112} +\SetMathEnvironmentSinglespace{1.112} +\setmainfont { texgyretermes } + [ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + ] +\setsansfont{LexendDeca} +\fontspec_font_if_exist:nT { Iosevka } + { + \setmonofont { Iosevka } + [ + UprightFont = *~Light, + ItalicFont = *~Light~Italic, + BoldFont = *~Semibold + ] + } +\fontspec_font_if_exist:nT { Source~ Han~ Serif~ SC } + { + \setCJKmainfont{ Source~ Han~ Serif~ SC } + [ + UprightFont = *~SemiBold, + ItalicFont = *~Bold, + BoldFont = *~Heavy, + Language = Chinese~Simplified + ] + } +\setCJKsansfont { FandolHei-Regular } + [ + Extension = .otf, + BoldFont = FandolHei-Bold + ] +\setCJKmonofont { FandolFang-Regular } + [ Extension = .otf ] +\setmathfont{XITSMath-Regular}[ + BoldFont = XITSMath-Bold, + Extension = .otf] +\lstdefinestyle{style@base} + { + basewidth = 0.5 em, + gobble = 3, + lineskip = 3 pt, + frame = l, + framerule = 1 pt, + framesep = 0 pt, + xleftmargin = 2 em, + xrightmargin = 3 em, + escapeinside = {(*}{*)}, + breaklines = true, + basicstyle = \small\ttfamily, + keywordstyle = \bfseries\color{njuviolet}, + commentstyle = \itshape\color{white!50!gray}, + stringstyle = \color{nju-chem-red}, + backgroundcolor = \color{white!95!gray} + } +\lstdefinestyle{style@shell} + { + style = style@base, + rulecolor = \color{njumagenta}, + language = bash, + alsoletter = {-}, + emphstyle = \color{nju-cs-green} + } +\lstdefinestyle{style@latex} + { + style = style@base, + rulecolor = \color{njublue}, + language = [LaTeX]TeX, + alsoletter = {*, -, .}, + texcsstyle = *\color{njuviolet}, + emphstyle = [1]\color{nju-ai-orange}, + emphstyle = [2]\color{nju-cs-green}, + emphstyle = [3]\bfseries\color{njuyellow} + } +\lstnewenvironment{shellexample}[1][]{% + \lstset{style=style@shell, #1}}{} +\lstnewenvironment{latexexample}[1][]{% + \lstset{style=style@latex, #1}}{} +\colorlet { at@guard } { njuviolet } +\definecolor { angle@guard } { gray } { 0.7 } +\definecolor { star@guard } { rgb } { 0.8 , 0 , 0 } +\definecolor { u@guard } { HTML } { 5463FF } +\definecolor { g@guard } { HTML } { 2B7A0B } +\definecolor { p@guard } { HTML } { FF1818 } +\definecolor { c@guard } { HTML } { FFC300 } +\prop_const_from_keyval:Nn \c__njudoc_module_color_prop + { + def-u = u@guard, + def-g = g@guard, + def-p = p@guard + } +\cs_new:Npn \__njudoc_set_module_color:Nn #1#2 + { + \prop_get:NnNF \c__njudoc_module_color_prop {#2} #1 + { \tl_set:Nn #1 { c@guard } } + \exp_args:NV \color #1 #2 + } +\cs_new:Npn \__njudoc_set_module_color:n + { \__njudoc_set_module_color:Nn \l_tmpa_tl } +\cs_new_protected:Npn \__njudoc_module_angle:Nn #1#2 + { + \group_begin: \color { angle@guard } \ttfamily \textlangle \group_end: + \group_begin: \sffamily #2 \group_end: + \group_begin: \color { angle@guard } #1 \ttfamily \textrangle \group_end: + } +\cs_set:Npn \__ctxdoc_module_angle:n + { \__njudoc_module_angle:Nn \c_empty_tl } +\cs_new_protected:Npn \__njudoc_colored_module_angle:NN #1#2 + { + \seq_clear:N #2 + \seq_map_inline:Nn #1 + { + \seq_gput_right:Nn #2 + { \__njudoc_set_module_color:n {##1} } + } + } +\cs_new_protected:Npn \__njudoc_print_module:n #1 + { + \__njudoc_colored_module_angle:NN \l_tmpa_seq \l_tmpb_seq + \bool_lazy_or:nnTF + { \str_if_empty_p:n {#1} } + { \int_compare_p:n { \seq_count:N \l_tmpb_seq = 1 } } + { + \str_clear:N \l_tmpa_str + \str_clear:N \l_tmpb_str + } + { + \str_set:Nn \l_tmpa_str { ( } + \str_set:Nn \l_tmpb_str { ) } + } + \__njudoc_module_angle:Nn \l_tmpb_str + { + \color { star@guard } #1 + \color { angle@guard } \l_tmpa_str + \seq_use:Nn \l_tmpb_seq + { \color { angle@guard } \orbar } + } + } +\cs_new:Npn \__njudoc_split_pm:n + { \seq_set_split:Nnn \l_tmpa_seq { | } } +\cs_generate_variant:Nn \__njudoc_split_pm:n { V } +\cs_new_protected_nopar:Npn \__njudoc_split_m:n #1 + { + \tl_set:Nn \l_tmpa_str {#1} + \clist_map_inline:nn { *, /, (, ) } + { \str_remove_all:Nn \l_tmpa_str {##1} } + \__njudoc_split_pm:V \l_tmpa_str + } +\group_begin: + \char_set_catcode_active:N \> + \cs_gset_protected:Npn \__ctxdoc_module_star:w #1 > #2 \q_stop + { + \__ctxdoc_output_module:nn + { \__njudoc_split_m:n {#1} } + { \__ctxdoc_module_push:n { \__njudoc_print_module:n { * } } } + \__ctxdoc_output_line:n {#2} + \__ctxdoc_star_format: + } + \cs_gset_protected:Npn \__ctxdoc_module_slash:w #1 > #2 \q_stop + { + \__ctxdoc_output_module:nn + { \__njudoc_split_m:n {#1} } + { \__ctxdoc_module_pop:n { \__njudoc_print_module:n { / } } } + \__ctxdoc_output_line:n {#2} + \__ctxdoc_slash_format: + } + \cs_gset_protected:Npn \__ctxdoc_module_pm:w #1 > #2 \q_stop + { + \tex_noindent:D + \hbox_overlap_left:n + { + \__ctxdoc_output_module:nn + { \__njudoc_split_pm:n {#1} } + { \__njudoc_print_module:n { } } + \skip_horizontal:n { \leftskip + \smallskipamount } + } + \group_begin: + \__ctxdoc_pm_format: + \__ctxdoc_output_line:n {#2} + \group_end: + } +\group_end: +\NewDocumentCommand \grd { m } + { \__ctxdoc_module_angle:n { \color { njuviolet } #1 } } +\NewDocumentCommand \sgrd { m } + { \__ctxdoc_module_angle:n { \color { star@guard } * \color{ c@guard } #1 } } +\NewDocumentCommand \pgrd { m } + { \__ctxdoc_module_angle:n { \color { #1 @guard } def- #1 } } +\cs_generate_variant:Nn \tl_remove_once:Nn { NV } +\cs_set_protected_nopar:Npn \__njudoc_output_line:N #1 + { + \tex_noindent:D + \__ctxdoc_replace_at_at:N #1 + \tl_remove_once:NV #1 \c__ctxdoc_active_cr_tl + \__codehigh_parse_code:nN { latex / latex3 } #1 + \tex_par:D + } +\bool_if:NT \g__njudoc_codehigh_bool + { + \cs_set:Npn \__ctxdoc_output_line: + { \__njudoc_output_line:N \l__ctxdoc_verbatim_line_tl } + } +\endinput +%% +%% End of file `njuthesis-doc.cls'. diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def index 6aa670fb152..1292bef9a24 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def @@ -23,36 +23,20 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.2.1 2023-05-03 13:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Graduate definition file for njuthesis} \ProvidesExplFile{njuthesis-graduate.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} - % \begin{syntax} - % \OPT{degree} = \Arg{中文学位名} - % \OPT{degree*} = \Arg{英文学位名} - % \end{syntax} - % 研究生国家图书馆封面英文封面上的学位名称。默认会由模板通过 \opt{degree} - % 和 \opt{type} 文档类选项生成,也可以由本选项自定义名称。 - % \end{function} \bool_if:NT \g__nju_opt_decl_bool { \RequirePackage { tabularray } } -\ctex_at_end_preamble:n +\cs_set:Npn \__nju_date:nn #1#2 + { \__nju_date:nnn { } {#1} {#2} \__nju_date:nnn { _en } {#1} {#2} } +\tl_new:N \g__nju_info_confer_tl +\tl_set:Nn \g__nju_info_confer_tl { - \__nju_date:n { submit } - \__nju_date_en:n { submit } - \__nju_date:n { defend } - \bool_if:NT \g__nju_opt_nlcover_bool - { - \__nju_date:n { bottom } - \__nju_date:n { confer } - \tl_new:N \g__nju_info_confer_tl - \tl_set:Nn \g__nju_info_confer_tl - { - \textbf { \c__nju_name_nju_tl } \hfil - \g__nju_info_conferdate_tl - } - } + \textbf { \c__nju_name_nju_tl } \hfil + \g__nju_info_conferdate_tl } \tl_new:N \g__nju_info_type_tl \tl_set:Nx \g__nju_info_type_tl @@ -117,16 +101,19 @@ \l__nju_tmpb_dim \tex_relax:D { ##1 } } } -\cs_new_protected:Npn \__nju_g_cover_info:NNNN #1#2#3#4 +\cs_new_protected:Npn \__nju_g_cover_info:NNNNN #1#2#3#4#5 { - \__nju_cover_entry_title:NNNN #1 #2 #3 #4 - \clist_map_inline:nn { author, major, field, supvfull } - { \__nju_cover_entry:NNNNn #1 #2 #3 #4 { ##1 } } + \bool_if:NTF \g__nju_opt_academic_bool + { \clist_set:Nn #1 { author, major, field, supvfull } } + { \clist_set:Nn #1 { author, majorc, field, supvfull } } + \__nju_cover_entry_title:NNNN #2 #3 #4 #5 + \clist_map_inline:Nn #1 + { \__nju_cover_entry:NNNNn #2 #3 #4 #5 { ##1 } } } \cs_new:Npn \__nju_g_cover_info: { \tl_set:Nn \l__nju_tmpa_tl { \skip_horizontal:n { .7 cm } } - \__nju_g_cover_info:NNNN \l__nju_tmpa_tl + \__nju_g_cover_info:NNNNN \l__nju_tmpa_clist \l__nju_tmpa_tl \c__nju_clabelwd_dim \c__nju_crulewd_dim \c__nju_fmt_coverlabel_tl } \__nju_declare_element:nn { g / cover-back / info } @@ -144,7 +131,7 @@ \__nju_cover_entry:NNNNn \c_empty_tl #1 #2 #3 { chairman } \tex_par:D \__nju_box_spread_name:NNn #1 #3 { reviewer } - \parbox [ t ] { #2 } + \parbox [ t ] {#2} { \__nju_box_multiline:NNn \g__nju_info_reviewer_clist #2 { 5 } \dim_gset_eq:NN \l__nju_tmpa_dim \tex_prevdepth:D @@ -342,14 +329,14 @@ } \__nju_declare_element:nn { g / decl / auth / date } { - content = \__nju_authdecl_secretlv_g:, + content = \__nju_g_decl_auth_secretlv:, format = \zihao { 5 } , align = l } -\cs_new_protected:Npn \__nju_degree_checkbox:Nn #1#2 +\cs_new_protected:Npn \__nju_degree_checkbox:nn #1#2 { \bool_lazy_and:nnTF - { \g__nju_opt_academic_bool && #1 } + { #1 \g__nju_opt_academic_bool } { \int_compare_p:n { \g__nju_info_type_int = #2 } } { \makebox [ 0 pt ] [l] { \ensuremath { \mdwhtsquare } } @@ -371,13 +358,13 @@ \c__nju_name_ida_tl & \g__nju_info_id_tl & \c__nju_name_depta_tl & \g__nju_info_dept_tl & \c__nju_name_year_tl & - \tl_range:Nnn \g__nju_info_submitdate_raw_tl {1} {4} \\ + \tl_range:Nnn \g__nju_info_submitdate_tl {1} {4} \\ \c__nju_name_degreea_tl & { - \__nju_degree_checkbox:Nn \c_true_bool { 2 } 学术学位硕士 \qquad - \__nju_degree_checkbox:Nn \c_false_bool { 2 } 专业学位硕士 \\ - \__nju_degree_checkbox:Nn \c_true_bool { 3 } 学术学位博士 \qquad - \__nju_degree_checkbox:Nn \c_false_bool { 3 } 专业学位博士 + \__nju_degree_checkbox:nn { } { 2 } 学术学位硕士 \qquad + \__nju_degree_checkbox:nn { ! } { 2 } 专业学位硕士 \\ + \__nju_degree_checkbox:nn { } { 3 } 学术学位博士 \qquad + \__nju_degree_checkbox:nn { ! } { 3 } 专业学位博士 } \\ \c__nju_name_email_tl & \g__nju_info_email_tl \\ \c__nju_name_supvb_tl & @@ -391,7 +378,7 @@ \c__nju_name_authsign_tl \tex_par:D \c__nju_name_blankdatea_tl } -\cs_new_protected:Npn \__nju_authdecl_secretlv_g: +\cs_new_protected:Npn \__nju_g_decl_auth_secretlv: { \c__nju_name_secretstatus_tl \tex_par:D \ensuremath { \mdwhtsquare } \c__nju_name_secretfree_tl \tex_par:D @@ -415,6 +402,7 @@ { element = { title, top, middle, emblem-img, bottom }, prefix = g / cover-en /, + format = \linespread { 1.3 }, top-skip = 0 pt plus 1.2 fil } \__nju_declare_page:nn { cover-nl } @@ -444,11 +432,14 @@ } \cs_new_protected:Npn \__nju_make_cover: { - \clist_map_inline:nn { front, back, en } - { \UseInstance { nju } { cover-g- ##1 } } - } -\cs_new_protected:Npn \__nju_make_cover_nl: +\bool_if:NTF \g__nju_opt_nlcover_bool { \UseInstance { nju } { cover-nl } } + { + \UseInstance { nju } { cover-g-front } + \UseInstance { nju } { cover-g-back } + \UseInstance { nju } { cover-g-en } + } + } \cs_new_protected:Npn \__nju_make_decl_i: { \cleardoublepage @@ -579,6 +570,7 @@ { listoftables } { 表格目录 }, { major a } { 专业 }, { major b } { 专业名称 }, + { major c } { 专业学位类别(领域) }, { notation } { 符号表 }, { orig decl } { 南京大学学位论文原创性声明 }, { orig sign } { 研究生签名 }, @@ -639,8 +631,6 @@ { type } { 学位论文 } { g } } { \__nju_define_name:nnn #1 } -\bool_if:NF \g__nju_opt_academic_bool - { \tl_set:Nn \c__nju_name_major_tl { 专业学位类别(领域) } } \tl_const:Nn \c__nju_text_origdecl_tl { 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作所 @@ -699,11 +689,11 @@ { name color } { black }, { section } { \bigger \normalfont \sffamily }, { chapter } { \c__nju_fmt_section_tl \centering }, - { chapterintoc } { \c__nju_fmt_section_tl }, { subsection } { \c__nju_fmt_section_tl }, { subsubsection } { \c__nju_fmt_section_tl }, { paragraph } { \c__nju_fmt_section_tl }, { subparagraph } { \c__nju_fmt_section_tl }, + { chapterintoc } { \c__nju_fmt_section_tl }, { toc title } { \centering \zihao { 3 } \bfseries }, { header } { \small \kaishu }, { footer } { \small \rmfamily } diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def index e2d0f0bff0f..a1a6dd88e3f 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def @@ -23,23 +23,12 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.2.1 2023-05-03 13:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Postdoctoral definition file for njuthesis} \ProvidesExplFile{njuthesis-postdoctoral.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} - % \begin{syntax} - % \OPT{degree} = \Arg{中文学位名} - % \OPT{degree*} = \Arg{英文学位名} - % \end{syntax} - % 研究生国家图书馆封面英文封面上的学位名称。默认会由模板通过 \opt{degree} - % 和 \opt{type} 文档类选项生成,也可以由本选项自定义名称。 - % \end{function} -\ctex_at_end_preamble:n - { - \__nju_date:n { submit } - } \__nju_declare_element:nn { p / cover / name-img } { content = \__nju_name:N \c__nju_namewd_dim, @@ -274,17 +263,16 @@ { pagestyle } { headings }, { abslabel } { \bfseries }, { abslabel_en } { }, - { cover title } { }, { cover label } { }, { emblem color } { black }, { name color } { black }, { section } { \bigger \normalfont \sffamily }, { chapter } { \c__nju_fmt_section_tl \centering }, - { chapterintoc } { \c__nju_fmt_section_tl }, { subsection } { \c__nju_fmt_section_tl }, { subsubsection } { \c__nju_fmt_section_tl }, { paragraph } { \c__nju_fmt_section_tl }, { subparagraph } { \c__nju_fmt_section_tl }, + { chapterintoc } { \c__nju_fmt_section_tl }, { toc title } { \centering \zihao { 3 } \bfseries }, { header } { \small \kaishu }, { footer } { \small \rmfamily } diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def index 3430def33a6..a48cb5de066 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def @@ -23,23 +23,12 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.2.1 2023-05-03 13:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Undergraduate definition file for njuthesis} \ProvidesExplFile{njuthesis-undergraduate.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} - % \begin{syntax} - % \OPT{degree} = \Arg{中文学位名} - % \OPT{degree*} = \Arg{英文学位名} - % \end{syntax} - % 研究生国家图书馆封面英文封面上的学位名称。默认会由模板通过 \opt{degree} - % 和 \opt{type} 文档类选项生成,也可以由本选项自定义名称。 - % \end{function} -\ctex_at_end_preamble:n - { - \__nju_date:n { submit } - } \__nju_declare_element:nn { u / cover / emblem-img } { content = \__nju_emblem:N \c__nju_emblemwd_dim, @@ -59,7 +48,7 @@ \__nju_declare_element:nn { u / cover / info } { content = \__nju_u_cover_info:, - format = \zihao { 3 } \kaishu + format = \zihao { 3 } } \cs_new_protected:Npn \__nju_u_cover_info:NNNN #1#2#3#4 { @@ -74,10 +63,10 @@ { \__nju_cover_entry_supv:NNNn #1 \l__nju_tmpb_dim #4 { supvii } } \__nju_cover_entry:NNNn #1 #2 #4 { submitdate } } -\cs_new_protected:Npn \__nju_u_cover_info: +\cs_new:Npn \__nju_u_cover_info: { \__nju_u_cover_info:NNNN \c__nju_clabelwd_dim \c__nju_crulewd_dim - \c__nju_hsep_dim \c_empty_tl + \c__nju_hsep_dim \kaishu } \__nju_declare_element:nn { u / decl / orig / emblem } { @@ -267,17 +256,17 @@ { pagestyle } { plain }, { abslabel } { \bfseries }, { abslabel_en } { }, - { cover title } { }, + { cover title } { \bfseries }, { cover label } { \kaishu }, { emblem color } { black }, { name color } { black }, { section } { \bigger \normalfont \sffamily }, { chapter } { \c__nju_fmt_section_tl \centering }, - { chapterintoc } { \c__nju_fmt_section_tl }, { subsection } { \c__nju_fmt_section_tl }, { subsubsection } { \c__nju_fmt_section_tl }, { paragraph } { \c__nju_fmt_section_tl }, { subparagraph } { \c__nju_fmt_section_tl }, + { chapterintoc } { \c__nju_fmt_section_tl }, { toc title } { \centering \zihao { 3 } \bfseries }, { header } { \small \kaishu }, { footer } { \small \rmfamily } diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls index 496d6753cba..2cbeec2104d 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls @@ -24,18 +24,11 @@ %% `.dtx' through XeTeX. %% \NeedsTeXFormat{LaTeX2e} -\GetIdInfo $Id: njuthesis.dtx 1.2.1 2023-05-03 13:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Thesis template for Nanjing University} \ProvidesExplClass{njuthesis} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} - % \begin{syntax} - % \OPT{degree} = \Arg{中文学位名} - % \OPT{degree*} = \Arg{英文学位名} - % \end{syntax} - % 研究生国家图书馆封面英文封面上的学位名称。默认会由模板通过 \opt{degree} - % 和 \opt{type} 文档类选项生成,也可以由本选项自定义名称。 - % \end{function} \RequirePackage { xtemplate, l3keys2e } \msg_new:nnn { njuthesis } { l3-too-old } @@ -86,7 +79,7 @@ \tl_new:N \g__nju_font_path_tl \bool_new:N \g__nju_font_path_bool \tl_new:N \g__nju_config_tl -\tl_const:Nx \c__nju_today_tl +\tl_const:Nx \c__nju_name_today_tl { \int_to_arabic:n { \c_sys_year_int } - \int_to_arabic:n { \c_sys_month_int } - @@ -121,66 +114,67 @@ \skip_vertical:N \c_zero_dim } \cs_new_protected:Npn \__nju_define_name:nn #1#2 - { \tl_const:cn { c__nju_name_ #1 _tl } { #2 } } + { \tl_const:cn { c__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_const:cn { c__nju_name_ #1 _tl } {#2} + \tl_const:cn { c__nju_name_ #1 _en_tl } {#3} } \cs_new_protected:Npn \__nju_define_fmt:nn #1#2 - { \tl_const:cn { c__nju_fmt_ #1 _tl } { #2 } } + { \tl_const:cn { c__nju_fmt_ #1 _tl } {#2} } \cs_new_protected:Npn \__nju_define_dim:nn #1#2 - { \dim_const:cn { c__nju_ #1 _dim } { #2 } } + { \dim_const:cn { c__nju_ #1 _dim } {#2} } \cs_new_protected:Npn \__nju_define_skip:nn #1#2 - { \skip_const:cn { c__nju_ #1 _skip } { #2 } } + { \skip_const:cn { c__nju_ #1 _skip } {#2} } \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 { g__nju_info_ #1 _tl } } \cs_new:Npn \__nju_fmt:n #1 { \tl_use:c { c__nju_fmt_ #1 _tl } } \cs_new:Npn \__nju_name:nn #1#2 { \group_begin: \__nju_fmt:n {#1} \__nju_name:n {#2} \group_end: } \cs_new:Npn \__nju_fontsize:nn #1#2 - { \fontsize { #1 } { #2 } \selectfont } + { \fontsize {#1} {#2} \selectfont } \cs_new:Npn \__nju_fontsize:nnn #1#2#3 - { \__nju_fontsize:nn { #1 } { \fp_to_decimal:n { #3 * #1 } } } + { \__nju_fontsize:nn {#1} { \fp_to_decimal:n { #3 * #1 } } } \cs_new:Npn \__nju_zihao:nn #1#2 { - \prop_get:NnNTF \c__ctex_font_size_prop { #2 } \l__ctex_font_size_tl - { \exp_after:wN \__nju_fontsize:nnn \l__ctex_font_size_tl { #1 } } - { \msg_error:nnn { ctex } { fontsize } { #2 } } + \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl + { \exp_after:wN \__nju_fontsize:nnn \l__ctex_font_size_tl {#1} } + { \msg_error:nnn { ctex } { fontsize } {#2} } } \cs_new:Npn \__nju_zihao:n { \__nju_zihao:nn { 1.3 } } \cs_generate_variant:Nn \cs_new:Npn { Npo } \cs_new:Npo \__nju_set_ccglue:n #1 { \sys_if_engine_xetex:TF - { \skip_set:Nn \l__ctex_ccglue_skip { #1 } } - { \ltjsetparameter { kanjiskip = { #1 } } } + { \skip_set:Nn \l__ctex_ccglue_skip {#1} } + { \ltjsetparameter { kanjiskip = {#1} } } } \cs_new_protected:Npn \__nju_box_ulined:NN #1#2 { \mode_leave_vertical: - \rule [ \c__nju_ruledpi_dim ] { #1 } { \c__nju_rulehti_dim } + \rule [ \c__nju_ruledpi_dim ] {#1} { \c__nju_rulehti_dim } \skip_horizontal:n { -#1 } - \hbox_to_wd:nn { #1 } { \tex_hfil:D #2 \tex_hfil:D } + \hbox_to_wd:nn {#1} { \tex_hfil:D #2 \tex_hfil:D } } \cs_generate_variant:Nn \__nju_box_ulined:NN { Nc } \cs_new_protected:Npn \__nju_box_ulined_info:Nn #1#2 { \__nju_box_ulined:Nc #1 { g__nju_info_ #2 _tl } } -\cs_new_protected:Npn \__nju_box_spread:NNn #1#2#3 +\cs_new_protected:Npn \__nju_box_spread:NNNn #1#2#3#4 { \mode_leave_vertical: - \__nju_get_width:Nn \l__nju_tmp_skip { #2 #3 } - \hbox_to_wd:nn { #1 } + \__nju_get_width:Nn #1 { #3 #4 } + \hbox_to_wd:nn {#2} { - \dim_compare:nTF { \l__nju_tmp_skip > #1 } + \dim_compare:nTF { #1 > #2 } { \tex_hfil:D \scalebox - { \dim_to_decimal_in_unit:nn { #1 } { \l__nju_tmp_skip } } - [ 1.0 ] { #2 #3 } \tex_hfil:D + { \dim_to_decimal_in_unit:nn {#2} {#1} } + [ 1.0 ] { #3 #4 } \tex_hfil:D } - { #2 \tl_map_inline:nn { #3 } { ##1 \tex_hfil:D } \tex_unskip:D } + { #3 \tl_map_inline:nn {#4} { ##1 \tex_hfil:D } \tex_unskip:D } } } +\cs_new:Npn \__nju_box_spread:NNn { \__nju_box_spread:NNNn \l__nju_tmp_skip } \cs_generate_variant:Nn \__nju_box_spread:NNn { NNv } \cs_generate_variant:Nn \__nju_box_spread:NNn { NNx } \cs_new_protected:Npn \__nju_box_spread_name:Nn #1#2 @@ -192,30 +186,29 @@ \mode_leave_vertical: \hbox_to_wd:nn {#1} { \tex_hfil:D #2 \tex_hfil:D } } -\cs_new_protected:Npn \__nju_box_multiline:NNNn #1#2#3#4 +\cs_new_protected:Npn \__nju_box_multiline:NNNNn #1#2#3#4#5 { - \int_set:Nn #1 { \int_max:nn { \clist_count:N #2 } { #4 } } - \int_step_inline:nn { #1 } + \int_set:Nn #1 { \int_max:nn { \clist_count:N #3 } {#5} } + \int_step_inline:nn {#1} { - \clist_pop:NN #2 \l__nju_tmpa_tl - \quark_if_no_value:NT \l__nju_tmpa_tl - { \tl_set_eq:NN \l__nju_tmpa_tl \c_empty_tl } - \__nju_box_ulined:NN #3 \l__nju_tmpa_tl \tex_par:D + \clist_pop:NNF #3 #2 { \tl_set_eq:NN #2 \c_empty_tl } + \__nju_box_ulined:NN #4 #2 \tex_par:D } } -\cs_new:Npn \__nju_box_multiline:NNn { \__nju_box_multiline:NNNn \l__nju_tmpa_int } +\cs_new:Npn \__nju_box_multiline:NNn + { \__nju_box_multiline:NNNNn \l__nju_tmpa_int \l__nju_tmpa_tl } \cs_new_protected:Npn \__nju_uline:n #1 { \mode_leave_vertical: - \rule [ \c__nju_ruledpi_dim ] { #1 } { \c__nju_rulehti_dim } + \rule [ \c__nju_ruledpi_dim ] {#1} { \c__nju_rulehti_dim } \skip_horizontal:n { -#1 } } \cs_new_protected:Npn \__nju_uuline:N #1 { \mode_leave_vertical: - \rule [ \c__nju_ruledpii_dim ] { #1 } { \c__nju_rulehtii_dim } + \rule [ \c__nju_ruledpii_dim ] {#1} { \c__nju_rulehtii_dim } \skip_horizontal:n { -#1 } - \rule [ \c__nju_ruledpiii_dim ] { #1 } { \c__nju_rulehtii_dim } + \rule [ \c__nju_ruledpiii_dim ] {#1} { \c__nju_rulehtii_dim } \skip_horizontal:n { -#1 } } \cs_new:Npn \__nju_get_width:Nn #1#2 @@ -235,7 +228,7 @@ } \cs_new_protected:Npn \__nju_get_width_print:Nn #1#2 { - \__nju_get_width:Nn #1 { #2 } + \__nju_get_width:Nn #1 {#2} \dim_set:Nn #1 { \textwidth - #1 } #2 } \cs_generate_variant:Nn \__nju_get_width_print:Nn { Nv } @@ -243,37 +236,30 @@ \cs_new_protected:Npn \__nju_uline_entry:Nn #1#2 { \__nju_get_width_print:Nv #1 { c__nju_name_ #2 _tl } - \__nju_box_ulined_info:Nn #1 { #2 } + \__nju_box_ulined_info:Nn #1 {#2} } \cs_new_protected:Npn \__nju_uline_bientry:Nn #1#2 { \__nju_get_width_print:Nv #1 { c__nju_name_ #2 _tl } \dim_sub:Nn #1 { \textwidth / 2 } - \__nju_box_ulined_info:Nn #1 { #2 } + \__nju_box_ulined_info:Nn #1 {#2} } \cs_new:Npn \__nju_date:www #1-#2-#3 \q_stop - { \__zhnum_date_aux:nnn { #1 } { #2 } { #3 } } + { \__zhnum_date_aux:nnn {#1} {#2} {#3} } \cs_new:Npn \__nju_date_en:www #1-#2-#3 \q_stop - { \clist_item:Nn \c__nju_name_month_en_clist { #2 } ~#3 , ~#1 } -\cs_new_protected:Npn \__nju_date:n #1 { \__nju_date:nn { #1 } { } } -\cs_new_protected:Npn \__nju_date_en:n #1 { \__nju_date:nn { #1 } { _en } } -\cs_generate_variant:Nn \exp_last_unbraced:NV { cV } -\cs_new_protected:Npn \__nju_date:nn #1#2 - { - \tl_set:Nv \l__nju_tmpa_tl { g__nju_info_ #1 date_raw_tl } - \tl_new:c { g__nju_info_ #1 date #2 _tl } - \tl_set:cx { g__nju_info_ #1 date #2 _tl } - { - \tl_if_empty:NTF \l__nju_tmpa_tl - { \__nju_name:n { blankdate #2 } } - { - \exp_last_unbraced:cV { __nju_date #2 :www } - \l__nju_tmpa_tl \q_stop - } + { \clist_item:Nn \c__nju_name_month_en_clist {#2} ~#3 , ~#1 } +\cs_new:Npn \__nju_date:nn { \__nju_date:nnn { } } +\cs_new:Npn \__nju_date:nnn #1#2#3 + { + \tl_set:cx { g__nju_info_ #2 date #1 _tl } + { + \tl_if_empty:nTF {#3} + { \__nju_name:n { blankdate #1 } } + { \use:c { __nju_date #1 :www } #3 \q_stop } } } \cs_new_protected:Npn \__nju_at_begin_document:n #1 - { \hook_gput_next_code:nn { begin document } { #1 } } + { \hook_gput_next_code:nn { begin document } {#1} } \cs_new:Npn \__nju_cs_clear:N #1 { \cs_set_eq:NN #1 \tex_relax:D } \cs_new:Npn \__nju_msg:nn { \msg_new:nnn { njuthesis } } \cs_new:Npn \__nju_loop_until:nnn #1#2#3 @@ -329,7 +315,7 @@ { \msg_error:nn { njuthesis } { missing-title } } \__nju_box_spread_name:NNn #2 #4 { title } \mode_leave_vertical: #1 - \parbox [ t ] { #3 } + \parbox [ t ] {#3} { \c__nju_fmt_covertitle_tl \__nju_uline_title: \dim_gset_eq:NN \l__nju_tmpa_dim \tex_prevdepth:D @@ -340,16 +326,16 @@ \cs_new:Npn \__nju_cover_entry_title:NNN { \__nju_cover_entry_title:NNNN \__nju_hskip: } \cs_new_protected:Npn \__nju_cover_entry:NNNNn #1#2#3#4#5 { - \__nju_box_spread_name:NNn #2 #4 { #5 } #1 - \__nju_box_ulined_info:Nn #3 { #5 } \tex_par:D + \__nju_box_spread_name:NNn #2 #4 {#5} #1 + \__nju_box_ulined_info:Nn #3 {#5} \tex_par:D } \cs_new:Npn \__nju_cover_entry:NNNn { \__nju_cover_entry:NNNNn \__nju_hskip: } \cs_new_protected:Npn \__nju_cover_entry:NNNnn #1#2#3#4#5 { - \__nju_box_spread_name:NNn #1 #3 { #4 } \__nju_hskip: - \__nju_box_ulined_info:Nn #2 { #4 } \__nju_hskip: - \__nju_box_spread_name:NNn #1 #3 { #5 } \__nju_hskip: - \__nju_box_ulined_info:Nn #2 { #5 } \tex_par:D + \__nju_box_spread_name:NNn #1 #3 {#4} \__nju_hskip: + \__nju_box_ulined_info:Nn #2 {#4} \__nju_hskip: + \__nju_box_spread_name:NNn #1 #3 {#5} \__nju_hskip: + \__nju_box_ulined_info:Nn #2 {#5} \tex_par:D } \cs_new_protected:Npn \__nju_cover_entry_supv:NNNn #1#2#3#4 { @@ -357,20 +343,20 @@ { \clist_item:cn { g__nju_info_ #4 _clist } { 1 } } \tl_set:Nn \l__nju_tmpb_tl { \clist_item:cn { g__nju_info_ #4 _clist } { 2 } } - \__nju_box_spread_name:NNn #1 #3 { #4 } \__nju_hskip: + \__nju_box_spread_name:NNn #1 #3 {#4} \__nju_hskip: \__nju_box_ulined:NN #2 \l__nju_tmpa_tl \__nju_hskip: \__nju_box_spread_name:NNn #1 #3 { supvtitle } \__nju_hskip: \__nju_box_ulined:NN #2 \l__nju_tmpb_tl \tex_par:D } \cs_new_protected:Npn \__nju_emblem:N #1 - { \njuemblem [ \c__nju_fmt_emblemcolor_tl ] { #1 } { ! } } + { \njuemblem [ \c__nju_fmt_emblemcolor_tl ] {#1} { ! } } \cs_new_protected:Npn \__nju_name:N #1 - { \njuname [ \c__nju_fmt_namecolor_tl ] { #1 } { ! } } + { \njuname [ \c__nju_fmt_namecolor_tl ] {#1} { ! } } \cs_new_protected:Npn \__nju_abs_bookmark:nn #1#2 { \phantomsection \__nju_bookmark:Nnn \g__nju_abs_showentry_bool {#1} {#2} - \__nju_chapter_header:n { #1 } + \__nju_chapter_header:n {#1} } \cs_generate_variant:Nn \__nju_abs_bookmark:nn { Vn } \cs_new_protected:Npn \__nju_abs_title:N #1 @@ -382,7 +368,7 @@ { \vbox_set:Nn \l__nju_tmpa_box { - \__nju_get_width:Nn \tex_hangindent:D { #3 } + \__nju_get_width:Nn \tex_hangindent:D {#3} \int_set:Nn \tex_hangafter:D { -1 } \skip_set_eq:NN \tex_leftskip:D #2 \skip_set_eq:NN \tex_rightskip:D \tex_leftskip:D @@ -390,7 +376,7 @@ \int_gzero:N \l__nju_tmpa_int \__nju_breakpar_loop:n { \int_gincr:N \l__nju_tmpa_int } } - \__nju_breakpar_print:nn { #3 } + \__nju_breakpar_print:nn {#3} { \bool_if:NT \g__nju_abs_title_strict_bool { @@ -513,6 +499,13 @@ requires~ loading~ the~ class~ with~ "ntheorem"~ option~ set~ to~ "true". } +\__nju_msg:nn { missing-symbol } + { + \string\mdwhtsquare\ and~ \string\checkmark\ are~ not~ + contained~ in~ the~ standard~ amsmath~ package.~ You~ + should~ redefine~ them~ with~ other~ packages~ loaded~ + to~ properly~ generate~ the~ declaration~ page. + } \__nju_msg:nn { missing-title } { Thesis~ title~ should~ not~ be~ left~ blank.\\ @@ -605,7 +598,7 @@ \cs_new_protected:cpn { __nju_loadpkg_ #2 : } { \bool_if:cT { g__nju_opt_load_ #2 _bool } - { \RequirePackage { #1 } } + { \RequirePackage {#1} } } \clist_put_right:Nn \g__nju_name_optional_pkg_clist {#1} } @@ -650,22 +643,22 @@ { \cs_new_eq:NN \__nju_keys_set:nn \keys_set:nn } \NewDocumentCommand \njusetup { o m } { - \tl_if_novalue:nTF { #1 } - { \__nju_keys_set:nn { nju } { #2 } } + \tl_if_novalue:nTF {#1} + { \__nju_keys_set:nn { nju } {#2} } { - \tl_if_in:nnTF { #1 } { / } + \tl_if_in:nnTF {#1} { / } { \__nju_keys_set:nn { nju } { #1 = {#2} } } { \__nju_keys_set:nn { nju / #1 } {#2} } } } \@onlypreamble \njusetup \NewDocumentCommand \njusetformat { m m } - { \tl_gset:cn { c__nju_fmt_ #1 _tl } { #2 } } + { \tl_gset:cn { c__nju_fmt_ #1 _tl } {#2} } \NewDocumentCommand \njusetlength { s m m } { - \bool_if:nTF { #1 } - { \skip_gset:cn { c__nju_ #2 _skip } { #3 } } - { \dim_gset:cn { c__nju_ #2 _dim } { #3 } } + \bool_if:nTF {#1} + { \skip_gset:cn { c__nju_ #2 _skip } {#3} } + { \dim_gset:cn { c__nju_ #2 _dim } {#3} } } \NewDocumentCommand \njusetname { s m O{} m } { \__nju_set_tokenlist:nnnnn {#1} {#2} {#3} {#4} { name } } @@ -673,7 +666,7 @@ { \__nju_set_tokenlist:nnnnn {#1} {#2} {#3} {#4} { text } } \cs_new_protected:Npn \__nju_set_tokenlist:nnnnn #1#2#3#4#5 { - \bool_if:nTF { #1 } + \bool_if:nTF {#1} { \tl_set_eq:NN \l__nju_tmpb_tl \c__nju_name_suffix_en_tl } { \tl_clear:N \l__nju_tmpb_tl } \tl_gset:cn { c__nju_ #5 _ #2 #3 \l__nju_tmpb_tl _tl } {#4} @@ -703,7 +696,15 @@ \__nju_loadpkg_fm: \bool_if:NTF \g__nju_opt_load_um_bool { \RequirePackage { unicode-math } } - { \RequirePackage { amsmath } } + { + \RequirePackage { amsmath } + \bool_if:NT \g__nju_opt_decl_bool + { + \msg_warning:nn { njuthesis } { missing-symbol } + \cs_new:Npn \mdwhtsquare { } + \cs_new:Npn \checkmark { } + } + } \RequirePackage { geometry, @@ -731,16 +732,16 @@ \RequirePackage { lua-ul } \NewDocumentCommand \njuline { m } { \underLine{#1} \__nju_null: } } -\cs_new_protected:Npn \__nju_check_pkg_version:nnn #1#2#3 +\cs_new:Npn \__nju_check_pkg_version:nnn #1#2#3 { \@ifpackagelater {#1} {#2} { } { \msg_error:nnnn { njuthesis } { package-too-old } {#1} {#3} } } \sys_if_engine_luatex:T { \__nju_check_pkg_version:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } -\cs_new_protected:Npn \__nju_check_pkg_conflict:nn #1#2 +\cs_new:Npn \__nju_check_pkg_conflict:nn #1#2 { - \ctex_at_begin_package:nn { #2 } + \ctex_at_begin_package:nn {#2} { \msg_warning:nnnn { njuthesis } { package-conflict } {#1} {#2} } } \bool_if:NT \g__nju_opt_load_um_bool @@ -750,7 +751,7 @@ amscd, amsfonts, amssymb, bbm, bm, eucal, eufrak, mathrsfs, newtxmath, upgreek } - { \__nju_check_pkg_conflict:nn { unicode-math } { #1 } } + { \__nju_check_pkg_conflict:nn { unicode-math } {#1} } } \exp_args:Nx \file_input:n { @@ -766,8 +767,8 @@ } \clist_map_inline:Nn \g__nju_config_clist { - \msg_info:nnn { njuthesis } { load-config } { #1 } - \file_input:n { #1 } + \msg_info:nnn { njuthesis } { load-config } {#1} + \file_input:n {#1} } \keys_define:nn { nju / info } { @@ -783,22 +784,22 @@ 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 , + major .code:n = + { + \clist_pop:NN \l_keys_value_tl \g__nju_info_major_tl + \clist_pop:NNF \l_keys_value_tl \g__nju_info_majorc_tl + { + \tl_set:Nn \g__nju_info_majorc_tl + { 工程 \g__nju_info_type_tl( \g__nju_info_major_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_supvii_clist , supervisor-ii* .tl_set:N = \g__nju_info_supvii_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 = \g__nju_info_defenddate_raw_tl , - defend-date .initial:V = \c__nju_today_tl , - confer-date .tl_set:N = \g__nju_info_conferdate_raw_tl , - confer-date .initial:V = \c__nju_today_tl , - bottom-date .tl_set:N = \g__nju_info_bottomdate_raw_tl , - bottom-date .initial:V = \c__nju_today_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 , @@ -809,7 +810,15 @@ school-code .tl_set:N = \g__nju_info_code_tl , school-code .initial:n = { 10284 } , degree .tl_set:N = \g__nju_info_degree_tl , - degree* .tl_set:N = \g__nju_info_degree_en_tl + degree* .tl_set:N = \g__nju_info_degree_en_tl , + } +\clist_map_inline:nn { submit, defend, confer, bottom } + { + \keys_define:nn { nju / info } + { + #1-date .code:n = \__nju_date:nn {#1} {##1}, + #1-date .initial:V = \c__nju_name_today_tl + } } \clist_map_inline:Nn \c__nju_name_anon_clist { \keys_define:nn { nju / info } { #1 .groups:n = { anonymous } } } @@ -846,7 +855,7 @@ { \__fontspec_main_setmainfont:nn { } { Times~New~Roman } \__fontspec_main_setsansfont:nn { } { Arial } - \__fontspec_main_setmonofont:nn { Scale = MatchLowercase } { #1 } + \__fontspec_main_setmonofont:nn { Scale = MatchLowercase } {#1} } \cs_new_protected:Npn \__nju_loadfont_latin_win: { \__nju_loadfont_latin:n { Courier~New } } @@ -882,19 +891,20 @@ ItalicFont = *-italic, BoldItalicFont = *-bolditalic } -\cs_new_protected:Npn \__nju_hide_no_script_msg: +\cs_new:Npn \__nju_hide_no_script_msg: { \msg_redirect_name:nnn { fontspec } { no-script } { info } } -\cs_new_protected:Npn \__nju_loadfont_cjk_win: - { - \setCJKmainfont { SimSun } - [ \c__nju_name_fakebold_tl, ItalicFont = KaiTi ] - \setCJKsansfont { SimHei } [ \c__nju_name_fakebold_tl ] - \setCJKmonofont { FangSong } [ \c__nju_name_fakebold_tl ] - \setCJKfamilyfont { zhsong } { SimSun } [ \c__nju_name_fakebold_tl ] - \setCJKfamilyfont { zhhei } { SimHei } [ \c__nju_name_fakebold_tl ] - \setCJKfamilyfont { zhfs } { FangSong } [ \c__nju_name_fakebold_tl ] - \setCJKfamilyfont { zhkai } { KaiTi } [ \c__nju_name_fakebold_tl ] - } +\cs_new:Npn \__nju_loadfont_cjk_win:N #1 + { + \setCJKmainfont { SimSun } [ #1, ItalicFont = KaiTi ] + \setCJKsansfont { SimHei } [#1] + \setCJKmonofont { FangSong } [#1] + \setCJKfamilyfont { zhsong } { SimSun } [#1] + \setCJKfamilyfont { zhhei } { SimHei } [#1] + \setCJKfamilyfont { zhfs } { FangSong } [#1] + \setCJKfamilyfont { zhkai } { KaiTi } [#1] + } +\cs_new:Npn \__nju_loadfont_cjk_win: + { \__nju_loadfont_cjk_win:N \c__nju_name_fakebold_tl } \cs_new_protected:Npn \__nju_loadfont_cjk_mac: { \__nju_hide_no_script_msg: @@ -945,9 +955,9 @@ \cs_new_protected:Npn \__nju_loadfont_cjk_founder: { \sys_if_engine_xetex:T - { \xeCJKEditPunctStyle {quanjiao} { optimize-kerning = true } } + { \xeCJKEditPunctStyle { quanjiao } { optimize-kerning = true } } \sys_if_engine_luatex:T - { \defaultCJKfontfeatures { JFM = { zh_CN/{quanjiao,fzpr} } } } + { \defaultCJKfontfeatures { JFM = { zh_CN / { quanjiao, fzpr } } } } \setCJKmainfont { FZShuSong-Z01 } [ BoldFont = FZXiaoBiaoSong-B05, ItalicFont = FZKai-Z03 ] \setCJKsansfont { FZXiHeiI-Z08 } [ BoldFont = FZHei-B01 ] @@ -998,7 +1008,7 @@ ItalicFeatures = FakeSlant, BoldItalicFeatures = FakeSlant } -\cs_new_protected:Npn \__nju_loadfont_stzhongs: +\cs_new:Npn \__nju_loadfont_stzhongs: { \fontspec_font_if_exist:nTF { 华文中宋 } { @@ -1013,7 +1023,7 @@ \cs_new:Npn \__nju_define_math_font:nn #1#2 { \cs_new:cpn { __nju_loadfont_math_ #1 : } - { \__um_setmathfont:nn { } { #2 } } + { \__um_setmathfont:nn { } {#2} } } \clist_map_inline:nn { @@ -1204,20 +1214,20 @@ \cs_new:Npn \__nju_bookmark_toc:nn #1#2 { \phantomsection \__nju_bookmark_toc:n {#1} } \cs_new:Npn \__nju_bookmark_pdf_nosec:nn #1#2 - { \pdfbookmark [0] { #1 } { #2 } } + { \pdfbookmark [0] {#1} {#2} } \cs_new:Npn \__nju_bookmark_pdf:nn #1#2 { \phantomsection \__nju_bookmark_pdf_nosec:nn {#1} {#2} } \cs_new:Npn \__nju_bookmark:Nnn #1#2#3 { \bool_if:NTF #1 - { \__nju_bookmark_toc:n { #2 } } - { \__nju_bookmark_pdf_nosec:nn { #2 } { #3 } } + { \__nju_bookmark_toc:n {#2} } + { \__nju_bookmark_pdf_nosec:nn {#2} {#3} } } \cs_new:Npn \__nju_chapter:Nnn #1#2#3 { - \chapter * { #2 } - \__nju_bookmark:Nnn #1 { #2 } { #3 } - \__nju_chapter_header:n { #2 } + \chapter * {#2} + \__nju_bookmark:Nnn #1 {#2} {#3} + \__nju_chapter_header:n {#2} } \cs_new:Npn \__nju_chapter:n #1 { \__nju_chapter:Nnn \c_true_bool {#1} { } } @@ -1226,10 +1236,10 @@ \cs_new_protected:Npn \__nju_chapter_header:n #1 { \bool_if:NTF \g__nju_opt_twoside_bool - { \markboth { #1 } { #1 } } + { \markboth {#1} {#1} } { \markboth { \hfill #1 \hfill } { } } } -\NewDocumentCommand \njuchapter { m } { \__nju_chapter:n { #1 } } +\NewDocumentCommand \njuchapter { m } { \__nju_chapter:n {#1} } \keys_set:nn { ctex } { chapter / beforeskip = \c__nju_chapterbefore_dim, @@ -1252,7 +1262,7 @@ { chapter/format = \c__nju_fmt_toctitle_tl } \__nju_chapter:cnn { g__nju_ #2 _showentry_bool } {#1} {#2} \group_end: - \@starttoc { #2 } + \@starttoc {#2} } \cs_generate_variant:Nn \__nju_make_toc:nn { vn } \cs_new_protected:Npn \__nju_define_toc_cmd:nnn #1#2#3 @@ -1262,8 +1272,8 @@ toc-entry .bool_set:c = { g__nju_ #3 _showentry_bool }, toc-entry .initial:n = true } - \exp_args:Nc \RenewDocumentCommand { #1 } { } - { \__nju_make_toc:vn { #2 name } { #3 } } + \exp_args:Nc \RenewDocumentCommand {#1} { } + { \__nju_make_toc:vn { #2 name } {#3} } } \clist_map_inline:nn { @@ -1322,7 +1332,7 @@ \bool_if:NT \g__nju_opt_load_blx_bool { \NewDocumentCommand \addbibresource { m } - { \clist_gput_right:Nn \g__nju_blx_resource_clist { #1 } } + { \clist_gput_right:Nn \g__nju_blx_resource_clist {#1} } } \cs_new_protected:Npn \__nju_blx_pre_setup: { @@ -1368,7 +1378,7 @@ pdfcreator = \c__nju_name_pdfcreator_tl } } -\cs_new_protected:Npn \__nju_cref_name:n #1 +\cs_new:Npn \__nju_cref_name:n #1 { \crefname {#1} { \__nju_name:n {#1} } { \__nju_name:n {#1} } } \bool_if:NT \g__nju_opt_load_cref_bool { @@ -1379,7 +1389,7 @@ \crefformat { subsection } { 第~#2#1#3~小节 } \crefformat { subsubsection } { 第~#2#1#3~小节 } \clist_map_inline:nn { figure, table, appendix, proof } - { \__nju_cref_name:n { #1 } } + { \__nju_cref_name:n {#1} } } \clist_set:Nn \g__nju_fn_ctext_option_clist { charf = \scriptsize } \keys_define:nn { nju / footnote } @@ -1428,7 +1438,7 @@ { \group_begin: \bool_set_eq:NN \l__circledtext_negative_bool #1 - \__circledtext_handle:Vn \g__nju_fn_ctext_option_clist { #2 } + \__circledtext_handle:Vn \g__nju_fn_ctext_option_clist {#2} \group_end: } \cs_generate_variant:Nn \__nju_fn_number_circled:Nn { NV } @@ -1492,6 +1502,7 @@ \bool_if:NTF \g__nju_opt_load_um_bool { \tl_const:Nn \c__nju_name_qed_tl { \ensuremath { \mdlgwhtsquare } } } { \tl_const:Nn \c__nju_name_qed_tl { \ensuremath { \rule {1ex} {1ex} } } } +\tl_new:N \l__nju_thm_share_tl \keys_define:nn { nju / theorem } { style .tl_set:N = \l__nju_thm_style_tl, @@ -1515,45 +1526,59 @@ { proof, *+ } { 证明 }, { theorem } { 定理 } }, + share-counter .bool_set:N = \l__nju_thm_share_bool, + share-counter .initial:n = false, define .value_forbidden:n = true, define .code:n = { \clist_if_empty:NT \g__nju_thm_type_clist { \msg_error:nn { njuthesis } { empty-theorem-type } } + \tl_clear:N \l__nju_thm_share_tl \clist_map_inline:Nn \g__nju_thm_type_clist - { \__nju_thm_define:nn ##1 } + { \__nju_thm_define:Nnn \l__nju_thm_share_tl ##1 } } } -\cs_new_protected:Npn \__nju_thm_define:nn #1#2 +\cs_new:Npn \__nju_thm_define:Nnn + { \__nju_thm_define:NNNNnn \l__nju_tmp_clist \l__nju_tmpa_tl \l__nju_tmpb_tl } +\cs_new:Npn \__nju_thm_define:NNNNnn #1#2#3#4#5#6 { \bool_if:NF \g__nju_opt_load_nthm_bool { \msg_error:nn { njuthesis } { missing-ntheorem } } \exp_args:NV \theoremstyle \l__nju_thm_style_tl \exp_args:NV \theoremheaderfont \l__nju_thm_header_font_tl \exp_args:NV \theorembodyfont \l__nju_thm_body_font_tl - \clist_set:Nn \l__nju_tmp_clist { #1 } - \clist_pop:NN \l__nju_tmp_clist \l__nju_tmpa_tl - \clist_pop:NN \l__nju_tmp_clist \l__nju_tmpb_tl - \tl_if_in:NnT \l__nju_tmpb_tl { + } + \clist_set:Nn #1 {#5} + \clist_pop:NN #1 #2 + \clist_pop:NN #1 #3 + \tl_if_in:NnT #3 { + } { \exp_args:NV \theoremsymbol \l__nju_thm_qed_symbol_tl } - \tl_if_in:NnTF \l__nju_tmpb_tl { * } - { \__nju_thm_new:VVn \l__nju_tmpa_tl \c_novalue_tl {#2} } - { \__nju_thm_new:VVn \l__nju_tmpa_tl \l__nju_thm_counter_tl {#2} } + \tl_if_in:NnTF #3 { * } + { \__nju_thm_new:VVVn #2 \c_novalue_tl #4 {#6} } + { \__nju_thm_new:VVVn #2 \l__nju_thm_counter_tl #4 {#6} } + \bool_if:NT \l__nju_thm_share_bool + { + \tl_gset_eq:NN #4 #2 + \bool_gset_false:N \l__nju_thm_share_bool + } \bool_if:NT \g__nju_opt_load_cref_bool - { \crefname { \l__nju_tmpa_tl } {#2} {#2} } + { \exp_args:NV \crefname #2 {#6} {#6} } \theoremsymbol { } } -\cs_new_protected:Npn \__nju_thm_new:nnn #1#2#3 +\cs_new_protected:Npn \__nju_thm_new:nnnn #1#2#3#4 { \group_begin: \cs_if_exist:cT { end #1 } { \cs_set_eq:NN \newtheorem \renewtheorem } \tl_if_novalue:nTF {#2} - { \newtheorem * {#1} {#3} } - { \newtheorem {#1} {#3} [#2] } + { \newtheorem * {#1} {#4} } + { + \tl_if_empty:nTF {#3} + { \newtheorem {#1} {#4} [#2] } + { \newtheorem {#1} [#3] {#4} } + } \group_end: } -\cs_generate_variant:Nn \__nju_thm_new:nnn { VVn } +\cs_generate_variant:Nn \__nju_thm_new:nnnn { VVVn } \bool_new:N \g__nju_opt_math_re_bool \bool_new:N \g__nju_opt_math_int_bool \bool_new:N \g__nju_opt_math_leq_bool @@ -1562,8 +1587,8 @@ { \tl_set_eq:NN \c__nju_name_integral_tl \l__um_nolimits_tl } { \tl_set_eq:NN \c__nju_name_integral_tl \c_empty_tl } \bool_if:NTF \g__nju_opt_load_um_bool - { \cs_new:Npn \__nju_um_setup:n #1 { \keys_set:nn { unicode-math } {#1} } } - { \cs_new:Npn \__nju_um_setup:n #1 { } } + { \cs_new:Npn \__nju_um_setup:n #1 { \keys_set:nn { unicode-math } {#1} } } + { \cs_new_eq:NN \__nju_um_setup:n \use_none:n } \keys_define:nn { nju / math } { integral .choice:, @@ -1657,28 +1682,31 @@ }, style .initial:n = GB } -\__nju_at_begin_document:n +\bool_if:NT \g__nju_opt_load_um_bool { - \use:c { __nju_loadfont_math_ \g__nju_font_math_tl : } - \bool_if:NT \g__nju_opt_math_leq_bool - { - \cs_set_eq:NN \le \leqslant - \cs_set_eq:NN \ge \geqslant - \cs_set_eq:NN \leq \leqslant - \cs_set_eq:NN \geq \geqslant - } - \bool_if:NT \g__nju_opt_math_re_bool + \__nju_at_begin_document:n { - \cs_set:Npn \Re { \operatorname { Re } } - \cs_set:Npn \Im { \operatorname { Im } } + \use:c { __nju_loadfont_math_ \g__nju_font_math_tl : } + \bool_if:NT \g__nju_opt_math_leq_bool + { + \cs_set_eq:NN \le \leqslant + \cs_set_eq:NN \ge \geqslant + \cs_set_eq:NN \leq \leqslant + \cs_set_eq:NN \geq \geqslant + } + \bool_if:NT \g__nju_opt_math_re_bool + { + \cs_set:Npn \Re { \operatorname { Re } } + \cs_set:Npn \Im { \operatorname { Im } } + } + \bool_if:NT \g__nju_opt_math_vec_bool + { \cs_set_eq:NN \vec \symbf } } - \bool_if:NT \g__nju_opt_math_vec_bool - { \cs_set_eq:NN \vec \symbf } } \cs_new_protected:Npn \__nju_new_img_cmd:nn #1#2 { \exp_args:Nc \NewDocumentCommand { nju #1 } { o m m } - { \includegraphics [ width = ##2, height = ##3 ] { #2 } } + { \includegraphics [ width = ##2, height = ##3 ] {#2} } } \keys_define:nn { nju / image } { @@ -1707,9 +1735,7 @@ \bool_if:NF \g__nju_opt_draft_bool { \pagenumbering { gobble } - \bool_if:NTF \g__nju_opt_nlcover_bool - { \__nju_make_cover_nl: } - { \__nju_make_cover: } + \__nju_make_cover: } \tl_remove_all:Nn \g__nju_info_title_tl { \\ } \bool_if:NF \g__nju_opt_draft_bool @@ -1741,7 +1767,7 @@ \advance \leftmargin \l__nju_tmpa_dim \__nju_cs_clear:N \makelabel } - \item \clist_use:cn { g__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 @@ -1810,7 +1836,7 @@ \RenewDocumentCommand \mkbibdateshort { m m m } { \textbf { \thefield { ##1 } } } \newrefsection - \nocite { #2 } + \nocite {#2} \printbibliography [ heading = subbibliography, title = #1 ] \endrefsection \group_end: @@ -1834,13 +1860,13 @@ \NewDocumentEnvironment { notation } { O { 10 em } O { 5 em } } { \__nju_chapter:V \c__nju_name_notation_tl - \__nju_make_notation:nn { #1 } { #2 } + \__nju_make_notation:nn {#1} {#2} } { \endlist \cleardoublepage } \NewDocumentEnvironment { notation* } { O { 10 em } O { 5 em } } { \chapter * { \c__nju_name_notation_tl } - \__nju_make_notation:nn { #1 } { #2 } + \__nju_make_notation:nn {#1} {#2} } { \endlist \cleardoublepage } \endinput |