summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls')
-rw-r--r--Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls107
1 files changed, 67 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
index ea790df30ed..19d70d8e153 100644
--- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
+++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls
@@ -24,7 +24,7 @@
%% `.dtx' through XeTeX.
%%
\NeedsTeXFormat{LaTeX2e}
-\GetIdInfo $Id: njuthesis.dtx 0.18.0 2022-05-01 12:40:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+\GetIdInfo $Id: njuthesis.dtx 0.19.0 2022-05-23 11:33:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
{Thesis template for Nanjing University}
\ProvidesExplClass{njuthesis}
{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -77,9 +77,6 @@
\tl_new:N \g__nju_cjk_font_tl
\tl_new:N \g__nju_config_tl
\clist_new:N \g__nju_theorem_type_clist
-\tl_new:N \g__nju_info_submitdate_tl
-\tl_new:N \g__nju_info_submitdate_en_tl
-\tl_new:N \g__nju_info_defenddate_tl
\tl_const:Nx \c__nju_today_tl
{
\int_to_arabic:n { \c_sys_year_int } -
@@ -149,12 +146,26 @@
\cs_new_protected:Npn \__nju_spread_box:nnn #1#2#3
{
\mode_leave_vertical:
+ \__nju_get_text_width:Nn \l__nju_tmpa_dim { #2 #3 }
\hbox_to_wd:nn { #1 }
- { #2 \tl_map_inline:nn { #3 } { ##1 \hfil } \unskip }
+ {
+ \dim_compare:nTF { \l__nju_tmpa_dim > #1 }
+ {
+ \hfil
+ \scalebox
+ { \dim_to_decimal_in_unit:nn { #1 } { \l__nju_tmpa_dim } }
+ [ 1.0 ] { #2 #3 }
+ \hfil
+ }
+ {
+ \hbox_to_wd:nn { #1 }
+ { #2 \tl_map_inline:nn { #3 } { ##1 \hfil } \unskip }
+ }
+ }
}
\cs_generate_variant:Nn \__nju_spread_box:nnn { nnV }
\cs_generate_variant:Nn \__nju_spread_box:nnn { nnx }
-\cs_new_protected:Npn \__nju_multiline_box:nnnn #1#2#3#4
+\cs_new_protected:Npn \__nju_multiline_box:NNnn #1#2#3#4
{
\int_set:Nn #1 { 1 }
\int_do_until:nn { #1 > #3 }
@@ -205,6 +216,24 @@
{ \__zhnum_date_aux:nnn { #1 } { #2 } { #3 } }
\cs_new:Npn \__nju_date_en:www #1-#2-#3 \q_stop
{ \clist_item:Nn \c__nju_month_en_clist { #2 } ~#3 , ~#1 }
+\cs_new_protected:Npn \__nju_date:n #1
+ {
+ \tl_new:c { g__nju_info_ #1 date_tl }
+ \tl_set:cn { g__nju_info_ #1 date_tl }
+ {
+ \exp_last_unbraced:Nv
+ \__nju_date:www { g__nju_info_ #1 date_raw_tl } \q_stop
+ }
+ }
+\cs_new_protected:Npn \__nju_date_en:n #1
+ {
+ \tl_new:c { g__nju_info_ #1 date_en_tl }
+ \tl_set:cn { g__nju_info_ #1 date_en_tl }
+ {
+ \exp_last_unbraced:Nv
+ \__nju_date:www { g__nju_info_ #1 date_raw_tl } \q_stop
+ }
+ }
\msg_new:nnn { njuthesis } { missing-title }
{
The~ title~ should~ not~ be~ left~ blank.\\
@@ -593,6 +622,10 @@
submit-date .initial:V = \c__nju_today_tl,
defend-date .tl_set:N = \g__nju_info_defenddate_raw_tl,
defend-date .initial:V = \c__nju_today_tl,
+ confer-date .tl_set:N = \g__nju_info_conferdate_raw_tl,
+ confer-date .initial:V = \c__nju_today_tl,
+ bottom-date .tl_set:N = \g__nju_info_bottomdate_raw_tl,
+ bottom-date .initial:V = \c__nju_today_tl,
chairman .tl_set:N = \g__nju_info_chairman_tl,
reviewer .clist_set:N = \g__nju_info_reviewer_clist,
clc .tl_set:N = \g__nju_info_clc_tl,
@@ -648,22 +681,21 @@
\bool_if:NT \l__nju_second_supv_bool
{ \__nju_quad: \g__nju_info_supv_ii_en_tl }
}
- \tl_set:Nn \g__nju_info_submitdate_tl
- {
- \exp_last_unbraced:NV
- \__nju_date:www \g__nju_info_submitdate_raw_tl \q_stop
- }
+ \__nju_date:n { submit }
\int_compare:nF { \g__nju_info_degree_int == 1 }
{
- \tl_set:Nn \g__nju_info_submitdate_en_tl
- {
- \exp_last_unbraced:NV
- \__nju_date_en:www \g__nju_info_submitdate_raw_tl \q_stop
- }
- \tl_set:Nn \g__nju_info_defenddate_tl
+ \__nju_date_en:n { submit }
+ \__nju_date:n { defend }
+ \bool_if:NT \g__nju_nlcover_bool
{
- \exp_last_unbraced:NV
- \__nju_date:www \g__nju_info_defenddate_raw_tl \q_stop
+ \__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
+ }
}
}
}
@@ -959,19 +991,19 @@
\RenewDocumentCommand \frontmatter { }
{
\cleardoublepage
- \exp_args:NV \pagestyle \c__nju_pagestyle_tl
+ \exp_args:NV \pagestyle \c__nju_fmt_pagestyle_tl
\pagenumbering { Roman }
}
\RenewDocumentCommand \mainmatter { }
{
\cleardoublepage
- \exp_args:NV \pagestyle \c__nju_pagestyle_tl
+ \exp_args:NV \pagestyle \c__nju_fmt_pagestyle_tl
\pagenumbering { arabic }
\normalfont \normalsize
}
\AtBeginEnvironment { document }
{
- \exp_args:NV \pagestyle \c__nju_pagestyle_tl
+ \exp_args:NV \pagestyle \c__nju_fmt_pagestyle_tl
\pagenumbering { Roman }
}
\cs_new_protected:Npn \__nju_add_tocline:n #1
@@ -1172,7 +1204,7 @@
\DeclareCaptionStyle{njucap}
{
font = small,
- labelfont = bf,
+ font += bf,
labelsep = quad,
justification = centering
}
@@ -1284,21 +1316,9 @@
}
}
\cleardoublepage
- \exp_args:NV \pagestyle \c__nju_pagestyle_tl
+ \exp_args:NV \pagestyle \c__nju_fmt_pagestyle_tl
\pagenumbering { Roman }
}
-\__nju_declare_element:nn { abstract / mark }
- {
- content = \c__nju_name_abstract_b_tl,
- format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
- }
-\__nju_declare_element:nn { abstract / en / mark }
- {
- content = \c__nju_name_abstract_b_en_tl,
- format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
- }
\cs_new_protected:Npn \__nju_print_keywords:nn #1#2
{
\tl_set:Nv \l__nju_tmpa_tl { c__nju_name_keywords #1 _tl }
@@ -1374,10 +1394,17 @@
{ \njuline { \bf ##1 } } { ##1 } }
\RenewDocumentCommand \mkbibdateshort { m m m }
{ \textbf { \thefield { ##1 } } }
- \begin{refsection}
- \nocite { #2 }
- \printbibliography [ heading = subbibliography, title = #1 ]
- \end{refsection}
+ \tl_if_eq:NnTF \blx@refsecreset@level { 2 }
+ {
+ \nocite { #2 }
+ \printbibliography [ heading = subbibliography, title = #1 ]
+ }
+ {
+ \begin{refsection}
+ \nocite { #2 }
+ \printbibliography [ heading = subbibliography, title = #1 ]
+ \end{refsection}
+ }
\group_end:
}
\cs_new_protected:Npn \__nju_notation_label:n #1 { #1 \hfil }