summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/njuthesis
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-08-08 21:00:24 +0000
committerKarl Berry <karl@freefriends.org>2022-08-08 21:00:24 +0000
commit06ce399249a627e8cfab294d85b39a9cbc91490b (patch)
treeabfdefc701f72706341e437f956363ad07c3de2e /Master/texmf-dist/tex/latex/njuthesis
parent8ca2c0f2f725360c1d1c530fc5a918bb593da82a (diff)
njuthesis (8aug22)
git-svn-id: svn://tug.org/texlive/trunk@64081 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/njuthesis')
-rw-r--r--Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def656
-rw-r--r--Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def287
-rw-r--r--Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def338
-rw-r--r--Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls1379
4 files changed, 1699 insertions, 961 deletions
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def
index fd834861cc8..fcc0cf9f111 100644
--- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def
+++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% njuthesis.dtx (with options: `definition-g')
+%% njuthesis.dtx (with options: `def-g')
%%
%% Copyright (C) 2021 - 2022
%% by Nanjing University Linux User Group
@@ -23,73 +23,104 @@
%% To produce the documentation run the original source files ending with
%% `.dtx' through XeTeX.
%%
-\GetIdInfo $Id: njuthesis.dtx 0.20.0 2022-06-10 14:42:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+\GetIdInfo $Id: njuthesis.dtx 1.0.0 2022-08-08 14:50:00
+ +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
{Graduate definition file for njuthesis}
\ProvidesExplFile{njuthesis-graduate.def}
{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__nju_declare_element:nn { cover / g / emblem-img }
+
+\bool_if:NT \g__nju_opt_decl_bool { \RequirePackage { tabularray } }
+\ctex_at_end_preamble:n
+ {
+ \__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
+ }
+ }
+ }
+\cs_new_protected:Npn \__nju_decl_sign:
{
- content = \__nju_emblem:N \c__nju_emblemwidthi_dim,
- bottom-skip = 1.5 cm
+ \clist_map_inline:nn { origsign, date }
+ { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } }
}
-\__nju_declare_element:nn { cover / g / name-img }
+\__nju_declare_element:nn { g / cover-front / emblem-img }
{
- content = \__nju_name:N \c__nju_namewidth_dim,
- bottom-skip = 2 cm
+ content = \__nju_emblem:N \c__nju_emblemwdi_dim,
+ bottom-skip = 20 pt
}
-\__nju_declare_element:nn { cover / g / type }
+\__nju_declare_element:nn { g / cover-front / name-img }
+ {
+ content = \__nju_name:N \c__nju_namewd_dim,
+ bottom-skip = 70 pt
+ }
+\__nju_declare_element:nn { g / cover-front / type }
{
content =
- \__nju_spread_box:nnV { 9 em } { } \g__nju_info_type_tl,
- format = \zihao { -1 } \bfseries,
- bottom-skip = 1 cm
+ \dim_set:Nn \l__nju_tmpb_dim { 266 pt }
+ \__nju_box_spread_name:Nn \l__nju_tmpb_dim { type },
+ format = \zihao { 1 } \bfseries,
+ bottom-skip = 20 pt
}
-\__nju_declare_element:nn { cover / g / degree }
+\__nju_declare_element:nn { g / cover-front / degree }
{
content = \c__nju_name_apply_tl,
- format = \zihao { -1 } \bfseries,
- bottom-skip = 1 cm plus 1.5 fil
+ format = \zihao { 1 } \bfseries,
+ bottom-skip = 40 pt plus 1 fill
}
-\__nju_declare_element:nn { cover / g / info }
+\__nju_declare_element:nn { g / cover-front / info }
{
content =
- \__nju_cover_info_g:NN \c__nju_coverlabel_dim \c__nju_coveruline_dim,
- bottom-skip = 0 pt plus 1.5 fil
- }
-\__nju_declare_element:nn { cover / g / date }
+ \__nju_g_cover_info:NNNN
+ \c__nju_clabelwd_dim
+ \c__nju_crulewd_dim
+ \c__nju_hsep_dim
+ \c__nju_fmt_coverlabel_tl,
+ bottom-skip = 20 pt plus 1 fill
+ }
+\__nju_declare_element:nn { g / cover-front / date }
{ content = \g__nju_info_submitdate_tl }
-\cs_new_protected:Npn \__nju_cover_info_g:NN #1#2
+\cs_new_protected:Npn \__nju_g_cover_info:NNNN #1#2#3#4
{
- \begin{minipage} { #1 + #2 + \c__nju_smallhskip_dim }
- \dim_set_eq:NN \baselineskip \c__nju_coverlineskip_dim
- \__nju_cover_entry_title:nnn { } { #1 } { #2 }
- \clist_map_inline:nn { author, major, field, supvfull }
- { \__nju_cover_entry:nnn { ##1 } { #1 } { #2 } }
- \end{minipage}
+ \dim_set_eq:NN \tex_baselineskip:D \c__nju_clineskip_dim
+ \__nju_cover_entry_title:NNN #1 #2 #4
+ \clist_map_inline:nn { author, major, field, supvfull }
+ { \__nju_cover_entry:NNNn #1 #2 #4 { ##1 } }
}
-\__nju_declare_element:nn { cover / g / back }
+\__nju_declare_element:nn { g / cover-back / info }
{
- content = \__nju_cover_back_g:,
+ content =
+ \__nju_g_cover_back:NN
+ \c__nju_clabelwd_dim
+ \c__nju_fmt_coverlabel_tl,
align = l
}
-\cs_new_protected:Npn \__nju_cover_back_g:
+\cs_new_protected:Npn \__nju_g_cover_back:NN #1#2
{
- \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_id_tl
- { : \__nju_quad: } \g__nju_info_id_tl
- \__nju_vskip:
- \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_defenddate_tl
- { : \__nju_quad: } \g__nju_info_defenddate_tl
- \__nju_vskip:
- \__nju_spread_box:nnV { 6.2 em } { \kaishu } \c__nju_name_supvfull_tl
- { : \__nju_quad: } \skip_horizontal:n { 8 em } \c__nju_name_sign_tl
+ \dim_set_eq:NN \tex_baselineskip:D \c__nju_clineskip_dim
+ \__nju_box_spread_name:NNn #1 #2 { id }
+ \c__nju_name_colon_tl \g__nju_info_id_tl \tex_par:D
+ \__nju_box_spread_name:NNn #1 #2 { defenddate }
+ \c__nju_name_colon_tl \g__nju_info_defenddate_tl \tex_par:D
+ \__nju_box_spread_name:NNn #1 #2 { supvfull }
+ \c__nju_name_colon_tl \skip_horizontal:n { 8 em }
+ { #2 \c__nju_name_sign_tl }
}
-\__nju_declare_element:nn { cover / g / en / title }
+\__nju_declare_element:nn { g / cover-en / title }
{
content = \g__nju_info_title_en_tl,
format = \bf \sffamily \zihao { 2 },
bottom-skip = 2 cm
}
-\__nju_declare_element:nn { cover / g / en / top }
+\__nju_declare_element:nn { g / cover-en / top }
{
content =
{ by }
@@ -102,131 +133,155 @@
format = \zihao { 4 },
bottom-skip = 0 pt plus 1.2 fil
}
-\__nju_declare_element:nn { cover / g / en / middle }
+\__nju_declare_element:nn { g / cover-en / middle }
{
content =
\c__nju_text_cover_en_tl \__nju_vskip:
- \textsc { \clist_item:Nn \c__nju_name_degree_en_clist
+ \textsc { \clist_item:Nn \c__nju_name_type_en_clist
{ \g__nju_info_degree_int } }
\__nju_vskip: { in } \__nju_vskip:
\g__nju_info_major_en_tl,
bottom-skip = 2 cm
}
-\__nju_declare_element:nn { cover / g / en / emblem-img }
+\__nju_declare_element:nn { g / cover-en / emblem-img }
{
- content = \__nju_emblem:N \c__nju_emblemwidthii_dim,
+ content = \__nju_emblem:N \c__nju_emblemwdii_dim,
bottom-skip = 1.5 cm
}
-\__nju_declare_element:nn { cover / g / en / bottom }
+\__nju_declare_element:nn { g / cover-en / bottom }
{
content =
\g__nju_info_dept_en_tl \skip_vertical:N \c_zero_skip
\c__nju_name_nju_en_tl \skip_vertical:n { 1 cm }
\g__nju_info_submitdate_en_tl
}
-\__nju_declare_element:nn { cover / nl / top }
+\__nju_declare_element:nn { cover-nl / top }
{
content = \__nju_cover_top_nl:,
bottom-skip = 2 cm
}
-\__nju_declare_element:nn { cover / nl / name }
+\__nju_declare_element:nn { cover-nl / name }
{
content =
- \__nju_spread_box:nnV { 6 em } { } \c__nju_name_title_b_tl,
+ \dim_set:Nn \l__nju_tmpa_dim { 6 em }
+ \__nju_box_spread_name:Nn \l__nju_tmpa_dim { titleb },
format = \zihao { -0 },
bottom-skip = 0 pt plus 1 fil
}
-\__nju_declare_element:nn { cover / nl / title }
+\__nju_declare_element:nn { cover-nl / title }
{
content = \__nju_cover_title_nl:,
format = \zihao { 1 },
bottom-skip = 0 pt plus 1 fil
}
-\__nju_declare_element:nn { cover / nl / middle }
+\__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 }
+\__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 }
+\__nju_declare_element:nn { cover-nl / date }
{
content = \g__nju_info_bottomdate_tl,
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 } { \g__nju_info_clc_tl } \hfill
- \__nju_spread_box:nnV { 3.2 em } { } \c__nju_name_secretlv_tl \__nju_hskip:
- \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_secretlv_tl } \\
- \__nju_spread_box:nnV { 3.2 em } { } \c__nju_name_udc_tl \__nju_hskip:
- \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_udc_tl } \hfill \null
+ \dim_set:Nn \l__nju_tmpa_dim { 3.2 em }
+ \dim_set:Nn \l__nju_tmpb_dim { 9 em }
+ \__nju_box_spread_name:Nn \l__nju_tmpa_dim { clc } \__nju_hskip:
+ \__nju_box_ulined_info:Nn \l__nju_tmpb_dim { clc } \tex_hfill:D
+ \__nju_box_spread_name:Nn \l__nju_tmpa_dim { secretlv } \__nju_hskip:
+ \__nju_box_ulined_info:Nn \l__nju_tmpb_dim { secretlv } \tex_par:D
+ \__nju_box_spread_name:Nn \l__nju_tmpa_dim { udc } \__nju_hskip:
+ \__nju_box_ulined_info:Nn \l__nju_tmpb_dim { udc } \tex_hfill:D \hbox:n { }
}
\cs_new_protected:Npn \__nju_cover_title_nl:
{
- \parbox [ b ] { 15 em } { \__nju_uline_title: } \par
+ \parbox [ b ] { 15 em } { \__nju_uline_title: } \tex_par:D
\skip_vertical:n { - 0.5 cm }
{ \zihao { 4 } \c__nju_name_subtitle_tl }
\skip_vertical:N \c_zero_skip
- \__nju_ulined_center_box:nn { 4.5 em } { \g__nju_info_author_tl }
+ \dim_set:Nn \l__nju_tmpa_dim { 4.5 em }
+ \__nju_box_ulined_info:Nn \l__nju_tmpa_dim { author }
\skip_vertical:n { - 0.5 cm }
{ \zihao { 4 } { ( } \c__nju_name_author_tl { ) } }
}
\cs_new_protected:Npn \__nju_cover_info_nl:
{
- \__nju_uline_list:nnn { \c__nju_name_supvinfo_tl }
+ \skip_set:Nn \l__nju_tmp_skip { 1 em plus 1 fill }
+ \__nju_uline_list:NNn \c__nju_name_supvinfo_tl \l__nju_tmp_skip
{
- \clist_use:Nn \g__nju_info_supv_clist { ~ }
- \clist_use:Nn \g__nju_info_supv_ii_clist { ~ }
+ \clist_use:Nn \g__nju_info_supv_clist { ~ }
+ \clist_use:Nn \g__nju_info_supvii_clist { ~ }
\__nju_hskip: \g__nju_info_supvcont_tl
}
- { 1 em plus 1 fill }
- \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { degree } { degree } { }
- \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { major_b } { major } { } \\
- \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { submitdate } { submitdate } { }
- \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { defenddate } { defenddate } { } \\
- \__nju_uline_entry:Nnnn \l__nju_tmpa_dim { confer } { confer } { }
+ \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { degree } { degree } { }
+ \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { majorb } { major } { }
+ \tex_par:D
+ \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { submitdate } { submitdate } { }
+ \__nju_uline_bientry:Nnnn \l__nju_tmpa_dim { defenddate } { defenddate } { }
+ \tex_par:D
+ \__nju_uline_entry:Nnnn \l__nju_tmpa_dim { confer } { confer } { }
}
\cs_new_protected:Npn \__nju_cover_bottom_nl:
{
+ \dim_set:Nn \l__nju_tmpa_dim { 9 em }
\c__nju_name_chairman_tl \__nju_hskip:
- \__nju_ulined_center_box:nn { 9 em } { \g__nju_info_chairman_tl } \\
+ \__nju_box_ulined_info:Nn \l__nju_tmpa_dim { chairman } \tex_par:D
\c__nju_name_reviewer_tl \__nju_hskip:
- \__nju_multiline_box:NNNn \l__nju_tmpa_int \l__nju_tmpb_int
- \g__nju_info_reviewer_clist { 9 em }
+ \__nju_box_multiline:NNNN \l__nju_tmpa_int \l__nju_tmpb_int
+ \g__nju_info_reviewer_clist \l__nju_tmpa_dim
+ }
+\__nju_declare_element:nn { g / decl / orig / title }
+ {
+ content = \c__nju_name_origdecl_tl,
+ format = \c__nju_fmt_chapter_tl,
+ bottom-skip = \c__nju_chapterafter_dim
+ }
+\__nju_declare_element:nn { g / decl / orig / text }
+ {
+ content = \c__nju_text_origdecl_tl,
+ align = n,
+ bottom-skip = 0 pt plus 1 fil
+ }
+\__nju_declare_element:nn { g / decl / orig / sign }
+ {
+ content = \__nju_decl_sign:,
+ align = r
}
-\__nju_declare_element:nn { authdecl / g / title }
+\__nju_declare_element:nn { g / decl / auth / title }
{
content = \c__nju_name_authdecl_tl,
format = \c__nju_fmt_chapter_tl,
- bottom-skip = 3 cm
+ bottom-skip = \c__nju_chapterafter_dim
}
-\__nju_declare_element:nn { authdecl / g / text }
+\__nju_declare_element:nn { g / decl / auth / text }
{
content = \c__nju_text_authdecl_tl,
align = n,
bottom-skip = 2 cm
}
-\__nju_declare_element:nn { authdecl / g / sign }
+\__nju_declare_element:nn { g / decl / auth / sign }
{
- content = \__nju_authdecl_sign_g:,
+ content = \__nju_g_decl_auth_sign:,
align = r,
- bottom-skip = 0pt plus 1 fill
+ bottom-skip = 0 pt plus 1 fill
}
-\__nju_declare_element:nn { authdecl / g / info }
+\__nju_declare_element:nn { g / decl / auth / info }
{
- content = \__nju_authdecl_info_g:,
+ content = \__nju_g_decl_auth_info:,
format = \zihao { 5 } ,
align = l,
bottom-skip = 2 cm
}
-\__nju_declare_element:nn { authdecl / g / date }
+\__nju_declare_element:nn { g / decl / auth / date }
{
content = \__nju_authdecl_secretlv_g:,
format = \zihao { 5 } ,
@@ -234,180 +289,187 @@
}
\cs_new_protected:Npn \__nju_degree_checkbox:n #1
{
- \int_compare:nNnTF { #1 } { = } { \g__nju_info_degree_int }
+ \int_compare:nNnTF { #1 } { = }
+ { \g__nju_info_degree_int * \g__nju_info_type_int }
{
\makebox [ 0 pt ] [l] { \ensuremath { \mdwhtsquare } }
\hspace { 0.1 em } \ensuremath { \checkmark }
}
{ \ensuremath { \mdwhtsquare } }
}
-\cs_new_protected:Npn \__nju_authdecl_info_g:
+\cs_new_protected:Npn \__nju_g_decl_auth_info:
{
\begin{tblr}
{
hlines, vlines, hspan=minimal,
+ cells = {font=\normalsize},
colspec = {cX[c]cX[c]cX[c]},
cell{1}{2} = {c=5}{m}, cell{3}{2} = {c=5}{m},
cell{4}{2} = {c=5}{m}, cell{5}{2} = {c=5}{m}
}
- \c__nju_name_title_c_tl & \g__nju_info_title_tl \\
- \c__nju_name_id_a_tl & \g__nju_info_id_tl &
- \c__nju_name_dept_a_tl & \g__nju_info_dept_tl &
+ \c__nju_name_titlec_tl & \g__nju_info_title_tl \\
+ \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} \\
- \c__nju_name_degree_a_tl &
+ \c__nju_name_degreea_tl &
{
\__nju_degree_checkbox:n { 2 } 学术学位硕士 \qquad{}
- \__nju_degree_checkbox:n { 3 } 专业学位硕士 \\
- \__nju_degree_checkbox:n { 4 } 学术学位博士 \qquad{}
- \__nju_degree_checkbox:n { 5 } 专业学位博士
+ \__nju_degree_checkbox:n { 4 } 专业学位硕士 \\
+ \__nju_degree_checkbox:n { 3 } 学术学位博士 \qquad{}
+ \__nju_degree_checkbox:n { 6 } 专业学位博士
} \\
\c__nju_name_email_tl & \g__nju_info_email_tl \\
- \c__nju_name_supv_b_tl &
+ \c__nju_name_supvb_tl &
\clist_item:Nn \g__nju_info_supv_clist {1}
- \bool_if:NT \l__nju_second_supv_bool
+ \bool_if:NT \l__nju_second_supvbool
{
\__nju_quad:
- \clist_item:Nn \g__nju_info_supv_ii_clist {1}
+ \clist_item:Nn \g__nju_info_supvii_clist {1}
} \\
\end{tblr}
}
-\cs_new_protected:Npn \__nju_authdecl_sign_g:
+\cs_new_protected:Npn \__nju_g_decl_auth_sign:
{
- \c__nju_name_authsign_tl \par
- \c__nju_name_blankdate_a_tl
+ \c__nju_name_authsign_tl \tex_par:D
+ \c__nju_name_blankdatea_tl
}
\cs_new_protected:Npn \__nju_authdecl_secretlv_g:
{
- \c__nju_name_secretstatus_tl \par
- \ensuremath { \mdwhtsquare } \c__nju_name_secretfree_tl \par
+ \c__nju_name_secretstatus_tl \tex_par:D
+ \ensuremath { \mdwhtsquare } \c__nju_name_secretfree_tl \tex_par:D
\ensuremath { \mdwhtsquare } \c__nju_name_secretdate_tl
}
-\__nju_declare_page:nn { cover-g-front-default }
+\__nju_declare_page:nn { cover-g-front }
{
element = { emblem-img, name-img, type, degree, info, date },
- prefix = cover / g /,
+ prefix = g / cover-front /,
format = \zihao { 3 } \kaishu,
- top-skip = 1.5 cm
+ top-skip = 0 pt
}
-\__nju_declare_page:nn { cover-g-back-default }
+\__nju_declare_page:nn { cover-g-back }
{
- element = { back },
- prefix = cover / g /,
+ element = { info },
+ prefix = g / cover-back /,
format = \zihao { 3 } \kaishu,
- top-skip = 20 cm
+ top-skip = 500 pt
}
-\__nju_declare_page:nn { cover-g-en-default }
+\__nju_declare_page:nn { cover-g-en }
{
element = { title, top, middle, emblem-img, bottom },
- prefix = cover / g / en /,
+ prefix = g / cover-en /,
top-skip = 0 pt plus 1.2 fil
}
-\__nju_declare_page:nn { cover-nl-default }
+\__nju_declare_page:nn { cover-nl }
{
element = { top, name, title, middle, bottom, date },
- prefix = cover / nl /,
+ prefix = cover-nl /,
format = \kaishu
}
-\__nju_declare_page:nn { authdecl-g-default }
+\__nju_declare_page:nn { origdecl-g }
+ {
+ element = { title, text, sign },
+ prefix = g / decl / orig /,
+ top-skip = \c__nju_chapterbefore_dim,
+ bottom-skip = 0 pt plus 1 fil,
+ bm-text = \c__nju_name_origdecl_tl,
+ bm-name = origdecl
+ }
+\__nju_declare_page:nn { authdecl-g }
{
element = { title, text, sign, info, date },
- prefix = authdecl / g /,
- top-skip = 1 cm,
- bottom-skip = 0.5 cm plus 1.5 fill
+ prefix = g / decl / auth /,
+ top-skip = \c__nju_chapterbefore_dim,
+ bottom-skip = 0.5 cm plus 1.5 fill,
+ bm-text = \c__nju_name_authdecl_tl,
+ bm-name = authdecl,
+ bookmark = toc
}
\cs_new_protected:Npn \__nju_make_cover:
{
\clist_map_inline:nn { front, back, en }
- { \UseInstance { nju } { cover-g- ##1 -default } }
+ { \UseInstance { nju } { cover-g- ##1 } }
}
\cs_new_protected:Npn \__nju_make_cover_nl:
- { \UseInstance { nju } { cover-nl-default } }
-\cs_new_protected:Npn \__nju_make_origdecl:
+ { \UseInstance { nju } { cover-nl } }
+\cs_new_protected:Npn \__nju_make_decl_i:
{
- \chapter* { \c__nju_name_origdecl_tl }
- \thispagestyle { empty }
- \c__nju_text_origdecl_tl
- \vfil
- \begin{flushright}
- \clist_map_inline:nn { origsign, origdate }
- { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } }
- \end{flushright}
- \vfil
+ \cleardoublepage
+ \UseInstance { nju } { origdecl-g }
+ \cleardoublepage
}
-\cs_new_protected:Npn \__nju_make_authdecl:
+\cs_new_protected:Npn \__nju_make_decl_ii:
{
- \UseInstance { nju } { authdecl-g-default }
+ \AtEndEnvironment { document }
+ {
+ \cleardoublepage
+ \UseInstance { nju } { authdecl-g }
+ \cleardoublepage
+ }
}
\__nju_declare_element:nn { abstract / title }
{
- content = \__nju_abs_title:V \c__nju_name_abstracttitle_tl,
+ content = \__nju_abs_title:N \c__nju_name_abstracttitle_tl,
+ format = \bfseries \kaishu \zihao { -2 },
+ bottom-skip = 20 pt
+ }
+\__nju_declare_element:nn { abstract / en / title }
+ {
+ content = \__nju_abs_title:N \c__nju_name_abstracttitle_en_tl,
format = \bfseries \kaishu \zihao { -2 },
- bottom-skip = 1.2 cm
+ bottom-skip = 20 pt
}
\__nju_declare_element:nn { abstract / info }
{
- content = \__nju_abs_info_g:n { : },
+ content = \__nju_abs_info_g:,
format = \zihao { 4 } \kaishu,
- bottom-skip = 2 cm,
+ bottom-skip = 30 pt,
align = l
}
-\__nju_declare_element:nn { abstract / en / title }
- {
- content = \__nju_abs_title:V \c__nju_name_abstracttitle_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 { :~ },
+ content = \__nju_abs_info_en_g:,
format = \zihao { 4 },
- bottom-skip = 2 cm,
+ bottom-skip = 30 pt,
align = l
}
\__nju_declare_element:nn { abstract / mark }
{
- content = \c__nju_name_abstract_b_tl,
+ content = \c__nju_name_abstractb_tl,
format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
+ bottom-skip = 15 pt
}
\__nju_declare_element:nn { abstract / en / mark }
{
- content = \c__nju_name_abstract_b_en_tl,
+ content = \c__nju_name_abstractb_en_tl,
format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
+ bottom-skip = 15 pt
}
-\cs_new_protected:Npn \__nju_abs_info_g:n #1
+\cs_new_protected:Npn \__nju_abs_info_g:
+ { \__nju_abs_info_g:N \c__nju_name_colon_tl }
+\cs_new_protected:Npn \__nju_abs_info_en_g:
+ { \__nju_abs_info_en_g:N \c__nju_name_colon_en_tl }
+\cs_new_protected:Npn \__nju_abs_info_g:N #1
{
- \__nju_uline_list:xnn
- {
- \clist_item:Nn \c__nju_name_type_clist { \g__nju_info_type_int }
- \c__nju_name_title_a_tl #1
- }
- { \g__nju_info_title_tl } { \g__nju_abs_title_left_skip }
- \__nju_full_uline:NV \l__nju_tmpa_dim
+ \__nju_uline_list:NNx \g__nju_info_title_tl \g__nju_abs_title_left_skip
+ { \c__nju_name_titlea_tl #1 }
+ \__nju_full_uline:Nx \l__nju_tmp_skip
{
- \__nju_ulined_center_box:nn { 11 em } { \g__nju_info_major_tl }
- \c__nju_name_major_a_tl
- \__nju_ulined_center_box:nn { 4 em } { \g__nju_info_grade_tl }
- \c__nju_name_grade_tl \c__nju_name_author_a_tl #1
- }
- \__nju_ulined_center_box:nn { \l__nju_tmpa_dim }
- { \g__nju_info_author_tl } \\
- \__nju_full_uline:NV \l__nju_tmpa_dim
- { \c__nju_name_supv_a_tl #1 }
- \__nju_ulined_center_box:nn { \l__nju_tmpa_dim }
- { \g__nju_info_supvfull_tl }
- }
-\cs_new_protected:Npn \__nju_abs_info_en_g:n #1
- {
- \__nju_uline_list:xnn { \g__nju_info_type_en_tl #1 }
- { \g__nju_info_title_en_tl } { \g__nju_abs_title_left_skip }
- \clist_map_inline:nn { major, author, supvfull }
- {
- \__nju_uline_entry:Nnnn \l__nju_tmpa_dim
- { ##1 _en } { ##1 _en } { #1 } \par
+ \dim_set:Nn \l__nju_tmpa_dim { 11 em }
+ \dim_set:Nn \l__nju_tmpb_dim { 4 em }
+ \__nju_box_ulined_info:Nn \l__nju_tmpa_dim { major }
+ \c__nju_name_majora_tl
+ \__nju_box_ulined_info:Nn \l__nju_tmpb_dim { grade }
+ \c__nju_name_grade_tl \c__nju_name_authora_tl #1
}
+ \__nju_box_ulined_info:Nn \l__nju_tmp_skip { author } \tex_par:D
+ \__nju_full_uline:Nx \l__nju_tmpa_dim { \c__nju_name_supva_tl #1 }
+ \__nju_box_ulined_info:Nn \l__nju_tmpa_dim { supvfull }
+ }
+\cs_new_protected:Npn \__nju_abs_info_en_g:N #1
+ {
+ \clist_map_inline:nn { title, major, author, supvfull }
+ { \__nju_name:n { ##1 _en } #1 \__nju_info:n { ##1 _en } \\ }
}
\cs_new_protected:Npn \__nju_make_abstract:
{
@@ -423,129 +485,105 @@
}
\clist_map_inline:nn
{
- { acknowledgement } { 致 \qquad{} 谢 },
- { tableofcontents } { 目 \qquad{} 录 },
- { id } { 学号 },
- { listoffigures } { 插图目录 },
- { listoftables } { 表格目录 },
- { notation } { 符号表 },
- { origdate } { 日期 },
- { paperlist } { 发表文章目录 },
- { pdfcreator } { LaTeX~ with~ njuthesis~ class },
- { preface } { 前 \qquad{} 言 },
- { supv_ii } { 第二导师 },
- { supv_ttl } { 职称 }
- }
- { \__nju_define_name:nn #1 }
-\clist_map_inline:nn
- {
- { abstract } { 摘要 } { ABSTRACT },
- % 用于书签的摘要名称字样
- { abstract_a } { 中文摘要 } { ABSTRACT },
- % 用于小标题的摘要名称字样
- { abstract_b } { 摘\qquad{}要 } { ABSTRACT },
- { appendix } { 附录 } { appendix },
- { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
- { blankdate_a } { \njuline{\qquad\qquad} 年
- \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
- { comma } { : } { :~ },
- { dept } { 院系 } { DEPARTMENT },
- { figure } { 图 } { figure },
- { keywords } { 关键词 } { Keywords },
- { lang } { 中文 } { 英文 },
- { nju } { 南京大学 } { Nanjing~ University },
- { table } { 表 } { table }
- }
- { \__nju_define_name:nnn #1 }
-\clist_map_inline:nn
- {
- { apply } {(申请 \g__nju_info_degree_tl 学位)},
- { authdecl } { 学位论文出版授权书 },
- { author_a }
- { \tl_item:Nn \g__nju_info_degree_tl { 1 } 士生姓名 },
- { authsign } { 作者签名:\njuline{\hspace{6em}} },
- % 用于摘要的作者名称字样
- { chairman } { 答辩委员会主席: },
- { clc } { 分类号 },
- { confer } { 学位授予单位和日期 },
- { defenddate } { 论文答辩日期 },
- { degree } { 申请学位级别 },
- % 用于出版授权书的学位名称字样
- { degree_a } { 论文级别 },
- % 用于出版授权书的院系名称字样
- { dept_a } { 所在院系 },
- { email } { 作者 Email },
- { field } { 研究方向 },
- { g } { 研究生 },
- { grade } { 级 },
- % 用于出版授权书的学号名称字样
- { id_a } { 研究生学号 },
- % 用于摘要的专业名称字样
- { major_a } { 专业 },
- % 用于国家图书馆封面的专业名称字样
- { major_b } { 专业名称 },
- { origdecl }
- { \c__nju_name_nju_tl 学位论文原创性声明 },
- { origsign } { 研究生签名 },
- { reviewer } { 评阅人: },
- { secretlv } { 密级 },
- { secretstatus } { 论文涉密情况: },
- { secretfree } { 不保密 },
- { secretdate }
- { 保密,保密期( \c__nju_name_blankdate_a_tl 至
- \c__nju_name_blankdate_a_tl ) },
- { sign } { (签字) },
- { submitdate } { 论文提交日期 },
- { subtitle } { (题名和副题名) },
- { supv } { 导师 },
- % 用于摘要的导师名称字样
- { supv_a } { 指导教师(姓名、职称) },
- % 用于出版授权书的导师名称字样
- { supv_b } { 导师姓名 },
- { supvinfo }
- { 指导教师姓名、职务、职称、学位、单位名称及地址 },
- % 用于普通封面的标题名称字样
- { title } { 论文题目 },
- % 用于摘要的标题名称字样
- { title_a } { 题目 },
- % 用于国家图书馆封面的标题名称字样
- { title_b } { 学位论文 },
- % 用于出版授权书的标题名称字样
- { title_c } { 论文题名 },
- { udc } { U D C },
- { year } { 学位年度 }
+ { acknowledgement } { 致 \qquad{} 谢 },
+ { apply } {(申请 \g__nju_info_degree_tl 学位)},
+ { auth decl } { 学位论文出版授权书 },
+ { author a } { \g__nju_info_type_tl 生姓名 },
+ { auth sign } { 作者签名:\njuline{\hspace{6em}} },
+ { chairman } { 答辩委员会主席: },
+ { clc } { 分类号 },
+ { confer } { 学位授予单位和日期 },
+ { date } { 日期 },
+ { defend date } { 论文答辩日期 },
+ { degree } { 申请学位级别 },
+ { degree a } { 论文级别 },
+ { dept a } { 所在院系 },
+ { email } { 作者 Email },
+ { field } { 研究方向 },
+ { grade } { 级 },
+ { id } { 学号 },
+ { id a } { 研究生学号 },
+ { listoffigures } { 插图目录 },
+ { listoftables } { 表格目录 },
+ { major a } { 专业 },
+ { major b } { 专业名称 },
+ { notation } { 符号表 },
+ { orig decl } { 南京大学学位论文原创性声明 },
+ { orig sign } { 研究生签名 },
+ { paper list } { 发表文章目录 },
+ { pdf creator } { LaTeX~ with~ njuthesis~ class },
+ { preface } { 前 \qquad{} 言 },
+ { reviewer } { 评阅人: },
+ { secret lv } { 密级 },
+ { secret status } { 论文涉密情况: },
+ { secret free } { 不保密 },
+ { secret date }
+ { 保密,保密期( \c__nju_name_blankdatea_tl 至
+ \c__nju_name_blankdatea_tl ) },
+ { sign } { (签字) },
+ { submit date } { 论文提交日期 },
+ { subtitle } { (题名和副题名) },
+ { supv } { 导师 },
+ { supv a } { 指导教师(姓名、职称) },
+ { supv b } { 导师姓名 },
+ { supv info }
+ { 指导教师姓名、职务、职称、学位、单位名称及地址 },
+ { supv ii } { 第二导师 },
+ { supv title } { 职称 },
+ { tableofcontents } { 目 \qquad{} 录 },
+ { title a } { 毕业论文题目 },
+ { title b } { 学位论文 },
+ { title c } { 论文题名 },
+ { udc } { U D C },
+ { year } { 学位年度 }
}
{ \__nju_define_name:nn #1 }
\clist_map_inline:nn
{
+ { abstract } { 摘要 } { ABSTRACT },
+ { abstract a } { 中文摘要 } { ABSTRACT },
+ { abstract b } { 摘\qquad{}要 } { ABSTRACT },
{ abstracttitle }
- { \c__nju_name_nju_tl \g__nju_info_type_tl 中文摘要首页用纸 }
- { \c__nju_name_nju_tl \g__nju_info_type_tl 英文摘要首页用纸 },
- { author } { 作者姓名 } { POSTGRADUATE },
- { major } { 专业名称 } { SPECIALIZATION },
- { supvfull } { 指导教师 } { MENTOR }
+ { 南京大学研究生毕业论文中文摘要首页用纸 }
+ { 南京大学研究生毕业论文英文摘要首页用纸 },
+ { appendix } { 附录 } { appendix },
+ { author } { 作者姓名 } { POSTGRADUATE },
+ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
+ { blankdate a } { \njuline{\qquad\qquad} 年
+ \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
+ { colon } { : } { : \c_space_tl },
+ { dept } { 院系 } { DEPARTMENT },
+ { figure } { 图 } { figure },
+ { keywords } { 关键词 } { KEYWORDS },
+ { lang } { 中文 } { 英文 },
+ { major } { 专业名称 } { SPECIALIZATION },
+ { nju } { 南京大学 } { Nanjing~ University },
+ { suffix } { } { _en },
+ { supv full } { 指导教师 } { MENTOR },
+ { table } { 表 } { table },
+ { title } { 论文题目 } { THESIS },
+ { type } { 研究生毕业论文 } { g }
}
{ \__nju_define_name:nnn #1 }
-\int_compare:nT { \g__nju_info_degree_int == 3 }
- { \njusetname{major}{专业学位类别(领域)} }
+\int_compare:nT { \g__nju_info_degree_int == 2 }
+ { \tl_set:Nn \c__nju_name_major_tl { 专业学位类别(领域) } }
\tl_const:Nn \c__nju_text_origdecl_tl
{
本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作所
取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或集体
- 已经发表或撰写过的研究成果,也不包含为获得 \c__nju_name_nju_tl 或其他教
- 育机构的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,
- 均已在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。
+ 已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构的学位
+ 证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已在论文的
+ 致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。
}
\tl_const:Nn \c__nju_text_authdecl_tl
{
- 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》
- (以下简称“章程”),愿意将本人的学位论文提交“中国学术期刊
- (光盘版)电子杂志社”在《中国博士学位论文全文数据库》、
- 《中国优秀硕士学位论文全文数据库》中全文发表。《中国博士
- 学位论文全文数据库》、《中国优秀硕士学位论文全文数据库》
- 可以以电子、网络及其他数字媒体形式公开出版,并同意编入
- 《中国知识资源总库》,在《中国博硕士学位论文评价数据库》
- 中使用和在互联网上传播,同意按“章程”规定享受相关权益。
+ 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》(以下简称“章
+ 程”),愿意将本人的学位论文提交“中国学术期刊(光盘版)电子杂志社”在《
+ 中国博士学位论文全文数据库》、《中国优秀硕士学位论文全文数据库》中全文
+ 发表。《中国博士学位论文全文数据库》、《中国优秀硕士学位论文全文数据库
+ 》可以以电子、网络及其他数字媒体形式公开出版,并同意编入《中国知识资源
+ 总库》,在《中国博硕士学位论文评价数据库》中使用和在互联网上传播,同意
+ 按“章程”规定享受相关权益。
}
\tl_const:Nn \c__nju_text_cover_en_tl
{
@@ -555,40 +593,40 @@
}
\clist_map_inline:nn
{
- { axiom } { 公理 } { Axiom },
- { corollary } { 推论 } { Corollary },
- { definition } { 定义 } { Definition },
- { example } { 例 } { Example },
- { lemma } { 引理 } { Lemma },
- { proof } { 证明 } { Proof },
- { theorem } { 定理 } { Theorem }
- }
- { \__nju_add_theorem_type:nnn #1 }
-\clist_map_inline:nn
- {
- { coverlabel } { 100 pt },
- { coverlineskip } { 40 pt },
- { coveruline } { 270 pt },
- { emblemwidthi } { 46 pt },
- { emblemwidthii } { 61 pt },
- { namewidth } { 126 pt },
- { smallhskip } { 5 pt },
- { smallvskip } { 1 ex }
+ { c lineskip } { 32 pt },
+ { c label wd } { 80 pt },
+ { c rule wd } { 240 pt },
+ { emblem wd i } { 46 pt },
+ { emblem wd ii } { 61 pt },
+ { name wd } { 126 pt },
+ { rule ht i } { .4 pt },
+ { rule ht ii } { .8 pt },
+ { rule dp i } { -.7 ex },
+ { rule dp ii } { -.9 ex },
+ { rule dp iii } { -1.2 ex },
+ { h sep } { 5 pt },
+ { v sep } { 1 ex },
+ { chapter before } { 10 pt },
+ { chapter after } { 60 pt }
}
{ \__nju_define_dim:nn #1 }
\clist_map_inline:nn
{
{ pagestyle } { headings },
- { emblemcolor } { black },
- { namecolor } { black },
- { section } { \large \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 },
- { toctitle } { \centering \zihao { 3 } \bfseries },
+ { abslabel } { \bfseries },
+ { abslabel_en } { },
+ { cover title } { },
+ { cover label } { \bfseries },
+ { 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 },
+ { 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
new file mode 100644
index 00000000000..97c1753824f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def
@@ -0,0 +1,287 @@
+%%
+%% This is file `njuthesis-postdoctoral.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% njuthesis.dtx (with options: `def-p')
+%%
+%% 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 1.0.0 2022-08-08 14:50:00
+ +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+ {Postdoctoral definition file for njuthesis}
+\ProvidesExplFile{njuthesis-postdoctoral.def}
+ {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
+
+\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,
+ bottom-skip = 40 pt
+ }
+\__nju_declare_element:nn { p / cover / report }
+ {
+ content = \c__nju_name_report_tl,
+ format = \zihao { 0 } \sffamily,
+ bottom-skip = 40 pt plus 1.5 fil
+ }
+\__nju_declare_element:nn { p / cover / title }
+ {
+ content =
+ \c__nju_name_title_tl
+ \c__nju_name_colon_tl
+ \g__nju_info_title_tl,
+ format = \zihao { 4 },
+ bottom-skip = 80 pt
+ }
+\__nju_declare_element:nn { p / cover / info }
+ {
+ content =
+ \__nju_p_cover_info:NN
+ \c__nju_clabelwd_dim
+ \c__nju_fmt_coverlabel_tl,
+ format = \zihao { -4 },
+ bottom-skip = 0 pt
+ }
+\cs_new_protected:Npn \__nju_p_cover_info:NN #1#2
+ {
+ \clist_set:Nn \l__nju_tmp_clist
+ { author, supvfull, dept, id, major, submitdate }
+ \__nju_get_max_width:NN \l__nju_tmpb_dim \l__nju_tmp_clist
+ \dim_set_eq:NN \tex_baselineskip:D \c__nju_clineskip_dim
+ \clist_map_inline:Nn \l__nju_tmp_clist
+ {
+ \__nju_box_spread_name:NNn #1 #2 { ##1 }
+ \c__nju_name_colon_tl
+ \__nju_box_center:Nn \l__nju_tmpb_dim { \__nju_info:n { ##1 } }
+ \tex_par:D
+ }
+ }
+\__nju_declare_element:nn { p / decl / orig / title }
+ {
+ content = \c__nju_name_origdecl_tl,
+ format = \c__nju_fmt_chapter_tl,
+ bottom-skip = \c__nju_chapterafter_dim
+ }
+\__nju_declare_element:nn { p / decl / orig / text }
+ {
+ content = \c__nju_text_origdecl_tl,
+ align = n,
+ bottom-skip = 2 cm
+ }
+\__nju_declare_element:nn { p / decl / orig / sign }
+ {
+ content = \__nju_p_decl_sign:nn { origsign } { date },
+ bottom-skip = 0 pt plus 1 fill
+ }
+\__nju_declare_element:nn { p / decl / auth / title }
+ {
+ content = \c__nju_name_authdecl_tl,
+ format = \c__nju_fmt_chapter_tl,
+ bottom-skip = \c__nju_chapterafter_dim
+ }
+\__nju_declare_element:nn { p / decl / auth / text }
+ {
+ content = \c__nju_text_authdecl_tl,
+ align = n,
+ bottom-skip = 2 cm
+ }
+\__nju_declare_element:nn { p / decl / auth / sign }
+ {
+ content =
+ \__nju_p_decl_sign:nn { authsign } { date }
+ \__nju_p_decl_sign:nn { authsigna } { date },
+ bottom-skip = 0 pt plus 1 fill
+ }
+\cs_new_protected:Npn \__nju_p_decl_sign:nn #1#2
+ {
+ \__nju_name:n {#1} \c__nju_name_colon_tl \hfill
+ \__nju_name:n {#2} \c__nju_name_colon_tl
+ \skip_horizontal:n { 160 pt } \null \__nju_vskip:
+ }
+\__nju_declare_page:nn { cover-p }
+ {
+ element = { name-img, report, title, info },
+ prefix = p / cover /,
+ format = \bfseries,
+ top-skip = 100 pt
+ }
+\__nju_declare_page:nn { authdecl-p }
+ {
+ element =
+ {
+ orig/title, orig/text, orig/sign,
+ auth/title, auth/text, auth/sign
+ },
+ prefix = p / decl /,
+ bm-text = 声明页,
+ bm-name = decl,
+ top-skip = \c__nju_chapterbefore_dim,
+ bottom-skip = 0 pt
+ }
+\cs_new_protected:Npn \__nju_make_cover:
+ {
+ \UseInstance { nju } { cover-p }
+ }
+\cs_new_protected:Npn \__nju_make_decl_i:
+ {
+ \cleardoublepage
+ \UseInstance { nju } { authdecl-p }
+ \cleardoublepage
+ }
+\cs_new_protected:Npn \__nju_make_decl_ii:
+ {
+ }
+\__nju_declare_element:nn { abstract / title }
+ {
+ content = \g__nju_info_title_tl,
+ format = \bfseries,
+ bottom-skip = 20 pt
+ }
+\__nju_declare_element:nn { abstract / en / title }
+ {
+ content = \g__nju_info_title_en_tl,
+ format = \bfseries,
+ bottom-skip = 20 pt
+ }
+\__nju_declare_element:nn { abstract / mark }
+ {
+ content = \c__nju_name_abstractb_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 15 pt
+ }
+\__nju_declare_element:nn { abstract / en / mark }
+ {
+ content = \c__nju_name_abstractb_en_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 15 pt
+ }
+\cs_new_protected:Npn \__nju_make_abstract:
+ {
+ \UseInstance { nju } { abstract / title }
+ \UseInstance { nju } { abstract / mark }
+ }
+\cs_new_protected:Npn \__nju_make_abstract_en:
+ {
+ \UseInstance { nju } { abstract / en / title }
+ \UseInstance { nju } { abstract / en / mark }
+ }
+\clist_map_inline:nn
+ {
+ { acknowledgement } { 致 \qquad{} 谢 },
+ { auth decl } { 研究报告使用授权书 },
+ { author } { 作者 },
+ { auth sign } { 本人签名 },
+ { auth sign a } { 导师签名 },
+ { date } { 日期 },
+ { dept } { 系别 },
+ { id } { 工号 },
+ { listoffigures } { 插图目录 },
+ { listoftables } { 表格目录 },
+ { major } { 学科专业 },
+ { notation } { 符号表 },
+ { orig decl } { 研究报告原创性声明 },
+ { orig sign } { 研究报告作者签名 },
+ { paper list } { 发表文章目录 },
+ { pdf creator } { LaTeX~ with~ njuthesis~ class },
+ { preface } { 前 \qquad{} 言 },
+ { report } { 博士后研究工作报告 },
+ { submit date } { 完成日期 },
+ { supv full } { 合作导师 },
+ { supv ii } { 第二导师 },
+ { supv title } { 职称 },
+ { tableofcontents } { 目 \qquad{} 录 },
+ { title } { 报告题目 },
+ }
+ { \__nju_define_name:nn #1 }
+\clist_map_inline:nn
+ {
+ { abstract } { 摘要 } { ABSTRACT },
+ { abstract a } { 中文摘要 } { ABSTRACT },
+ { abstract b } { 摘\qquad{}要 } { ABSTRACT },
+ { appendix } { 附录 } { appendix },
+ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
+ { blankdate a } { \njuline{\qquad\qquad} 年
+ \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
+ { colon } { : } { : \c_space_tl },
+ { figure } { 图 } { figure },
+ { keywords } { 关键词 } { KEYWORDS },
+ { lang } { 中文 } { 英文 },
+ { nju } { 南京大学 } { Nanjing~ University },
+ { suffix } { } { _en },
+ { table } { 表 } { table },
+ }
+ { \__nju_define_name:nnn #1 }
+\tl_const:Nn \c__nju_text_origdecl_tl
+ {
+ 本人郑重声明:所呈交的研究报告,是本人独立进行研究工作所取得的成果。除
+ 文中已经注明引用的内容外,本报告不含任何其他个人或集体已经发表或撰写过
+ 的作品成果。对本报告的研究做出重要贡献的个人和集体,均已在报告中以明确
+ 方式标明。本人完全意识到本声明的法律结果由本人承担。
+ }
+\tl_const:Nn \c__nju_text_authdecl_tl
+ {
+ 本研究报告作者完全了解南京大学有关保留和使用该报告的规定,即:博士后在
+ 职期间的知识产权单位属南京大学。学校有权保留并向国家有关部门或机构送交
+ 研究报告的复印件和电子版,允许研究报告被查阅和借阅;学校可以公布研究报
+ 告的全部或部分内容,可以允许采用影印、缩印或其它复制手段保存、汇编研究
+ 报告。保密的研究报告在解密后适用于本授权书。
+ }
+\clist_map_inline:nn
+ {
+ { c lineskip } { 28 pt },
+ { c label wd } { 50 pt },
+ { name wd } { 220 pt },
+ { rule ht i } { .4 pt },
+ { rule ht ii } { .8 pt },
+ { rule dp i } { -.7 ex },
+ { rule dp ii } { -.9 ex },
+ { rule dp iii } { -1.2 ex },
+ { h sep } { 5 pt },
+ { v sep } { 1 ex },
+ { chapter before } { 10 pt },
+ { chapter after } { 60 pt }
+ }
+ { \__nju_define_dim:nn #1 }
+\clist_map_inline:nn
+ {
+ { pagestyle } { headings },
+ { abslabel } { \bfseries },
+ { abslabel_en } { },
+ { 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 },
+ { toc title } { \centering \zihao { 3 } \bfseries },
+ { header } { \small \kaishu },
+ { footer } { \small \rmfamily }
+ }
+ { \__nju_define_fmt:nn #1 }
+\endinput
+%%
+%% End of file `njuthesis-postdoctoral.def'.
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def
index 852e5d36332..c9366ed4662 100644
--- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def
+++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% njuthesis.dtx (with options: `definition-ug')
+%% njuthesis.dtx (with options: `def-u')
%%
%% Copyright (C) 2021 - 2022
%% by Nanjing University Linux User Group
@@ -23,119 +23,153 @@
%% To produce the documentation run the original source files ending with
%% `.dtx' through XeTeX.
%%
-\GetIdInfo $Id: njuthesis.dtx 0.20.0 2022-06-10 14:42:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+\GetIdInfo $Id: njuthesis.dtx 1.0.0 2022-08-08 14:50:00
+ +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
{Undergraduate definition file for njuthesis}
\ProvidesExplFile{njuthesis-undergraduate.def}
{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__nju_declare_element:nn { cover / ug / emblem-img }
+
+\ctex_at_end_preamble:n
{
- content = \__nju_emblem:N \c__nju_emblemwidth_dim,
- bottom-skip = 1 cm,
+ \__nju_date:n { submit }
+ }
+\__nju_declare_element:nn { u / cover / emblem-img }
+ {
+ content = \__nju_emblem:N \c__nju_emblemwd_dim,
+ bottom-skip = 10 pt,
align = l
}
-\__nju_declare_element:nn { cover / ug / name-img }
+\__nju_declare_element:nn { u / cover / name-img }
+ {
+ content = \__nju_name:N \c__nju_namewd_dim,
+ bottom-skip = 10 pt,
+ }
+\__nju_declare_element:nn { u / cover / title }
+ {
+ content =
+ \dim_set:Nn \l__nju_tmpb_dim { 217 pt }
+ \__nju_box_spread_name:Nn \l__nju_tmpb_dim { type },
+ format = \zihao { -1 } \bfseries,
+ bottom-skip = 10 pt plus 1 fill
+ }
+\__nju_declare_element:nn { u / cover / info }
+ {
+ content =
+ \__nju_u_cover_info:NNNN
+ \c__nju_clabelwd_dim
+ \c__nju_crulewd_dim
+ \c__nju_hsep_dim
+ \c__nju_fmt_coverlabel_tl,
+ format = \zihao { 3 }
+ }
+\cs_new_protected:Npn \__nju_u_cover_info:NNNN #1#2#3#4
+ {
+ \dim_set_eq:NN \tex_baselineskip:D \c__nju_clineskip_dim
+ \__nju_cover_entry:NNNn #1 #2 #4 { dept }
+ \__nju_cover_entry:NNNn #1 #2 #4 { major }
+ \__nju_cover_entry_title:NNN #1 #2 #4
+ \dim_set:Nn \l__nju_tmpb_dim { #2 * 1/2 - #1 * 1/2 - #3 }
+ \__nju_cover_entry:NNNnn #1 \l__nju_tmpb_dim #4 { grade } { id }
+ \__nju_cover_entry:NNNn #1 #2 #4 { author }
+ \__nju_cover_entry_supv:NNNn #1 \l__nju_tmpb_dim #4 { supv }
+ \bool_if:NT \l__nju_second_supvbool
+ { \__nju_cover_entry_supv:NNNn #1 \l__nju_tmpb_dim #4 { supvii } }
+ \__nju_cover_entry:NNNn #1 #2 #4 { submitdate }
+ }
+\__nju_declare_element:nn { u / decl / orig / emblem }
{
- content = \__nju_name:N \c__nju_namewidth_dim,
- bottom-skip = 1 cm
+ content = \__nju_emblem:N \c__nju_emblemwdi_dim,
+ bottom-skip = 30 pt
}
-\__nju_declare_element:nn { cover / ug / title }
+\__nju_declare_element:nn { u / decl / orig / title }
{
- content =
- \__nju_spread_box:nnV { 9 em } { \bf } \g__nju_info_type_tl,
- format = \zihao { -1 },
- bottom-skip = 0 pt plus 1.5 fill
+ content = \c__nju_name_origdecl_tl,
+ format = \zihao { -1 } \sffamily,
+ bottom-skip = 50 pt
}
-\__nju_declare_element:nn { cover / ug / info }
+\__nju_declare_element:nn { u / decl / orig / text }
{
- content =
- \__nju_cover_info_ug:NN \c__nju_coverlabel_dim \c__nju_coveruline_dim,
- format = \zihao { 3 }
+ content = \c__nju_text_origdecl_tl,
+ format = \zihao { -3 },
+ align = n,
+ bottom-skip = 0 pt plus 1 fil
}
-\cs_new_protected:Npn \__nju_cover_info_ug:NN #1#2
+\__nju_declare_element:nn { u / decl / orig / sign }
{
- \begin{minipage} { #1 + #2 + \c__nju_smallhskip_dim }
- \dim_set_eq:NN \baselineskip \c__nju_coverlineskip_dim
- \dim_set:Nn \l__nju_tmpb_dim { .5 #2 - .5 #1 - \c__nju_smallhskip_dim }
- \__nju_cover_entry:nnn { dept } { #1 } { #2 }
- \__nju_cover_entry:nnn { major } { #1 } { #2 }
- \__nju_cover_entry_title:nnn { \bf } { #1 } { #2 }
- \__nju_cover_bientry:nnnn { grade } { id } { #1 } { \l__nju_tmpb_dim }
- \__nju_cover_entry:nnn { author } { #1 } { #2 }
- \__nju_cover_entry_supv:nnn { supv } { #1 } { \l__nju_tmpb_dim }
- \bool_if:NT \l__nju_second_supv_bool
- { \__nju_cover_entry_supv:nnn { supv_ii } { #1 } { \l__nju_tmpb_dim } }
- \__nju_cover_entry:nnn { submitdate } { #1 } { #2 }
- \end{minipage}
+ content = \__nju_decl_sign:,
+ format = \zihao { -3 },
+ align = r
}
-\__nju_declare_page:nn { cover-ug-default }
+\cs_new_protected:Npn \__nju_decl_sign:
+ {
+ \clist_map_inline:nn { origsign, id, date }
+ { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } }
+ }
+\__nju_declare_page:nn { cover-u }
{
element = { emblem-img, name-img, title, info },
- prefix = cover / ug /,
- bottom-skip = 0.5 cm plus 1.5 fill
+ prefix = u / cover /,
+ bottom-skip = 0 pt plus 1 fill
+ }
+\__nju_declare_page:nn { origdecl-u }
+ {
+ element = { emblem, title, text, sign },
+ prefix = u / decl / orig /,
+ top-skip = 0 pt,
+ bottom-skip = 0 pt plus 1 fil
}
\cs_new_protected:Npn \__nju_make_cover:
{
- \UseInstance { nju } { cover-ug-default }
+ \UseInstance { nju } { cover-u }
}
-\cs_new_protected:Npn \__nju_make_origdecl:
+\cs_new_protected:Npn \__nju_make_decl_i:
{
\cleardoublepage
- \thispagestyle { empty }
- \begin{center}
- \njuemblem{2cm}{!}\\
- {\zihao{-1}\sffamily \c__nju_name_origdecl_tl }
- \end{center}
- \zihao{-3}
- \hspace{2em}
- \c__nju_text_origdecl_tl
- \vfil
- \begin{flushright}
- \clist_map_inline:nn { origsign, id, origdate }
- { \__nju_vskip: \__nju_name:n { ##1 } : \__nju_uline:n { 7 em } }
- \end{flushright}
- \vfil
- \normalfont \normalsize
+ \UseInstance { nju } { origdecl-u }
+ \cleardoublepage
}
-\cs_new_protected:Npn \__nju_make_authdecl:
+\cs_new_protected:Npn \__nju_make_decl_ii:
{
- \prg_do_nothing:
}
\__nju_declare_element:nn { abstract / title }
{
- content = \__nju_abs_title:V \c__nju_name_abstracttitle_tl,
+ content = \__nju_abs_title:N \c__nju_name_abstracttitle_tl,
format = \bfseries \kaishu \zihao { -2 },
- bottom-skip = 1.2 cm
+ bottom-skip = 20 pt
+ }
+\__nju_declare_element:nn { abstract / en / title }
+ {
+ content = \__nju_abs_title:N \c__nju_name_abstracttitle_en_tl,
+ format = \bfseries \kaishu \zihao { -2 },
+ bottom-skip = 20 pt
}
\__nju_declare_element:nn { abstract / info }
{
- content = \__nju_abs_info_ug:nn { } { : },
+ content = \__nju_abs_info_u:,
format = \zihao { -4 } \kaishu,
- bottom-skip = 1 cm,
+ bottom-skip = 15 pt,
align = l
}
-\__nju_declare_element:nn { abstract / en / title }
- {
- content = \__nju_abs_title:V \c__nju_name_abstracttitle_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 } { :~ },
+ content = \__nju_abs_info_en_u:,
format = \zihao { -4 },
- bottom-skip = 1 cm,
+ bottom-skip = 15 pt,
align = l
}
-\cs_new_protected:Npn \__nju_abs_info_ug:nn #1#2
+\cs_new_protected:Npn \__nju_abs_info_u:
+ { \__nju_abs_info_u:nn { } { \c__nju_name_colon_tl } }
+\cs_new_protected:Npn \__nju_abs_info_en_u:
+ { \__nju_abs_info_u:nn { _en } { \c__nju_name_colon_en_tl } }
+\cs_new_protected:Npn \__nju_abs_info_u: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 { g__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, supvfull }
- { \__nju_name:n { ##1 #1 } #2 \__nju_info:n { ##1 #1 } \\ }
- \__nju_name:n { abstract #1 } #2
+ \tl_set_eq:NN \c__nju_name_author_tl \c__nju_name_authora_tl
+ \clist_map_inline:nn { title, dept, major, author, supvfull }
+ {
+ \__nju_name:nn { abslabel #1 } { ##1 #1 } #2
+ \__nju_info:n { ##1 #1 } \\
+ }
+ \__nju_name:nn { abslabel #1 } { abstract #1 } #2
}
\cs_new_protected:Npn \__nju_make_abstract:
{
@@ -149,69 +183,52 @@
}
\clist_map_inline:nn
{
- { acknowledgement } { 致 \qquad{} 谢 },
- { tableofcontents } { 目 \qquad{} 录 },
- { id } { 学号 },
- { listoffigures } { 插图目录 },
- { listoftables } { 表格目录 },
- { notation } { 符号表 },
- { origdate } { 日期 },
- { paperlist } { 发表文章目录 },
- { pdfcreator } { LaTeX~ with~ njuthesis~ class },
- { preface } { 前 \qquad{} 言 },
- { supv_ii } { 第二导师 },
- { supv_ttl } { 职称 }
- }
- { \__nju_define_name:nn #1 }
-\clist_map_inline:nn
- {
- { abstract } { 摘要 } { ABSTRACT },
- % 用于书签的摘要名称字样
- { abstract_a } { 中文摘要 } { ABSTRACT },
- % 用于小标题的摘要名称字样
- { abstract_b } { 摘\qquad{}要 } { ABSTRACT },
- { appendix } { 附录 } { appendix },
- { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
- { blankdate_a } { \njuline{\qquad\qquad} 年
- \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
- { comma } { : } { :~ },
- { dept } { 院系 } { DEPARTMENT },
- { figure } { 图 } { figure },
- { keywords } { 关键词 } { Keywords },
- { lang } { 中文 } { 英文 },
- { nju } { 南京大学 } { Nanjing~ University },
- { table } { 表 } { table }
- }
- { \__nju_define_name:nnn #1 }
-\clist_map_inline:nn
- {
- % 用于摘要的作者名称字样
- { author_a } { 本科生姓名 },
- { grade } { 年级 },
- { origdecl } { \c__nju_name_nju_tl
- 本科毕业论文(设计) \\ 诚信承诺书 },
- { origsign } { 作者签名 },
- { submitdate } { 提交日期 },
- { supv } { 指导教师 },
- { title } { 题目 },
- { type } { 本科生毕业论文(设计、作品) },
- { ug } { 本科 }
+ { acknowledgement } { 致 \qquad{} 谢 },
+ { author a } { 本科生姓名 },
+ { date } { 日期 },
+ { grade } { 年级 },
+ { id } { 学号 },
+ { listoffigures } { 插图目录 },
+ { listoftables } { 表格目录 },
+ { notation } { 符号表 },
+ { orig decl }
+ { 南京大学本科毕业论文(设计) \\ 诚信承诺书 },
+ { orig sign } { 作者签名 },
+ { paper list } { 发表文章目录 },
+ { pdf creator } { LaTeX~ with~ njuthesis~ class },
+ { preface } { 前 \qquad{} 言 },
+ { submit date } { 提交日期 },
+ { supv } { 指导教师 },
+ { supv ii } { 第二导师 },
+ { supv title } { 职称 },
+ { tableofcontents } { 目 \qquad{} 录 },
}
{ \__nju_define_name:nn #1 }
\clist_map_inline:nn
{
+ { abstract } { 摘要 } { ABSTRACT },
+ { abstract a } { 中文摘要 } { ABSTRACT },
+ { abstract b } { 摘\qquad{}要 } { ABSTRACT },
{ abstracttitle }
- {
- \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 },
- { supvfull } { 指导教师(姓名、职称) } { MENTOR }
+ { 南京大学本科生毕业论文(设计、作品)中文摘要 }
+ { 南京大学本科生毕业论文(设计、作品)英文摘要 },
+ { appendix } { 附录 } { appendix },
+ { author } { 学生姓名 } { UNDERGRADUATE },
+ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
+ { blankdate a } { \njuline{\qquad\qquad} 年
+ \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
+ { colon } { : } { : \c_space_tl },
+ { dept } { 院系 } { DEPARTMENT },
+ { figure } { 图 } { figure },
+ { keywords } { 关键词 } { KEYWORDS },
+ { lang } { 中文 } { 英文 },
+ { major } { 专业 } { SPECIALIZATION },
+ { nju } { 南京大学 } { Nanjing~ University },
+ { suffix } { } { _en },
+ { supv full } { 指导教师(姓名、职称) } { MENTOR },
+ { table } { 表 } { table },
+ { title } { 题目 } { THESIS },
+ { type } { 本科毕业论文 } { u }
}
{ \__nju_define_name:nnn #1 }
\tl_const:Nn \c__nju_text_origdecl_tl
@@ -224,39 +241,40 @@
}
\clist_map_inline:nn
{
- { axiom } { 公理 } { Axiom },
- { corollary } { 推论 } { Corollary },
- { definition } { 定义 } { Definition },
- { example } { 例 } { Example },
- { lemma } { 引理 } { Lemma },
- { proof } { 证明 } { Proof },
- { theorem } { 定理 } { Theorem }
- }
- { \__nju_add_theorem_type:nnn #1 }
-\clist_map_inline:nn
- {
- { coverlabel } { 68 pt },
- { coverlineskip } { 40 pt },
- { coveruline } { 270 pt },
- { emblemwidth } { 68 pt },
- { namewidth } { 300 pt },
- { smallhskip } { 5 pt },
- { smallvskip } { 1 ex }
+ { c lineskip } { 36 pt },
+ { c label wd } { 68 pt },
+ { c rule wd } { 270 pt },
+ { emblem wd } { 68 pt },
+ { emblem wd i } { 68 pt },
+ { name wd } { 300 pt },
+ { rule ht i } { .4 pt },
+ { rule ht ii } { .8 pt },
+ { rule dp i } { -.7 ex },
+ { rule dp ii } { -.9 ex },
+ { rule dp iii } { -1.2 ex },
+ { h sep } { 5 pt },
+ { v sep } { 1 ex },
+ { chapter before } { 10 pt },
+ { chapter after } { 60 pt }
}
{ \__nju_define_dim:nn #1 }
\clist_map_inline:nn
{
{ pagestyle } { plain },
- { emblemcolor } { black },
- { namecolor } { black },
- { section } { \large \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 },
- { toctitle } { \centering \zihao { 3 } \bfseries },
+ { abslabel } { \bfseries },
+ { abslabel_en } { },
+ { 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 },
+ { 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 5bc6ba2267b..018a77f98df 100644
--- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
+++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
@@ -24,10 +24,12 @@
%% `.dtx' through XeTeX.
%%
\NeedsTeXFormat{LaTeX2e}
-\GetIdInfo $Id: njuthesis.dtx 0.20.0 2022-06-10 14:42:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+\GetIdInfo $Id: njuthesis.dtx 1.0.0 2022-08-08 14:50:00
+ +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
{Thesis template for Nanjing University}
\ProvidesExplClass{njuthesis}
{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
+
\RequirePackage { xtemplate, l3keys2e }
\msg_new:nnn { njuthesis } { l3-too-old }
{
@@ -53,30 +55,44 @@
{ \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
+\box_new:N \l__nju_tmpa_box
+\box_new:N \l__nju_tmpb_box
+\box_new:N \l__nju_tmpc_box
\clist_new:N \l__nju_tmp_clist
\dim_new:N \l__nju_tmpa_dim
\dim_new:N \l__nju_tmpb_dim
\int_new:N \l__nju_tmpa_int
\int_new:N \l__nju_tmpb_int
+\skip_new:N \l__nju_tmp_skip
\tl_new:N \l__nju_tmpa_tl
\tl_new:N \l__nju_tmpb_tl
\int_new:N \g__nju_info_degree_int
-\int_new:N \g__nju_info_diploma_int
\int_new:N \g__nju_info_type_int
\tl_new:N \g__nju_info_degree_tl
-\tl_new:N \g__nju_info_diploma_tl
-\tl_new:N \g__nju_info_type_tl
\tl_new:N \g__nju_info_type_en_tl
-\bool_new:N \g__nju_twoside_bool
-\bool_set_true:N \g__nju_twoside_bool
-\bool_new:N \l__nju_second_supv_bool
+\bool_new:N \g__nju_opt_twoside_bool
+\bool_set_true:N \g__nju_opt_twoside_bool
+\bool_new:N \l__nju_second_supvbool
\tl_new:N \g__nju_info_supvfull_tl
\tl_new:N \g__nju_info_supvfull_en_tl
-\tl_new:N \g__nju_latin_font_tl
-\tl_new:N \g__nju_cjk_font_tl
+\tl_new:N \g__nju_font_latin_tl
+\tl_new:N \g__nju_font_cjk_tl
+\tl_new:N \g__nju_font_math_tl
+\tl_new:N \g__nju_font_path_tl
+\bool_new:N \g__nju_font_path_bool
+\bool_gset_false:N \g__nju_font_path_bool
\tl_new:N \g__nju_config_tl
-\clist_new:N \g__nju_theorem_type_clist
+\clist_new:N \g__nju_thm_type_clist
+\clist_gset:Nn \g__nju_thm_type_clist
+ {
+ { axiom } { 公理 },
+ { corollary } { 推论 },
+ { definition } { 定义 },
+ { example } { 例 },
+ { lemma } { 引理 },
+ { proof, *+ } { 证明 },
+ { theorem } { 定理 }
+ }
\tl_const:Nx \c__nju_today_tl
{
\int_to_arabic:n { \c_sys_year_int } -
@@ -84,37 +100,35 @@
\int_to_arabic:n { \c_sys_day_int }
}
\clist_const:Nn \c__nju_name_type_clist
- { 毕业论文, 毕业设计 }
+ { 学士, 硕士, 博士 }
\clist_const:Nn \c__nju_name_type_en_clist
- { THESIS, DESIGN }
+ { Bachelor, Master, Doctor~of~Philosophy }
\clist_const:Nn \c__nju_name_degree_clist
- { 学士, 硕士, 硕士专业, 博士 }
-\clist_const:Nn \c__nju_name_degree_en_clist
- { Bachelor, Master, Master, Doctor~of~Philosophy }
-\clist_const:Nn \c__nju_month_en_clist
+ { \c_empty_tl, 专业 }
+\clist_const:Nn \c__nju_name_month_en_clist
{
January, February, March, April, May, June,
July, August, September, October, November, December
}
-\clist_const:Nn \c__nju_blind_info_clist
+\clist_const:Nn \c__nju_name_anon_clist
{
author, chairman, clc, dept, email, field, grade,
id, major, secretlv, supvcont, udc
}
-\clist_const:Nn \c__nju_blind_info_en_clist
- { author, dept, field, major, supv, supv_ii }
-\clist_const:Nn \c__nju_blind_infolist_clist
- { reviewer, supv, supv_ii }
+\clist_const:Nn \c__nju_name_anon_en_clist
+ { author, dept, field, major, supv, supvii }
+\clist_const:Nn \c__nju_name_anonlist_clist
+ { reviewer, supv, supvii }
\cs_new:Nn \__nju_quad: { \skip_horizontal:n { 1 em } }
\cs_new:Nn \__nju_qquad: { \skip_horizontal:n { 2 em } }
-\cs_new:Nn \__nju_vskip: { \skip_vertical:N \c__nju_smallvskip_dim }
-\cs_new:Nn \__nju_hskip: { \skip_horizontal:N \c__nju_smallhskip_dim }
-\cs_new_protected:Npn \__nju_vskip:N #1
+\cs_new:Nn \__nju_vskip: { \skip_vertical:N \c__nju_vsep_dim }
+\cs_new:Nn \__nju_hskip: { \skip_horizontal:N \c__nju_hsep_dim }
+\cs_set_protected:Npn \__nju_vskip:N #1
{
- \hrule height \c_zero_dim
- \nobreak
- \skip_vertical:n { - \baselineskip - \lineskip }
+ \tex_hrule:D \@height \c_zero_dim \scan_stop:
+ \tex_penalty:D \@M
\skip_vertical:N #1
+ \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 } }
@@ -129,91 +143,108 @@
{ \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 } }
-\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 { g__nju_info_ #1 _tl } }
-\cs_new_protected:Npn \__nju_ulined_center_box:nn #1#2
+\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_protected:Npn \__nju_box_ulined:NN #1#2
{
\mode_leave_vertical:
- \rule [ -0.55 ex ] { #1 } { 0.4 pt }
+ \rule [ \c__nju_ruledpi_dim ] { #1 } { \c__nju_rulehti_dim }
\skip_horizontal:n { -#1 }
- \hbox_to_wd:nn { #1 } { \hfil #2 \hfil }
+ \hbox_to_wd:nn { #1 } { \tex_hfil:D #2 \tex_hfil:D }
}
-\cs_new_protected:Npn \__nju_spread_box:nnn #1#2#3
+\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
{
\mode_leave_vertical:
- \__nju_get_text_width:Nn \l__nju_tmpa_dim { #2 #3 }
+ \__nju_get_width:Nn \l__nju_tmpa_dim { #2 #3 }
\hbox_to_wd:nn { #1 }
{
\dim_compare:nTF { \l__nju_tmpa_dim > #1 }
{
- \scalebox
+ \tex_hfil:D \scalebox
{ \dim_to_decimal_in_unit:nn { #1 } { \l__nju_tmpa_dim } }
- [ 1.0 ] { #2 #3 }
+ [ 1.0 ] { #2 #3 } \tex_hfil:D
}
- { #2 \tl_map_inline:nn { #3 } { ##1 \hfil } \unskip }
+ { #2 \tl_map_inline:nn { #3 } { ##1 \tex_hfil:D } \tex_unskip:D }
}
}
-\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
+\cs_generate_variant:Nn \__nju_box_spread:NNn { NNv }
+\cs_new_protected:Npn \__nju_box_spread_name:Nn #1#2
+ { \__nju_box_spread:NNv #1 \c_empty_tl { c__nju_name_ #2 _tl } }
+\cs_new_protected:Npn \__nju_box_spread_name:NNn #1#2#3
+ { \__nju_box_spread:NNv #1 #2 { c__nju_name_ #3 _tl } }
+\cs_new_protected:Npn \__nju_box_center:Nn #1#2
+ {
+ \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
{
\int_set:Nn #1 { 1 }
\int_set:Nn #2 { \clist_count:N #3 }
- \int_compare:nF { #2 > 4 }
- { \int_set:Nn #2 { 4 } }
+ \int_compare:nF { #2 > 4 } { \int_set:Nn #2 { 4 } }
\int_do_until:nn { #1 > #2 }
{
- \__nju_ulined_center_box:nn { #4 }
- { \clist_item:Nn #3 { #1 } } \\
+ \clist_pop:NN #3 \l__nju_tmpa_tl
+ \__nju_box_ulined:NN #4 \l__nju_tmpa_tl \tex_par:D
\int_incr:N #1
}
}
\cs_new_protected:Npn \__nju_uline:n #1
{
\mode_leave_vertical:
- \rule [ -0.55 ex ] { #1 } { 0.4 pt }
+ \rule [ \c__nju_ruledpi_dim ] { #1 } { \c__nju_rulehti_dim }
\skip_horizontal:n { -#1 }
}
-\cs_new_protected:Npn \__nju_uuline:n #1
+\cs_new_protected:Npn \__nju_uuline:N #1
{
\mode_leave_vertical:
- \rule [ -0.5 ex ] { #1 } { 0.4 pt }
+ \rule [ \c__nju_ruledpii_dim ] { #1 } { \c__nju_rulehtii_dim }
\skip_horizontal:n { -#1 }
- \rule [ -0.6 ex ] { #1 } { 0.4 pt }
+ \rule [ \c__nju_ruledpiii_dim ] { #1 } { \c__nju_rulehtii_dim }
\skip_horizontal:n { -#1 }
}
-\cs_new:Npn \__nju_get_text_width:Nn #1#2
+\cs_new:Npn \__nju_get_width:Nn #1#2
{
- \hbox_set:Nn \l__nju_tmp_box {#2}
- \dim_set:Nn #1 { \box_wd:N \l__nju_tmp_box }
+ \hbox_set:Nn \l__nju_tmpa_box {#2}
+ \dim_set:Nn #1 { \box_wd:N \l__nju_tmpa_box }
+ }
+\cs_generate_variant:Nn \__nju_get_width:Nn { NV }
+\cs_generate_variant:Nn \__nju_get_width:Nn { Nv }
+\cs_new:Npn \__nju_get_max_width:NN #1#2
+ {
+ \clist_map_inline:Nn #2
+ {
+ \__nju_get_width:Nv \l__nju_tmpa_dim { g__nju_info_ ##1 _tl }
+ \dim_gset:Nn #1 { \dim_max:nn {#1} { \l__nju_tmpa_dim } }
+ }
}
-\cs_generate_variant:Nn \__nju_get_text_width:Nn { NV }
\cs_new_protected:Npn \__nju_full_uline:Nn #1#2
{
- \__nju_get_text_width:Nn #1 { #2 }
+ \__nju_get_width:Nn #1 { #2 }
\dim_set:Nn #1 { \textwidth - #1 } #2
}
-\cs_generate_variant:Nn \__nju_full_uline:Nn { NV }
+\cs_generate_variant:Nn \__nju_full_uline:Nn { Nx }
\cs_new_protected:Npn \__nju_uline_entry:Nnnn #1#2#3#4
{
- \__nju_full_uline:NV #1 { \__nju_name:n { #2 } #4 }
- \__nju_ulined_center_box:nn { #1 } { \__nju_info:n { #3 } }
+ \__nju_full_uline:Nx #1 { \__nju_name:n { #2 } #4 }
+ \__nju_box_ulined_info:Nn #1 { #3 }
}
\cs_new_protected:Npn \__nju_uline_bientry:Nnnn #1#2#3#4
{
- \__nju_full_uline:NV #1 { \__nju_name:n { #2 } #4 }
+ \__nju_full_uline:Nx #1 { \__nju_name:n { #2 } #4 }
\dim_sub:Nn #1 { \textwidth / 2 }
- \__nju_ulined_center_box:nn { #1 } { \__nju_info:n { #3 } }
+ \__nju_box_ulined_info:Nn #1 { #3 }
}
\cs_new:Npn \__nju_date:www #1-#2-#3 \q_stop
{ \__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 }
+ { \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 }
@@ -225,74 +256,106 @@
{
\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 }
+ {
+ \exp_last_unbraced:cV { __nju_date #2 :www }
+ \l__nju_tmpa_tl \q_stop
+ }
}
}
+\cs_new_protected:Npn \__nju_at_begin_document:n #1
+ { \hook_gput_next_code:nn { begin document } { #1 } }
+\cs_new_protected:Npn \__nju_cs_clear:N #1
+ { \cs_set_eq:NN #1 \prg_do_nothing: }
\msg_new:nnn { njuthesis } { missing-title }
{
The~ title~ should~ not~ be~ left~ blank.\\
Please~ check~ whether~ you~ have~ fill~ in~
both~ Chinese~ and~ English~ titles.
}
+\cs_new:Npn \__nju_loop_until:nnn #1#2#3
+ { #2 \bool_if:nF {#1} { #3 \__nju_loop_until:nnn {#1} {#2} {#3} } }
+\cs_new:Npn \__nju_breakpar_loop:n #1
+ {
+ \dim_set:Nn \l__nju_tmpa_dim
+ { - \tex_prevdepth:D - \c__nju_ruledpi_dim - \c__nju_rulehti_dim }
+ \hbox_gset:Nn \l__nju_tmpc_box { }
+ \__nju_loop_until:nnn { \box_if_empty_p:N \l__nju_tmpb_box }
+ {
+ \box_gset_to_last:N \l__nju_tmpb_box
+ \tex_unskip:D \tex_unpenalty:D
+ }
+ {
+ \hbox_gset:Nn \l__nju_tmpc_box
+ {
+ \vbox_top:n
+ {
+ \box_use_drop:N \l__nju_tmpb_box
+ \__kernel_kern:n { \l__nju_tmpa_dim }
+ \tex_hrule:D
+ }
+ \tex_penalty:D
+ \l__nju_tmpa_box
+ \hbox_unpack_drop:N \l__nju_tmpc_box
+ }
+ #1
+ }
+ }
+\cs_new:Npn \__nju_breakpar_print:nn #1#2
+ {
+ \group_begin:
+ \tex_noindent:D #1
+ \hbox_unpack_drop:N \l__nju_tmpc_box #2
+ \tex_par:D
+ \group_end:
+ }
\cs_new_protected:Npn \__nju_uline_title:
{
- \setbox0 = \vbox{
- \leftskip=0.5em plus 1 fill
- \rightskip=\leftskip \parskip=1cm
- \parindent=\z@ \g__nju_info_title_tl \par
- \global\setbox2=\hbox{}
- \loop
- \setbox1=\lastbox \unskip\unpenalty
- \unless\ifvoid1
- \global\setbox2=\hbox{\__nju_uline_box:\penalty0\unhbox2}
- \repeat
+ \vbox_set:Nn \l__nju_tmpa_box
+ {
+ \skip_set:Nn \tex_leftskip:D { .5 em plus 1 fill }
+ \skip_set_eq:NN \tex_rightskip:D \tex_leftskip:D
+ \g__nju_info_title_tl \tex_par:D
+ \__nju_breakpar_loop:n { }
}
- { \noindent \unhbox2 \par }
+ \__nju_breakpar_print:nn { } { }
}
-\cs_new_protected:Npn \__nju_cover_entry_title:nnn #1#2#3
+\cs_new_protected:Npn \__nju_cover_entry_title:NNN #1#2#3
{
\tl_if_empty:NT \g__nju_info_title_tl
{ \msg_error:nn { njuthesis } { missing-title } }
- \__nju_spread_box:nnV { #2 } { \kaishu } \c__nju_name_title_tl
+ \__nju_box_spread_name:NNn #1 #3 { title }
\mode_leave_vertical: \__nju_hskip:
- \parbox [ t ] { #3 }
+ \parbox [ t ] { #2 }
{
- \dim_set_eq:NN \baselineskip \c__nju_coverlineskip_dim
- #1 \__nju_uline_title:
- \dim_gset_eq:NN \l__nju_tmpa_dim \prevdepth
+ \dim_set_eq:NN \tex_baselineskip:D \c__nju_clineskip_dim
+ \c__nju_fmt_covertitle_tl \__nju_uline_title:
+ \dim_gset_eq:NN \l__nju_tmpa_dim \tex_prevdepth:D
}
- \par \prevdepth \l__nju_tmpa_dim
- }
-\cs_new_protected:Npn \__nju_cover_entry:nnn #1#2#3
- {
- \__nju_spread_box:nnx { #2 } { \kaishu } { \__nju_name:n { #1 } }
- \__nju_hskip:
- \__nju_ulined_center_box:nn { #3 } { \__nju_info:n { #1 } }
- \par
- }
-\cs_new_protected:Npn \__nju_cover_bientry:nnnn #1#2#3#4
- {
- \__nju_spread_box:nnx { #3 } { \kaishu } { \__nju_name:n { #1 } }
- \__nju_hskip:
- \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #1 } }
- \__nju_hskip:
- \__nju_spread_box:nnx { #3 } { \kaishu } { \__nju_name:n { #2 } }
- \__nju_hskip:
- \__nju_ulined_center_box:nn { #4 } { \__nju_info:n { #2 } }
- \par
- }
-\cs_new_protected:Npn \__nju_cover_entry_supv:nnn #1#2#3
- {
- \__nju_spread_box:nnx { #2 } { \kaishu } { \__nju_name:n { #1 } }
- \__nju_hskip:
- \__nju_ulined_center_box:nn { #3 }
- { \clist_item:cn { g__nju_info_ #1 _clist } { 1 } }
- \__nju_hskip:
- \__nju_spread_box:nnV { #2 } { \kaishu } \c__nju_name_supv_ttl_tl
- \__nju_hskip:
- \__nju_ulined_center_box:nn { #3 }
- { \clist_item:cn { g__nju_info_ #1 _clist } { 2 } }
- \par
+ \tex_par:D
+ \dim_set_eq:NN \tex_prevdepth:D \l__nju_tmpa_dim
+ }
+\cs_new_protected:Npn \__nju_cover_entry:NNNn #1#2#3#4
+ {
+ \__nju_box_spread_name:NNn #1 #3 { #4 } \__nju_hskip:
+ \__nju_box_ulined_info:Nn #2 { #4 } \tex_par:D
+ }
+\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
+ }
+\cs_new_protected:Npn \__nju_cover_entry_supv:NNNn #1#2#3#4
+ {
+ \tl_set:Nn \l__nju_tmpa_tl
+ { \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_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 } { ! } }
@@ -301,59 +364,52 @@
\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_bookmark:Nnn \g__nju_abs_showentry_bool {#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
+\cs_new_protected:Npn \__nju_abs_title:N #1
{
- \__nju_get_text_width:Nn \l__nju_tmpa_dim {#1}
- \__nju_uuline:n { \l__nju_tmpa_dim } #1
+ \__nju_get_width:NV \l__nju_tmpa_dim #1
+ \__nju_uuline:N \l__nju_tmpa_dim #1
}
-\cs_generate_variant:Nn \__nju_abs_title:n { V }
-\cs_new_protected:Npn \__nju_uline_box:
- { \vtop{\box1\kern-\prevdepth\kern0.5ex\hrule} }
\msg_new:nnn { njuthesis } { abs-title-too-long }
{
Your~ title~ is~ too~ long~ to~ fit~ in~ two~ lines.\\
I~ have~ drawn~ additional~ lines~ to~ contain~ it,~
which~ will~ probably~ make~ your~ abstract~ page~
look~ slightly~ different~ from~ the~ standard.\\
- You~ can~ use~ the~ "style/abstract-title"~ key~
+ You~ can~ use~ the~ "abstract/title-style"~ key~
to~ disable~ this~ message.
}
-\cs_new_protected:Npn \__nju_uline_list:nnn #1#2#3
+\cs_new_protected:Npn \__nju_uline_list:NNn #1#2#3
{
- \hbox_set:Nn \l__nju_tmp_box {#1}
- \setbox0 = \vbox{\hangindent=\wd\l__nju_tmp_box \hangafter=-1
- \leftskip=#3 \rightskip=\leftskip \parindent=\z@ #2\par
- \global\setbox2=\hbox{}
+ \vbox_set:Nn \l__nju_tmpa_box
+ {
+ \__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
+ \tex_noindent:D #1 \tex_par:D
\int_gzero:N \l__nju_tmpa_int
- \loop
- \setbox1=\lastbox \unskip\unpenalty
- \unless\ifvoid1
- \global\setbox2=\hbox{\__nju_uline_box:\penalty0\unhbox2}
- \int_gincr:N \l__nju_tmpa_int
- \repeat
+ \__nju_breakpar_loop:n { \int_gincr:N \l__nju_tmpa_int }
}
- {
- \noindent\copy\l__nju_tmp_box\unhbox2
- \bool_if:NT \g__nju_strict_abs_title_bool
+ \__nju_breakpar_print:nn { #3 }
+ {
+ \bool_if:NT \g__nju_abs_title_strict_bool
{
\int_case:nnF { \l__nju_tmpa_int }
{
{ 0 } { \msg_error:nn { njuthesis } { missing-title } }
{ 1 } { \__nju_uline:n { \textwidth } }
- { 2 } { \prg_do_nothing: }
+ { 2 } { }
}
{ \msg_warning:nn { njuthesis } { abs-title-too-long } }
- \par
+ \tex_par:D
}
}
}
-\cs_generate_variant:Nn \__nju_uline_list:nnn { xnn }
+\cs_generate_variant:Nn \__nju_uline_list:NNn { NNx }
\DeclareObjectType { nju } { \c_zero_int }
\DeclareTemplateInterface { nju } { element } { \c_zero_int }
{
@@ -369,37 +425,31 @@
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 }
+ l = { \cs_set_eq:NN \__njuelem_align: \raggedright },
+ r = { \cs_set_eq:NN \__njuelem_align: \raggedleft },
+ c = { \cs_set_eq:NN \__njuelem_align: \centering },
+ n = { \__nju_cs_clear:N \__njuelem_align: }
}
}
{
\AssignTemplateKeys
\group_begin:
- \l__njuelem_begin_align_tl
- \l__njuelem_format_tl
- \l__njuelem_content_tl \par
- \l__njuelem_end_align_tl
+ \__njuelem_align:
+ \l__njuelem_format_tl \l__njuelem_content_tl \tex_par:D
\group_end:
\__nju_vskip:N \l__njuelem_bottom_skip
}
+\exp_args_generate:n { NVV }
\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
+ bottom-skip : skip = \c_zero_skip,
+ bm-text : tokenlist = \c_empty_tl,
+ bm-name : tokenlist = \c_empty_tl,
+ bookmark : choice { toc, pdf, none } = none
}
\DeclareTemplateCode { nju } { page } { \c_zero_int }
{
@@ -407,13 +457,23 @@
prefix = \l__njupage_prefix_tl,
format = \l__njupage_format_tl,
top-skip = \l__njupage_top_skip,
- bottom-skip = \l__njupage_bottom_skip
+ bottom-skip = \l__njupage_bottom_skip,
+ bm-text = \l__njupage_bm_text_tl,
+ bm-name = \l__njupage_bm_name_tl,
+ bookmark =
+ {
+ toc = { \cs_set_eq:NN \__njupage_bookmark:nn \__nju_bookmark_toc:nn },
+ pdf = { \cs_set_eq:NN \__njupage_bookmark:nn \__nju_bookmark_pdf:nn },
+ none = { \cs_set:Nn \__njupage_bookmark:nn { } }
+ }
}
{
\AssignTemplateKeys
\clearpage
\thispagestyle { empty }
\__nju_vskip:N \l__njupage_top_skip
+ \exp_args:NVV \__njupage_bookmark:nn
+ \l__njupage_bm_text_tl \l__njupage_bm_name_tl
\group_begin:
\l__njupage_format_tl
\clist_map_inline:Nn \l__njupage_element_clist
@@ -421,53 +481,110 @@
\group_end:
\__nju_vskip:N \l__njupage_bottom_skip
}
-\cs_new_protected:Npn \__nju_declare_element:nn #1#2
+\cs_new:Npn \__nju_declare_element:nn #1#2
{ \DeclareInstance { nju } {#1} { element } {#2} }
-\cs_new_protected:Npn \__nju_declare_page:nn #1#2
+\cs_new:Npn \__nju_declare_page:nn #1#2
{ \DeclareInstance { nju } {#1} { page } {#2} }
\keys_define:nn { nju }
{
- degree .choices:nn = { ug, mg, mf, phd }
- { \int_gset_eq:NN \g__nju_info_degree_int \l_keys_choice_int },
- degree .initial:n = ug,
- type .choices:nn = { thesis, design }
+ type .choices:nn = { bachelor, master, doctor, postdoc }
{ \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,
- decl-page .bool_set:N = \g__nju_decl_bool,
+ type .initial:n = bachelor,
+ degree .choices:nn = { academic, professional }
+ { \int_gset_eq:NN \g__nju_info_degree_int \l_keys_choice_int },
+ degree .initial:n = academic,
+ nl-cover .bool_set:N = \g__nju_opt_nlcover_bool,
+ nl-cover .initial:n = false,
+ decl-page .bool_set:N = \g__nju_opt_decl_bool,
decl-page .initial:n = false,
- draft .bool_gset:N = \g__nju_draft_bool,
+ draft .bool_gset:N = \g__nju_opt_draft_bool,
draft .initial:n = false,
oneside .value_forbidden:n = true,
twoside .value_forbidden:n = true,
- oneside .bool_gset_inverse:N = \g__nju_twoside_bool,
- blind .value_forbidden:n = true,
- blind .bool_set:N = \g__nju_blind_bool,
+ oneside .bool_gset_inverse:N = \g__nju_opt_twoside_bool,
+ anonymous .bool_set:N = \g__nju_opt_anon_bool,
+ anonymous .initial:n = false,
latin-font .choices:nn =
{ gyre, mac, win, none }
- { \tl_set_eq:NN \g__nju_latin_font_tl \l_keys_choice_tl },
+ { \tl_set_eq:NN \g__nju_font_latin_tl \l_keys_choice_tl },
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
+ { \tl_set_eq:NN \g__nju_font_cjk_tl \l_keys_choice_tl },
+ math-font .choices:nn =
+ {
+ asana, cambria, fira, garamond, lm, libertinus, newcm,
+ stix, bonum, dejavu, pagella, schola, termes, xits, none
+ }
+ { \tl_set_eq:NN \g__nju_font_math_tl \l_keys_choice_tl },
+ math-font .initial:n = xits,
+ font-path .code:n =
+ {
+ \bool_set_true:N \g__nju_font_path_bool
+ \tl_set_eq:NN \g__nju_font_path_tl \l_keys_choice_tl
+ },
+ zihao .tl_set:N = \g__nju_opt_zihao_tl,
+ zihao .initial:n = -4,
+ linespread .tl_set:N = \g__nju_opt_linespread_tl,
+ linespread .initial:n = 1.625,
+ config .clist_set:N = \g__nju_config_clist
}
-\ProcessKeysOptions { nju }
+\clist_new:N \g__nju_name_optional_pkg_clist
+\cs_new_protected:Npn \__nju_define_pkg_keys:nnn #1#2#3
+ {
+ \keys_define:nn { nju }
+ {
+ #1 .bool_gset:c = { g__nju_opt_load_ #2 _bool },
+ #1 .initial:n = #3
+ }
+ \cs_new_protected:cpn { __nju_loadpkg_ #2 : }
+ {
+ \bool_if:cT { g__nju_opt_load_ #2 _bool }
+ { \RequirePackage { #1 } }
+ }
+ \clist_put_right:Nn \g__nju_name_optional_pkg_clist {#1}
+ }
+\clist_map_inline:nn
+ {
+ { biblatex } { blx } { true },
+ { cleveref } { cref } { true },
+ { ntheorem } { nthm } { true },
+ { enumitem } { enit } { true },
+ { footmisc } { fm } { true },
+ { unicode-math } { um } { true }
+ }
+ { \__nju_define_pkg_keys:nnn #1 }
\keys_define:nn { nju }
{
- % abstract .meta:nn = { nju / abstract } { #1 },
- bib .meta:nn = { nju / bib } { #1 },
- % cover .meta:nn = { nju / cover } { #1 },
- % font .meta:nn = { nju / font } { #1 },
- % footer .meta:nn = { nju / footer } { #1 },
- % footnote .meta:nn = { nju / footnote } { #1 },
- % header .meta:nn = { nju / header } { #1 },
- info .meta:nn = { nju / info } { #1 },
- style .meta:nn = { nju / style } { #1 },
- theorem .meta:nn = { nju / theorem } { #1 }
- % toc .meta:nn = { nju / toc } { #1 }
- }
-\NewDocumentCommand \njusetup { m } { \keys_set:nn { nju } { #1 } }
+ minimal .value_forbidden:n = true,
+ minimal .code:n =
+ {
+ \clist_map_inline:Nn \g__nju_name_optional_pkg_clist
+ { \keys_set:nn { nju } { ##1 = false } }
+ \keys_set:nn { nju } { math-font = none }
+ }
+ }
+\ProcessKeysOptions { nju }
+\bool_if:NTF \g__nju_opt_twoside_bool
+ { \tl_const:Nn \c__nju_name_pagemode_tl { twoside } }
+ { \tl_const:Nn \c__nju_name_pagemode_tl { oneside } }
+\clist_map_inline:nn
+ {
+ abstract, bib, image, footer, footnote, header,
+ info, label-sep, listoffigures, listoftables,
+ math, style, theorem, tableofcontents
+ }
+ { \keys_define:nn { nju } { #1 .meta:nn = { nju / #1 } {##1} } }
+\NewDocumentCommand \njusetup { o m }
+ {
+ \tl_if_novalue:nTF { #1 }
+ { \keys_set:nn { nju } { #2 } }
+ {
+ \tl_if_in:nnTF { #1 } { / }
+ { \keys_set:nn { nju } { #1 = {#2} } }
+ { \keys_set:nn { nju / #1 } {#2} }
+ }
+ }
+\@onlypreamble \njusetup
\NewDocumentCommand \njusetformat { m m }
{ \tl_gset:cn { c__nju_fmt_ #1 _tl } { #2 } }
\NewDocumentCommand \njusetlength { s m m }
@@ -482,68 +599,64 @@
{ \__nju_set_tokenlist:nnnnn {#1} {#2} {#3} {#4} { text } }
\cs_new_protected:Npn \__nju_set_tokenlist:nnnnn #1#2#3#4#5
{
- \tl_if_novalue:nTF { #3 }
- { \tl_clear:N \l__nju_tmpa_tl }
- { \tl_set:Nn \l__nju_tmpa_tl { _ #3 } }
- \bool_if:nTF { #1 }
- { \tl_set:Nn \l__nju_tmpb_tl { _en } }
- { \tl_clear:N \l__nju_tmpb_tl }
- \tl_gset:cn { c__nju_ #5 _ #2 \l__nju_tmpa_tl \l__nju_tmpb_tl _tl } {#4}
+ \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}
}
-\PassOptionsToClass
+\exp_args:Nx \PassOptionsToClass
{
a4paper,
UTF8,
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
+ \c__nju_name_pagemode_tl,
+ \bool_if:NT \g__nju_opt_draft_bool { draft, }
+ linespread = \g__nju_opt_linespread_tl,
+ fontset = none,
+ zihao = \g__nju_opt_zihao_tl
}
{ ctexbook }
\clist_map_inline:nn
{
{ no-math } { fontspec },
{ perpage } { footmisc },
- { hyphens } { url },
- { warnings-off={ mathtools-colon, mathtools-overbracket } }
- { unicode-math },
{ capitalise, nameinlink, noabbrev }
{ cleveref }
}
{ \PassOptionsToPackage #1 }
\LoadClass { ctexbook } [ 2018/04/01 ]
+\__nju_loadpkg_enit:
+\__nju_loadpkg_fm:
+\bool_if:NTF \g__nju_opt_load_um_bool
+ { \RequirePackage { unicode-math } }
+ { \RequirePackage { amsmath } }
\RequirePackage
{
geometry,
fancyhdr,
- footmisc,
setspace,
- mathtools,
- unicode-math,
booktabs,
caption,
graphicx,
- enumitem,
- hyperref,
- cleveref
+ hyperref
}
-\bool_if:NT \g__nju_twoside_bool { \RequirePackage{ emptypage } }
+\__nju_loadpkg_cref:
+\bool_if:NT \g__nju_opt_load_nthm_bool
+ {
+ \PassOptionsToPackage { amsmath, thmmarks, noconfig } { ntheorem }
+ \RequirePackage { ntheorem }
+ }
+\bool_if:NT \g__nju_opt_twoside_bool { \RequirePackage { emptypage } }
\sys_if_engine_xetex:T
{
- \RequirePackage{xeCJKfntef}
+ \RequirePackage { xeCJKfntef }
\NewDocumentCommand \njuline { m } { \CJKunderline{#1} }
}
\sys_if_engine_luatex:T
{
- \RequirePackage{lua-ul}
+ \RequirePackage { lua-ul }
\NewDocumentCommand \njuline { m } { \underLine{#1} \null }
}
-\bool_lazy_and:nnT
- { \g__nju_decl_bool }
- { !\int_compare_p:n { \g__nju_info_degree_int == 1 } }
- { \RequirePackage { tabularray } }
\msg_new:nnn { njuthesis } { package-too-old }
{
Package~ "#1"~ is~ too~ old.\\
@@ -559,7 +672,6 @@
}
\sys_if_engine_luatex:T
{ \__nju_check_pkg_version:nnn { luatexja } { 2021/10/24 } { 20211024.0 } }
-\RequirePackage { filehook }
\msg_new:nnn { njuthesis } { package-conflict }
{
The~ "#2"~ package~ is~ incompatible~ with~ "#1".\\
@@ -568,21 +680,30 @@
}
\cs_new_protected:Npn \__nju_check_pkg_conflict:nn #1#2
{
- \AtEndOfPackageFile * { #1 }
+ \ctex_at_begin_package:nn { #2 }
+ { \msg_warning:nnnn { njuthesis } { package-conflict } {#1} {#2} }
+ }
+\bool_if:NT \g__nju_opt_load_um_bool
+ {
+ \clist_map_inline:nn
{
- \AtBeginOfPackageFile * { #2 }
- { \msg_error:nnnn { njuthesis } { package-conflict } {#1} {#2} }
+ amscd, amsfonts, amssymb, bbm, bm, eucal,
+ eufrak, mathrsfs, newtxmath, upgreek
}
+ { \__nju_check_pkg_conflict:nn { unicode-math } { #1 } }
}
-\clist_map_inline:nn
+\exp_args:Nx \file_input:n
{
- amscd, amsfonts, amssymb, bbm, bm, eucal,
- eufrak, mathrsfs, newtxmath, upgreek
+ njuthesis-
+ \int_case:nn { \g__nju_info_type_int }
+ {
+ { 1 } { undergraduate }
+ { 2 } { graduate }
+ { 3 } { graduate }
+ { 4 } { postdoctoral }
+ }
+ .def
}
- { \__nju_check_pkg_conflict:nn { unicode-math } { #1 } }
-\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_map_inline:Nn \g__nju_config_clist
@@ -610,8 +731,8 @@
field* .tl_set:N = \g__nju_info_field_en_tl,
supervisor .clist_set:N = \g__nju_info_supv_clist,
supervisor* .tl_set:N = \g__nju_info_supv_en_tl,
- supervisor-ii .clist_set:N = \g__nju_info_supv_ii_clist,
- supervisor-ii* .tl_set:N = \g__nju_info_supv_ii_en_tl,
+ 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,
@@ -628,126 +749,112 @@
supervisor-contact .tl_set:N = \g__nju_info_supvcont_tl,
email .tl_set:N = \g__nju_info_email_tl
}
+\tl_set:Nx \g__nju_info_type_tl
+ {
+ \clist_item:Nn \c__nju_name_type_clist
+ { \g__nju_info_type_int }
+ }
\tl_set:Nx \g__nju_info_degree_tl
{
+ \g__nju_info_type_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 \g__nju_info_diploma_tl { ug } }
- { \tl_set:Nn \g__nju_info_diploma_tl { g } }
\ctex_at_end_preamble:n
{
- \tl_set:Nx \g__nju_info_type_tl
- { \clist_item:Nn \c__nju_name_type_clist { \g__nju_info_type_int } }
\tl_set:Nx \g__nju_info_type_en_tl
{ \clist_item:Nn \c__nju_name_type_en_clist { \g__nju_info_type_int } }
- \tl_put_left:Nx \g__nju_info_type_tl
- { \tl_use:c { c__nju_name_ \g__nju_info_diploma_tl _tl } }
- \bool_set:Nn \l__nju_second_supv_bool
- { ! \clist_if_empty_p:N \g__nju_info_supv_ii_clist }
+ \bool_set:Nn \l__nju_second_supvbool
+ { ! \clist_if_empty_p:N \g__nju_info_supvii_clist }
\tl_set:Nx \g__nju_info_supvfull_tl
{
\clist_use:Nn \g__nju_info_supv_clist { \__nju_hskip: }
- \bool_if:NT \l__nju_second_supv_bool
+ \bool_if:NT \l__nju_second_supvbool
{
\__nju_quad:
- \clist_use:Nn \g__nju_info_supv_ii_clist { \__nju_hskip: }
+ \clist_use:Nn \g__nju_info_supvii_clist { \__nju_hskip: }
}
}
\tl_set:Nx \g__nju_info_supvfull_en_tl
{
\g__nju_info_supv_en_tl
- \bool_if:NT \l__nju_second_supv_bool
- { \__nju_quad: \g__nju_info_supv_ii_en_tl }
- }
- \__nju_date:n { submit }
- \int_compare:nF { \g__nju_info_degree_int == 1 }
- {
- \__nju_date_en:n { submit }
- \__nju_date:n { defend }
- \bool_if:NT \g__nju_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
- }
- }
+ \bool_if:NT \l__nju_second_supvbool
+ { \__nju_quad: \g__nju_info_supvii_en_tl }
}
}
-\bool_if:NT \g__nju_blind_bool
+\bool_if:NT \g__nju_opt_anon_bool
{
\ctex_at_end_preamble:n
{
- \clist_map_inline:Nn \c__nju_blind_info_clist
+ \clist_map_inline:Nn \c__nju_name_anon_clist
{ \tl_gclear:c { g__nju_info_ #1 _tl } }
- \clist_map_inline:Nn \c__nju_blind_info_en_clist
+ \clist_map_inline:Nn \c__nju_name_anon_en_clist
{ \tl_gclear:c { g__nju_info_ #1 _en_tl } }
- \clist_map_inline:Nn \c__nju_blind_infolist_clist
+ \clist_map_inline:Nn \c__nju_name_anonlist_clist
{ \clist_gclear:c { g__nju_info_ #1 _clist } }
\tl_gclear:N \c__nju_name_nju_tl
\tl_gclear:N \c__nju_name_nju_en_tl
}
}
\bool_lazy_or:nnT
- { \tl_if_empty_p:N \g__nju_latin_font_tl }
- { \tl_if_empty_p:N \g__nju_cjk_font_tl }
+ { \tl_if_empty_p:N \g__nju_font_latin_tl }
+ { \tl_if_empty_p:N \g__nju_font_cjk_tl }
{
\sys_if_platform_windows:TF
{
- \tl_set:Nn \g__nju_latin_font_tl { win }
- \tl_set:Nn \g__nju_cjk_font_tl { win }
+ \tl_set:Nn \g__nju_font_latin_tl { win }
+ \tl_set:Nn \g__nju_font_cjk_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_font_latin_tl { mac }
+ \tl_set:Nn \g__nju_font_cjk_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_font_latin_tl { gyre }
+ \tl_set:Nn \g__nju_font_cjk_tl { fandol }
}
}
}
-\cs_new_protected:Npn \__nju_load_latin_font_win:
+\cs_new_protected:Npn \__nju_loadfont_latin_win:
{
- \setmainfont { Times~New~Roman }
- \setsansfont { Arial }
- \setmonofont { Courier~New }
- [ Scale = MatchLowercase ]
+ \__fontspec_main_setmainfont:nn { } { Times~New~Roman }
+ \__fontspec_main_setsansfont:nn { } { Arial }
+ \__fontspec_main_setmonofont:nn
+ { Scale = MatchLowercase }
+ { Courier~New }
}
-\cs_new_protected:Npn \__nju_load_latin_font_mac:
+\cs_new_protected:Npn \__nju_loadfont_latin_mac:
{
- \setmainfont { Times~New~Roman }
- \setsansfont { Arial }
- \setmonofont { Menlo }
- [ Scale = MatchLowercase ]
+ \__fontspec_main_setmainfont:nn { } { Times~New~Roman }
+ \__fontspec_main_setsansfont:nn { } { Arial }
+ \__fontspec_main_setmonofont:nn
+ { Scale = MatchLowercase }
+ { Menlo }
}
-\cs_new_protected:Npn \__nju_load_latin_font_gyre:
+\cs_new_protected:Npn \__nju_loadfont_latin_gyre:
{
- \setmainfont { texgyretermes }
- [
+ \__fontspec_main_setmainfont:nn
+ {
Extension = .otf,
UprightFont = *-regular,
BoldFont = *-bold,
ItalicFont = *-italic,
BoldItalicFont = *-bolditalic
- ]
- \setsansfont { texgyreheros }
- [
+ }
+ { texgyretermes }
+ \__fontspec_main_setsansfont:nn
+ {
Extension = .otf,
UprightFont = *-regular,
BoldFont = *-bold,
ItalicFont = *-italic,
BoldItalicFont = *-bolditalic
- ]
- \setmonofont { texgyrecursor }
- [
+ }
+ { texgyreheros }
+ \__fontspec_main_setmonofont:nn
+ {
Extension = .otf,
UprightFont = *-regular,
BoldFont = *-bold,
@@ -755,11 +862,12 @@
BoldItalicFont = *-bolditalic,
Scale = MatchLowercase,
Ligatures = CommonOff
- ]
+ }
+ { texgyrecursor }
}
\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:
+\cs_new_protected:Npn \__nju_loadfont_cjk_win:
{
\setCJKmainfont { SimSun }
[ AutoFakeBold = 2.17, ItalicFont = KaiTi ]
@@ -770,7 +878,7 @@
\setCJKfamilyfont { zhfs } { FangSong } [ AutoFakeBold = 2.17 ]
\setCJKfamilyfont { zhkai } { KaiTi } [ AutoFakeBold = 2.17 ]
}
-\cs_new_protected:Npn \__nju_load_cjk_font_mac:
+\cs_new_protected:Npn \__nju_loadfont_cjk_mac:
{
\__nju_hide_no_script_msg:
\setCJKmainfont{Songti~SC~Light}[
@@ -785,7 +893,7 @@
\setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
\setCJKfamilyfont{zhnewhei}{PingFang~SC}
}
-\cs_new_protected:Npn \__nju_load_cjk_font_fandol:
+\cs_new_protected:Npn \__nju_loadfont_cjk_fandol:
{
\__nju_hide_no_script_msg:
\setCJKmainfont { FandolSong-Regular }
@@ -819,7 +927,7 @@
AutoFakeBold = 2.17
]
}
-\cs_new_protected:Npn \__nju_load_cjk_font_founder:
+\cs_new_protected:Npn \__nju_loadfont_cjk_founder:
{
\sys_if_engine_xetex:T
{ \xeCJKEditPunctStyle {quanjiao} { optimize-kerning = true } }
@@ -838,7 +946,7 @@
\setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
\defaultCJKfontfeatures{}
}
-\cs_new_protected:Npn \__nju_load_cjk_font_noto:
+\cs_new_protected:Npn \__nju_loadfont_cjk_noto:
{
\setCJKmainfont
[
@@ -865,7 +973,7 @@
\setCJKfamilyfont { zhkai } { FZKai-Z03 }
[AutoFakeBold=2.17]
}
-\cs_new_protected:Npn \__nju_load_cjk_font_source:
+\cs_new_protected:Npn \__nju_loadfont_cjk_source:
{
\setCJKmainfont
[
@@ -892,66 +1000,145 @@
\setCJKfamilyfont { zhkai } { FZKai-Z03 }
[AutoFakeBold=2.17]
}
-\cs_new_protected:Npn \__nju_load_math_font:
+\cs_new:Npn \__nju_define_math_font:nn #1#2
{
- % \setmathfont{STIXTwoMath-Regular}[Extension = .otf]
- \setmathfont{XITSMath-Regular}[
- BoldFont = XITSMath-Bold,
- Extension = .otf]
- \setmathfont{NewCMMath-Regular.otf}[range={cal,bb,frak}]
- \setmathfont{NewCMMath-Regular.otf}[version=bold,range={bfcal}]
+ \cs_new:cpn { __nju_loadfont_math_ #1 : }
+ { \__um_setmathfont:nn { } { #2 } }
}
-\cs_new_protected:Npn \__nju_load_font:
+\clist_map_inline:nn
{
- \use:c { __nju_load_latin_font_ \g__nju_latin_font_tl : }
- \use:c { __nju_load_cjk_font_ \g__nju_cjk_font_tl : }
- \__nju_load_math_font:
+ { asana } { Asana-Math.otf },
+ { fira } { FiraMath-Regular.otf },
+ { garamond } { Garamond-Math.otf },
+ { lm } { latinmodern-math.otf },
+ { libertinus } { LibertinusMath-Regular.otf },
+ { stix } { STIXMath-Regular.otf },
+ { bonum } { texgyrebonum-math.otf },
+ { dejavu } { texgyredejavu-math.otf },
+ { pagella } { texgyrepagella-math.otf },
+ { schola } { texgyreschola-math.otf },
+ { termes } { texgyretermes-math.otf }
+ }
+ { \__nju_define_math_font:nn #1 }
+\cs_new:Npn \__nju_loadfont_math_cambria:
+ {
+ \bool_if:NTF \g__nju_font_path_bool
+ {
+ \__um_setmathfont:nn
+ { Path = \g__nju_font_path_tl/, FontIndex = 1 }
+ { cambria.ttc }
+ }
+ { \__um_setmathfont:nn { } { Cambria~Math } }
+ }
+\cs_new:Npn \__nju_loadfont_math_xits:
+ {
+ \bool_if:NTF \g__nju_opt_math_int_bool
+ { \tl_set:Nn \l__nju_tmpa_tl { 8 } }
+ { \tl_clear:N \l__nju_tmpa_tl }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = \l__nju_tmpa_tl,
+ BoldFont = XITSMath-Bold
+ }
+ { XITSMath-Regular }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = 1,
+ range = {cal,bfcal}
+ }
+ { XITSMath-Regular }
+ }
+\cs_new:Npn \__nju_loadfont_math_newcm:
+ {
+ \bool_if:NTF \g__nju_opt_math_int_bool
+ { \tl_set:Nn \l__nju_tmpa_tl { 2 } }
+ { \tl_clear:N \l__nju_tmpa_tl }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = \l__nju_tmpa_tl
+ }
+ { NewCMMath-Book }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = 1,
+ range = {scr,bfscr}
+ }
+ { NewCMMath-Book }
+ \__fontspec_main_setmathrm:nn
+ {
+ Extension = .otf,
+ UprightFont = *-Book,
+ BoldFont = *-Bold,
+ ItalicFont = *-BookItalic,
+ BoldItalicFont = *-BoldItalic
+ }
+ { NewCM10 }
+ \__fontspec_main_setmathsf:nn
+ {
+ Extension = .otf,
+ UprightFont = *-Book,
+ BoldFont = *-Bold,
+ ItalicFont = *-BookOblique,
+ BoldItalicFont = *-BoldOblique
+ }
+ { NewCMSans10 }
+ \__fontspec_main_setmathtt:nn
+ {
+ Extension = .otf,
+ UprightFont = *-Book,
+ ItalicFont = *-BookItalic,
+ BoldFont = *-Bold,
+ BoldItalicFont = *-BoldOblique
+ }
+ { NewCMMono10 }
+ }
+\cs_new:Npn \__nju_loadfont_math_none: { }
+\cs_new_protected:Npn \__nju_loadfont:
+ {
+ \use:c { __nju_loadfont_latin_ \g__nju_font_latin_tl : }
+ \use:c { __nju_loadfont_cjk_ \g__nju_font_cjk_tl : }
\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
- \RenewDocumentCommand \large { } { \zihao { 4 } }
+ \NewDocumentCommand \bigger { } { \ctex_zihao:n { 4 } }
}
-\__nju_load_font:
+\__nju_loadfont:
\geometry
{
vmargin = 2.5 cm,
hmargin = 3.2 cm,
headheight = 15 pt
}
-\bool_if:NT \g__nju_draft_bool { \geometry { showframe } }
-\keys_define:nn { nju / style }
+\bool_if:NT \g__nju_opt_draft_bool { \geometry { showframe } }
+\keys_define:nn { nju / header }
{
- header/format .tl_gset:N = \c__nju_fmt_header_tl,
- 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 = \c__nju_fmt_footer_tl,
- 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 } }
+ content .clist_gset:N = \g__nju_header_twoside_clist,
+ content* .clist_gset:N = \g__nju_header_oneside_clist,
+ content .initial:n =
+ { { EL } { \leftmark }, { OR } { \rightmark } },
+ content* .initial:n =
+ { { L } { \leftmark }, { R } { \rightmark } }
+ }
+\keys_define:nn { nju / footer }
+ {
+ content .clist_gset:N = \g__nju_footer_twoside_clist,
+ content* .clist_gset:N = \g__nju_footer_oneside_clist,
+ content .initial:n = { { C } { \thepage } },
+ content* .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
- }
+ \clist_set_eq:Nc \g__nju_header_clist
+ { g__nju_header_ \c__nju_name_pagemode_tl _clist }
+ \clist_set_eq:Nc \g__nju_footer_clist
+ { g__nju_footer_ \c__nju_name_pagemode_tl _clist }
}
\cs_new_protected:Npn \__nju_header:nn #1#2
{ \fancyhead [#1] { \c__nju_fmt_header_tl \nouppercase {#2} } }
@@ -998,27 +1185,42 @@
\exp_args:NV \pagestyle \c__nju_fmt_pagestyle_tl
\pagenumbering { Roman }
}
-\cs_new_protected:Npn \__nju_add_tocline:n #1
+\cs_new:Npn \__nju_bookmark_toc:n #1
{ \addcontentsline { toc } { chapter } { \c__nju_fmt_chapterintoc_tl #1 } }
-\cs_generate_variant:Nn \__nju_add_tocline:n { V }
-\cs_new_protected:Npn \__nju_chapter:n #1
- {
- \chapter * { #1 }
- \__nju_add_tocline:n { #1 }
- \__nju_chapter_header:n { #1 }
- }
-\cs_generate_variant:Nn \__nju_chapter:n { V }
+\cs_generate_variant:Nn \__nju_bookmark_toc:n { V }
+\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 } }
+\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 } }
+ }
+\cs_new:Npn \__nju_chapter:Nnn #1#2#3
+ {
+ \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} { } }
+\cs_generate_variant:Nn \__nju_chapter:Nnn { cnn }
+\cs_generate_variant:Nn \__nju_chapter:n { V }
\cs_new_protected:Npn \__nju_chapter_header:n #1
{
- \bool_if:NTF \g__nju_twoside_bool
+ \bool_if:NTF \g__nju_opt_twoside_bool
{ \markboth { #1 } { #1 } }
{ \markboth { \hfill #1 \hfill } { } }
}
\NewDocumentCommand \njuchapter { m } { \__nju_chapter:n { #1 } }
\keys_set:nn { ctex }
{
- chapter / beforeskip = 10 pt,
- chapter / afterskip = 60 pt,
+ chapter / beforeskip = \c__nju_chapterbefore_dim,
+ chapter / afterskip = \c__nju_chapterafter_dim,
chapter / format = \c__nju_fmt_chapter_tl,
section / format = \c__nju_fmt_section_tl,
subsection / format = \c__nju_fmt_subsection_tl,
@@ -1028,37 +1230,58 @@
contentsname = \c__nju_name_tableofcontents_tl,
listfigurename = \c__nju_name_listoffigures_tl,
listtablename = \c__nju_name_listoftables_tl,
- chapter / tocline = \c__nju_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2
- }
-\keys_define:nn { nju / style }
- {
- toc-in-toc .bool_gset:N = \g__nju_toc_in_toc_bool,
- toc-in-toc .initial:n = true
+ chapter / tocline = \c__nju_fmt_chapterintoc_tl \CTEXnumberline {#1} #2
}
\cs_new_protected:Npn \__nju_make_toc:nn #1#2
{
\group_begin:
\keys_set:nn { ctex }
{ chapter/format = \c__nju_fmt_toctitle_tl }
- \bool_if:NTF \g__nju_toc_in_toc_bool
- { \__nju_chapter:n { #1 } }
- {
- \chapter * { #1 }
- \pdfbookmark [0] { #1 } { #2 }
- \__nju_chapter_header:n { #1 }
- }
+ \__nju_chapter:cnn { g__nju_ #2 _showentry_bool } {#1} {#2}
\group_end:
\@starttoc { #2 }
}
-\cs_generate_variant:Nn \__nju_make_toc:nn { Vn }
-\RenewDocumentCommand \tableofcontents { }
- { \__nju_make_toc:Vn \contentsname { toc } }
-\RenewDocumentCommand \listoffigures { }
- { \__nju_make_toc:Vn \listfigurename { lof } }
-\RenewDocumentCommand \listoftables { }
- { \__nju_make_toc:Vn \listtablename { lot } }
-\clist_new:N \g__nju_biblatex_option_clist
-\clist_new:N \g__nju_bib_resource_clist
+\cs_generate_variant:Nn \__nju_make_toc:nn { vn }
+\cs_new_protected:Npn \__nju_define_toc_cmd:nnn #1#2#3
+ {
+ \keys_define:nn { nju / #1 }
+ {
+ 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 } }
+ }
+\clist_map_inline:nn
+ {
+ { tableofcontents } { contents } { toc },
+ { listoffigures } { listfigure } { lof },
+ { listoftables } { listtable } { lot }
+ }
+ { \__nju_define_toc_cmd:nnn #1 }
+\ctex_at_end_preamble:n
+ {
+ \bool_if:NF \g__nju_toc_showentry_bool
+ {
+ \bool_set_false:N \g__nju_lof_showentry_bool
+ \bool_set_false:N \g__nju_lot_showentry_bool
+ }
+ }
+\keys_define:nn { nju / tableofcontents }
+ {
+ dotline .choice:,
+ dotline / chapter .code:n =
+ {
+ \cs_set_protected_nopar:Npn \l@chapter
+ {
+ \skip_vertical:N 1.0 em \@plus \p@ \scan_stop:
+ \@dottedtocline { \z@ } { \z@ } { 1.5 em }
+ }
+ },
+ dotline / section .code:n = { }
+ }
+\clist_new:N \g__nju_blx_option_clist
+\clist_new:N \g__nju_blx_resource_clist
\msg_new:nnn { njuthesis } { extra-bib-style }
{
Wrongly-placed~ bib~ style.\\
@@ -1069,66 +1292,69 @@
style .choice:,
style / numeric .code:n =
{
- \clist_gput_right:Nn \g__nju_biblatex_option_clist
+ \clist_gput_right:Nn \g__nju_blx_option_clist
{ style = gb7714-2015 }
},
style / author-year .code:n =
{
- \clist_gput_right:Nn \g__nju_biblatex_option_clist
+ \clist_gput_right:Nn \g__nju_blx_option_clist
{ style = gb7714-2015ay }
},
style / unknown .code:n =
- {
- \clist_gput_right:Nx \g__nju_biblatex_option_clist
- { style = \l_keys_value_tl }
- },
+ { \clist_gput_right:Nn \g__nju_blx_option_clist { style = #1 } },
style .initial:n = numeric,
option .code:n =
{
\tl_if_in:VnTF \l_keys_value_tl { style = }
{ \msg_error:nn { njuthesis } { extra-bib-style } }
{
- \clist_gput_right:NV \g__nju_biblatex_option_clist
+ \clist_gput_right:NV \g__nju_blx_option_clist
\l_keys_value_tl
}
},
resource .code:n =
{
- \clist_gput_right:NV \g__nju_bib_resource_clist
+ \clist_gput_right:NV \g__nju_blx_resource_clist
\l_keys_value_tl
},
}
-\NewDocumentCommand \addbibresource { m }
- { \clist_gput_right:Nn \g__nju_bib_resource_clist { #1 } }
-\cs_new_protected:Npn \__nju_biblatex_pre_setup:
+\bool_if:NT \g__nju_opt_load_blx_bool
+ {
+ \NewDocumentCommand \addbibresource { m }
+ { \clist_gput_right:Nn \g__nju_blx_resource_clist { #1 } }
+ }
+\cs_new_protected:Npn \__nju_blx_pre_setup:
{
\cs_undefine:N \addbibresource
- \clist_gput_right:Nn \g__nju_biblatex_option_clist { backend = biber }
+ \clist_gput_right:Nn \g__nju_blx_option_clist { backend = biber }
\exp_args:NV \PassOptionsToPackage
- \g__nju_biblatex_option_clist { biblatex }
+ \g__nju_blx_option_clist { biblatex }
}
-\cs_new_protected:Npn \__nju_biblatex_post_setup:
+\cs_new_protected:Npn \__nju_blx_post_setup:
{
\defbibheading { njubibintoc } [ \bibname ] { \__nju_chapter:n { ##1 } }
\tl_if_eq:NnTF \blx@refsecreset@level { 2 }
{ \DeclarePrintbibliographyDefaults { heading = subbibintoc } }
{ \DeclarePrintbibliographyDefaults { heading = njubibintoc } }
- \clist_map_inline:Nn \g__nju_bib_resource_clist
+ \clist_map_inline:Nn \g__nju_blx_resource_clist
{ \addbibresource { ##1 } }
}
\BeforeBeginEnvironment { document }
{
- \__nju_biblatex_pre_setup:
- \RequirePackage { biblatex }
- \__nju_biblatex_post_setup:
+ \bool_if:NT \g__nju_opt_load_blx_bool
+ {
+ \__nju_blx_pre_setup:
+ \RequirePackage { biblatex }
+ \__nju_blx_post_setup:
+ }
}
\ctex_at_end_preamble:n
{
\pdfstringdefDisableCommands
{
- \cs_set_eq:NN \\ \prg_do_nothing:
- \cs_set_eq:NN \quad \prg_do_nothing:
- \cs_set_eq:NN \qquad \prg_do_nothing:
+ \clist_map_inline:nn
+ { \\, \quad, \qquad, \bigger }
+ { \__nju_cs_clear:N #1 }
}
\hypersetup
{
@@ -1143,28 +1369,24 @@
}
}
\cs_new_protected:Npn \__nju_cref_name:n #1
- {
- \clist_map_inline:nn { #1 }
+ { \crefname {#1} { \__nju_name:n {#1} } { \__nju_name:n {#1} } }
+\bool_if:NT \g__nju_opt_load_cref_bool
+ {
+ \crefdefaultlabelformat { #2#1#3\, }
+ \crefformat { equation } { 公式~#2#1#3~ }
+ \crefformat { chapter } { 第#2#1#3章 }
+ \crefformat { section } { 第~#2#1#3~节 }
+ \crefformat { subsection } { 第~#2#1#3~小节 }
+ \crefformat { subsubsection } { 第~#2#1#3~小节 }
+ \clist_map_inline:nn { figure, table, appendix, proof }
+ { \__nju_cref_name:n { #1 } }
+ }
+\tl_new:N \g__nju_fn_style_tl
+\keys_define:nn { nju / footnote }
+ {
+ style .choices:nn = { plain, pifont }
{
- \crefname { ##1 }
- { \__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章 }
-\crefformat { section } { 第~#2#1#3~节 }
-\crefformat { subsection } { 第~#2#1#3~小节 }
-\crefformat { subsubsection } { 第~#2#1#3~小节 }
-\__nju_cref_name:n { figure, table, appendix, proof }
-\__nju_cref_name:V \g__nju_theorem_type_clist
-\tl_new:N \l__nju_fn_style_tl
-\keys_define:nn { nju / style }
- {
- footnote-style .choices:nn = { plain, pifont }
- {
- \tl_gset_eq:NN \l__nju_fn_style_tl \l_keys_choice_tl
+ \tl_gset_eq:NN \g__nju_fn_style_tl \l_keys_choice_tl
\int_compare:nT { \l_keys_choice_int = 2 }
{ \RequirePackage { pifont } }
}
@@ -1175,7 +1397,7 @@
\tl_const:Nn \c__nju_fn_style_pifont_tl { pifont }
\cs_new:Npn \__nju_footnote_number:N #1
{
- \tl_case:NnF \l__nju_fn_style_tl
+ \tl_case:NnF \g__nju_fn_style_tl
{
\c__nju_fn_style_plain_tl
{ \int_use:N #1 }
@@ -1184,15 +1406,39 @@
}
{ \int_use:N #1 }
}
-\cs_set:Npn \thefootnote { \__nju_footnote_number:N \c@footnote }
-\cs_set:Npn \@makefntext #1
+\bool_if:NT \g__nju_opt_load_fm_bool
{
- \mode_leave_vertical:
- \hbox_to_wd:nn { 1.5 em } { \@thefnmark \hfil }
- #1
+ \cs_set:Npn \thefootnote { \__nju_footnote_number:N \c@footnote }
+ \cs_set:Npn \@makefntext #1
+ {
+ \mode_leave_vertical:
+ \hbox_to_wd:nn { 1.5 em } { \@thefnmark \tex_hfil:D }
+ #1
+ }
}
+\keys_define:nn { nju / image } { path .code:n = { \graphicspath {#1} } }
\DeclareGraphicsExtensions { .pdf, .eps, .jpg, .png }
\BeforeBeginEnvironment { tabular } { \centering \zihao {5} }
+\ctex_at_end_package:nn { tabularray }
+ {
+ \__tblr_use_lib_booktabs:
+ \tl_set:Nn \l__nju_tmpb_tl
+ { , abovesep = 4 pt, stretch = 0.8, cells = { font = \small } }
+ \tl_put_right:NV \l__tblr_default_tblr_inner_tl \l__nju_tmpb_tl
+ \tl_put_right:NV \l__tblr_default_talltblr_inner_tl \l__nju_tmpb_tl
+ \tl_put_right:Nn \l__tblr_default_talltblr_outer_tl { , headsep = -4 pt }
+ \DefTblrTemplate { caption-tag } { default }
+ { \c__nju_name_table_tl \hspace { 0.25em } \thetable }
+ \DefTblrTemplate { caption-sep } { default } { \quad }
+ \DefTblrTemplate { firsthead } { caption }
+ {
+ \makebox [ \tablewidth ]
+ { \parbox { \columnwidth } { \UseTblrTemplate {caption} {normal} } }
+ }
+ \SetTblrTemplate { firsthead } { caption }
+ \SetTblrStyle { caption } { font = \normalfont \bfseries \small }
+ \SetTblrStyle { note } { font = \normalfont \footnotesize }
+ }
\DeclareCaptionStyle{njucap}
{
font = small,
@@ -1202,62 +1448,214 @@
}
\captionsetup [ figure ] { style = njucap }
\captionsetup [ table ] { style = njucap }
-\setlist { noitemsep }
+\cs_generate_variant:Nn \ctex_patch_cmd:Nnn { cnv }
+\clist_map_inline:nn { figure, table, equation }
+ {
+ \keys_define:nn { nju / label-sep }
+ {
+ #1 .tl_set:c = { g__nju_sep_ #1 _tl },
+ #1 .initial:n = { - }
+ }
+ \__nju_at_begin_document:n
+ { \ctex_patch_cmd:cnv { the #1 } {.} { g__nju_sep_ #1 _tl } }
+ }
+\bool_if:NT \g__nju_opt_load_enit_bool { \setlist { noitemsep } }
+\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} } } }
\keys_define:nn { nju / theorem }
{
- predefine .bool_set:N = \g__nju_thm_predefine_bool,
- style .tl_set:N = \l__nju_thm_style_tl,
- header-font .tl_set:N = \l__nju_thm_header_font_tl,
- body-font .tl_set:N = \l__nju_thm_body_font_tl,
- qed-symbol .tl_set:N = \l__nju_thm_qed_symbol_tl,
- counter .tl_set:N = \l__nju_thm_counter_tl,
- predefine .initial:n = true,
- style .initial:n = plain,
- header-font .initial:n = \normalfont \bfseries,
- body-font .initial:n = \itshape,
- qed-symbol .initial:n = \ensuremath { \mdwhtsquare },
- counter .initial:n = chapter
+ style .tl_set:N = \l__nju_thm_style_tl,
+ header-font .tl_set:N = \l__nju_thm_header_font_tl,
+ body-font .tl_set:N = \l__nju_thm_body_font_tl,
+ qed-symbol .tl_set:N = \l__nju_thm_qed_symbol_tl,
+ counter .tl_set:N = \l__nju_thm_counter_tl,
+ style .initial:n = plain,
+ header-font .initial:n = \normalfont \bfseries,
+ body-font .initial:n = \itshape,
+ qed-symbol .initial:V = \c__nju_name_qed_tl,
+ counter .initial:n = chapter,
+ type .clist_set:N = \g__nju_thm_type_clist,
+ define .value_forbidden:n = true,
+ define .code:n =
+ {
+ \clist_if_empty:NT \g__nju_thm_type_clist
+ { \msg_error:nn { njuthesis } { empty-theorem-type } }
+ \clist_map_inline:Nn \g__nju_thm_type_clist
+ { \__nju_thm_define:nn ##1 }
+ }
+ }
+\msg_new:nnn { njuthesis } { empty-theorem-type }
+ {
+ Empty~ theorem~ list~ to~ define.\\
+ The~ key~ "theorem/type"~ should~ not~ be~ set~ empty.
}
-\cs_new_protected:Npn \__nju_new_theorem:Nn #1#2
+\msg_new:nnn { njuthesis } { missing-ntheorem }
{
- \clist_map_inline:Nn #1
- { \newtheorem { ##1 } { \__nju_name:n { ##1 } } [#2] }
+ "ntheorem"~ package~ not~ detected.\\
+ The~ functionality~ of~ built-in~ theorem~ settings~ require~
+ loading~ the~ class~ with~ "ntheorem"~ option~ set~ to~ "true".
}
-\cs_generate_variant:Nn \__nju_new_theorem:Nn { NV }
-\cs_new_protected:Npn \__nju_ntheorem_post_setup:
+\cs_new_protected:Npn \__nju_thm_define:nn #1#2
{
+ \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
- \exp_args:NV \theoremsymbol \l__nju_thm_qed_symbol_tl
- \newtheorem* { proof } { \c__nju_name_proof_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 { + }
+ { \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} }
+ \bool_if:NT \g__nju_opt_load_cref_bool
+ { \crefname { \l__nju_tmpa_tl } {#2} {#2} }
\theoremsymbol { }
+ }
+\cs_new_protected:Npn \__nju_thm_new:nnn #1#2#3
+ {
\group_begin:
- \clist_remove_all:Nn \g__nju_theorem_type_clist { proof }
- \__nju_new_theorem:NV \g__nju_theorem_type_clist \l__nju_thm_counter_tl
+ \cs_if_exist:cT { end #1 }
+ { \cs_set_eq:NN \newtheorem \renewtheorem }
+ \tl_if_novalue:nTF {#2}
+ { \newtheorem * {#1} {#3} }
+ { \newtheorem {#1} {#3} [#2] }
\group_end:
}
-\ctex_at_end_preamble:n
+\cs_generate_variant:Nn \__nju_thm_new:nnn { VVn }
+\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
+\bool_new:N \g__nju_opt_math_vec_bool
+\bool_if:NTF \g__nju_opt_load_um_bool
+ { \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 { } }
+\keys_define:nn { nju / math }
+ {
+ integral .choice:,
+ integral / upright .code:n =
+ { \bool_set_true:N \g__nju_opt_math_int_bool },
+ integral / slanted .code:n =
+ { \bool_set_false:N \g__nju_opt_math_int_bool },
+ integral-limits .choice:,
+ integral-limits / true .code:n =
+ { \tl_clear:N \l__um_nolimits_tl },
+ integral-limits / false .code:n =
+ { \tl_set_eq:NN \l__um_nolimits_tl \c__nju_name_integral_tl },
+ less-than-or-equal .choice:,
+ less-than-or-equal / slanted .code:n =
+ { \bool_set_true:N \g__nju_opt_math_leq_bool },
+ less-than-or-equal / horizontal .code:n =
+ { \bool_set_false:N \g__nju_opt_math_leq_bool },
+ math-ellipsis .choice:,
+ math-ellipsis / centered .code:n =
+ {
+ \DeclareRobustCommand \mathellipsis
+ { \mathinner { \unicodecdots } }
+ },
+ math-ellipsis / lower .code:n =
+ {
+ \DeclareRobustCommand \mathellipsis
+ { \mathinner { \unicodeellipsis } }
+ },
+ partial .choices:nn =
+ { upright, italic } { \__nju_um_setup:n { partial = #1 } },
+ real-part .choice:,
+ real-part / roman .code:n =
+ { \bool_set_true:N \g__nju_opt_math_re_bool },
+ real-part / fraktur .code:n =
+ { \bool_set_false:N \g__nju_opt_math_re_bool },
+ vector .choice:,
+ vector / boldfont .code:n =
+ { \bool_set_true:N \g__nju_opt_math_vec_bool },
+ vector / arrow .code:n =
+ { \bool_set_false:N \g__nju_opt_math_vec_bool },
+ uppercase-greek .choice:,
+ uppercase-greek / upright .code:n =
+ { \__nju_um_setup:n { math-style = ISO } },
+ uppercase-greek / italic .code:n =
+ { \__nju_um_setup:n { math-style = TeX } },
+ style .choice:,
+ style / TeX .code:n =
+ {
+ \keys_set:nn { nju / math }
+ {
+ integral = slanted,
+ integral-limits = false,
+ less-than-or-equal = horizontal,
+ math-ellipsis = centered,
+ partial = italic,
+ real-part = fraktur,
+ vector = arrow,
+ uppercase-greek = upright
+ }
+ \__nju_um_setup:n { bold-style = TeX }
+ },
+ style / ISO .code:n =
+ {
+ \keys_set:nn { nju / math }
+ {
+ integral = upright,
+ integral-limits = true,
+ less-than-or-equal = horizontal,
+ math-ellipsis = lower,
+ partial = upright,
+ real-part = roman,
+ vector = arrow,
+ uppercase-greek = italic
+ }
+ \__nju_um_setup:n { bold-style = ISO }
+ },
+ style / GB .code:n =
+ {
+ \keys_set:nn { nju / math }
+ {
+ integral = upright,
+ integral-limits = false,
+ less-than-or-equal = slanted,
+ math-ellipsis = centered,
+ partial = upright,
+ real-part = roman,
+ vector = boldfont,
+ uppercase-greek = italic
+ }
+ \__nju_um_setup:n { bold-style = ISO }
+ },
+ style .initial:n = GB
+ }
+\__nju_at_begin_document:n
{
- \bool_if:NT \g__nju_thm_predefine_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 \leslant
+ \cs_set_eq:NN \ge \geslant
+ \cs_set_eq:NN \leq \leqslant
+ \cs_set_eq:NN \geq \geqslant
+ }
+ \bool_if:NT \g__nju_opt_math_re_bool
{
- \PassOptionsToPackage { amsmath, thmmarks } { ntheorem }
- \RequirePackage { ntheorem }
- \__nju_ntheorem_post_setup:
+ \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 }
}
\cs_new_protected:Npn \__nju_new_img_cmd:nn #1#2
{
- \exp_args:Nc \NewDocumentCommand { #1 } { o m m }
+ \exp_args:Nc \NewDocumentCommand { nju #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 }
+\keys_define:nn { nju / image }
{
- 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 }
+ nju-emblem .code:n = { \__nju_new_img_cmd:nn { emblem } {#1} },
+ nju-name .code:n = { \__nju_new_img_cmd:nn { name } {#1} }
}
\msg_new:nnn { njuthesis } { missing-image }
{
@@ -1278,33 +1676,28 @@
\msg_warning:nn { njuthesis } { missing-image }
\RequirePackage { njuvisual }
}
- \bool_if:NT \g__nju_blind_bool
+ \bool_if:NT \g__nju_opt_anon_bool
{
- \RenewDocumentCommand \njuemblem { o m m } { \prg_do_nothing: }
- \RenewDocumentCommand \njuname { o m m } { \prg_do_nothing: }
+ \RenewDocumentCommand \njuemblem { o m m } { }
+ \RenewDocumentCommand \njuname { o m m } { }
}
}
\RenewDocumentCommand \maketitle { }
{
- \bool_if:NF \g__nju_draft_bool
+ \bool_if:NF \g__nju_opt_draft_bool
{
\pagenumbering { gobble }
- \bool_if:NTF \g__nju_nlcover_bool
+ \bool_if:NTF \g__nju_opt_nlcover_bool
{ \__nju_make_cover_nl: }
{ \__nju_make_cover: }
}
\tl_remove_all:Nn \g__nju_info_title_tl { \\ }
- \bool_if:NF \g__nju_draft_bool
+ \bool_if:NF \g__nju_opt_draft_bool
{
- \bool_if:NT \g__nju_decl_bool
+ \bool_if:NT \g__nju_opt_decl_bool
{
- \__nju_make_origdecl:
- \AtEndEnvironment { document }
- {
- \cleardoublepage
- \__nju_make_authdecl:
- \cleardoublepage
- }
+ \__nju_make_decl_i:
+ \__nju_make_decl_ii:
}
}
\cleardoublepage
@@ -1314,9 +1707,11 @@
\cs_new_protected:Npn \__nju_print_keywords:nn #1#2
{
\tl_set:Nv \l__nju_tmpa_tl { c__nju_name_keywords #1 _tl }
- \__nju_get_text_width:NV \l__nju_tmpa_dim \l__nju_tmpa_tl
- \dim_add:Nn \l__nju_tmpa_dim { 1 em }
- \exp_args:NNv \tl_put_right:Nn \l__nju_tmpa_tl { c__nju_name_comma #1 _tl }
+ \exp_args:NNv \tl_put_left:Nn
+ \l__nju_tmpa_tl { c__nju_fmt_abslabel #1 _tl }
+ \exp_args:NNv \tl_put_right:Nn
+ \l__nju_tmpa_tl { c__nju_name_colon #1 _tl }
+ \__nju_get_width:NV \l__nju_tmpa_dim \l__nju_tmpa_tl
\list { \l__nju_tmpa_tl }
{
\labelwidth \l__nju_tmpa_dim
@@ -1324,39 +1719,39 @@
\leftmargin \c_zero_dim
\rightmargin \c_zero_dim
\advance \leftmargin \l__nju_tmpa_dim
- \cs_set_eq:NN \makelabel \textbf
+ \__nju_cs_clear:N \makelabel
}
\item \clist_use:cn { g__nju_info_keywords #1 _clist } { #2 }
\endlist
}
\skip_new:N \g__nju_abs_title_left_skip
-\keys_define:nn { nju / style }
+\keys_define:nn { nju / abstract }
{
- abstract-in-toc .bool_gset:N = \g__nju_abs_in_toc_bool,
- abstract-in-toc .initial:n = true,
- abstract-title .choice:,
- abstract-title / strict .code:n =
+ toc-entry .bool_set:N = \g__nju_abs_showentry_bool,
+ toc-entry .initial:n = true,
+ title-style .choice:,
+ title-style / strict .code:n =
{
- \bool_gset_true:N \g__nju_strict_abs_title_bool
- \skip_gset:Nn \g__nju_abs_title_left_skip { 1 em }
+ \bool_set_true:N \g__nju_abs_title_strict_bool
+ \skip_set:Nn \g__nju_abs_title_left_skip { .5 em }
},
- abstract-title / centered .code:n =
+ title-style / centered .code:n =
{
- \bool_gset_true:N \g__nju_strict_abs_title_bool
- \skip_gset:Nn \g__nju_abs_title_left_skip { 0 pt plus 1 fill }
+ \bool_set_true:N \g__nju_abs_title_strict_bool
+ \skip_set:Nn \g__nju_abs_title_left_skip { .5 em plus 1 fill }
},
- abstract-title / natural .code:n =
+ title-style / natural .code:n =
{
- \bool_gset_false:N \g__nju_strict_abs_title_bool
- \skip_gset:Nn \g__nju_abs_title_left_skip { 0 pt plus 1 fill }
+ \bool_set_false:N \g__nju_abs_title_strict_bool
+ \skip_set:Nn \g__nju_abs_title_left_skip { .5 em plus 1 fill }
},
- abstract-title .initial:n = strict
+ title-style .initial:n = strict
}
\NewDocumentEnvironment { abstract } { +b }
{
\cleardoublepage
\thispagestyle { plain }
- \__nju_abs_bookmark:Vn \c__nju_name_abstract_a_tl { abstract }
+ \__nju_abs_bookmark:Vn \c__nju_name_abstracta_tl { abstract }
\__nju_make_abstract:
\group_begin: \kaishu \zihao { -4 } #1
}
@@ -1365,7 +1760,7 @@
{
\cleardoublepage
\thispagestyle { plain }
- \__nju_abs_bookmark:Vn \c__nju_name_abstract_a_en_tl { abstract-en }
+ \__nju_abs_bookmark:Vn \c__nju_name_abstracta_en_tl { abstract-en }
\__nju_make_abstract_en:
\group_begin: \zihao { -4 } #1
}
@@ -1401,7 +1796,7 @@
}
\group_end:
}
-\cs_new_protected:Npn \__nju_notation_label:n #1 { #1 \hfil }
+\cs_new_protected:Npn \__nju_notation_label:n #1 { #1 \tex_hfil:D }
\cs_new_protected:Npn \__nju_make_notation:nn #1#2
{
\dim_set:Nn \l__nju_tmpa_dim { \textwidth - #1 - #2 }
@@ -1411,7 +1806,7 @@
\labelsep \c_zero_dim
\itemsep \c_zero_dim
\parsep \c_zero_dim
- \leftmargin .5\l__nju_tmpa_dim
+ \leftmargin .5\l__nju_tmpa_dim
\rightmargin \leftmargin
\advance \leftmargin #2
\cs_set_eq:NN \makelabel \__nju_notation_label:n
@@ -1428,7 +1823,7 @@
\chapter * { \c__nju_name_notation_tl }
\__nju_make_notation:nn { #1 } { #2 }
}
- { \endlist }
+ { \endlist \cleardoublepage }
\endinput
%%
%% End of file `njuthesis.cls'.