Skip to content
Snippets Groups Projects
Commit b7c9fba1 authored by Yu Xiong's avatar Yu Xiong :confounded:
Browse files

refactor: 重构了个人信息相关的部分命令

parent 31197e3c
Branches
Tags
No related merge requests found
...@@ -36,14 +36,21 @@ ...@@ -36,14 +36,21 @@
zihao=-4 zihao=-4
]{ctexbook}[2018/04/01] ]{ctexbook}[2018/04/01]
\RequirePackage{l3keys2e} \RequirePackage{l3keys2e}
\tl_new:N \l__nju_info_degree_tl
\tl_new:N \l__nju_info_type_tl
\keys_define:nn { nju } \keys_define:nn { nju }
{ {
nlcover .bool_set:N = \nju_nl_cover, nlcover .bool_set:N = \nju_nl_cover,
nlcover .initial:n = false, nlcover .initial:n = false,
degree .tl_set:N = \nju_degree, }
degree .initial:n = ug, \keys_define:nn { nju }
type .tl_set:N = \nju_type, {
type .initial:n = thesis, degree .choices:nn =
{ ug, mg, mg, phd }
{ \tl_set_eq:NN \l__nju_info_degree_tl \l_keys_choice_tl },
type .choices:nn =
{ thesis, design }
{ \tl_set_eq:NN \l__nju_info_type_tl \l_keys_choice_tl },
} }
\keys_define:nn { nju } \keys_define:nn { nju }
{ {
...@@ -51,39 +58,56 @@ ...@@ -51,39 +58,56 @@
} }
\keys_define:nn { nju / info } \keys_define:nn { nju / info }
{ {
% 题目
TitleA .tl_set:N = \l__nju_info_title_a_tl, TitleA .tl_set:N = \l__nju_info_title_a_tl,
TitleB .tl_set:N = \l__nju_info_title_b_tl, TitleB .tl_set:N = \l__nju_info_title_b_tl,
TitleC .tl_set:N = \l__nju_info_title_c_tl, TitleC .tl_set:N = \l__nju_info_title_c_tl,
Title* .tl_set:N = \l__nju_info_title_en_tl, Title* .tl_set:N = \l__nju_info_title_en_tl,
% 年级学号姓名 }
\keys_define:nn { nju / info }
{
Grade .tl_set:N = \l__nju_info_grade_tl, Grade .tl_set:N = \l__nju_info_grade_tl,
StudentID .tl_set:N = \l__nju_info_id_tl, StudentID .tl_set:N = \l__nju_info_id_tl,
StudentName .tl_set:N = \l__nju_info_author_tl, StudentName .tl_set:N = \l__nju_info_author_tl,
StudentName* .tl_set:N = \l__nju_info_author_en_tl, StudentName* .tl_set:N = \l__nju_info_author_en_tl,
% 院系专业方向 }
\keys_define:nn { nju / info }
{
Department .tl_set:N = \l__nju_info_dept_tl, Department .tl_set:N = \l__nju_info_dept_tl,
Department* .tl_set:N = \l__nju_info_dept_en_tl, Department* .tl_set:N = \l__nju_info_dept_en_tl,
Major .tl_set:N = \l__nju_major_tl, Major .tl_set:N = \l__nju_major_tl,
Major* .tl_set:N = \l__nju_major_en_tl, Major* .tl_set:N = \l__nju_major_en_tl,
Field .tl_set:N = \l__nju_field_tl, Field .tl_set:N = \l__nju_field_tl,
Field* .tl_set:N = \l__nju_field_en_tl, Field* .tl_set:N = \l__nju_field_en_tl,
}
\keys_define:nn { nju / info }
{
SupervisorA .tl_set:N = \l__nju_info_supv_a_tl, SupervisorA .tl_set:N = \l__nju_info_supv_a_tl,
SupervisorA* .tl_set:N = \l__nju_info_supv_a_en_tl, SupervisorA* .tl_set:N = \l__nju_info_supv_a_en_tl,
SupervisorATitle .tl_set:N = \l__nju_info_supv_a_title_tl, SupervisorATitle .tl_set:N = \l__nju_info_supv_a_title_tl,
SupervisorATitle* .tl_set:N = \l__nju_info_supv_a_title_en_tl, SupervisorATitle* .tl_set:N = \l__nju_info_supv_a_title_en_tl,
}
\keys_define:nn { nju / info }
{
SupervisorB .tl_set:N = \l__nju_info_supv_b_tl, SupervisorB .tl_set:N = \l__nju_info_supv_b_tl,
SupervisorB* .tl_set:N = \l__nju_info_supv_b_en_tl, SupervisorB* .tl_set:N = \l__nju_info_supv_b_en_tl,
SupervisorBTitle .tl_set:N = \l__nju_info_supv_b_title_tl, SupervisorBTitle .tl_set:N = \l__nju_info_supv_b_title_tl,
SupervisorBTitle* .tl_set:N = \l__nju_info_supv_b_title_en_tl, SupervisorBTitle* .tl_set:N = \l__nju_info_supv_b_title_en_tl,
}
\keys_define:nn { nju / info }
{
SubmitDate .tl_set:N = \l__nju_submit_date_tl, SubmitDate .tl_set:N = \l__nju_submit_date_tl,
}
\keys_define:nn { nju / info }
{
DefendDate .tl_set:N = \l__nju_defend_date_tl, DefendDate .tl_set:N = \l__nju_defend_date_tl,
ReviewerChairman .tl_set:N = \l__nju_info_chairman_tl, ReviewerChairman .tl_set:N = \l__nju_info_chairman_tl,
ReviewerA .tl_set:N = \l__nju_info_reviewer_a_tl, ReviewerA .tl_set:N = \l__nju_info_reviewer_a_tl,
ReviewerB .tl_set:N = \l__nju_info_reviewer_b_tl, ReviewerB .tl_set:N = \l__nju_info_reviewer_b_tl,
ReviewerC .tl_set:N = \l__nju_info_reviewer_c_tl, ReviewerC .tl_set:N = \l__nju_info_reviewer_c_tl,
ReviewerD .tl_set:N = \l__nju_info_reviewer_d_tl, ReviewerD .tl_set:N = \l__nju_info_reviewer_d_tl,
% 国家图书馆封面相关 }
\keys_define:nn { nju / info }
{
Classification .tl_set:N = \l__nju_info_classif_tl, Classification .tl_set:N = \l__nju_info_classif_tl,
SecurityLevel .tl_set:N = \l__nju_info_seclv_tl, SecurityLevel .tl_set:N = \l__nju_info_seclv_tl,
UDC .tl_set:N = \l__nju_info_udc_tl, UDC .tl_set:N = \l__nju_info_udc_tl,
...@@ -372,7 +396,7 @@ ...@@ -372,7 +396,7 @@
\fancyhead{} \fancyhead{}
\fancyfoot[C]{\zihao{5}\thepage} \fancyfoot[C]{\zihao{5}\thepage}
} }
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l__nju_info_degree_tl} { ug }
{ {
% the header line % the header line
\tl_set:Nn \headrulewidth {0pt} \tl_set:Nn \headrulewidth {0pt}
...@@ -690,10 +714,10 @@ numberwithin=section, ...@@ -690,10 +714,10 @@ numberwithin=section,
\l__nju_info_supv_b_title_en_tl \l__nju_info_supv_b_title_en_tl
} }
} }
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l__nju_info_degree_tl} { ug }
{ {
% 本科 % 本科
\tl_const:Nn \c__nju_name_diploma_tl {\hfill\hfill } \tl_const:Nn \l__nju_name_diploma_tl {\hfill\hfill }
\tl_const:Nn \c__nju_name_title_tl {\hfill} \tl_const:Nn \c__nju_name_title_tl {\hfill}
\tl_const:Nn \c__nju_cover_uline_len_a_tl { 250pt } \tl_const:Nn \c__nju_cover_uline_len_a_tl { 250pt }
...@@ -709,7 +733,7 @@ numberwithin=section, ...@@ -709,7 +733,7 @@ numberwithin=section,
} }
{ {
% 本科以外都是研究生 % 本科以外都是研究生
\tl_const:Nn \c__nju_name_diploma_tl {\hfill\hfill\hfill } \tl_const:Nn \l__nju_name_diploma_tl {\hfill\hfill\hfill }
\tl_const:Nn \c__nju_name_title_tl {\hfill\hfill\hfill} \tl_const:Nn \c__nju_name_title_tl {\hfill\hfill\hfill}
\tl_const:Nn \c__nju_cover_uline_len_a_tl { 250pt } \tl_const:Nn \c__nju_cover_uline_len_a_tl { 250pt }
...@@ -721,7 +745,7 @@ numberwithin=section, ...@@ -721,7 +745,7 @@ numberwithin=section,
\tl_const:Nn \c__nju_cover_box_len_tl { 6em } \tl_const:Nn \c__nju_cover_box_len_tl { 6em }
% 研究生学位分类 % 研究生学位分类
\str_case_e:nn { \nju_degree } \str_case_e:nn { \l__nju_info_degree_tl }
{ {
{ mg } { \tl_const:Nn \c__nju_name_degree_tl { 硕士 } } { mg } { \tl_const:Nn \c__nju_name_degree_tl { 硕士 } }
{ mf } { \tl_const:Nn \c__nju_name_degree_tl { 硕士专业 } } { mf } { \tl_const:Nn \c__nju_name_degree_tl { 硕士专业 } }
...@@ -748,14 +772,14 @@ numberwithin=section, ...@@ -748,14 +772,14 @@ numberwithin=section,
\makebox[\c__nju_cover_box_len_tl][s]{ \makebox[\c__nju_cover_box_len_tl][s]{
#1\c__nju_cover_uline_bskip_tl} #1\c__nju_cover_uline_bskip_tl}
} }
\str_if_eq:NNTF {\nju_type} {thesis} \str_if_eq:NNTF { \l__nju_info_type_tl } { thesis }
{ {
\tl_const:Nn \nju_type_name \tl_const:Nn \l__nju_info_type_tl_name
{ \c__nju_name_diploma_tl 毕\hfill\hfill\hfill} { \l__nju_name_diploma_tl 毕\hfill\hfill\hfill}
} }
{ {
\tl_const:Nn \nju_type_name \tl_const:Nn \l__nju_info_type_tl_name
{ \c__nju_name_diploma_tl 毕\hfill\hfill\hfill} { \l__nju_name_diploma_tl 毕\hfill\hfill\hfill}
} }
\cs_new_protected:Npn \__nju_cover_title_breakline: \cs_new_protected:Npn \__nju_cover_title_breakline:
{ {
...@@ -778,8 +802,9 @@ numberwithin=section, ...@@ -778,8 +802,9 @@ numberwithin=section,
} }
} }
} }
\tl_new:N \nju_printcoverinfo_ug \cs_new_protected:Npn \__nju_print_covertab:
\tl_set:Nn \nju_printcoverinfo_ug {%
\str_if_eq:NNTF { \l__nju_info_degree_tl } { ug }
{ {
\begin{tabular}{p{4.2em}c} \begin{tabular}{p{4.2em}c}
\__nju_cover_box:n {\hfill} \__nju_cover_box:n {\hfill}
...@@ -821,8 +846,6 @@ numberwithin=section, ...@@ -821,8 +846,6 @@ numberwithin=section,
& \__nju_cover_uline_a:n {\l__nju_submit_date_tl}\\ & \__nju_cover_uline_a:n {\l__nju_submit_date_tl}\\
\end{tabular} \end{tabular}
} }
\tl_new:N \nju_printcoverinfo_g
\tl_set:Nn \nju_printcoverinfo_g
{ {
\begin{tabular}{p{6em}c} \begin{tabular}{p{6em}c}
\__nju_cover_title_breakline: \__nju_cover_title_breakline:
...@@ -836,6 +859,7 @@ numberwithin=section, ...@@ -836,6 +859,7 @@ numberwithin=section,
& \__nju_cover_uline_a:n {\l__nju_info_supv_full_tl}\\ & \__nju_cover_uline_a:n {\l__nju_info_supv_full_tl}\\
\end{tabular} \end{tabular}
} }
}
\tl_new:N \nju_printcover_nl % 国家图书馆封面 \tl_new:N \nju_printcover_nl % 国家图书馆封面
\tl_new:N \nju_printcover_ug % 本科封面 \tl_new:N \nju_printcover_ug % 本科封面
\tl_new:N \nju_printcover_g % 研究生封面 \tl_new:N \nju_printcover_g % 研究生封面
...@@ -926,14 +950,15 @@ numberwithin=section, ...@@ -926,14 +950,15 @@ numberwithin=section,
\begin{center} \begin{center}
\includegraphics[height=3.35cm]{njuname} \includegraphics[height=3.35cm]{njuname}
\vskip 10mm \vskip 10mm
{\zihao{1}\makebox[9em][s]{\bf{\songti\nju_type_name}}} {\zihao{1}\makebox[9em][s]{\bf{\songti\l__nju_info_type_tl_name}}}
\vfill \vfill
\vskip\stretch{0} \vskip\stretch{0}
{\bgroup {\bgroup
\kaishu\zihao{3} \kaishu\zihao{3}
\def\tabcolsep{1pt} \def\tabcolsep{1pt}
\def\arraystretch{1.5} \def\arraystretch{1.5}
\nju_printcoverinfo_ug % 绘制信息框 % 绘制信息框
\__nju_print_covertab:
\egroup} \egroup}
\vfill \vfill
\end{center} \end{center}
...@@ -955,7 +980,7 @@ numberwithin=section, ...@@ -955,7 +980,7 @@ numberwithin=section,
\vskip 10mm \vskip 10mm
\includegraphics[height=2cm]{njuname-large} \includegraphics[height=2cm]{njuname-large}
\vskip 15mm \vskip 15mm
{\zihao{1}\makebox[10em][s]{\bf{\kaishu\nju_type_name}}} {\zihao{1}\makebox[10em][s]{\bf{\kaishu\l__nju_info_type_tl_name}}}
\vskip 5mm \vskip 5mm
{\zihao{1}\bf{\kaishu{(申请\c__nju_name_degree_tl 学位)}}} {\zihao{1}\bf{\kaishu{(申请\c__nju_name_degree_tl 学位)}}}
\par\vfill \par\vfill
...@@ -965,7 +990,8 @@ numberwithin=section, ...@@ -965,7 +990,8 @@ numberwithin=section,
\def\tabcolsep{1pt} \def\tabcolsep{1pt}
\def\arraystretch{1.5} \def\arraystretch{1.5}
\vskip 10mm \vskip 10mm
\nju_printcoverinfo_g % 绘制信息框 % 绘制信息框
\__nju_print_covertab:
\egroup} \egroup}
\vfill \vfill
\vskip 10mm \vskip 10mm
...@@ -994,7 +1020,7 @@ numberwithin=section, ...@@ -994,7 +1020,7 @@ numberwithin=section,
} }
\tl_set:Nn \maketitle \tl_set:Nn \maketitle
{% {%
\str_if_eq:NNTF { \nju_degree } { ug } \str_if_eq:NNTF { \l__nju_info_degree_tl } { ug }
{ {
\nju_printcover_nl % 国家图书馆封面 \nju_printcover_nl % 国家图书馆封面
\nju_printcover_ug % 本科封面 \nju_printcover_ug % 本科封面
...@@ -1004,7 +1030,7 @@ numberwithin=section, ...@@ -1004,7 +1030,7 @@ numberwithin=section,
\nju_printcover_g % 研究生封面 \nju_printcover_g % 研究生封面
} }
} }
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l__nju_info_degree_tl} { ug }
{ {
% 本科摘要环境 % 本科摘要环境
\NewDocumentEnvironment{abstract} {} \NewDocumentEnvironment{abstract} {}
...@@ -1094,7 +1120,7 @@ numberwithin=section, ...@@ -1094,7 +1120,7 @@ numberwithin=section,
毕业论文题目:\hspace{0.5em}\nju_underline:n {\l__nju_info_title_tl\hfill}\\ 毕业论文题目:\hspace{0.5em}\nju_underline:n {\l__nju_info_title_tl\hfill}\\
\uline{\makebox[9em]{\l__nju_major_tl}}专业 \uline{\makebox[9em]{\l__nju_major_tl}}专业
\uline{\makebox[4em]{\l__nju_info_grade_tl}} \uline{\makebox[4em]{\l__nju_info_grade_tl}}
\str_if_eq:NNTF {\nju_degree} { phd } {}{} \str_if_eq:NNTF {\l__nju_info_degree_tl} { phd } {}{}
士生姓名:\uline{\hfill\l__nju_info_author_tl\hfill} \\ 士生姓名:\uline{\hfill\l__nju_info_author_tl\hfill} \\
指导教师(姓名、职称):\uline{\hfill\l__nju_info_supv_full_tl\hfill}\par 指导教师(姓名、职称):\uline{\hfill\l__nju_info_supv_full_tl\hfill}\par
\egroup \egroup
......
...@@ -572,7 +572,6 @@ through XeTeX. ...@@ -572,7 +572,6 @@ through XeTeX.
% \section{代码实现} % \section{代码实现}
% @@在l3docstrip中表示名空间,在生成cls时会被相应字段替换,譬如在njuthesis中@@=nju % @@在l3docstrip中表示名空间,在生成cls时会被相应字段替换,譬如在njuthesis中@@=nju
% %
% laTex默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故1.5/1.2*1.3 = 1.625
% \begin{macrocode} % \begin{macrocode}
%<@@=nju> %<@@=nju>
%<*class> %<*class>
...@@ -581,125 +580,155 @@ through XeTeX. ...@@ -581,125 +580,155 @@ through XeTeX.
twoside, twoside,
UTF8, UTF8,
scheme=chinese, scheme=chinese,
% \end{macrocode}
%
% 关于行距,\hologo{LaTeX}默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故
% \[ 1.5\times\frac{1.3}{1.2} = 1.625\]
% \begin{macrocode}
linespread=1.625, linespread=1.625,
fontset=none, fontset=none,
zihao=-4 zihao=-4
]{ctexbook}[2018/04/01] ]{ctexbook}[2018/04/01]
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % 是否需要国家图书馆封面的设置
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{l3keys2e} \RequirePackage{l3keys2e}
% \end{macrocode} % \end{macrocode}
% 用于存储学位名称的全局变量,注意宏的命名,l代表局部变量,g代表全局变量
% \begin{macrocode}
\tl_new:N \l_@@_info_degree_tl
\tl_new:N \l_@@_info_type_tl
% \end{macrocode}
% %
% 是否需要国家图书馆封面的设置
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju } \keys_define:nn { nju }
{ {
nlcover .bool_set:N = \nju_nl_cover, nlcover .bool_set:N = \nju_nl_cover,
nlcover .initial:n = false, nlcover .initial:n = false,
}
% \end{macrocode} % \end{macrocode}
% %
% 学位信息的设置
% \begin{macrocode} % \begin{macrocode}
degree .tl_set:N = \nju_degree, \keys_define:nn { nju }
degree .initial:n = ug, {
% \end{macrocode} degree .choices:nn =
% { ug, mg, mg, phd }
% \begin{macrocode} { \tl_set_eq:NN \l_@@_info_degree_tl \l_keys_choice_tl },
type .tl_set:N = \nju_type, type .choices:nn =
type .initial:n = thesis, { thesis, design }
{ \tl_set_eq:NN \l_@@_info_type_tl \l_keys_choice_tl },
} }
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % \subsection{个人信息}
% 输入
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju } \keys_define:nn { nju }
{ {
info.meta:nn = { nju / info } { #1 } info.meta:nn = { nju / info } { #1 }
} }
\keys_define:nn { nju / info }
{
% \end{macrocode} % \end{macrocode}
% %
% Put text here.
% \begin{macrocode}
% 题目 % 题目
% \begin{macrocode}
\keys_define:nn { nju / info }
{
TitleA .tl_set:N = \l_@@_info_title_a_tl, TitleA .tl_set:N = \l_@@_info_title_a_tl,
TitleB .tl_set:N = \l_@@_info_title_b_tl, TitleB .tl_set:N = \l_@@_info_title_b_tl,
TitleC .tl_set:N = \l_@@_info_title_c_tl, TitleC .tl_set:N = \l_@@_info_title_c_tl,
Title* .tl_set:N = \l_@@_info_title_en_tl, Title* .tl_set:N = \l_@@_info_title_en_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % 年级、学号、姓名
% \begin{macrocode} % \begin{macrocode}
% 年级学号姓名 \keys_define:nn { nju / info }
{
Grade .tl_set:N = \l_@@_info_grade_tl, Grade .tl_set:N = \l_@@_info_grade_tl,
StudentID .tl_set:N = \l_@@_info_id_tl, StudentID .tl_set:N = \l_@@_info_id_tl,
StudentName .tl_set:N = \l_@@_info_author_tl, StudentName .tl_set:N = \l_@@_info_author_tl,
StudentName* .tl_set:N = \l_@@_info_author_en_tl, StudentName* .tl_set:N = \l_@@_info_author_en_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % 院系、专业、方向
% \begin{macrocode} % \begin{macrocode}
% 院系专业方向 \keys_define:nn { nju / info }
{
Department .tl_set:N = \l_@@_info_dept_tl, Department .tl_set:N = \l_@@_info_dept_tl,
Department* .tl_set:N = \l_@@_info_dept_en_tl, Department* .tl_set:N = \l_@@_info_dept_en_tl,
Major .tl_set:N = \l_@@_major_tl, Major .tl_set:N = \l_@@_major_tl,
Major* .tl_set:N = \l_@@_major_en_tl, Major* .tl_set:N = \l_@@_major_en_tl,
Field .tl_set:N = \l_@@_field_tl, Field .tl_set:N = \l_@@_field_tl,
Field* .tl_set:N = \l_@@_field_en_tl, Field* .tl_set:N = \l_@@_field_en_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% 导师 % 导师
% Put text here. %
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju / info }
{
SupervisorA .tl_set:N = \l_@@_info_supv_a_tl, SupervisorA .tl_set:N = \l_@@_info_supv_a_tl,
SupervisorA* .tl_set:N = \l_@@_info_supv_a_en_tl, SupervisorA* .tl_set:N = \l_@@_info_supv_a_en_tl,
SupervisorATitle .tl_set:N = \l_@@_info_supv_a_title_tl, SupervisorATitle .tl_set:N = \l_@@_info_supv_a_title_tl,
SupervisorATitle* .tl_set:N = \l_@@_info_supv_a_title_en_tl, SupervisorATitle* .tl_set:N = \l_@@_info_supv_a_title_en_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% 第二导师 % 第二导师
% Put text here. %
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju / info }
{
SupervisorB .tl_set:N = \l_@@_info_supv_b_tl, SupervisorB .tl_set:N = \l_@@_info_supv_b_tl,
SupervisorB* .tl_set:N = \l_@@_info_supv_b_en_tl, SupervisorB* .tl_set:N = \l_@@_info_supv_b_en_tl,
SupervisorBTitle .tl_set:N = \l_@@_info_supv_b_title_tl, SupervisorBTitle .tl_set:N = \l_@@_info_supv_b_title_tl,
SupervisorBTitle* .tl_set:N = \l_@@_info_supv_b_title_en_tl, SupervisorBTitle* .tl_set:N = \l_@@_info_supv_b_title_en_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here.
% 提交日期 % 提交日期
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju / info }
{
SubmitDate .tl_set:N = \l_@@_submit_date_tl, SubmitDate .tl_set:N = \l_@@_submit_date_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here.
% 答辩 % 答辩
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { nju / info }
{
DefendDate .tl_set:N = \l_@@_defend_date_tl, DefendDate .tl_set:N = \l_@@_defend_date_tl,
ReviewerChairman .tl_set:N = \l_@@_info_chairman_tl, ReviewerChairman .tl_set:N = \l_@@_info_chairman_tl,
ReviewerA .tl_set:N = \l_@@_info_reviewer_a_tl, ReviewerA .tl_set:N = \l_@@_info_reviewer_a_tl,
ReviewerB .tl_set:N = \l_@@_info_reviewer_b_tl, ReviewerB .tl_set:N = \l_@@_info_reviewer_b_tl,
ReviewerC .tl_set:N = \l_@@_info_reviewer_c_tl, ReviewerC .tl_set:N = \l_@@_info_reviewer_c_tl,
ReviewerD .tl_set:N = \l_@@_info_reviewer_d_tl, ReviewerD .tl_set:N = \l_@@_info_reviewer_d_tl,
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here.
% \begin{macrocode}
% 国家图书馆封面相关 % 国家图书馆封面相关
% \begin{macrocode}
\keys_define:nn { nju / info }
{
Classification .tl_set:N = \l_@@_info_classif_tl, Classification .tl_set:N = \l_@@_info_classif_tl,
SecurityLevel .tl_set:N = \l_@@_info_seclv_tl, SecurityLevel .tl_set:N = \l_@@_info_seclv_tl,
UDC .tl_set:N = \l_@@_info_udc_tl, UDC .tl_set:N = \l_@@_info_udc_tl,
SupervisorContact .tl_set:N = \l_@@_info_supv_cont_tl, SupervisorContact .tl_set:N = \l_@@_info_supv_cont_tl,
} }
% \end{macrocode} % \end{macrocode}
% % 定义用于设置个人信息的命令
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand \njusetup { m } \NewDocumentCommand \njusetup { m }
{ \keys_set:nn { nju } { #1 } } { \keys_set:nn { nju } { #1 } }
% \end{macrocode} % \end{macrocode}
% %
% mandatory and optional arguments are, and so forth. % 设置页边距
% \begin{macrocode} % \begin{macrocode}
\RequirePackage[ \RequirePackage[
top=2.5cm, top=2.5cm,
...@@ -707,6 +736,10 @@ through XeTeX. ...@@ -707,6 +736,10 @@ through XeTeX.
left=3.2cm, left=3.2cm,
right=3.2cm right=3.2cm
]{geometry} ]{geometry}
% \end{macrocode}
%
% mandatory and optional arguments are, and so forth.
% \begin{macrocode}
\RequirePackage{xparse} \RequirePackage{xparse}
\RequirePackage{titletoc} % 修改目录内标题格式 \RequirePackage{titletoc} % 修改目录内标题格式
\RequirePackage[hyphens]{url} % generate better linebreaks in the url \RequirePackage[hyphens]{url} % generate better linebreaks in the url
...@@ -821,7 +854,7 @@ through XeTeX. ...@@ -821,7 +854,7 @@ through XeTeX.
% %
% %
% \begin{variable}{\g_@@_latin_fontset_tl,\g_@@_cjk_fontset_tl} % \begin{variable}{\g_@@_latin_fontset_tl,\g_@@_cjk_fontset_tl}
% 用于存储所使用字体名称的全局变量,注意宏的命名,l代表局部变量,g代表全局变量 % 用于存储所使用字体名称的全局变量
% \begin{macrocode} % \begin{macrocode}
\tl_new:N \g_@@_latin_fontset_tl \tl_new:N \g_@@_latin_fontset_tl
\tl_new:N \g_@@_cjk_fontset_tl \tl_new:N \g_@@_cjk_fontset_tl
...@@ -1154,7 +1187,7 @@ through XeTeX. ...@@ -1154,7 +1187,7 @@ through XeTeX.
% %
% Put text here. % Put text here.
% \begin{macrocode} % \begin{macrocode}
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l_@@_info_degree_tl} { ug }
{ {
% the header line % the header line
\tl_set:Nn \headrulewidth {0pt} \tl_set:Nn \headrulewidth {0pt}
...@@ -1607,10 +1640,10 @@ through XeTeX. ...@@ -1607,10 +1640,10 @@ through XeTeX.
% Put text here. % Put text here.
% \begin{macrocode} % \begin{macrocode}
% 判断学位进行命令定义 % 判断学位进行命令定义
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l_@@_info_degree_tl} { ug }
{ {
% 本科 % 本科
\tl_const:Nn \c_@@_name_diploma_tl { 本\hfill 科\hfill } \tl_const:Nn \l_@@_name_diploma_tl { 本\hfill 科\hfill }
\tl_const:Nn \c_@@_name_title_tl { 题\hfill 目 } \tl_const:Nn \c_@@_name_title_tl { 题\hfill 目 }
\tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt } \tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
...@@ -1626,7 +1659,7 @@ through XeTeX. ...@@ -1626,7 +1659,7 @@ through XeTeX.
} }
{ {
% 本科以外都是研究生 % 本科以外都是研究生
\tl_const:Nn \c_@@_name_diploma_tl { 研\hfill 究\hfill 生\hfill } \tl_const:Nn \l_@@_name_diploma_tl { 研\hfill 究\hfill 生\hfill }
\tl_const:Nn \c_@@_name_title_tl { 论\hfill 文\hfill 题\hfill 目 } \tl_const:Nn \c_@@_name_title_tl { 论\hfill 文\hfill 题\hfill 目 }
\tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt } \tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
...@@ -1638,7 +1671,7 @@ through XeTeX. ...@@ -1638,7 +1671,7 @@ through XeTeX.
\tl_const:Nn \c_@@_cover_box_len_tl { 6em } \tl_const:Nn \c_@@_cover_box_len_tl { 6em }
% 研究生学位分类 % 研究生学位分类
\str_case_e:nn { \nju_degree } \str_case_e:nn { \l_@@_info_degree_tl }
{ {
{ mg } { \tl_const:Nn \c_@@_name_degree_tl { 硕士 } } { mg } { \tl_const:Nn \c_@@_name_degree_tl { 硕士 } }
{ mf } { \tl_const:Nn \c_@@_name_degree_tl { 硕士专业 } } { mf } { \tl_const:Nn \c_@@_name_degree_tl { 硕士专业 } }
...@@ -1647,9 +1680,9 @@ through XeTeX. ...@@ -1647,9 +1680,9 @@ through XeTeX.
} }
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % \begin{macro}{\@@_cover_uline_a:n}
% 在封面绘制下划线
% \begin{macrocode} % \begin{macrocode}
% 封面下划线
\cs_new:Npn \@@_cover_uline_a:n #1 \cs_new:Npn \@@_cover_uline_a:n #1
{ {
\uline{\makebox[\c_@@_cover_uline_len_a_tl] \uline{\makebox[\c_@@_cover_uline_len_a_tl]
...@@ -1666,6 +1699,7 @@ through XeTeX. ...@@ -1666,6 +1699,7 @@ through XeTeX.
{\rm\c_@@_cover_uline_font_tl #2 }} {\rm\c_@@_cover_uline_font_tl #2 }}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro}
% %
% Put text here. % Put text here.
% \begin{macrocode} % \begin{macrocode}
...@@ -1680,19 +1714,19 @@ through XeTeX. ...@@ -1680,19 +1714,19 @@ through XeTeX.
% Put text here. % Put text here.
% \begin{macrocode} % \begin{macrocode}
% 判断类型 % 判断类型
\str_if_eq:NNTF {\nju_type} {thesis} \str_if_eq:NNTF { \l_@@_info_type_tl } { thesis }
{ {
\tl_const:Nn \nju_type_name \tl_const:Nn \l_@@_info_type_tl_name
{ \c_@@_name_diploma_tl 毕\hfill 业\hfill 论\hfill 文 } { \l_@@_name_diploma_tl 毕\hfill 业\hfill 论\hfill 文 }
} }
{ {
\tl_const:Nn \nju_type_name \tl_const:Nn \l_@@_info_type_tl_name
{ \c_@@_name_diploma_tl 毕\hfill 业\hfill 设\hfill 计 } { \l_@@_name_diploma_tl 毕\hfill 业\hfill 设\hfill 计 }
} }
% \end{macrocode} % \end{macrocode}
% %
% \begin{macro}{\@@_cover_title_breakline:}
% 对多行标题进行自动判断,并输出换行后的结果 % 对多行标题进行自动判断,并输出换行后的结果
%
% \begin{macrocode} % \begin{macrocode}
\cs_new_protected:Npn \@@_cover_title_breakline: \cs_new_protected:Npn \@@_cover_title_breakline:
{ {
...@@ -1716,12 +1750,14 @@ through XeTeX. ...@@ -1716,12 +1750,14 @@ through XeTeX.
} }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro}
% %
% Put text here. % Put text here.
% \begin{macrocode}
% 封面信息栏 本科 % 封面信息栏 本科
\tl_new:N \nju_printcoverinfo_ug % \begin{macrocode}
\tl_set:Nn \nju_printcoverinfo_ug \cs_new_protected:Npn \@@_print_covertab:
{%
\str_if_eq:NNTF { \l_@@_info_degree_tl } { ug }
{ {
\begin{tabular}{p{4.2em}c} \begin{tabular}{p{4.2em}c}
\@@_cover_box:n {院\hfill 系} \@@_cover_box:n {院\hfill 系}
...@@ -1763,13 +1799,6 @@ through XeTeX. ...@@ -1763,13 +1799,6 @@ through XeTeX.
& \@@_cover_uline_a:n {\l_@@_submit_date_tl}\\ & \@@_cover_uline_a:n {\l_@@_submit_date_tl}\\
\end{tabular} \end{tabular}
} }
% \end{macrocode}
%
% Put text here.
% \begin{macrocode}
% 封面信息栏 研究生
\tl_new:N \nju_printcoverinfo_g
\tl_set:Nn \nju_printcoverinfo_g
{ {
\begin{tabular}{p{6em}c} \begin{tabular}{p{6em}c}
\@@_cover_title_breakline: \@@_cover_title_breakline:
...@@ -1783,9 +1812,12 @@ through XeTeX. ...@@ -1783,9 +1812,12 @@ through XeTeX.
& \@@_cover_uline_a:n {\l_@@_info_supv_full_tl}\\ & \@@_cover_uline_a:n {\l_@@_info_supv_full_tl}\\
\end{tabular} \end{tabular}
} }
}
% \end{macrocode} % \end{macrocode}
% %
% Put text here. % Put text here.
%
% Put text here.
% \begin{macrocode} % \begin{macrocode}
% 绘制封面命令 % 绘制封面命令
\tl_new:N \nju_printcover_nl % 国家图书馆封面 \tl_new:N \nju_printcover_nl % 国家图书馆封面
...@@ -1888,14 +1920,15 @@ through XeTeX. ...@@ -1888,14 +1920,15 @@ through XeTeX.
\begin{center} \begin{center}
\includegraphics[height=3.35cm]{njuname} \includegraphics[height=3.35cm]{njuname}
\vskip 10mm \vskip 10mm
{\zihao{1}\makebox[9em][s]{\bf{\songti\nju_type_name}}} {\zihao{1}\makebox[9em][s]{\bf{\songti\l_@@_info_type_tl_name}}}
\vfill \vfill
\vskip\stretch{0} \vskip\stretch{0}
{\bgroup {\bgroup
\kaishu\zihao{3} \kaishu\zihao{3}
\def\tabcolsep{1pt} \def\tabcolsep{1pt}
\def\arraystretch{1.5} \def\arraystretch{1.5}
\nju_printcoverinfo_ug % 绘制信息框 % 绘制信息框
\@@_print_covertab:
\egroup} \egroup}
\vfill \vfill
\end{center} \end{center}
...@@ -1922,7 +1955,7 @@ through XeTeX. ...@@ -1922,7 +1955,7 @@ through XeTeX.
\vskip 10mm \vskip 10mm
\includegraphics[height=2cm]{njuname-large} \includegraphics[height=2cm]{njuname-large}
\vskip 15mm \vskip 15mm
{\zihao{1}\makebox[10em][s]{\bf{\kaishu\nju_type_name}}} {\zihao{1}\makebox[10em][s]{\bf{\kaishu\l_@@_info_type_tl_name}}}
\vskip 5mm \vskip 5mm
{\zihao{1}\bf{\kaishu{(申请\c_@@_name_degree_tl 学位)}}} {\zihao{1}\bf{\kaishu{(申请\c_@@_name_degree_tl 学位)}}}
\par\vfill \par\vfill
...@@ -1932,7 +1965,8 @@ through XeTeX. ...@@ -1932,7 +1965,8 @@ through XeTeX.
\def\tabcolsep{1pt} \def\tabcolsep{1pt}
\def\arraystretch{1.5} \def\arraystretch{1.5}
\vskip 10mm \vskip 10mm
\nju_printcoverinfo_g % 绘制信息框 % 绘制信息框
\@@_print_covertab:
\egroup} \egroup}
\vfill \vfill
\vskip 10mm \vskip 10mm
...@@ -1966,7 +2000,7 @@ through XeTeX. ...@@ -1966,7 +2000,7 @@ through XeTeX.
% 重定义maketitle生成封面 % 重定义maketitle生成封面
\tl_set:Nn \maketitle \tl_set:Nn \maketitle
{% {%
\str_if_eq:NNTF { \nju_degree } { ug } \str_if_eq:NNTF { \l_@@_info_degree_tl } { ug }
{ {
\nju_printcover_nl % 国家图书馆封面 \nju_printcover_nl % 国家图书馆封面
\nju_printcover_ug % 本科封面 \nju_printcover_ug % 本科封面
...@@ -1982,7 +2016,7 @@ through XeTeX. ...@@ -1982,7 +2016,7 @@ through XeTeX.
% %
% \begin{macrocode} % \begin{macrocode}
% 判断学位 % 判断学位
\str_if_eq:NNTF {\nju_degree} { ug } \str_if_eq:NNTF {\l_@@_info_degree_tl} { ug }
{ {
% 本科摘要环境 % 本科摘要环境
\NewDocumentEnvironment{abstract} {} \NewDocumentEnvironment{abstract} {}
...@@ -2076,7 +2110,7 @@ through XeTeX. ...@@ -2076,7 +2110,7 @@ through XeTeX.
毕业论文题目:\hspace{0.5em}\nju_underline:n {\l_@@_info_title_tl\hfill}\\ 毕业论文题目:\hspace{0.5em}\nju_underline:n {\l_@@_info_title_tl\hfill}\\
\uline{\makebox[9em]{\l_@@_major_tl}}专业 \uline{\makebox[9em]{\l_@@_major_tl}}专业
\uline{\makebox[4em]{\l_@@_info_grade_tl}}级 \uline{\makebox[4em]{\l_@@_info_grade_tl}}级
\str_if_eq:NNTF {\nju_degree} { phd } {博}{硕} \str_if_eq:NNTF {\l_@@_info_degree_tl} { phd } {博}{硕}
士生姓名:\uline{\hfill\l_@@_info_author_tl\hfill} \\ 士生姓名:\uline{\hfill\l_@@_info_author_tl\hfill} \\
指导教师(姓名、职称):\uline{\hfill\l_@@_info_supv_full_tl\hfill}\par 指导教师(姓名、职称):\uline{\hfill\l_@@_info_supv_full_tl\hfill}\par
\egroup \egroup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment