Skip to content
Snippets Groups Projects
njuthesis.dtx 93.9 KiB
Newer Older
Yu Xiong's avatar
Yu Xiong committed
% 发表文章目录与合作文章目录。
%    \begin{macrocode}
\NewDocumentCommand\njupaperlist { t* m }
{  
  \begin{refsection} 
    \nocite{#2}
    \IfBooleanTF {#1}
    { \printbibliography[heading=subbibliography,title=合作文章目录] }
    { \printbibliography[heading=subbibliography,title=发表文章目录] }
  \end{refsection}
}
%    \end{macrocode}
% \end{macro}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{参考文献}
% biblatex设置
\RequirePackage[
    style=gb7714-2015,
    %style=numeric-comp,
    %citestyle=authortitle-icomp,
    % citestyle=numeric-comp,
    %bibstyle=authoryear,
    % bibstyle=numeric,
    sorting=none,
    %sorting=nyt,
    %sortcites=true,
    %autocite=footnote,
    backend=biber, % Compile the bibliography with biber
    hyperref=true,
    backref=false,
    citecounter=true,
    pagetracker=true,
    citetracker=true,
    ibidtracker=context,
    autopunct=true,
    autocite=plain,
    % gbpub=false,         % Uncomment if you do NOT want '[S.l. : s.n.]' 
                           % in reference entries, GitHub Issue (#47)
    % gbnamefmt=lowercase, % Uncomment if you do NOT want uppercase author 
                           % names in reference entries, GitHub Issue (#23)
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 忽略不需要的文献信息。
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\AtEveryBibitem{
	\clearfield{abstract}
	\clearfield{issn}
	\clearfield{isbn}
	\clearfield{archivePrefix}
	\clearfield{arxivId}
	\clearfield{pmid}
	\clearfield{eprint}
	\ifentrytype{online}{}{\ifentrytype{misc}{}{\clearfield{url}}}
	% \ifentrytype{book}{\clearfield{doi}}{}
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{引用}
Yu Xiong's avatar
Yu Xiong committed
% 修改标签名称。默认在名称后面添加空格,删除公式编号的括号
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
\crefdefaultlabelformat{#2#1#3\,}

\crefname{figure}{图}{图}
\crefname{table}{表}{表}
% \crefname{equation}{公式}{公式}
Yu Xiong's avatar
Yu Xiong committed
\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~小节}
\crefname{appendix}{附录}{附录}

% \crefname{definition}{定义}{定义}
% \crefname{axiom}{公理}{公理}
% \crefname{property}{性质}{性质}
% \crefname{proposition}{命题}{命题}
% \crefname{lemma}{引理}{引理}
% \crefname{corollary}{推论}{推论}
% \crefname{remark}{注解}{注解}
% \crefname{condition}{条件}{条件}
% \crefname{conclusion}{结论}{结论}
% \crefname{assumption}{假设}{假设}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% \pkg{hyperref} 
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.11}{2021/10/01}{写入PDF元数据。}
%    \begin{macrocode}
\ctex_at_end_preamble:n
{
  \hypersetup
    {
      bookmarksnumbered = true,
      psdextra          = true,
      unicode           = true,
%    \end{macrocode}
% 填写 PDF 元信息。
%    \begin{macrocode}
      pdftitle    = \l_@@_info_title_tl,
      pdfauthor   = \l_@@_info_author_tl,
      pdfcreator  = \c_@@_name_pdf_creator_tl
    }
}
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{图表浮动体}
% 
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{图片表格}
% 
% 图表位置调整
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\floatsetup[figure]{ % Captions for figures
	capposition=bottom,%
	margins=centering,%
	floatwidth=\textwidth%
}
\floatsetup[table]{ % Captions for tables
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% 
% 图表标题样式
%    \begin{macrocode}
\DeclareCaptionFont{songticap}{\zihao{5}\bf\songti}
\captionsetup{
  font=small,%
  labelfont=songticap,
	textfont=songticap,
	strut=no,%
	hypcap=true, % Links point to the top of the figure
	% indention=0pt, % Suppress indentation
	% % parindent=0pt, % Suppress space between paragraphs
	aboveskip=6pt, % Increase the space between the figure and the caption
	belowskip=6pt, % Increase the space between the caption and the table
}
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{代码}
% 
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
\floatsetup[lstlisting]{ % Captions for lstlistings
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}
\lstset{
	basicstyle=\ttfamily\linespread{1}\small\selectfont,
    keywordstyle=\bfseries,% use bold style for keywords
    commentstyle=\rmfamily\itshape,% use italic style for comments
    stringstyle=\ttfamily,% 字符串风格
    flexiblecolumns,% ?
    numbers=left,% left-aligned numbering
    showspaces=false,% hide markers for spaces
    showstringspaces=false,
    captionpos=t,% place the caption at the top
	% frame=lrtb,% show all four sides of the frame
	% linewidth=.8\textwidth,
	% breakatwhitespace=true,
	breaklines=true,
	xleftmargin=2em,xrightmargin=2em,% set the width of the code environment
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\lstdefinestyle{LaTeX}{
  language=TeX,
  morekeywords={
    begin, caption, label, mathrm, frac, 
    toprule, midrule, bottomrule, includegraphics}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{列表}
Yu Xiong's avatar
Yu Xiong committed
% 列表环境
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\renewcommand{\labelitemi}{\tiny$\blacktriangleright$}
\renewcommand{\labelitemii}{\textbullet}

\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
\setlist[description]{noitemsep}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{定理环境}
%
% \begin{macro}{\mathbi}
% Math bold italic letters
%    \begin{macrocode}
\NewDocumentCommand\mathbi{m}{\textbf{\em #1}}
%    \end{macrocode}
% \end{macro}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\declaretheoremstyle[
    	%spaceabove=.5\thm@preskip,
    	%spacebelow=.5\thm@postskip,
    	headfont=\bf\songti,%\scshape,
    	notefont=\songti,% notebraces={ (}{)},
    	bodyfont=\songti,
    	%headformat={\NAME\space\NUMBER\space\NOTE},
    	headpunct={},
    	%postheadspace={.5em plus .1em minus .1em},
    	%prefoothook={\hfill\qedsymbol}
    ]{njuthm}

\theoremstyle{njuthm}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 修改证明环境标题 
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\let\oldproofname=\proofname
Yu Xiong's avatar
Yu Xiong committed
\renewcommand*{\proofname}{\rm\bf\songti{\oldproofname}} 
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\declaretheorem[
	name=算法,
	style=njuthm,
	refname={算法,算法},
	Refname={算法,算法},
	% numberwithin=section,
]{algorithm}
\declaretheorem[
	name=假设,
	style=njuthm,
	refname={假设,假设},
	Refname={假设,假设},
	% numberwithin=section,
]{assumption}
\declaretheorem[
	name=公理,
	style=njuthm,
	refname={公理,公理},
	Refname={公理,公理},
	% numberwithin=section,
]{axiom}
\declaretheorem[
	name=结论,
	style=njuthm,
	refname={结论,结论},
	Refname={结论,结论},
	% numberwithin=section,
]{conclusion}
\declaretheorem[
	name=条件,
	style=njuthm,
	refname={条件,条件},
	Refname={条件,条件},
	% numberwithin=section,
]{condition}
\declaretheorem[
	name=推论,
	style=njuthm,
	refname={推论,推论},
	Refname={推论,推论},
	% numberwithin=section,
]{corollary}
\declaretheorem[
	name=定义,
	style=njuthm,
	refname={定义,定义},
	Refname={定义,定义},
	% numberwithin=section,
]{definition}
\declaretheorem[
    	name=例,
    	style=njuthm,
    	refname={例,例},
    	Refname={例,例},
    	% numberwithin=section,
]{example}
\declaretheorem[
	name=引理,
	style=njuthm,
	refname={引理,引理},
	Refname={引理,引理},
	% numberwithin=section,
]{lemma}
\declaretheorem[
	name=性质,
	style=njuthm,
	refname={性质,性质},
	Refname={性质,性质},
	% numberwithin=section,
]{property}
\declaretheorem[
	name=命题,
	style=njuthm,
	refname={命题,命题},
	Refname={命题,命题},
	% numberwithin=section,
]{proposition}
\declaretheorem[
	name=注解,
	style=njuthm,
	refname={注解,注解},
	Refname={注解,注解},
	% numberwithin=section,
]{remark}
\declaretheorem[
	name=定理,
	style=njuthm,
	refname={定理,定理},
	Refname={定理,定理},
	numberwithin=section,
]{theorem}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{封面}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{内部命令}
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\tl_const:Nn \l_@@_info_title_tl 
{
  \l_@@_info_title_a_tl
  \l_@@_info_title_b_tl
  \l_@@_info_title_c_tl
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{variable}{\l_@@_info_supv_full_tl,\l_@@_info_supv_full_en_tl}
% 用于存储导师姓名加职称的变量,旧版编译器不支持字符串中含有|\hspace{.5em}|这样的空白空间命令
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\tl_new:N \l_@@_info_supv_full_tl
\tl_new:N \l_@@_info_supv_full_en_tl
%    \end{macrocode}
% \end{variable}
%
Yu Xiong's avatar
Yu Xiong committed
% 拼合双导师的姓名和职称。
%    \begin{macrocode}
\tl_set:Nn \l_@@_info_supv_full_tl
  \l_@@_info_supv_a_tl\ 
  \l_@@_info_supv_a_title_tl\ \ 
  \l_@@_info_supv_b_tl\ 
  \l_@@_info_supv_b_title_tl
\tl_set:Nn \l_@@_info_supv_full_en_tl
{
  \l_@@_info_supv_a_title_en_tl\ 
  \l_@@_info_supv_a_en_tl\ \ 
  \l_@@_info_supv_b_title_en_tl\ 
  \l_@@_info_supv_b_en_tl
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{variable}{\l_@@_name_degree_tl,\l_@@_name_degree_en_tl}
% 用于存储学位名称的变量
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
\tl_new:N \l_@@_name_degree_tl
\tl_new:N \l_@@_name_degree_en_tl
%    \end{macrocode}
% \end{variable}
%
% 判断学位进行命令定义
%    \begin{macrocode}
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
Yu Xiong's avatar
Yu Xiong committed
  \tl_const:Nn \l_@@_name_diploma_tl { 本科 }
  \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_b_tl { 90pt }
  \tl_const:Nn \c_@@_cover_uline_font_tl { \songti }
  \tl_const:Nn \c_@@_cover_uline_style_tl { \bf }
  \tl_const:Nn \c_@@_cover_uline_bskip_tl {}

  \tl_const:Nn \c_@@_cover_box_len_tl { 4.2em }

  % 本科强制不打印国家图书馆封面
Yu Xiong's avatar
Yu Xiong committed
  \bool_set_false:N \g_@@_nlcover_bool
} 
{ 
  % 本科以外都是研究生 
Yu Xiong's avatar
Yu Xiong committed
  \tl_const:Nn \l_@@_name_diploma_tl { 研究生 }
  \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_b_tl { 14em }
  \tl_const:Nn \c_@@_cover_uline_font_tl { \kaishu }
  \tl_const:Nn \c_@@_cover_uline_style_tl {}
  \tl_const:Nn \c_@@_cover_uline_bskip_tl { \hspace{1em} }
  \tl_const:Nn \c_@@_cover_box_len_tl { 6em }
  % 研究生学位名称
  \int_compare:nTF { \g_@@_info_degree_int == 4 } 
Yu Xiong's avatar
Yu Xiong committed
    \tl_set:Nn \l_@@_name_degree_tl { 博士 }
    \tl_set:Nn \l_@@_name_degree_en_tl { Doctor~of~Philosophy }
Yu Xiong's avatar
Yu Xiong committed
    \tl_set:Nn \l_@@_name_degree_en_tl { Master }
    \int_compare:nTF { \g_@@_info_degree_int == 2 } { mg }
Yu Xiong's avatar
Yu Xiong committed
    { \tl_set:Nn \l_@@_name_degree_tl { 硕士 } }
    { \tl_set:Nn \l_@@_name_degree_tl { 硕士专业 } }
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% \begin{macro}{\@@_spread_box:nn}
Yu Xiong's avatar
Yu Xiong committed
% 来自\cls{fduthesis}:分散对齐的水平盒子。
Yu Xiong's avatar
Yu Xiong committed
% \begin{arguments}
%   \item   宽度
%   \item   内容
% \end{arguments}
% 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip}
% 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。
% |#2| 需要完全展开以避免 underfull 警告。
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
\cs_generate_variant:Nn \tl_map_inline:nn       { xn }
Yu Xiong's avatar
Yu Xiong committed
\cs_new_protected:Npn \@@_spread_box:nn #1#2
  {
    \mode_leave_vertical:
    \hbox_to_wd:nn {#1}
      { \tl_map_inline:xn {#2} { ##1 \hfil } \unskip }
  }
%    \end{macrocode}
% \end{macro}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{macro}{\@@_cover_uline_a:n}
% 在封面绘制下划线
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\cs_new:Npn \@@_cover_uline_a:n #1
{
  \uline{\makebox[\c_@@_cover_uline_len_a_tl]
    {\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_b:n #1
{
  \uline{\makebox[\c_@@_cover_uline_len_b_tl]
    {\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_nl:nn #1 #2
{
  \uline{\makebox[#1]
    {\rm\c_@@_cover_uline_font_tl #2 }}
}
%    \end{macrocode}
% \begin{macro}{\@@_cover_box:n}
%    \begin{macrocode}
\cs_new:Npn \@@_cover_box:n #1 
{
  \makebox[\c_@@_cover_box_len_tl][s]{
    #1\c_@@_cover_uline_bskip_tl}
}
%    \end{macrocode}
% \begin{macro}{\@@_cover_type:}
% 学位类型。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_cover_type:
{
  \int_compare:nTF { \g_@@_info_degree_int == 1 } { 本科 } { 研究生 }
  \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int }
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_cover_degree:}
% 学位类型。
\cs_new_protected:Npn \@@_cover_degree:
  { 申请 }
  \clist_item:Nn \c_@@_name_degree_clist { \g_@@_info_degree_int }
  { 学位 }
Yu Xiong's avatar
Yu Xiong committed
% \end{macro}
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{封面组件}
%
% \begin{macro}{\@@_cover_title_breakline:}
Yu Xiong's avatar
Yu Xiong committed
% 对标题进行自动判断,如果某行标题空则不输出接下来的若干行,得到多行标题。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_cover_title_breakline:
{
  \@@_cover_box:n {\c_@@_name_title_tl}
  & \@@_cover_uline_a:n 
  { \c_@@_cover_uline_style_tl \l_@@_info_title_a_tl } \\
  \tl_if_empty:NF \l_@@_info_title_b_tl
  {
    \tl_if_empty:NTF \l_@@_info_title_c_tl
      { 
        & \@@_cover_uline_a:n  
        {\c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\ 
      }
      {
        & \@@_cover_uline_a:n  
        { \c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\
        & \@@_cover_uline_a:n  
        { \c_@@_cover_uline_style_tl \l_@@_info_title_c_tl } \\
      }
  }
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{macro}{\@@_print_covertab:}
% 封面信息栏
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_covertab:
{%
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
  {
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {院\hfill 系}
      & \@@_cover_uline_a:n  {\l_@@_info_dept_tl} \\
      \@@_cover_box:n {专\hfill 业}
      & \@@_cover_uline_a:n  {\l_@@_major_tl} \\
      \@@_cover_title_breakline:
    \end{tabular}\\
    \begin{tabular}{p{4.2em}cp{4.2em}c}
      \@@_cover_box:n {年\hfill 级}
      & \@@_cover_uline_b:n {\l_@@_info_grade_tl}
      & \@@_cover_box:n {学\hfill 号}
      & \@@_cover_uline_b:n {\l_@@_info_id_tl}\\
    \end{tabular}\\
    
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {学\hfill 生\hfill 姓\hfill 名}
      & \@@_cover_uline_a:n  {\l_@@_info_author_tl}
    \end{tabular}\\
    \begin{tabular}{p{4.2em}cp{4.2em}c}
      \@@_cover_box:n {导\hfill 师}
      & \@@_cover_uline_b:n {\l_@@_info_supv_a_tl}
      & \@@_cover_box:n {职\hfill 称}
      & \@@_cover_uline_b:n {\l_@@_info_supv_a_title_tl}\\
  
      % 第二导师
      \tl_if_empty:NF \l_@@_info_supv_b_tl
      {
        \@@_cover_box:n {第\hfill 二\hfill 导\hfill 师}
        & \@@_cover_uline_b:n {\l_@@_info_supv_b_tl}
        & \@@_cover_box:n {职\hfill 称}
        & \@@_cover_uline_b:n {\l_@@_info_supv_b_title_tl}\\
      }
    \end{tabular}\\
  
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {提\hfill 交\hfill 日\hfill 期}
      & \@@_cover_uline_a:n  {\l_@@_submit_date_tl}\\
    \end{tabular}  
  } 
  { 
    \begin{tabular}{p{6em}c}    
      \@@_cover_title_breakline:
      \@@_cover_box:n {作\hfill 者\hfill 姓\hfill 名}
Yu Xiong's avatar
Yu Xiong committed
      & \@@_cover_uline_a:n  {\@@_spread_box:nn {4em}{\l_@@_info_author_tl}}\\
      \@@_cover_box:n {专\hfill 业\hfill 名\hfill 称}
      & \@@_cover_uline_a:n  {\l_@@_major_tl}\\
      \@@_cover_box:n {研\hfill 究\hfill 方\hfill 向}
      & \@@_cover_uline_a:n  {\l_@@_field_tl}\\
      \@@_cover_box:n {指\hfill 导\hfill 教\hfill 师}
      & \@@_cover_uline_a:n  {\l_@@_info_supv_full_tl}\\
    \end{tabular}
  } 
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{绘制封面}
%
% \begin{macro}{\@@_print_cover_nl:}
% 按需绘制国家图书馆封面,修改自胡海星模板
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_nl:
  \thispagestyle{empty}
  \pdfbookmark[0]{国家图书馆封面}{nl}
Yu Xiong's avatar
Yu Xiong committed
    \noindent\null\vskip -20mm \hskip -15mm
    \songti\zihao{-4}
    \makebox[40pt][l]{分类号}
Yu Xiong's avatar
Yu Xiong committed
    \@@_cover_uline_b:n {\l_@@_info_clc_tl}
    \hfill
    \makebox[40pt][l]{密级}
    \@@_cover_uline_b:n {\l_@@_info_seclv_tl}
    \vskip 10pt \hskip -15mm
    \@@_cover_uline_b:n {\l_@@_info_udc_tl}
  }

  % 中部
  \vskip\stretch{2}
  \begin{center}
    \def\ULthickness{1pt}
    {\kaishu\zihao{-0} 学\hspace{0.5em}位\hspace{0.5em}论\hspace{0.5em}文}
      \kaishu\zihao{1}
      \vskip \stretch{1}
      \@@_cover_uline_b:n {\l_@@_info_title_a_tl}\\
      \@@_cover_uline_b:n {\l_@@_info_title_b_tl}\\
      \@@_cover_uline_b:n {\l_@@_info_title_c_tl}\\
    \vskip \stretch{1}
    {\kaishu\zihao{4}(题名和副题名)}
    \vskip \stretch{1} \vskip 5mm
    {\kaishu\zihao{1}\uline{\makebox{\l_@@_info_author_tl}}}
    \vskip \stretch{1}
    {\kaishu\zihao{4}(作者姓名)}
  \end{center}

  % 底部
Yu Xiong's avatar
Yu Xiong committed
  \vskip\stretch{1}\kaishu\zihao{4}
  \noindent 指导教师姓名、职务、职称、学位、单位名称及地址%
  \@@_cover_uline_nl:nn {94pt}{\l_@@_info_supv_a_tl}\par
  \noindent \@@_cover_uline_nl:nn {\textwidth}{%
  \l_@@_info_supv_cont_tl}\par
  \noindent 申请学位级别%
  \@@_cover_uline_nl:nn {9em}{\l_@@_name_degree_tl}%
  \noindent 专业名称%
  \uline{\hfill\l_@@_major_tl\hfill}\par
  \noindent 论文提交日期%
  \@@_cover_uline_nl:nn {9em}{\l_@@_submit_date_tl}%
  \noindent 论文答辩日期%
  \uline{\hfill\l_@@_defend_date_tl\hfill}\par
  \noindent 学位授予单位和日期\uline{\hfill}\par
  \begin{flushright}
    答辩委员会主席:
    \@@_cover_uline_nl:nn {9em}{ \l_@@_info_chairman_tl }\par
    评阅人:
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {1} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {2} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {3} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {4} }\par
  \end{flushright}
  \begin{center}
    \kaishu\zihao{3}\hspace{2em} 年\hspace{1em} 月\hspace{1em} 日
  \end{center}
  \vskip -10mm
  \cleardoublepage
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{macro}{\@@_print_cover_ug:}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_ug:
{
  \thispagestyle{empty}
  \pagenumbering{Roman}
  % Start
  \pdfbookmark{封面}{cover} % 将封面插入pdf书签
  \begin{spacing}{1.25}
Yu Xiong's avatar
Yu Xiong committed
  \noindent\null\hspace{-10mm}
  \njuemblem{!}{3cm}\smallskip 
mc's avatar
mc committed
    \njuname{!}{3.35cm}
    {\zihao{1}\bf\songti\@@_spread_box:nn {9em}{\@@_cover_type:}}
    \vfill
    \vskip\stretch{0}
    {\bgroup
    \kaishu\zihao{3}
    \def\tabcolsep{1pt}
    \def\arraystretch{1.5}
    % 绘制信息框
    \@@_print_covertab: 
    \egroup}
    \vfill
  \end{center}
  \end{spacing}
  \cleardoublepage
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{macro}{\@@_print_cover_g:}
% 研究生封面
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_g:
{
  \thispagestyle{empty}
  \pagenumbering{Roman}
  % Start
  \pdfbookmark{封面}{cover} % 将封面插入pdf书签
  \begin{spacing}{1.25}
  \begin{center}
Yu Xiong's avatar
Yu Xiong committed
    \noindent\null\vskip 5mm
    \njuemblem{!}{1.9cm}
mc's avatar
mc committed
    \njuname{4.4cm}{!}
Yu Xiong's avatar
Yu Xiong committed
    \par\vskip -2mm 
    \njuname*{4.4cm}{!}
Yu Xiong's avatar
Yu Xiong committed
    \bgroup
      \zihao{1}\bf\kaishu
      \@@_spread_box:nn {10em}{\@@_cover_type:}
Yu Xiong's avatar
Yu Xiong committed
      \vskip 5mm
      \@@_cover_degree:
Yu Xiong's avatar
Yu Xiong committed
    \egroup
    \par\vfill\vskip\stretch{0}
    \bgroup
      \bf\kaishu\zihao{3}
      \def\tabcolsep{1pt}
      \def\arraystretch{1.5}
      \vskip 10mm
      \@@_print_covertab:
    \egroup
    \bf\kaishu\zihao{4}\l_@@_submit_date_tl
    \vskip 15mm
  \end{center}
  \end{spacing}

  \newpage % 封面背面
  \thispagestyle{empty}
  \begin{spacing}{1.625}
    % TODO: 等待调整格式
    {\bgroup
    \kaishu\zihao{3}
    \makebox[6em][s]{\bf\kaishu 学\hfill 号}:\MakeUppercase{\l_@@_info_id_tl}
    \makebox[6em][s]{\bf\kaishu 论文答辩日期}:\l_@@_defend_date_tl
    \par
    \makebox[6em][s]{\bf\kaishu 指\hfill 导\hfill 教\hfill 师}:\hspace{50mm}(签字)
    \par
    \egroup}
    \vskip 15mm
  \end{spacing}
  \cleardoublepage
}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@@_print_cover_en:}
% 研究生英文封面
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_en:
{
  \thispagestyle{empty}
  \pdfbookmark{英文封面}{cover-en} % 将封面插入pdf书签
  \begin{center}
    \noindent\vspace*{20pt}
    \bf\sffamily\zihao{2}\l_@@_info_title_en_tl
    \vskip \stretch{1}
    \normalfont\rmfamily\zihao{4}{by}
    \vskip 3pt
    \bf\sffamily\zihao{4}\l_@@_info_author_en_tl
    \vskip\stretch{1}
    \normalfont\rmfamily\zihao{4}{Supervised~by}
    \normalfont\sffamily\zihao{4}
    \l_@@_info_supv_a_title_en_tl
    \hspace{.5em}\l_@@_info_supv_a_en_tl\\
    \l_@@_info_supv_b_title_en_tl
    \hspace{.5em}\l_@@_info_supv_b_en_tl
    \vskip\stretch{1}
    \normalsize\rmfamily{%
      A~dissertation~submitted~to\\
      the~graduate~school~of~Nanjing~University\\
      in~partial~fulfilment~of~the~requirements~for~the~degree~of\\
Yu Xiong's avatar
Yu Xiong committed
      {\textsc{\l_@@_name_degree_en_tl}}\\
      in\\
      {\l_@@_major_en_tl}
    }
    \vskip\stretch{2}
    \njuemblem{2.5cm}{!}\par
    \vskip 3mm
    \normalfont\l_@@_info_dept_en_tl\\
    {Nanjing~University}
    \vskip 30pt
    \normalfont\normalsize\l_@@_submit_date_en_tl
  \end{center}
  \normalfont
  \cleardoublepage
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{macro}{\maketitle}
% 重定义maketitle生成封面
%    \begin{macrocode}
\tl_set:Nn \maketitle 
{%
  \int_compare:nTF { \g_@@_info_degree_int == 1 }
    {
      \@@_print_cover_ug: % 本科封面
    } 
    { 
      \bool_if:NT \g_@@_nlcover_bool { \@@_print_cover_nl: } % 国家图书馆封面
      \@@_print_cover_g: % 研究生封面
      \@@_print_cover_en: % 英文封面
    } 
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% \end{macro}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{摘要绘制}
%
% \begin{macro}{\@@_print_keywords:,\@@_print_keywords_en:}
Yu Xiong's avatar
Yu Xiong committed
% 中英文关键词
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_keywords:
{
  \par\vspace{2ex}
  \bgroup
    \noindent
    \c_@@_name_keywords_tl
    \clist_use:Nn \l_@@_info_keywords_clist {;} 
    \par
  \egroup
\cs_new_protected:Npn \@@_print_keywords_en:
{
  \par\vspace{2ex}
  \bgroup
    \noindent
    \c_@@_name_keywords_en_tl\hspace{0.5em}
    \clist_use:Nn \l_@@_info_keywords_en_clist {;}
    \par
  \egroup
Yu Xiong's avatar
Yu Xiong committed
% \end{macro}
Yu Xiong's avatar
Yu Xiong committed
% \begin{macro}{\@@_print_abstract_ug:,\@@_print_abstract_en_ug:}
% 输出本科摘要格式。
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_abstract_ug:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{中文摘要}{abstract-zh}
  \begin{center}
    \kaishu\zihao{-2}{\textbf{
      \uuline{南京大学本科生毕业论文(设计、作品)中文摘要}}}
  \end{center}
Yu Xiong's avatar
Yu Xiong committed
  \bgroup
    \noindent\kaishu\zihao{-4}
    题目: \l_@@_info_title_tl \\
    院系: \l_@@_info_dept_tl \\
    专业: \l_@@_major_tl \\
    本科生姓名: \l_@@_info_author_tl \\
    指导教师(姓名、职称):\l_@@_info_supv_full_tl \\
    摘要:
Yu Xiong's avatar
Yu Xiong committed
  \egroup
  \kaishu\zihao{-4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_ug:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{英文摘要}{abstract-en}
  \begin{center}
      \kaishu\zihao{-2}{\textbf{\uuline{
        南京大学本科生毕业论文(设计、作品)英文摘要}}}
  \end{center}
  {
    \bgroup
    THESIS: ~~\l_@@_info_title_en_tl \\
    DEPARTMENT: ~~\l_@@_info_dept_en_tl \\
    SPECIALIZATION: ~~\l_@@_major_en_tl \\
    UNDERGRADUATE:~~\l_@@_info_author_en_tl \\
    MENTOR:~~\l_@@_info_supv_full_en_tl \\
    ABSTRACT:
    \egroup
  \zihao{-4}\par%
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% \end{macro}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{macro}{\@@_print_abstract_g:,\@@_print_abstract_en_g:}
% 输出研究生摘要格式。
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_abstract_g:
  \thispagestyle{plain}
  \pdfbookmark[0]{中文摘要}{abstract-zh}
  \begin{center}
    \kaishu\zihao{-2}{\textbf{\uuline{
      南京大学研究生毕业论文中文摘要首页用纸}}}
  \end{center}
  \bgroup
    \noindent\kaishu\zihao{4}
    毕业论文题目:\hspace{0.5em}\njuline{\l_@@_info_title_tl\hfill}\\
    \njuline{\makebox[11em]{\l_@@_major_tl}}专业
    \njuline{\makebox[4em]{\l_@@_info_grade_tl}}级
    \int_compare:nTF { \g_@@_info_degree_int == 4} { phd } { 博 } { 硕 }
    士生姓名:\njuline{\hfill\l_@@_info_author_tl\hfill}\\
    指导教师(姓名、职称):\njuline{\hfill\l_@@_info_supv_full_tl\hfill}\par
  \egroup
  \kaishu\zihao{4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_g:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{英文摘要}{abstract-en}
  \begin{center}
Yu Xiong's avatar
Yu Xiong committed
      \kaishu\zihao{-2}{\textbf{\uuline{
        南京大学研究生毕业论文英文摘要首页用纸}}}
  \end{center}
  {
    \zihao{4}
    THESIS: ~~\l_@@_info_title_en_tl \\
    SPECIALIZATION: ~~\l_@@_major_en_tl \\
    POSTGRADUATE:~~\l_@@_info_author_en_tl \\
    MENTOR:~~\l_@@_info_supv_full_en_tl\par
  \zihao{4}\par%
}
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% \end{macro}
%
% 
% 判断学位
%
%    \begin{macrocode}
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
{   
  \NewDocumentEnvironment{abstract} {}
  {\@@_print_abstract_ug:}{\@@_print_keywords:\newpage}
  \NewDocumentEnvironment{abstract*} {}
  {\@@_print_abstract_en_ug:}{\@@_print_keywords_en:\cleardoublepage}
}
{
  \NewDocumentEnvironment{abstract} {}
  {\@@_print_abstract_g:}{\@@_print_keywords:\newpage}
  \NewDocumentEnvironment{abstract*} {}
  {\@@_print_abstract_en_g:}{\@@_print_keywords_en:\cleardoublepage}
Yu Xiong's avatar
Yu Xiong committed
%</class>
%    \end{macrocode}
%