diff options
author | Karl Berry <karl@freefriends.org> | 2022-03-19 20:03:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-03-19 20:03:43 +0000 |
commit | ca06ce88f61fcdd3ac3e0d448bc5eff174b12ff9 (patch) | |
tree | 63d0fc03c8799d773b27a6c991cf29863b994991 /Master/texmf-dist/tex/latex/njuthesis | |
parent | e8be1d547a4b7dae051eb30aabd3fb75e754a1df (diff) |
njuthesis (18mar22)
git-svn-id: svn://tug.org/texlive/trunk@62813 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/njuthesis')
3 files changed, 1029 insertions, 772 deletions
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def new file mode 100644 index 00000000000..157092684d5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def @@ -0,0 +1,431 @@ +%% +%% This is file `njuthesis-graduate.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% njuthesis.dtx (with options: `definition-g') +%% +%% Copyright (C) 2021 - 2022 +%% 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 0.16.0 2022-03-19 12:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ + {Graduate definition file for njuthesis} +\ProvidesExplFile{njuthesis-graduate.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\tl_const:Nn \c__nju_pagestyle_tl { headings } +\__nju_declare_element:nn { cover / g / emblem-img } + { + content = \njuemblem [ black ] { ! } { 1.9 cm }, + bottom-skip = 1 cm + } +\__nju_declare_element:nn { cover / g / name-img } + { + content = \njuname [ black ] { 4.4 cm } { ! }, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { cover / g / type } + { + content = + \__nju_spread_box:nnV { 9 em } { } \l__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, + 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 }, + 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 + { + \begin{minipage} { #1 + #2 + 0.3 em } + \raggedleft + \__nju_multiline_title:nnn { } { #1 } { #2 } + \clist_map_inline:nn { author, major, field, supv_full } + { \__nju_cover_entry:nnn { ##1 } { #1 } { #2 } } + \end{minipage} + } +\__nju_declare_element:nn { cover / g / back } + { + content = \__nju_cover_back_g:, + align = l + } +\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_vskip: + \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_df_date_tl + { : \__nju_quad: } \l__nju_info_df_date_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_declare_element:nn { cover / g / en / title } + { + content = \l__nju_info_title_en_tl, + format = \bf \sffamily \zihao { 2 }, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { cover / g / en / top } + { + content = + { by } + \skip_vertical:N \c_zero_skip + \textbf { \sffamily \l__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 }, + 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_info_degree_int } } + \__nju_vskip: { in } \__nju_vskip: + \l__nju_info_major_en_tl, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { cover / g / en / emblem-img } + { + content = \njuemblem [ black ] { ! } { 2.5 cm }, + bottom-skip = 1.5 cm + } +\__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 + } +\__nju_declare_element:nn { cover / nl / top } + { + content = \__nju_cover_top_nl:, + bottom-skip = 2 cm + } +\__nju_declare_element:nn { cover / nl / name } + { + content = + \__nju_spread_box:nnV { 6 em } { } \c__nju_name_title_tl, + format = \zihao { -0 }, + bottom-skip = 0 pt plus 1.2 fil + } +\__nju_declare_element:nn { cover / nl / title } + { + content = \__nju_cover_title_nl:, + format = \zihao { 1 }, + bottom-skip = 1 cm + } +\__nju_declare_element:nn { cover / nl / middle } + { + content = \__nju_cover_info_nl:, + format = \zihao { 4 }, + bottom-skip = 0 pt plus 1.2 fil + } +\__nju_declare_element:nn { cover / nl / bottom } + { + content = \__nju_cover_bottom_nl:, + bottom-skip = 1 cm, + align = r + } +\__nju_declare_element:nn { cover / nl / date } + { + content = \__nju_qquad: 年 \__nju_quad: 月 \__nju_quad: 日, + format = \kaishu \zihao { 3 } + } +\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 } \\ + V { 3.2 em } { } { \c__nju_name_udc_tl } \__nju_hskip: + \__nju_ulined_center_box:nn { 9 em } { \l__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 } + \skip_vertical:n { - 0.5 cm } + { \zihao { 4 } \c__nju_name_title_b_tl } + \skip_vertical:N \c_zero_skip + \__nju_ulined_center_box:nn { 4.5 em } { \l__nju_info_author_tl } + \skip_vertical:n { - 0.5 cm } + { \zihao { 4 } { ( } \c__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 } + } +\cs_new_protected:Npn \__nju_cover_bottom_nl: + { + \__nju_name:n { chairman } \__nju_hskip: + \__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 } + } +\__nju_declare_page:nn { cover-g-front-default } + { + element = { emblem-img, name-img, type, degree, info, date }, + prefix = cover / g /, + format = \zihao { 3 } \kaishu, + top-skip = 1.5 cm + } +\__nju_declare_page:nn { cover-g-back-default } + { + element = { back }, + prefix = cover / g /, + format = \zihao { 3 } \kaishu, + top-skip = 20 cm + } +\__nju_declare_page:nn { cover-g-en-default } + { + element = { title, top, middle, emblem-img, bottom }, + prefix = cover / g / en /, + top-skip = 0 pt plus 1.2 fil + } +\__nju_declare_page:nn { cover-nl-default } + { + element = { top, name, title, middle, bottom, date }, + prefix = cover / nl /, + format = \kaishu + } +\cs_new_protected:Npn \__nju_make_cover: + { + \clist_map_inline:nn { front, back, en } + { \UseInstance { nju } { cover-g- ##1 -default } } + } +\cs_new_protected:Npn \__nju_make_cover_nl: + { \UseInstance { nju } { cover-nl-default } } +\cs_new_protected:Npn \__nju_make_orig_decl: + { + \chapter* { \c__nju_name_orig_decl_tl } + \thispagestyle { empty } + \c__nju_orig_decl_text_tl + \vfil + \begin{flushright} + \clist_map_inline:nn { orig_sign, orig_date } + { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } } + \end{flushright} + \vfil + } +\__nju_declare_element:nn { abstract / title } + { + content = \__nju_abs_title:V \c__nju_name_abstract_title_tl, + format = \bfseries \kaishu \zihao { -2 }, + bottom-skip = 1.2 cm + } +\__nju_declare_element:nn { abstract / info } + { + content = \__nju_abs_info_g:n { : }, + format = \zihao { 4 } \kaishu, + align = l, + bottom-skip = 1 cm + } +\__nju_declare_element:nn { abstract / en / title } + { + content = \__nju_abs_title:V \c__nju_name_abstract_title_en_tl, + format = \bfseries \kaishu \zihao { -2 }, + bottom-skip = 1.2 cm + } +\__nju_declare_element:nn { abstract / en / info } + { + content = \__nju_abs_info_en_g:n { :~ }, + format = \zihao { 4 }, + align = l, + bottom-skip = 1 cm + } +\cs_new_protected:Npn \__nju_abs_info_g:n #1 + { + \__nju_full_uline:NV \l__nju_tmp_dim + { + \clist_item:Nn \c__nju_name_type_clist { \g__nju_info_type_int } + \c__nju_name_title_a_tl #1 + } + \__nju_ulined_center_box:nn { \l__nju_tmp_dim } + { \tl_range:Nnn \l__nju_info_title_tl { 1 } { 20 } } \\ + \__nju_uline:n { \textwidth } \__nju_qquad: + \tl_range:Nnn \l__nju_info_title_tl { 21 } { -1 } \\ + \__nju_full_uline:NV \l__nju_tmp_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 { \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 } + } +\cs_new_protected:Npn \__nju_abs_info_en_g:n #1 + { + \__nju_full_uline:NV \l__nju_tmp_dim + { \clist_item:Nn \c__nju_name_type_en_clist + { \g__nju_info_type_int } #1 } + \__nju_ulined_center_box:nn { \l__nju_tmp_dim } + { \tl_range:Nnn \l__nju_info_title_en_tl { 1 } { 40 } } \\ + \__nju_uline:n { \textwidth } \__nju_qquad: + \tl_range:Nnn \l__nju_info_title_en_tl { 41 } { -1 } + \clist_map_inline:nn { major, author, supv_full } + { \\ + \__nju_uline_entry:Nnnn \l__nju_tmp_dim + { ##1 _en } { ##1 _en } { #1 } + } + } +\cs_new_protected:Npn \__nju_make_abstract: + { + \UseInstance { nju } { abstract / title } + \UseInstance { nju } { abstract / info } + } +\cs_new_protected:Npn \__nju_make_abstract_en: + { + \UseInstance { nju } { abstract / en / title } + \UseInstance { nju } { abstract / en / info } + } +\clist_map_inline:nn + { + { acknowledgement } { 致\hspace{2em}谢 }, + { id } { 学号 }, + { notation } { 符号表 }, + { orig_date } { 日期 }, + { paperlist } { 发表文章目录 }, + { pdf_creator } { LaTeX~ with~ njuthesis~ class }, + { preface } { 前\hspace{2em}言 }, + { supv_ii } { 第二导师 }, + { supv_ttl } { 职称 } + } + { \__nju_define_name:nn #1 } +\clist_map_inline:nn + { + { abstract } { 摘要 } { ABSTRACT }, + % 用于书签的摘要名称字样 + { abstract_a } { 中文摘要 } { ABSTRACT }, + { appendix } { 附录 } { appendix }, + { dept } { 院系 } { DEPARTMENT }, + { figure } { 图 } { figure }, + { keywords } { 关键词: } { Keywords:~ }, + { lang } { 中文 } { 英文 }, + { nju } { 南京大学 } { Nanjing~ University }, + { table } { 表 } { table } + } + { \__nju_define_name:nnn #1 } +\clist_map_inline:nn + { + % 用于摘要的作者名称字样 + { author_a } + { \tl_item:Nn \l__nju_info_degree_tl { 1 } 士生姓名 }, + { chairman } { 答辩委员会主席: }, + { clc } { 分类号 }, + { confer } { 学位授予单位和日期 }, + { df_date } { 论文答辩日期 }, + { degree } { 申请学位级别 }, + { apply } + { (申请 \l__nju_info_degree_tl 学位) }, + { field } { 研究方向 }, + { g } { 研究生 }, + { grade } { 级 }, + % 用于摘要的专业名称字样 + { major_a } { 专业 }, + % 用于国家图书馆封面的专业名称字样 + { major_b } { 专业名称 }, + { orig_decl } + { \c__nju_name_nju_tl 学位论文原创性声明 }, + { orig_sign } { 研究生签名 }, + { reviewer } { 评阅人: }, + { seclv } { 密级 }, + { sign } { (签字) }, + { sm_date } { 论文提交日期 }, + { supv } { 导师 }, + % 用于摘要的导师名称字样 + { supv_a } { 指导教师(姓名、职称) }, + { supv_info } + { 指导教师姓名、职务、职称、学位、单位名称及地址 }, + % 用于普通封面的标题名称字样 + { title } { 论文题目 }, + % 用于摘要的标题名称字样 + { title_a } { 题目 }, + % 用于国家图书馆封面的标题名称字样 + { title_b } { (题名和副题名) }, + { udc } { U D C } + } + { \__nju_define_name:nn #1 } +\clist_map_inline:nn + { + { abstract_title } + { 南京大学 \l__nju_info_type_tl 中文摘要首页用纸 } + { 南京大学 \l__nju_info_type_tl 英文摘要首页用纸 }, + { author } { 作者姓名 } { POSTGRADUATE }, + { major } { 专业方向 } { SPECIALIZATION }, + { supv_full } { 指导教师 } { 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 + { + 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作 + 所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或 + 集体已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构 + 的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已 + 在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 + } +\clist_map_inline:nn + { + { axiom } { 公理 } { Axiom }, + { corollary } { 推论 } { Corollary }, + { definition } { 定义 } { Definition }, + { example } { 例 } { Example }, + { lemma } { 引理 } { Lemma }, + { proof } { 证明 } { Proof }, + { theorem } { 定理 } { Theorem } + } + { \__nju_add_theorem_type:nnn #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 new file mode 100644 index 00000000000..590a83fc8c6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def @@ -0,0 +1,218 @@ +%% +%% This is file `njuthesis-undergraduate.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% njuthesis.dtx (with options: `definition-ug') +%% +%% Copyright (C) 2021 - 2022 +%% 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 0.16.0 2022-03-19 12:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ + {Undergraduate definition file for njuthesis} +\ProvidesExplFile{njuthesis-undergraduate.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\tl_const:Nn \c__nju_pagestyle_tl { plain } +\__nju_declare_element:nn { cover / ug / emblem-img } + { + content = \njuemblem [ black ] { ! } { 3.35 cm }, + bottom-skip = 1 cm, + align = l + } +\__nju_declare_element:nn { cover / ug / name-img } + { + content = \njuname [ black ] { ! } { 3 cm }, + bottom-skip = 1 cm + } +\__nju_declare_element:nn { cover / ug / title } + { + content = + \__nju_spread_box:nnV { 9 em } { \bf } \l__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 }, + format = \zihao { 3 } + } +\cs_new_protected:Npn \__nju_cover_info_ug:nnn #1#2#3 + { + \begin{minipage} { #1 + #2 + 0.3 em } + \raggedleft + \__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:nnn { author } { #1 } { #2 } + \__nju_cover_supv_entry:nnn { supv } { #1 } { #3 } + \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 } + \end{minipage} + } +\__nju_declare_page:nn { cover-ug-default } + { + element = { emblem-img, name-img, title, info }, + prefix = cover / ug /, + bottom-skip = 0.5 cm plus 1.5 fill + } +\cs_new_protected:Npn \__nju_make_cover: + { + \UseInstance { nju } { cover-ug-default } + } +\cs_new_protected:Npn \__nju_make_orig_decl: + { + \chapter* { \c__nju_name_orig_decl_tl } + \thispagestyle { empty } + \c__nju_orig_decl_text_tl + \vfil + \begin{flushright} + \clist_map_inline:nn { orig_sign, id, orig_date } + { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } } + \end{flushright} + \vfil + } +\__nju_declare_element:nn { abstract / title } + { + content = \__nju_abs_title:V \c__nju_name_abstract_title_tl, + format = \bfseries \kaishu \zihao { -2 }, + bottom-skip = 1.2 cm + } +\__nju_declare_element:nn { abstract / info } + { + content = \__nju_abs_info_ug:nn { } { : }, + format = \zihao { -4 } \kaishu, + align = l, + bottom-skip = 1 cm + } +\__nju_declare_element:nn { abstract / en / title } + { + content = \__nju_abs_title:V \c__nju_name_abstract_title_en_tl, + format = \bfseries \kaishu \zihao { -2 }, + bottom-skip = 1.2 cm + } +\__nju_declare_element:nn { abstract / en / info } + { + content = \__nju_abs_info_ug:nn { _en } { :~ }, + format = \zihao { -4 }, + align = l, + bottom-skip = 1 cm + } +\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 } + { \__nju_name:n { ##1 #1 } #2 \__nju_info:n { ##1 #1 } \\ } + \__nju_name:n { abstract #1 } #2 + } +\cs_new_protected:Npn \__nju_make_abstract: + { + \UseInstance { nju } { abstract / title } + \UseInstance { nju } { abstract / info } + } +\cs_new_protected:Npn \__nju_make_abstract_en: + { + \UseInstance { nju } { abstract / en / title } + \UseInstance { nju } { abstract / en / info } + } +\clist_map_inline:nn + { + { acknowledgement } { 致\hspace{2em}谢 }, + { id } { 学号 }, + { notation } { 符号表 }, + { orig_date } { 日期 }, + { paperlist } { 发表文章目录 }, + { pdf_creator } { LaTeX~ with~ njuthesis~ class }, + { preface } { 前\hspace{2em}言 }, + { supv_ii } { 第二导师 }, + { supv_ttl } { 职称 } + } + { \__nju_define_name:nn #1 } +\clist_map_inline:nn + { + { abstract } { 摘要 } { ABSTRACT }, + % 用于书签的摘要名称字样 + { abstract_a } { 中文摘要 } { ABSTRACT }, + { appendix } { 附录 } { appendix }, + { dept } { 院系 } { DEPARTMENT }, + { figure } { 图 } { figure }, + { keywords } { 关键词: } { Keywords:~ }, + { lang } { 中文 } { 英文 }, + { nju } { 南京大学 } { Nanjing~ University }, + { table } { 表 } { table } + } + { \__nju_define_name:nnn #1 } +\clist_map_inline:nn + { + % 用于摘要的作者名称字样 + { author_a } { 本科生姓名 }, + { grade } { 年级 }, + { orig_decl } + { \c__nju_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, + { orig_sign } { 作者签名 }, + { sm_date } { 提交日期 }, + { supv } { 导师 }, + { title } { 题目 }, + { type } { 本科生毕业论文(设计、作品) }, + { ug } { 本科生 } + } + { \__nju_define_name:nn #1 } +\clist_map_inline:nn + { + { abstract_title } + { + \c__nju_name_nju_tl \c__nju_name_type_tl + \c__nju_name_lang_tl \c__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 + }, + { author } { 学生姓名 } { UNDERGRADUATE }, + { major } { 专业 } { SPECIALIZATION }, + { supv_full } { 指导教师(姓名、职称) } { MENTOR } + } + { \__nju_define_name:nnn #1 } +\tl_const:Nn \c__nju_orig_decl_text_tl + { + 本人郑重承诺:所呈交的毕业论文(设计)(题目:)是在指导教师的指导下 + 严格按照学校和院系有关规定由本人独立完成的。本毕业论文(设计)中引用 + 他人观点及参考资源的内容均已标注引用,如出现侵犯他人知识产权的行为, + 由本人承担相应法律责任。本人承诺不存在抄袭、伪造、篡改、代写、买卖毕 + 业论文(设计)等违纪行为。 + } +\clist_map_inline:nn + { + { axiom } { 公理 } { Axiom }, + { corollary } { 推论 } { Corollary }, + { definition } { 定义 } { Definition }, + { example } { 例 } { Example }, + { lemma } { 引理 } { Lemma }, + { proof } { 证明 } { Proof }, + { theorem } { 定理 } { Theorem } + } + { \__nju_add_theorem_type:nnn #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 19383bdf427..28129f7a647 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls @@ -24,8 +24,7 @@ %% `.dtx' through XeTeX. %% \NeedsTeXFormat{LaTeX2e} -\RequirePackage{expl3} -\GetIdInfo $Id: njuthesis.dtx 0.15.0 2022-02-20 10:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ +\GetIdInfo $Id: njuthesis.dtx 0.16.0 2022-03-19 12:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ {Thesis template for Nanjing University} \ProvidesExplClass{njuthesis} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -33,17 +32,15 @@ \msg_new:nnn { njuthesis } { l3-too-old } { Package~ "#1"~ is~ too~ old. \\ - Please~ update~ an~ up-to-date~ version~ of~ - the~ bundles "l3kernel"~ and~ "l3packages"~ - using~ your~ TeX~ package~ manager~ or~ from~ \\ - CTAN. + Please~ update~ an~ up-to-date~ version~ of~ the~ + bundles~ "l3kernel"~ and~ "l3packages"~ using~ + your~ TeX~ package~ manager~ or~ from~ CTAN. } \clist_map_inline:nn { xtemplate, l3keys2e } { \@ifpackagelater {#1} { 2020/10/01 } { } { \msg_error:nnn { njuthesis } { l3-too-old } {#1} } } - \msg_new:nnn { njuthesis } { unsupported-engine } { The~ njuthesis~ class~ requires~ either~ @@ -52,23 +49,19 @@ You~ must~ change~ your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex". } -\sys_if_engine_xetex:F - { - \sys_if_engine_luatex:F - { - \msg_fatal:nnx { njuthesis } { unsupported-engine } - { \c_sys_engine_str } - } - } +\bool_lazy_or:nnF + { \sys_if_engine_xetex_p: } + { \sys_if_engine_luatex_p: } + { \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 \int_new:N \l__nju_tmp_int \seq_new:N \l__nju_tmp_seq \tl_new:N \l__nju_tmp_tl -\int_new:N \l__nju_info_degree_int +\int_new:N \g__nju_info_degree_int \int_new:N \l__nju_info_diploma_int -\int_new:N \l__nju_info_type_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 @@ -77,9 +70,10 @@ \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 -\bool_new:N \g__nju_load_sys_font_bool \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 @@ -120,6 +114,11 @@ \tl_const:cn { c__nju_name_ #1 _tl } { #2 } \tl_const:cn { c__nju_name_ #1 _en_tl } { #3 } } +\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_protected:Npn \__nju_ulined_center_box:nn #1#2 @@ -129,13 +128,14 @@ \skip_horizontal:n { -#1 } \hbox_to_wd:nn { #1 } { \hfil #2 \hfil } } -\cs_generate_variant:Nn \tl_map_inline:nn { xn } \cs_new_protected:Npn \__nju_spread_box:nnn #1#2#3 { \mode_leave_vertical: \hbox_to_wd:nn { #1 } - { #2 \tl_map_inline:xn { #3 } { ##1 \hfil } \unskip } + { #2 \tl_map_inline:nn { #3 } { ##1 \hfil } \unskip } } +\cs_generate_variant:Nn \__nju_spread_box:nnn { nnV } +\cs_generate_variant:Nn \__nju_spread_box:nnn { nnx } \cs_new_protected:Npn \__nju_multiline_box:nnnn #1#2#3#4 { \int_set:Nn #1 { 1 } @@ -194,29 +194,151 @@ { \__zhnum_date_aux:nnn { #1 } { #2 } { #3 } } \cs_new:Npn \__nju_date_en:www #1-#2-#3 \q_stop { \clist_item:Nn \c__nju_month_en_clist { #2 } ~#3 , ~#1 } +\cs_new_protected:Npn \__nju_split_title:n #1 + { + \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 } + } + } +\cs_generate_variant:Nn \__nju_split_title:n { V } +\cs_new_protected:Npn \__nju_multiline_title:nnn #1#2#3 + { + \__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: } + } +\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: + } +\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_spread_box:nnx { #3 } { \kaishu } { \__nju_name:n { #2 } } + \__nju_hskip: + \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #2 } } + \__nju_vskip: + } +\cs_new_protected:Npn \__nju_cover_supv_entry: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 + \__nju_hskip: + \__nju_ulined_center_box:nn { #3 } + { \clist_item:cn { l__nju_info_ #1 _clist } { 2 } } + \__nju_vskip: + } +\cs_new_protected:Npn \__nju_abs_bookmark:nn #1#2 + { + \phantomsection + \bool_if:NTF \g__nju_abs_in_toc_bool + { \__nju_add_tocline:n { #1 } } + { \pdfbookmark [0] { #1 } { #2 } } + \__nju_chapter_header:n { #1 } + } +\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 + } +\cs_generate_variant:Nn \__nju_abs_title:n { V } +\DeclareObjectType { nju } { \c_zero_int } +\DeclareTemplateInterface { nju } { element } { \c_zero_int } + { + content : tokenlist = \c_empty_tl, + format : tokenlist = \c_empty_tl, + bottom-skip : skip = \c_zero_skip, + align : choice { l, r, c, n } = c + } +\DeclareTemplateCode { nju } { element } { \c_zero_int } + { + content = \l__njuelem_content_tl, + format = \l__njuelem_format_tl, + bottom-skip = \l__njuelem_bottom_skip, + align = + { + l = + { \tl_set_eq:NN \l__njuelem_begin_align_tl \flushleft + \tl_set_eq:NN \l__njuelem_end_align_tl \endflushleft }, + r = + { \tl_set_eq:NN \l__njuelem_begin_align_tl \flushright + \tl_set_eq:NN \l__njuelem_end_align_tl \endflushright }, + c = + { \tl_set_eq:NN \l__njuelem_begin_align_tl \center + \tl_set_eq:NN \l__njuelem_end_align_tl \endcenter }, + n = + { \tl_clear:N \l__njuelem_begin_align_tl + \tl_clear:N \l__njuelem_end_align_tl } + } + } + { + \AssignTemplateKeys + \group_begin: + \l__njuelem_begin_align_tl + \l__njuelem_format_tl + \l__njuelem_content_tl \par + \l__njuelem_end_align_tl + \group_end: + \__nju_vskip:N \l__njuelem_bottom_skip + } +\DeclareTemplateInterface { nju } { page } { \c_zero_int } + { + element : commalist = \c_empty_clist, + prefix : tokenlist = \c_empty_tl, + format : tokenlist = \c_empty_tl, + top-skip : skip = \c_zero_skip, + bottom-skip : skip = \c_zero_skip + } +\DeclareTemplateCode { nju } { page } { \c_zero_int } + { + element = \l__njupage_element_clist, + prefix = \l__njupage_prefix_tl, + format = \l__njupage_format_tl, + top-skip = \l__njupage_top_skip, + bottom-skip = \l__njupage_bottom_skip + } + { + \AssignTemplateKeys + \newpage + \__nju_vskip:N \l__njupage_top_skip + \group_begin: + \l__njupage_format_tl + \clist_map_inline:Nn \l__njupage_element_clist + { \UseInstance { nju } { \l__njupage_prefix_tl ##1 } } + \group_end: + \__nju_vskip:N \l__njupage_bottom_skip + } +\cs_new_protected:Npn \__nju_declare_element:nn #1#2 + { \DeclareInstance { nju } {#1} { element } {#2} } +\cs_new_protected:Npn \__nju_declare_page:nn #1#2 + { \DeclareInstance { nju } {#1} { page } {#2} } \keys_define:nn { nju } { degree .choices:nn = { ug, mg, mf, phd } - { - \int_set_eq:NN \l__nju_info_degree_int \l_keys_choice_int - \tl_set:Nn \l__nju_info_degree_tl - { - \clist_item:Nn \c__nju_name_degree_clist - { \l__nju_info_degree_int } - } - \int_compare:nTF { \l__nju_info_degree_int == 1 } - { \tl_set:Nn \l__nju_info_diploma_tl { ug } } - { \tl_set:Nn \l__nju_info_diploma_tl { g } } - }, + { \int_gset_eq:NN \g__nju_info_degree_int \l_keys_choice_int }, degree .initial:n = ug, type .choices:nn = { thesis, design } - { - \int_set_eq:NN \l__nju_info_type_int \l_keys_choice_int - \tl_set:Nn \l__nju_info_type_tl - { \clist_item:Nn \c__nju_name_type_clist { \l__nju_info_type_int } } - \tl_put_left:Nn \l__nju_info_type_tl - { \tl_use:c { c__nju_name_ \l__nju_info_diploma_tl _tl } } - }, + { \int_gset_eq:NN \g__nju_info_type_int \l_keys_choice_int }, type .initial:n = thesis, nlcover .bool_set:N = \g__nju_nlcover_bool, nlcover .initial:n = false, @@ -233,6 +355,7 @@ cjk-font .choices:nn = { fandol, founder, mac, noto, source, win, none } { \tl_set_eq:NN \g__nju_cjk_font_tl \l_keys_choice_tl }, + config .tl_set:N = \g__nju_config_clist } \ProcessKeysOptions { nju } \keys_define:nn { nju } @@ -242,140 +365,16 @@ style .meta:nn = { nju / style } { #1 } } \NewDocumentCommand \njusetup { m } { \keys_set:nn { nju } { #1 } } -\clist_map_inline:nn - { - { acknowledgement } { 致\hspace{2em}谢 }, - { id } { 学号 }, - { notation } { 符号表 }, - { orig_date } { 日期 }, - { paperlist } { 发表文章目录 }, - { pdf_creator } { LaTeX~ with~ njuthesis~ class }, - { preface } { 前\hspace{2em}言 }, - { supv_ii } { 第二导师 }, - { supv_ttl } { 职称 } - } - { \__nju_define_name:nn #1 } -\clist_map_inline:nn - { - { abstract } { 摘要 } { ABSTRACT }, - { appendix } { 附录 } { appendix }, - { dept } { 院系 } { DEPARTMENT }, - { figure } { 图 } { figure }, - { keywords } { 关键词: } { Keywords:~ }, - { lang } { 中文 } { 英文 }, - { nju } { 南京大学 } { Nanjing~ University }, - { table } { 表 } { table } - } - { \__nju_define_name:nnn #1 } -\int_compare:nTF { \l__nju_info_degree_int == 1 } - { - \clist_map_inline:nn - { - { author_full } { 本科生姓名 }, - { grade } { 年级 }, - { orig_decl } { 本科毕业论文(设计)诚信承诺书 }, - { orig_sign } { 作者签名 }, - { sm_date } { 提交日期 }, - { supv } { 导师 }, - { title } { 题目 }, - { type } { 本科生毕业论文(设计、作品) }, - { ug } { 本科 } - } - { \__nju_define_name:nn #1 } - \clist_map_inline:nn - { - { author } { 学生姓名 } { UNDERGRADUATE }, - { major } { 专业 } { SPECIALIZATION }, - { supv_full } { 指导教师(姓名、职称) } { MENTOR } - } - { \__nju_define_name:nnn #1 } - \tl_const:Nn \c__nju_orig_decl_text_tl - { - 本人郑重承诺:所呈交的毕业论文(设计)(题目:)是在指导教师的指导下 - 严格按照学校和院系有关规定由本人独立完成的。本毕业论文(设计)中引用 - 他人观点及参考资源的内容均已标注引用,如出现侵犯他人知识产权的行为, - 由本人承担相应法律责任。本人承诺不存在抄袭、伪造、篡改、代写、买卖毕 - 业论文(设计)等违纪行为。 - } - } - { - \clist_map_inline:nn - { - { abstract_r } { 摘要首页用纸 }, - { author_r } { 生姓名 }, - { chairman } { 答辩委员会主席: }, - { clc } { 分类号 }, - { confer } { 学位授予单位和日期 }, - { df_date } { 论文答辩日期 }, - { degree } { 申请学位级别 }, - { apply } - { (申请 \l__nju_info_degree_tl 学位) }, - { field } { 研究方向 }, - { g } { 研究生 }, - { grade } { 级 }, - { major_s } { 专业 }, - { major_nl } { 专业名称 }, - { orig_decl } { 学位论文原创性声明 }, - { orig_sign } { 研究生签名 }, - { reviewer } { 评阅人: }, - { seclv } { 密级 }, - { sign } { (签字) }, - { sm_date } { 论文提交日期 }, - { supv } { 导师 }, - { supv_r } { (姓名、职称) }, - { supv_info } { 指导教师姓名、职务、 - 职称、学位、单位名称及地址 }, - { title } { 论文题目 }, - { title_nl } { (题名和副题名) }, - { title_s } { 题目 }, - { udc } { U D C } - } - { \__nju_define_name:nn #1 } - \clist_map_inline:nn - { - { author } { 作者姓名 } { POSTGRADUATE }, - { major } { 专业方向 } { SPECIALIZATION }, - { supv_full } { 指导教师 } { 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 - { - 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作 - 所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或 - 集体已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构 - 的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已 - 在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 - } - } -\clist_const:Nn \c__nju_theorem_type_clist - { axiom, corollary, definition, example, lemma, theorem } -\clist_map_inline:nn - { - { axiom } { 公理 } { Axiom }, - { corollary } { 推论 } { Corollary }, - { definition } { 定义 } { Definition }, - { example } { 例 } { Example }, - { lemma } { 引理 } { Lemma }, - { proof } { 证明 } { Proof }, - { theorem } { 定理 } { Theorem } - } - { \__nju_define_name:nnn #1 } \PassOptionsToClass { a4paper, UTF8, - scheme=chinese, + scheme = chinese, \bool_if:NTF \g__nju_twoside_bool { twoside, } { oneside, } \bool_if:NT \g__nju_draft_bool { draft, } - linespread=1.625, - fontset=none, - zihao=-4 + linespread = 1.625, + fontset = none, + zihao = -4 } { ctexbook } \clist_map_inline:nn @@ -396,8 +395,6 @@ geometry, fancyhdr, setspace, - njuvisual, - amsmath, mathtools, unicode-math, ntheorem, @@ -421,7 +418,7 @@ } \msg_new:nnn { njuthesis } { package-too-old } { - Package~ "#1"~ is~ too~ old. \\ + Package~ "#1"~ is~ too~ old.\\ The~ njuthesis~ class~ only~ supports~ "#1"~ with~ a~ version higher~ than~ v#2.\\ Please~ update~ an~ up-to-date~ version~ of~ it~ @@ -434,6 +431,16 @@ } \sys_if_engine_luatex:T { \__nju_check_package:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } +\int_compare:nTF { \g__nju_info_degree_int == 1 } + { \file_input:n { njuthesis-undergraduate.def } } + { \file_input:n { njuthesis- graduate.def } } +\msg_new:nnn { njuthesis } { load-config } + { I~ am~ loading~ config~ file~ "#1". } +\clist_if_empty:NF \g__nju_config_clist + { + \msg_info:nnx { njuthesis } { load-config } { \g__nju_config_tl } + \clist_map_inline:Nn \g__nju_config_clist { \file_input:n { #1 } } + } \keys_define:nn { nju / info } { title .tl_set:N = \l__nju_info_title_tl, @@ -466,6 +473,18 @@ udc .tl_set:N = \l__nju_info_udc_tl, supervisor-contact .tl_set:N = \l__nju_info_supv_cont_tl, } +\tl_set:Nx \l__nju_info_degree_tl + { + \clist_item:Nn \c__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_put_left:Nx \l__nju_info_type_tl + { \tl_use:c { c__nju_name_ \l__nju_info_diploma_tl _tl } } \ctex_at_end_preamble:n { \bool_set:Nn \l__nju_second_supv_bool @@ -490,7 +509,7 @@ \exp_last_unbraced:NV \__nju_date:www \l__nju_info_sm_date_raw_tl \q_stop } - \int_compare:nF { \l__nju_info_degree_int == 1 } + \int_compare:nF { \g__nju_info_degree_int == 1 } { \tl_set:Nn \l__nju_info_sm_date_en_tl { @@ -504,59 +523,71 @@ } } } -\tl_if_empty:NTF \g__nju_latin_font_tl - { \bool_gset_true:N \g__nju_load_sys_font_bool } - { - \tl_if_empty:NT \g__nju_cjk_font_tl - { \bool_gset_true:N \g__nju_load_sys_font_bool } - } -\bool_if:NT \g__nju_load_sys_font_bool +\bool_lazy_or:nnT + { \tl_if_empty_p:N \g__nju_latin_font_tl } + { \tl_if_empty_p:N \g__nju_cjk_font_tl } { \sys_if_platform_windows:TF - { \tl_set:Nn \g__nju_latin_font_tl { win } - \tl_set:Nn \g__nju_cjk_font_tl { win } } - { \ctex_if_platform_macos:TF - { \tl_set:Nn \g__nju_latin_font_tl { mac } - \tl_set:Nn \g__nju_cjk_font_tl { mac } } - { \tl_set:Nn \g__nju_latin_font_tl { gyre } - \tl_set:Nn \g__nju_cjk_font_tl { fandol } } } + { + \tl_set:Nn \g__nju_latin_font_tl { win } + \tl_set:Nn \g__nju_cjk_font_tl { win } + } + { + \ctex_if_platform_macos:TF + { + \tl_set:Nn \g__nju_latin_font_tl { mac } + \tl_set:Nn \g__nju_cjk_font_tl { mac } + } + { + \tl_set:Nn \g__nju_latin_font_tl { gyre } + \tl_set:Nn \g__nju_cjk_font_tl { fandol } + } + } } \cs_new_protected:Npn \__nju_load_latin_font_win: { - \setmainfont{Times~New~Roman} - \setsansfont{Arial} - \setmonofont{Courier~New}[Scale=MatchLowercase] + \setmainfont { Times~New~Roman } + \setsansfont { Arial } + \setmonofont { Courier~New } + [ Scale = MatchLowercase ] } \cs_new_protected:Npn \__nju_load_latin_font_mac: { - \setmainfont{Times~New~Roman} - \setsansfont{Arial} - \setmonofont{Menlo}[Scale=MatchLowercase] + \setmainfont { Times~New~Roman } + \setsansfont { Arial } + \setmonofont { Menlo } + [ Scale = MatchLowercase ] } \cs_new_protected:Npn \__nju_load_latin_font_gyre: { - \setmainfont{texgyretermes}[ - Extension=.otf, - UprightFont=*-regular, - BoldFont=*-bold, - ItalicFont=*-italic, - BoldItalicFont=*-bolditalic] - \setsansfont{texgyreheros}[ - Extension=.otf, - UprightFont=*-regular, - BoldFont=*-bold, - ItalicFont=*-italic, - BoldItalicFont=*-bolditalic] - \setmonofont{texgyrecursor}[ - Extension=.otf, - UprightFont=*-regular, - BoldFont=*-bold, - ItalicFont=*-italic, - BoldItalicFont=*-bolditalic, - Scale=MatchLowercase, - Ligatures=CommonOff] - } -\cs_new_protected:Npn \__nju_diable_no_script_msg: + \setmainfont { texgyretermes } + [ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + ] + \setsansfont { texgyreheros } + [ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic + ] + \setmonofont { texgyrecursor } + [ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + Scale = MatchLowercase, + Ligatures = CommonOff + ] + } +\cs_new_protected:Npn \__nju_hide_no_script_msg: { \msg_redirect_name:nnn { fontspec } { no-script } { info } } \cs_new_protected:Npn \__nju_load_cjk_font_win: { @@ -571,7 +602,7 @@ } \cs_new_protected:Npn \__nju_load_cjk_font_mac: { - \__nju_diable_no_script_msg: + \__nju_hide_no_script_msg: \setCJKmainfont{Songti~SC~Light}[ BoldFont=Songti~SC~Bold, ItalicFont=Kaiti~SC, @@ -586,25 +617,37 @@ } \cs_new_protected:Npn \__nju_load_cjk_font_fandol: { - \__nju_diable_no_script_msg: - \setCJKmainfont{FandolSong-Regular}[ - Extension=.otf, - BoldFont=FandolSong-Bold, - ItalicFont=FandolKai-Regular] - \setCJKsansfont{FandolHei-Regular}[ - Extension=.otf, - BoldFont=FandolHei-Bold] - \setCJKmonofont{FandolFang-Regular}[Extension=.otf] - \setCJKfamilyfont{zhsong}{FandolSong-Regular}[ - Extension=.otf, - BoldFont=FandolSong-Bold] - \setCJKfamilyfont{zhhei}{FandolHei-Regular}[ - Extension=.otf, - BoldFont=FandolHei-Bold] - \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf] - \setCJKfamilyfont{zhkai}{FandolKai-Regular}[ - Extension=.otf, - AutoFakeBold=2.17] + \__nju_hide_no_script_msg: + \setCJKmainfont { FandolSong-Regular } + [ + Extension = .otf, + BoldFont = FandolSong-Bold, + ItalicFont = FandolKai-Regular + ] + \setCJKsansfont { FandolHei-Regular } + [ + Extension = .otf, + BoldFont = FandolHei-Bold + ] + \setCJKmonofont { FandolFang-Regular } + [ Extension = .otf ] + \setCJKfamilyfont { zhsong } { FandolSong-Regular } + [ + Extension = .otf, + BoldFont = FandolSong-Bold + ] + \setCJKfamilyfont { zhhei } { FandolHei-Regular } + [ + Extension = .otf, + BoldFont = FandolHei-Bold + ] + \setCJKfamilyfont { zhfs } { FandolFang-Regular } + [ Extension = .otf ] + \setCJKfamilyfont { zhkai } { FandolKai-Regular } + [ + Extension = .otf, + AutoFakeBold = 2.17 + ] } \cs_new_protected:Npn \__nju_load_cjk_font_founder: { @@ -619,9 +662,9 @@ \setCJKfamilyfont { zhsong } { FZShuSong-Z01 } [ BoldFont = FZXiaoBiaoSong-B05 ] \setCJKfamilyfont { zhhei } { FZHei-B01 } - [AutoFakeBold=2.17] + [ AutoFakeBold = 2.17 ] \setCJKfamilyfont { zhkai } { FZKai-Z03 } - [AutoFakeBold=2.17] + [ AutoFakeBold = 2.17 ] \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } \defaultCJKfontfeatures{} } @@ -707,44 +750,86 @@ headheight = 15 pt } \bool_if:NT \g__nju_draft_bool { \geometry { showframe } } -\cs_new_protected:Npn \__nju_fancy_head:nn #1#2 - { \fancyhead [#1] { \small \kaishu \nouppercase {#2} } } +\keys_define:nn { nju / style } + { + header/format .tl_gset:N = \g__nju_header_format_tl, + header/format .initial:n = \small \kaishu, + header .clist_gset:N = \g__nju_header_twoside_clist, + header* .clist_gset:N = \g__nju_header_oneside_clist, + header .initial:n = + { + { EL } { \leftmark }, { OR } { \rightmark } + }, + header* .initial:n = + { + { L } { \leftmark }, { R } { \rightmark } + }, + footer/format .tl_gset:N = \g__nju_footer_format_tl, + footer/format .initial:n = \small \rmfamily, + footer .clist_gset:N = \g__nju_footer_twoside_clist, + footer* .clist_gset:N = \g__nju_footer_oneside_clist, + footer .initial:n = { { C } { \thepage } }, + footer* .initial:n = { { C } { \thepage } } + } +\clist_new:N \g__nju_header_clist +\clist_new:N \g__nju_footer_clist +\ctex_at_end_preamble:n + { + \bool_if:NTF \g__nju_twoside_bool + { + \clist_set_eq:NN \g__nju_header_clist \g__nju_header_twoside_clist + \clist_set_eq:NN \g__nju_footer_clist \g__nju_footer_twoside_clist + } + { + \clist_set_eq:NN \g__nju_header_clist \g__nju_header_oneside_clist + \clist_set_eq:NN \g__nju_footer_clist \g__nju_footer_oneside_clist + } + } +\cs_new_protected:Npn \__nju_header:nn #1#2 + { \fancyhead [#1] { \g__nju_header_format_tl #2 } } +\cs_new_protected:Npn \__nju_footer:nn #1#2 + { \fancyfoot [#1] { \g__nju_footer_format_tl #2 } } \fancypagestyle { plain } { \fancyhf { } - \fancyfoot [ C ] { \zihao { 5 } \rmfamily \thepage } + \clist_map_inline:Nn \g__nju_footer_clist { \__nju_footer:nn ##1 } \tl_set:Nn \headrulewidth { \c_zero_dim } \tl_set:Nn \footrulewidth { \c_zero_dim } } -\cs_new_protected:Npn \__nju_set_heading_g: +\fancypagestyle { headings } { - \bool_if:NTF \g__nju_twoside_bool + \fancyhf { } + \clist_if_empty:NTF \g__nju_header_clist { - \__nju_fancy_head:nn { EL } { \leftmark } - \__nju_fancy_head:nn { OR } { \rightmark } + \tl_set:Nn \headrulewidth { \c_zero_dim } } { - \__nju_fancy_head:nn { L } { \leftmark } - \__nju_fancy_head:nn { R } { \rightmark } + \tl_set:Nn \headrulewidth { 0.4 pt } + \dim_set:Nn \headheight { 20 pt } + \clist_map_inline:Nn \g__nju_header_clist + { \__nju_header:nn ##1 } } - \tl_set:Nn \headrulewidth { 0.4 pt } - \dim_set:Nn \headheight { 20 pt } + \clist_map_inline:Nn \g__nju_footer_clist { \__nju_footer:nn ##1 } + \tl_set:Nn \footrulewidth { \c_zero_dim } } \RenewDocumentCommand \frontmatter { } { \cleardoublepage - \pagestyle { empty } + \exp_args:NV \pagestyle \c__nju_pagestyle_tl \pagenumbering { Roman } } \RenewDocumentCommand \mainmatter { } { \cleardoublepage - \pagestyle { plain } - \int_compare:nF { \l__nju_info_degree_int == 1 } - { \__nju_set_heading_g: } + \exp_args:NV \pagestyle \c__nju_pagestyle_tl \pagenumbering { arabic } \normalfont \normalsize } +\AtBeginEnvironment { document } + { + \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 } } @@ -762,7 +847,7 @@ { \markboth { #1 } { #1 } } { \markboth { \hfill #1 \hfill } { } } } -\NewDocumentCommand \njuchapter { m } { \__nju_chapter:V { #1 } } +\NewDocumentCommand \njuchapter { m } { \__nju_chapter:n { #1 } } \keys_set:nn { ctex } { chapter / beforeskip = 10 pt, @@ -855,7 +940,7 @@ } \cs_new_protected:Npn \__nju_biblatex_post_setup: { - \defbibheading { njubibintoc } [ \bibname ] { \__nju_chapter:V { ##1 } } + \defbibheading { njubibintoc } [ \bibname ] { \__nju_chapter:n { ##1 } } \tl_if_eq:NnTF \blx@refsecreset@level { 2 } { \DeclarePrintbibliographyDefaults { heading = subbibintoc } } { \DeclarePrintbibliographyDefaults { heading = njubibintoc } } @@ -892,6 +977,7 @@ { \__nju_name:n { ##1 } } { \__nju_name:n { ##1 _en } } } } +\cs_generate_variant:Nn \__nju_cref_name:n { V } \crefdefaultlabelformat { #2#1#3\, } \crefformat { equation } { 公式~#2#1#3~ } \crefformat { chapter } { 第#2#1#3章 } @@ -899,8 +985,9 @@ \crefformat { subsection } { 第~#2#1#3~小节 } \crefformat { subsubsection } { 第~#2#1#3~小节 } \__nju_cref_name:n { figure, table, appendix, proof } -\exp_args:NV \__nju_cref_name:n \c__nju_theorem_type_clist +\__nju_cref_name:V \g__nju_theorem_type_clist \DeclareGraphicsExtensions { .pdf, .eps, .jpg, .png } +\BeforeBeginEnvironment { tabular } { \centering \zihao {5} } \DeclareCaptionStyle{njucap} { font = small, @@ -919,418 +1006,42 @@ } \theoremsymbol { \ensuremath { \mdwhtsquare } } \newtheorem* { proof } { \c__nju_name_proof_tl } -\__nju_new_theorem:N \c__nju_theorem_type_clist -\cs_new_protected:Npn \__nju_split_title:n #1 - { - \tl_if_in:VnTF { #1 } { \\ } - { - \seq_set_split:NnV \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 } - } - } -\cs_new_protected:Npn \__nju_multiline_title:nnn #1#2#3 - { - \__nju_split_title:n { \l__nju_info_title_tl } - \__nju_spread_box:nnn { #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: } - } -\cs_new_protected:Npn \__nju_cover_entry:nnn #1#2#3 - { - \__nju_spread_box:nnn { #2 } { \kaishu } { \__nju_name:n { #1 } } - \__nju_hskip: - \__nju_ulined_center_box:nn { #3 } { \__nju_info:n { #1 } } - \__nju_vskip: - } -\cs_new_protected:Npn \__nju_cover_bientry:nnnn #1#2#3#4 - { - \__nju_spread_box:nnn { #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_spread_box:nnn { #3 } { \kaishu } { \__nju_name:n { #2 } } - \__nju_hskip: - \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #2 } } - \__nju_vskip: - } -\cs_new_protected:Npn \__nju_cover_supv_entry:nnn #1#2#3 - { - \__nju_spread_box:nnn { #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:nnn { #2 } { \kaishu } { \c__nju_name_supv_ttl_tl } - \__nju_hskip: - \__nju_ulined_center_box:nn { #3 } - { \clist_item:cn { l__nju_info_ #1 _clist } { 2 } } - \__nju_vskip: - } -\DeclareObjectType { nju } { \c_zero_int } -\DeclareTemplateInterface { nju } { element } { \c_zero_int } +\group_begin: + \clist_remove_all:Nn \g__nju_theorem_type_clist { proof } + \__nju_new_theorem:N \g__nju_theorem_type_clist +\group_end: +\cs_new_protected:Npn \__nju_new_img_cmd:nn #1#2 { - content : tokenlist = \c_empty_tl, - format : tokenlist = \c_empty_tl, - bottom-skip : skip = \c_zero_skip, - align : choice { l, r, c, n } = c - } -\DeclareTemplateCode { nju } { element } { \c_zero_int } - { - content = \l__njuelem_content_tl, - format = \l__njuelem_format_tl, - bottom-skip = \l__njuelem_bottom_skip, - align = - { - l = - { \tl_set_eq:NN \l__njuelem_begin_align_tl \flushleft - \tl_set_eq:NN \l__njuelem_end_align_tl \endflushleft }, - r = - { \tl_set_eq:NN \l__njuelem_begin_align_tl \flushright - \tl_set_eq:NN \l__njuelem_end_align_tl \endflushright }, - c = - { \tl_set_eq:NN \l__njuelem_begin_align_tl \center - \tl_set_eq:NN \l__njuelem_end_align_tl \endcenter }, - n = - { \tl_clear:N \l__njuelem_begin_align_tl - \tl_clear:N \l__njuelem_end_align_tl } - } - } - { - \AssignTemplateKeys - \group_begin: - \l__njuelem_begin_align_tl - \l__njuelem_format_tl - \l__njuelem_content_tl \par - \l__njuelem_end_align_tl - \group_end: - \__nju_vskip:N \l__njuelem_bottom_skip - } -\DeclareTemplateInterface { nju } { page } { \c_zero_int } - { - element : commalist = \c_empty_clist, - prefix : tokenlist = \c_empty_tl, - format : tokenlist = \c_empty_tl, - top-skip : skip = \c_zero_skip, - bottom-skip : skip = \c_zero_skip - } -\DeclareTemplateCode { nju } { page } { \c_zero_int } - { - element = \l__njupage_element_clist, - prefix = \l__njupage_prefix_tl, - format = \l__njupage_format_tl, - top-skip = \l__njupage_top_skip, - bottom-skip = \l__njupage_bottom_skip + \exp_args:Nc \NewDocumentCommand { #1 } { o m m } + { \includegraphics [ width = ##2, height = ##3 ] { #2 } } } +\cs_generate_variant:Nn \__nju_new_img_cmd:nn { nV } +\keys_define:nn { nju / style } { - \AssignTemplateKeys - \newpage - \__nju_vskip:N \l__njupage_top_skip - \group_begin: - \l__njupage_format_tl - \clist_map_inline:Nn \l__njupage_element_clist - { \UseInstance { nju } { \l__njupage_prefix_tl ##1 } } - \group_end: - \__nju_vskip:N \l__njupage_bottom_skip + emblem-img .code:n = + { \__nju_new_img_cmd:nV { njuemblem } \l_keys_value_tl }, + name-img .code:n = + { \__nju_new_img_cmd:nV { njuname } \l_keys_value_tl } } -\cs_new_protected:Npn \__nju_declare_element:nn #1#2 - { \DeclareInstance { nju } {#1} { element } {#2} } -\cs_new_protected:Npn \__nju_declare_page:nn #1#2 - { \DeclareInstance { nju } {#1} { page } {#2} } -\keys_define:nn { nju / style } +\msg_new:nnn { njuthesis } { missing-image } { - emblem-img .tl_set:N = \l__nju_emblem_img_tl, - name-img .tl_set:N = \l__nju_name_img_tl + Local~ images~ not~ designated.\\ + It~ seems~ that~ you~ haven't~ fill~ in~ both~ + "style/emblem-img"~ and~ "style/name-img",~ + therefore~ I~ am~ using~ package~ "njuvisual"~ + instead,~ which~ may~ slow~ down~ the~ compilation. } \ctex_at_end_preamble:n { - \tl_if_empty:NF \l__nju_emblem_img_tl + \bool_lazy_and:nnF + { \cs_if_exist_p:N \njuemblem } + { \cs_if_exist_p:N \njuname } { - \RenewDocumentCommand \njuemblem { o m m } - { \includegraphics [ width = #2, height = #3 ] - { \l__nju_emblem_img_tl } } + \cs_undefine:N \njuemblem + \cs_undefine:N \njuname + \msg_warning:nn { njuthesis } { missing-image } + \RequirePackage { njuvisual } } - \tl_if_empty:NF \l__nju_name_img_tl - { - \RenewDocumentCommand \njuname { o m m } - { \includegraphics [ width = #2, height = #3 ] - { \l__nju_name_img_tl } } - } - } -\__nju_declare_element:nn { cover / ug / emblem-img } - { - content = \njuemblem [ black ] { ! } { 3.35 cm }, - bottom-skip = 1 cm, - align = l - } -\__nju_declare_element:nn { cover / ug / name-img } - { - content = \njuname [ black ] { ! } { 3 cm }, - bottom-skip = 1 cm - } -\__nju_declare_element:nn { cover / ug / title } - { - content = - \__nju_spread_box:nnn { 9 em } { \bf } { \l__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 }, - format = \zihao { 3 } - } -\cs_new_protected:Npn \__nju_cover_info_ug:nnn #1#2#3 - { - \begin{minipage} { #1 + #2 + 0.3 em } - \raggedleft - \__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:nnn { author } { #1 } { #2 } - \__nju_cover_supv_entry:nnn { supv } { #1 } { #3 } - \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 } - \end{minipage} - } -\__nju_declare_element:nn { cover / g / emblem-img } - { - content = \njuemblem [ black ] { ! } { 1.9 cm }, - bottom-skip = 1 cm - } -\__nju_declare_element:nn { cover / g / name-img } - { - content = \njuname [ black ] { 4.4 cm } { ! }, - bottom-skip = 2 cm - } -\__nju_declare_element:nn { cover / g / type } - { - content = - \__nju_spread_box:nnn { 9 em } { } { \l__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, - 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 }, - 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 - { - \begin{minipage} { #1 + #2 + 0.3 em } - \raggedleft - \__nju_multiline_title:nnn { } { #1 } { #2 } - \clist_map_inline:nn { author, major, field, supv_full } - { \__nju_cover_entry:nnn { ##1 } { #1 } { #2 } } - \end{minipage} - } -\__nju_declare_element:nn { cover / g / back } - { - content = \__nju_cover_back_g:, - align = l - } -\cs_new_protected:Npn \__nju_cover_back_g: - { - \__nju_spread_box:nnn { 6.2 em } { \kaishu } { \c__nju_name_id_tl } - { : \__nju_quad: } \l__nju_info_id_tl - \__nju_vskip: - \__nju_spread_box:nnn { 6.2 em } { \kaishu } { \c__nju_name_df_date_tl } - { : \__nju_quad: } \l__nju_info_df_date_tl - \__nju_vskip: - \__nju_spread_box:nnn { 6.2 em } { \kaishu } { \c__nju_name_supv_full_tl } - { : \__nju_quad: } \skip_horizontal:n { 8 em } \c__nju_name_sign_tl - } -\__nju_declare_element:nn { cover / g / en / title } - { - content = \l__nju_info_title_en_tl, - format = \bf \sffamily \zihao { 2 }, - bottom-skip = 2 cm - } -\__nju_declare_element:nn { cover / g / en / top } - { - content = - { by } - \skip_vertical:N \c_zero_skip - \textbf { \sffamily \l__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 }, - 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 - { \l__nju_info_degree_int } } - \__nju_vskip: { in } \__nju_vskip: - \l__nju_info_major_en_tl, - bottom-skip = 2 cm - } -\__nju_declare_element:nn { cover / g / en / emblem-img } - { - content = \njuemblem [ black ] { ! } { 2.5 cm }, - bottom-skip = 1.5 cm - } -\__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 - } -\__nju_declare_element:nn { cover / nl / top } - { - content = \__nju_cover_top_nl:, - bottom-skip = 2 cm - } -\__nju_declare_element:nn { cover / nl / name } - { - content = - \__nju_spread_box:nnn { 6 em } { } { \c__nju_name_title_tl }, - format = \zihao { -0 }, - bottom-skip = 0 pt plus 1.2 fil - } -\__nju_declare_element:nn { cover / nl / title } - { - content = \__nju_cover_title_nl:, - format = \zihao { 1 }, - bottom-skip = 1 cm - } -\__nju_declare_element:nn { cover / nl / middle } - { - content = \__nju_cover_info_nl:, - format = \zihao { 4 }, - bottom-skip = 0 pt plus 1.2 fil - } -\__nju_declare_element:nn { cover / nl / bottom } - { - content = \__nju_cover_bottom_nl:, - bottom-skip = 1 cm, - align = r - } -\__nju_declare_element:nn { cover / nl / date } - { - content = \__nju_qquad: 年 \__nju_quad: 月 \__nju_quad: 日, - format = \kaishu \zihao { 3 } - } -\cs_new_protected:Npn \__nju_cover_top_nl: - { - \__nju_spread_box:nnn { 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:nnn { 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:nnn { 3.2 em } { } { \c__nju_name_udc_tl } \__nju_hskip: - \__nju_ulined_center_box:nn { 9 em } { \l__nju_info_udc_tl } \hfill \null - } -\cs_new_protected:Npn \__nju_cover_title_nl: - { - \__nju_split_title:n { \l__nju_info_title_tl } - \__nju_multiline_box:nnnn { \l__nju_tmp_int } \l__nju_tmp_clist { 3 } { 15 em } - \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } \c__nju_name_title_nl_tl } - \skip_vertical:N \c_zero_skip - \__nju_ulined_center_box:nn { 4.5 em } { \l__nju_info_author_tl } - \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } { ( } \c__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_nl } { 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 } - } -\cs_new_protected:Npn \__nju_cover_bottom_nl: - { - \__nju_name:n { chairman } \__nju_hskip: - \__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 } - } -\__nju_declare_page:nn { cover-ug-default } - { - element = { emblem-img, name-img, title, info }, - prefix = cover / ug /, - bottom-skip = 0.5 cm plus 1.5 fill - } -\__nju_declare_page:nn { cover-g-front-default } - { - element = { emblem-img, name-img, type, degree, info, date }, - prefix = cover / g /, - format = \zihao { 3 } \kaishu, - top-skip = 1.5 cm - } -\__nju_declare_page:nn { cover-g-back-default } - { - element = { back }, - prefix = cover / g /, - format = \zihao { 3 } \kaishu, - top-skip = 20 cm - } -\__nju_declare_page:nn { cover-g-en-default } - { - element = { title, top, middle, emblem-img, bottom }, - prefix = cover / g / en /, - top-skip = 0 pt plus 1.2 fil - } -\__nju_declare_page:nn { cover-nl-default } - { - element = { top, name, title, middle, bottom, date }, - prefix = cover / nl /, - format = \kaishu - } -\cs_new_protected:Npn \__nju_make_cover_ug: - { \UseInstance { nju } { cover-ug-default } } -\cs_new_protected:Npn \__nju_make_cover_g: - { - \clist_map_inline:nn { front, back, en } - { \UseInstance { nju } { cover-g- ##1 -default } } - } -\cs_new_protected:Npn \__nju_make_cover_nl: - { \UseInstance { nju } { cover-nl-default } } -\cs_new_protected:Npn \__nju_make_orig_decl: - { - \chapter* { \c__nju_name_nju_tl \c__nju_name_orig_decl_tl } - \thispagestyle { empty } - \c__nju_orig_decl_text_tl - \vfil - \begin{flushright} - \clist_set:Nn \l__nju_tmp_clist { orig_sign, id, orig_date } - \int_compare:nF { \l__nju_info_degree_int == 1 } - { \clist_remove_all:Nn \l__nju_tmp_clist { id } } - \clist_map_inline:Nn \l__nju_tmp_clist - { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } } - \end{flushright} - \vfil } \RenewDocumentCommand \maketitle { } { @@ -1340,103 +1051,18 @@ \pagenumbering { gobble } \bool_if:NTF \g__nju_nlcover_bool { \__nju_make_cover_nl: } - { \use:c { __nju_make_cover_ \l__nju_info_diploma_tl : } } + { \__nju_make_cover: } \bool_if:NT \g__nju_orig_decl_bool { \__nju_make_orig_decl: } } \tl_remove_all:Nn \l__nju_info_title_tl { \\ } \cleardoublepage - \pagestyle { plain } + \exp_args:NV \pagestyle \c__nju_pagestyle_tl \pagenumbering { Roman } - \normalfont \normalsize - } -\keys_define:nn { nju / style } - { - abstract-in-toc .bool_gset:N = \g__nju_abs_in_toc_bool, - abstract-in-toc .initial:n = true - } -\cs_new_protected:Npn \__nju_abs_bookmark:nn #1#2 - { - \phantomsection - \bool_if:NTF \g__nju_abs_in_toc_bool - { \__nju_add_tocline:n { #1 } } - { \pdfbookmark [0] { #1 } { #2 } } - } -\cs_generate_variant:Nn \__nju_abs_bookmark:nn { Vn } -\cs_new_protected:Npn \__nju_abs_title_uuline:n #1 - { \bf \kaishu \zihao { -2 } \__nju_uuline:n { #1 } } -\cs_new_protected:Npn \__nju_abs_info_style:n #1 - { \noindent \zihao{ #1 } \kaishu } -\cs_new_protected:Npn \__nju_abs_info_style_en: #1 - { \zihao{ #1 } } -\cs_new_protected:Npn \__nju_abs_title_ug:n #1 - { - \clist_map_inline:nn { nju, type, lang #1, abstract } - { \__nju_name:n { ##1 } } - } -\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 { \l__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_full_tl - \clist_map_inline:nn { dept, major, author, supv_full } - { \__nju_name:n { ##1 #1 } #2 \__nju_info:n { ##1 #1 } \\ } - \__nju_name:n { abstract #1 } #2 - } -\cs_new_protected:Npn \__nju_abs_title_g:n #1 - { - \__nju_name:n { nju } \__nju_info:n { type } - \__nju_name:n { lang #1 } \__nju_name:n { abstract_r } - } -\cs_new_protected:Npn \__nju_abs_info_g:nn #1#2 - { - \tl_if_blank:eTF { #1 } - { - \__nju_full_uline:NV \l__nju_tmp_dim - { - \clist_item:Nn \c__nju_name_type_clist { \l__nju_info_type_int } - \c__nju_name_title_s_tl #2 - } - \__nju_ulined_center_box:nn { \l__nju_tmp_dim } - { \tl_range:Nnn \l__nju_info_title_tl { 1 } { 20 } } \\ - \__nju_uline:n { \textwidth } \__nju_qquad: - \tl_range:Nnn \l__nju_info_title_tl { 21 } { -1 } \\ - \__nju_full_uline:NV \l__nju_tmp_dim - { - \__nju_ulined_center_box:nn { 11 em } { \l__nju_info_major_tl } - \c__nju_name_major_s_tl - \__nju_ulined_center_box:nn { 4 em } { \l__nju_info_grade_tl } - \c__nju_name_grade_tl - \tl_item:nn { \l__nju_info_degree_tl } { 1 } - \c__nju_name_author_r_tl #2 - } - \__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_full_tl \c__nju_name_supv_r_tl #2 } - \__nju_ulined_center_box:nn { \l__nju_tmp_dim } - { \l__nju_info_supv_full_tl } - } - { - \__nju_full_uline:NV \l__nju_tmp_dim - { \clist_item:cn { c__nju_name_type #1 _clist } - { \l__nju_info_type_int } # 2 } - \__nju_ulined_center_box:nn { \l__nju_tmp_dim } - { \tl_range:Nnn \l__nju_info_title_en_tl { 1 } { 40 } } \\ - \__nju_uline:n { \textwidth } \__nju_qquad: - \tl_range:Nnn \l__nju_info_title_en_tl { 41 } { -1 } - \clist_map_inline:nn { major, author, supv_full } - { \\ - \__nju_uline_entry:Nnnn \l__nju_tmp_dim { ##1 _en } { ##1 _en } { #2 } - } - } } \cs_new_protected:Npn \__nju_print_keywords:nn #1#2 { - \exp_args:NNc - \tl_set_eq:NN \l__nju_tmp_tl { c__nju_name_keywords #1 _tl } - \__nju_get_text_width:Nn \l__nju_tmp_dim { \l__nju_tmp_tl } + \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 { } { \labelwidth \l__nju_tmp_dim @@ -1450,35 +1076,17 @@ \clist_use:cn { l__nju_info_keywords #1 _clist } { #2 } \endlist } -\cs_new_protected:Npn \__nju_make_abs_ug:nn #1#2 - { - \begin{center} - \__nju_abs_title_uuline:n { 22 em } - \__nju_abs_title_ug:n { #1 } - \end{center} - \group_begin: - \__nju_abs_info_style:n { -4 } - \__nju_abs_info_ug:nn { #1 } { #2 } - \group_end: \__nju_vskip: - } -\cs_new_protected:Npn \__nju_make_abs_g:nn #1#2 +\keys_define:nn { nju / style } { - \begin{center} - \__nju_abs_title_uuline:n { 19 em } - \__nju_abs_title_g:n { #1 } - \end{center} - \group_begin: - \__nju_abs_info_style:n { 4 } - \__nju_abs_info_g:nn { #1 } { #2 } - \group_end: \__nju_vskip: + abstract-in-toc .bool_gset:N = \g__nju_abs_in_toc_bool, + abstract-in-toc .initial:n = true } \NewDocumentEnvironment { abstract } { +b } { \cleardoublepage \thispagestyle { plain } - \__nju_abs_bookmark:Vn - { \c__nju_name_lang_tl \c__nju_name_abstract_tl } { abstract } - \use:c { __nju_make_abs_ \l__nju_info_diploma_tl :nn } { } { : } + \__nju_abs_bookmark:Vn \c__nju_name_abstract_a_tl { abstract } + \__nju_make_abstract: \group_begin: \kaishu \zihao { -4 } #1 } { \__nju_print_keywords:nn { } { ; } \group_end: } @@ -1486,15 +1094,15 @@ { \cleardoublepage \thispagestyle { plain } - \__nju_abs_bookmark:Vn { \c__nju_name_abstract_en_tl } { abstract-en } - \use:c { __nju_make_abs_ \l__nju_info_diploma_tl :nn } { _en } { :~ } - \group_begin: \zihao{ -4 } #1 + \__nju_abs_bookmark:Vn \c__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 \c__nju_name_preface_tl #1 } { } \NewDocumentEnvironment { acknowledgement } { +b } - { \__nju_chapter:V { \c__nju_name_acknowledgement_tl } #1 } { } + { \__nju_chapter:V \c__nju_name_acknowledgement_tl #1 } { } \NewDocumentCommand \njupaperlist { O { \c__nju_name_paperlist_tl } m } { @@ -1531,7 +1139,7 @@ } \NewDocumentEnvironment { notation } { O { 10 em } O { 5 em } } { - \__nju_chapter:V { \c__nju_name_notation_tl } + \__nju_chapter:V \c__nju_name_notation_tl \__nju_make_notation:nn { #1 } { #2 } } { \endlist } |