summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/njuthesis/njuthesis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/unicodetex/latex/njuthesis/njuthesis.dtx')
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.dtx5397
1 files changed, 3492 insertions, 1905 deletions
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
index 5dacce5878..ced6a7f27e 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
@@ -74,8 +74,9 @@ To produce the documentation run the original source files ending with
\generate{
\usedir{tex/latex/njuthesis}
\file{\jobname.cls} {\from{\jobname.dtx}{class}}
- \file{\jobname-undergraduate.def} {\from{\jobname.dtx}{definition-ug}}
- \file{\jobname-graduate.def} {\from{\jobname.dtx}{definition-g}}
+ \file{\jobname-undergraduate.def} {\from{\jobname.dtx}{def-u}}
+ \file{\jobname-graduate.def} {\from{\jobname.dtx}{def-g}}
+ \file{\jobname-postdoctoral.def} {\from{\jobname.dtx}{def-p}}
%<*internal>
\usedir{source/latex/njuthesis}
\file{\jobname.ins} {\from{\jobname.dtx}{install}}
@@ -92,6 +93,7 @@ To produce the documentation run the original source files ending with
\Msg{* *}
\Msg{* njuthesis.cls *}
\Msg{* njuthesis-graduate.def *}
+\Msg{* njuthesis-postdoctoral.def *}
\Msg{* njuthesis-undergraduate.def *}
\Msg{* njuthesis.ins *}
\Msg{* *}
@@ -111,38 +113,40 @@ To produce the documentation run the original source files ending with
%
% ^^A 故意留白
% ^^A 故意留白
-% ^^A 故意留白
-% ^^A 故意留白
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<*!(driver|install)>
% ^^A 诚耀百廿,雄创一流
% ^^A 南京大学一百二十周年华诞邀您共襄盛举!
-%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.20.0 2022-06-10 14:42:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.0.0 2022-08-08 14:50:00
+%<+!driver> +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
-%<definition-ug> {Undergraduate definition file for njuthesis}
-%<definition-ug>\ProvidesExplFile{njuthesis-undergraduate.def}
-%<definition-g> {Graduate definition file for njuthesis}
-%<definition-g>\ProvidesExplFile{njuthesis-graduate.def}
+%<def-u> {Undergraduate definition file for njuthesis}
+%<def-u>\ProvidesExplFile{njuthesis-undergraduate.def}
+%<def-g> {Graduate definition file for njuthesis}
+%<def-g>\ProvidesExplFile{njuthesis-graduate.def}
+%<def-p> {Postdoctoral definition file for njuthesis}
+%<def-p>\ProvidesExplFile{njuthesis-postdoctoral.def}
%<!driver> {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%</!(driver|install)>
%
%<*driver>
\ProvidesFile{njuthesis.dtx}
\documentclass[fontset=fandol]{ctxdoc}
-\usepackage{listings,njuvisual,tabularray,unicode-math}
+\usepackage{listings,njuvisual,tabularray,unicode-math,zhlineskip}
\usepackage[firstpage=true]{background}
-\backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm}
-\colorlet{at@guard}{njuviolet}
+\backgroundsetup{
+ contents={\njuemblem[white!85!gray]{22cm}{!}},
+ scale=1, angle=0, hshift=-4cm
+}
\definecolor{olgreen}{HTML}{138a07}
-\definecolor{agrd}{HTML}{2E3191}
\newcommand\olbutton[1]{\textcolor{olgreen}{\bfseries #1}}
-\newcommand\agrd[1]{\textcolor{agrd}{\sffamily 〈#1〉}}
-\newcommand\bgrd[1]{\textcolor{at@guard}{\sffamily #1}}
\newcommand\tikzlogo{Ti\emph{k}Z}
-\hypersetup{%
- pdftitle = {The njuthesis class - LaTeX thesis template for Nanjing University},
+\hypersetup{
+ pdftitle = {
+ The njuthesis class -
+ LaTeX thesis template for Nanjing University},
citecolor = njublue,
linkcolor = njuviolet,
urlcolor = njumagenta}
@@ -150,11 +154,35 @@ To produce the documentation run the original source files ending with
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
\SetTblrInner{row{1}={font=\bfseries}}
+\SetTblrInner[talltblr]{row{1}={font=\bfseries}}
\DefTblrTemplate{caption-sep}{default}{\quad}
+\def\TA{\TblrNote{a}}
+\def\TB{\TblrNote{b}}
+\def\TC{\TblrNote{c}}
+\def\TD{\TblrNote{d}}
+\def\TE{\TblrNote{e}}
+\def\TL{\TeX~Live}
+\def\MacTeX{Mac\TeX}
+\def\biber{\hologo{biber}}
+\def\LaTeXe{\hologo{LaTeX2e}}
+\SetTextEnvironmentSinglespace{1.112}
+\SetMathEnvironmentSinglespace{1.112}
+\setsansfont{LexendDeca}
+\setmonofont{Iosevka}[
+ UprightFont = Iosevka Light,
+ ItalicFont = Iosevka Light Italic,
+ BoldFont = Iosevka Semibold
+]
+\setCJKmainfont{Source Han Serif SC}[
+ UprightFont = Source Han Serif SC SemiBold,
+ ItalicFont = Source Han Serif SC Bold,
+ BoldFont = Source Han Serif SC Heavy,
+ Language = Chinese Simplified
+]
\setmathfont{XITSMath-Regular}[
BoldFont = XITSMath-Bold,
Extension = .otf]
- \lstdefinestyle{style@base}
+\lstdefinestyle{style@base}
{
basewidth = 0.5 em,
gobble = 3,
@@ -185,7 +213,7 @@ To produce the documentation run the original source files ending with
style = style@base,
rulecolor = \color{njublue},
language = [LaTeX]TeX,
- alsoletter = {*, -},
+ alsoletter = {*, -, .},
texcsstyle = *\color{njuviolet},
emphstyle = [1]\color{nju-ai-orange},
emphstyle = [2]\color{nju-cs-green}
@@ -194,6 +222,119 @@ To produce the documentation run the original source files ending with
\lstset{style=style@shell, #1}}{}
\lstnewenvironment{latexexample}[1][]{%
\lstset{style=style@latex, #1}}{}
+\makeatletter
+\ExplSyntaxOn
+\colorlet { at@guard } { njuviolet }
+\definecolor { angle@guard } { gray } { 0.7 }
+\definecolor { star@guard } { rgb } { 0.8 , 0 , 0 }
+\definecolor { u@guard } { HTML } { 5463FF }
+\definecolor { g@guard } { HTML } { 2B7A0B }
+\definecolor { p@guard } { HTML } { FF1818 }
+\definecolor { c@guard } { HTML } { FFC300 }
+\clist_const:Nn \c__njudoc_module_color_clist
+ {
+ { def-u } { u@guard },
+ { def-g } { g@guard },
+ { def-p } { p@guard },
+ { class } { c@guard }
+ }
+\cs_new_protected:Npn \__njudoc_compare_module:nnn #1#2#3
+ { \str_if_eq:nnT {#1} {#2} { \color {#3} #1 } }
+\cs_new_protected:Npn \__njudoc_set_module_color:n #1
+ {
+ \clist_map_inline:Nn \c__njudoc_module_color_clist
+ { \__njudoc_compare_module:nnn {#1} ##1 }
+ }
+\cs_new_protected:Npn \__njudoc_module_angle:Nn #1#2
+ {
+ \group_begin: \color { angle@guard } \ttfamily \textlangle \group_end:
+ \group_begin: \sffamily #2 \group_end:
+ \group_begin: \color { angle@guard } #1 \ttfamily \textrangle \group_end:
+ }
+\cs_set_protected:Npn \__ctxdoc_module_angle:n #1
+ { \__njudoc_module_angle:Nn \c_empty_tl {#1} }
+\cs_new_protected:Npn \__njudoc_colored_module_angle:NN #1#2
+ {
+ \seq_clear:N #2
+ \seq_map_inline:Nn #1
+ {
+ \seq_gput_right:Nn #2
+ { \__njudoc_set_module_color:n {##1} }
+ }
+ }
+\cs_new_protected:Npn \__njudoc_print_module:n #1
+ {
+ \__njudoc_colored_module_angle:NN \l_tmpa_seq \l_tmpb_seq
+ \bool_lazy_or:nnTF
+ { \str_if_empty_p:n { #1 } }
+ { \int_compare_p:n { \seq_count:N \l_tmpb_seq = 1 } }
+ {
+ \str_clear:N \l_tmpa_str
+ \str_clear:N \l_tmpb_str
+ }
+ {
+ \str_set:Nn \l_tmpa_str { ( }
+ \str_set:Nn \l_tmpb_str { ) }
+ }
+ \__njudoc_module_angle:Nn \l_tmpb_str
+ {
+ \color { star@guard } #1
+ \color { angle@guard } \l_tmpa_str
+ \seq_use:Nn \l_tmpb_seq
+ { \color { angle@guard } \orbar }
+ }
+ }
+\cs_new_protected_nopar:Npn \__njudoc_split_pm:n #1
+ { \seq_set_split:Nnn \l_tmpa_seq { | } {#1} }
+\cs_new_protected_nopar:Npn \__njudoc_split_m:n #1
+ {
+ \tl_set:Nn \l_tmpa_str {#1}
+ \clist_map_inline:nn { *, /, (, ) }
+ { \str_remove_all:Nn \l_tmpa_str {##1} }
+ \seq_set_split:NnV \l_tmpa_seq { | } \l_tmpa_str
+ }
+\group_begin:
+ \char_set_catcode_active:N \>
+ \cs_gset_protected:Npn \__ctxdoc_module_star:w #1 > #2 \q_stop
+ {
+ \__ctxdoc_output_module:nn
+ { \__njudoc_split_m:n {#1} }
+ { \__ctxdoc_module_push:n { \__njudoc_print_module:n { * } } }
+ \__ctxdoc_output_line:n {#2}
+ \__ctxdoc_star_format:
+ }
+ \cs_gset_protected:Npn \__ctxdoc_module_slash:w #1 > #2 \q_stop
+ {
+ \__ctxdoc_output_module:nn
+ { \__njudoc_split_m:n {#1} }
+ { \__ctxdoc_module_pop:n { \__njudoc_print_module:n { / } } }
+ \__ctxdoc_output_line:n {#2}
+ \__ctxdoc_slash_format:
+ }
+ \cs_gset_protected:Npn \__ctxdoc_module_pm:w #1 > #2 \q_stop
+ {
+ \tex_noindent:D
+ \hbox_overlap_left:n
+ {
+ \__ctxdoc_output_module:nn
+ { \__njudoc_split_pm:n {#1} }
+ { \__njudoc_print_module:n { } }
+ \skip_horizontal:n { \leftskip + \smallskipamount }
+ }
+ \group_begin:
+ \__ctxdoc_pm_format:
+ \__ctxdoc_output_line:n {#2}
+ \group_end:
+ }
+\group_end:
+\NewDocumentCommand \grd { m }
+ { \__ctxdoc_module_angle:n { \color { njuviolet } #1 } }
+\NewDocumentCommand \sgrd { m }
+ { \__ctxdoc_module_angle:n { \color { star@guard } * \color{ c@guard } #1 } }
+\NewDocumentCommand \pgrd { m }
+ { \__ctxdoc_module_angle:n { \color { #1 @guard } def- #1 } }
+\ExplSyntaxOff
+\makeatother
\begin{document}
\DocInput{njuthesis.dtx}
\PrintChanges
@@ -210,7 +351,7 @@ To produce the documentation run the original source files ending with
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}
% {git+nju-lug-email-3104-issue-@yaoge123.cn}}}
%
-% \date{v0.20.0 \quad 2022-06-10}
+% \date{v1.0.0 \quad 2022-08-08}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
@@ -223,7 +364,7 @@ To produce the documentation run the original source files ending with
% \changes{v0.7}{2021/09/12}{将 \cls{njuthesis} 发布在 CTAN。}
% \changes{v0.8}{2021/09/12}{修复已知问题,进行公开宣传。}
% \changes{v0.9}{2021/09/15}{使用 DocStrip 合并模板文件。}
-% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合 \hologo{LaTeX3} 规范。}
+% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合 \LaTeX3 规范。}
% \changes{v0.9}{2021/09/15}{进一步完善文档。}
% \changes{v0.10}{2021/09/24}{删除了生成自述文件的代码。}
% \changes{v0.12}{2021/11/28}{删除内置的 \pkg{njuvisual} 代码。}
@@ -232,17 +373,23 @@ To produce the documentation run the original source files ending with
% \changes{v0.12}{2021/12/06}{修改了说明文档的代码呈现样式。}
% \changes{v0.13}{2021/12/12}{优化了编译速度。}
% \changes{v0.13}{2021/12/15}{适配2022届本科生毕业毕业论文(设计)规范。}
-% \changes{v0.14}{2022/01/13}{将本模板内嵌入南大 \hologo{TeX} 网站。}
+% \changes{v0.13}{2021/12/16}{默认不加载 \pkg{listings} 宏包。}
+% \changes{v0.14}{2022/01/13}{将本模板内嵌入南大 \TeX{} 网站。}
% \changes{v0.16}{2022/03/01}{分离本科生和研究生模板配置。}
% \changes{v0.19}{2022/05/23}{对研究生普通封面进行若干细节修改。}
% \changes{v0.19}{2022/05/23}{对国家图书馆封面进行若干细节修改。}
% \changes{v0.20}{2022/06/08}{更正本科生模板部分字样。}
+% \changes{v1.0}{2022/06/29}{移除毕业设计封面。}
+% \changes{v1.0}{2022/07/05}{按类型重命名变量。}
+% \changes{v1.0}{2022/07/23}{新增博士后出站报告模板。}
+% \changes{v1.0}{2022/07/28}{在手册中以不同颜色指示不同模块。}
+% \changes{v1.0}{2022/08/02}{删除 \LaTeX 基础用法的说明。}
%
%
% \maketitle
%
% \begin{abstract}
-% 南京大学学位论文 \hologo{LaTeX} 模板 \cls{njuthesis} 基于本科生院的论文撰写
+% 南京大学学位论文 \LaTeX 模板 \cls{njuthesis} 基于本科生院的论文撰写
% 规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学
% 位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书
% 写的方便。
@@ -251,7 +398,7 @@ To produce the documentation run the original source files ending with
% \def\abstractname{Abstract}
% \begin{abstract}
% The \cls{njuthesis} class is intended for typesetting Nanjing University
-% dissertations with \hologo{LaTeX}, providing support for bachelor, master,
+% dissertations with \LaTeX, providing support for bachelor, master,
% and doctoral thesis.
% \end{abstract}
%
@@ -284,17 +431,19 @@ To produce the documentation run the original source files ending with
% \section{模板介绍}
%
% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 Linux
-% 用户组维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
+% 用户组维护的,用于处理本校学生毕业论文排版需求的 \LaTeX 模板。
%
% 本模板使用的本科生毕业论文模板格式依据
-% 《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju2021},
-% 研究生学位论文格式依据研究生院提供的材料包。
+% 《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju-bachelor-2022},
+% 研究生学位论文格式依据研究生院提供的材料包\cite{nju-master-2022,nju-doctor-2022}。
+% 博士后出站报告格式要求与博士学位论文一致\cite{nju-postdoc-2022},
+% 封面、摘要的设计参考了部分既有报告。
%
%
% \subsection{开始之前}
% \label{subsec:first-things-first}
%
-% 在本文正式介绍 \cls{njuthesis} 论文模板前,您也许并不熟悉 \hologo{TeX}
+% 在本文正式介绍 \cls{njuthesis} 论文模板前,您也许并不熟悉 \TeX{}
% 排版系统。话不多说,请先按部就班体验一遍下述的工作流程:
%
% \bigskip
@@ -331,9 +480,9 @@ To produce the documentation run the original source files ending with
% 点击左上角的菜单按钮,查看编译器是否显示为 |XeLaTeX|;
% 再如果\emph{还有其他原因},通过这几分钟的实验我们也可以得到一个极其
% 有益的结论:\emph{也许 Word 模板更加适合您}。这可以节省下熟悉
-% \hologo{TeX} 排版软件使用方法所需的可观时间。
+% \TeX{} 排版软件使用方法所需的可观时间。
%
-% \subparagraph{但我依然对 \hologo{LaTeX} 一无所知!}
+% \subparagraph{但我依然对 \LaTeX 一无所知!}
% 这意味着您真的得花些时间在\emph{长篇累牍的精细介绍}上。
% 如果您已经下定决心,请接着向后阅读,有需要时善用搜索引擎。
%
@@ -369,7 +518,7 @@ To produce the documentation run the original source files ending with
% 与其让一千个学生做一千种不同的模板,不如有人牵起头来,集中力量办大事。因此,南
% 京大学 Linux User Group 的有志之士在2021年暑期联合起来,参考以上的现成模板,兼
% 顾友校 \cls{fduthesis}\cite{fduthesis}、\textsc{THuThesis}\cite{thuthesis} 等
-% 优秀项目,构建了这一全新模板,力求通过 \hologo{LaTeX3} 语法和清晰的接口实现良
+% 优秀项目,构建了这一全新模板,力求通过 \LaTeX3 语法和清晰的接口实现良
% 好的易用性和可维护性。
%
% 目前,本模板的主要维护者包括:
@@ -382,10 +531,10 @@ To produce the documentation run the original source files ending with
%
% \subsection{快速上手}
%
-% \hologo{LaTeX} 并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听
+% \LaTeX 并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听
% 到“\emph{给毕业论文交差也得写代码}”这种事情就头疼,实在是我们不愿意见到而必须
-% 要面对的情况。目前,中文互联网上的 \hologo{LaTeX} 写作教程可谓汗牛充栋,然而
-% 如何快速准确找到所需要的用法,尤其是 \hologo{LaTeX3} 的新接口,需要一定的时间
+% 要面对的情况。目前,中文互联网上的 \LaTeX 写作教程可谓汗牛充栋,然而
+% 如何快速准确找到所需要的用法,尤其是 \LaTeX3 的新接口,需要一定的时间
% 或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您
% 的相关知识体系,只能\emph{尽力做到有求必应},在需要的地方顺带提一嘴,以期使您
% 少走点弯路。
@@ -393,8 +542,9 @@ To produce the documentation run the original source files ending with
% 如果您希望在使用本模板前了解一些关于这个排版软件的基础知识,在此尝试列举一些有
% 所帮助的资料:
% \begin{description}
-% \item[\textit{lshort}] 著名的介绍文档,已被译为多种语言,可以参考英文版\cite{lshort}及其中文翻译版\cite{lshort-zh-cn}。
-% \item[《\hologo{LaTeX} 入门》] 刘海洋著\cite{刘海洋2013latex入门}。
+% \item[\textit{lshort}] 著名的介绍文档,已被译为多种语言,可以参考英文版
+% \cite{lshort}及其中文翻译版\cite{lshort-zh-cn}。
+% \item[《\LaTeX 入门》] 刘海洋著\cite{刘海洋2013latex入门}。
% \end{description}
%
%
@@ -403,7 +553,7 @@ To produce the documentation run the original source files ending with
% 本模板通过 \textsc{DocStrip} 进行维护,实际上是一种\emph{文学编程}。文学编程的
% 本体是那些用来说明的文字,按写书写文章的方式组织。\file{njuthesis.dtx} 包含
% \cls{njuthesis} 文档类的所有信息。前半部分为模板说明,即各种常用命令与必要的使
-% 用方法;后半部分为代码实现,为带有详细注释的 \hologo{TeX} 源代码。后者配合附
+% 用方法;后半部分为代码实现,为带有详细注释的 \TeX{} 源代码。后者配合附
% 录,为有意了解本模板实现细节的同学提供必要指引。
%
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,无衬线字体的
@@ -411,7 +561,7 @@ To produce the documentation run the original source files ending with
% 字体的 \opt{opt-example} 为选项名,等宽字体的 \env{env-example} 为需要
% |\begin{}|和|\end{}|的环境名,等。本手册提供的代码示例中,左侧边线呈现南大标
% 准洋红色 {\color{njumagenta}$\blacksquare$} 的属于终端命令,呈南大标准蓝色
-% {\color{njublue}$\blacksquare$} 的属于 \hologo{LaTeX} 源代码。
+% {\color{njublue}$\blacksquare$} 的属于 \LaTeX 源代码。
%
%
% \subsection{许可说明}
@@ -423,10 +573,14 @@ To produce the documentation run the original source files ending with
% 本模板之版权隶属于 © 2021 - 2022 南京大学 Linux 用户组。
%
% \subparagraph{发布和修改}
-% 本模板的发布和(或)修改遵守 LaTeX Project Public License(版本 1.3c 或更高)的条款。该许可证的最新版本位于 \url{http://www.latex-project.org/lppl.txt},1.3c 及更新的版本随附于 2003/12/01 版本以后的所有 \hologo{LaTeX} 发行版。
+% 本模板的发布和(或)修改遵守 LaTeX Project Public License(版本 1.3c 或更高)
+% 的条款。该许可证的最新版本位于 \url{http://www.latex-project.org/lppl.txt},
+% 1.3c 及更新的版本随附于 2003/12/01 版本以后的所有 \LaTeX 发行版。
%
% \subparagraph{联系作者}
-% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,请通过 \href{https://github.com/nju-lug/NJUThesis/issues}{GitHub Issue} 或者 QQ 群聊\footnote{群号是 991559926。}联系 NJU LUG。
+% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,
+% 请通过 \href{https://github.com/nju-lug/NJUThesis/issues}{GitHub Issue}
+% 或者 QQ 群聊\footnote{群号是 991559926。}联系 NJU LUG。
%
%
% \section{安装}
@@ -438,14 +592,14 @@ To produce the documentation run the original source files ending with
% \cls{njuthesis} 目前处于积极的维护中,主要可通过以下三种途径获取模板文件:
%
% \subparagraph{CTAN}
-% \href{https://ctan.org/}{CTAN}\footnote{The Comprehensive \hologo{TeX}
-% Archive Network} 是所有 \hologo{TeX} 相关材料的中枢。
+% \href{https://ctan.org/}{CTAN}\footnote{The Comprehensive \TeX{}
+% Archive Network} 是所有 \TeX{} 相关材料的中枢。
% 本模板的 CTAN 页面
% \footnote{\href{https://ctan.org/pkg/njuthesis}{\cls{njuthesis}} 已经于2021年9
% 月12日发布在 CTAN,用于绘制南大图标的
% \href{https://ctan.org/pkg/njuvisual}{\pkg{njuvisual}} 也已于同年11月28日发
-% 布,两者已被 \hologo{TeX} Live 和 \hologo{MiKTeX} 收录。}上提供基本的介绍信息,可以下载说明文档(本文档)和宏包源代
-% 码。当然,使用这一来源时并不需要接触后者,请参考
+% 布,两者已被 \TeX{} Live 和 \MiKTeX 收录。}上提供基本的介绍信息,可以下载
+% 说明文档(本文档)和宏包源代码。当然,使用这一来源时并不需要接触后者,请参考
% \ref{subsubsec:standard-installation} 的标准安装方法。
%
% \subparagraph{GitHub 仓库}
@@ -510,10 +664,10 @@ To produce the documentation run the original source files ending with
% \subsubsection{标准安装}
% \label{subsubsec:standard-installation}
%
-% 我们\emph{始终建议}使用宏包管理器将 \cls{njuthesis} 安装到您的 \hologo{TeX} 系
-% 统。您可以通过 \hologo{TeX}\,Live Manager 或者 \hologo{MiKTeX} Console 等图形
-% 化包管理器直接搜索并安装 \cls{njuthesis} (及其依赖的 \pkg{njuvisual})最新的
-% 稳定版。同时,您也可以使用终端命令。例如,假设您使用的是 \hologo{TeX}\,Live,
+% 我们\emph{始终建议}使用宏包管理器将 \cls{njuthesis} 安装到您的 \TeX 系
+% 统。您可以通过 \TL~Manager 或者 \MiKTeX~Console 等图形化包管理器直接搜
+% 索并安装 \cls{njuthesis} (及其依赖的 \pkg{njuvisual})最新的
+% 稳定版。同时,您也可以使用终端命令。例如,假设您使用的是 \TL,
% 键入下述 \pkg{tlmgr} 的命令(很可能需要管理员权限):
% \begin{shellexample}[morekeywords={tlmgr},emph={install}]
% tlmgr install njuthesis njuvisual
@@ -523,7 +677,8 @@ To produce the documentation run the original source files ending with
% 另一方面,CTAN 依赖开发者手动上传更新,版本更新具有滞后性。如果使用时遇到了问
% 题,不妨使用下一小节的\emph{即时安装方法}优先载入较新的格式文件。
%
-% {\color{red}|[!]|} 如果您具备相关经验\footnote{譬如熟悉命令行操作、使用的是 \hologo{TeX}\,Live 发行版等},可以在下载仓库内全部文件后,于该目录下运行
+% {\color{red}|[!]|} 如果您具备相关经验\footnote{譬如熟悉命令行操作、使用的是 \TL
+% 发行版等},可以在下载仓库内全部文件后,于该目录下运行
% \begin{shellexample}[morekeywords={l3build},emph={install}]
% l3build install
% \end{shellexample}
@@ -555,26 +710,27 @@ To produce the documentation run the original source files ending with
% \subsection{本地编译}
% \label{subsec:localcompile}
%
-% 本地编译的安装过程分为两个阶段:安装 \hologo{TeX} 发行版以及配置编辑器。前者提供了可以被命
-% 令行终端调用的编译程序,后者则提供了语法高亮、自动编译等人性化功能。
+% 本地编译的安装过程分为两个阶段:安装 \TeX 发行版以及配置
+% 编辑器。前者提供了可以被命令行终端调用的编译程序,
+% 后者则提供了语法高亮、自动编译等人性化功能。
%
-% \subsubsection{安装\hologo{TeX}发行版}
+% \subsubsection{安装 \TeX{} 发行版}
%
-% 首先需要下载并安装 \hologo{TeX} 软件发行版,其中包括引擎、宏包、字体、
-% 文档等。各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次
-% 编译前请务必通过 MiKTeX Console、TeX LiveManager 等图形化程序或
+% 首先需要下载并安装 \TeX{} 软件发行版,其中包括引擎、宏包、字体、文档等。
+% 各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次
+% 编译前请务必通过 \MiKTeX~Console、\TL~Manager 等图形化程序或
% \pkg{tlmgr} \emph{手动更新全部宏包}以避免潜在的兼容性问题。
% \begin{table}[ht]
% \centering
-% \caption{\hologo{TeX} 软件发行版一览}
+% \caption{\TeX 软件发行版一览}
% \label{tab:texdistribution}
% \begin{tabular}{cccc}
% \toprule
-% \hologo{TeX} & Windows & macOS & Linux \\
+% \TeX & Windows & macOS & Linux \\
% \midrule
-% \hologo{TeX}\,Live & $\bullet$ & & $\bullet$ \\
-% Mac\hologo{TeX} & & $\bullet$ & \\
-% \hologo{MiKTeX} & $\bullet$ & $\bullet$ & $\bullet$ \\
+% \TL & $\bullet$ & & $\bullet$ \\
+% \MacTeX & & $\bullet$ & \\
+% \MiKTeX & $\bullet$ & $\bullet$ & $\bullet$ \\
% \bottomrule
% \end{tabular}
% \end{table}
@@ -586,7 +742,7 @@ To produce the documentation run the original source files ending with
% \href{https://mirror.nju.edu.cn/download/TeX%20排版系统}
% {南京大学开源软件镜像站}可以获得最佳的下载体验。
% \item 使用最新的发行版,即版本号为2022或者22。
-% \item 对于 Windows 和 macOS 用户,更推荐轻量化的 \hologo{MiKTeX} 套件。
+% \item 对于 Windows 和 macOS 用户,更推荐轻量化的 \MiKTeX 套件。
% ^^A \item Linux 用户请尽可能下载 full 版本,如 |texlive-full|。
% ^^A 换言之,下载最大的软件包。
% \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查
@@ -602,18 +758,18 @@ To produce the documentation run the original source files ending with
%
% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是
% 最好的文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代
-% 更美观更多功能}的编辑器,譬如\emph{安装了 \hologo{LaTeX} Workshop 插件的
+% 更美观更多功能}的编辑器,譬如\emph{安装了 \LaTeX Workshop 插件的
% \href{https://code.visualstudio.com/}{Visual Studio Code}}。您也可以根据
% 个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
%
% \cls{njuthesis} 为一些常见编辑器提供了配置文件,如
% \begin{description}
% \item[Visual Studio Code] 本模板在 \file{.vscode/} 中提供一份
-% \hologo{LaTeX} Workshop 插件的简易配置,在打开文件夹后将自动导入,
+% \LaTeX Workshop 插件的简易配置,在打开文件夹后将自动导入,
% 可以省略初始配置步骤直接使用。
% \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键
% |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置
-% 为使用 \hologo{XeLaTeX} 编译,然后按照 \ref{subsubsec:compileseq}
+% 为使用 \XeLaTeX 编译,然后按照 \ref{subsubsec:compileseq}
% 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用
% \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
% \end{description}
@@ -621,7 +777,7 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{编译顺序}
% \label{subsubsec:compileseq}
-% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎,
+% \TeX 本身是命令行程序,通过不同的命令调用所需的编译引擎,
% 编辑器提供的快捷按钮实际只是做了包装。为了便于排查运行错误,
% 以下通过具体终端命令简要描述编译过程。
%
@@ -638,14 +794,14 @@ To produce the documentation run the original source files ending with
% 文档位于同一目录下。该目录下同时会生成若干中间文件。
%
% 编译命令具体为引擎名称加主文件名,在编译 \file{.tex} 文件时,
-% 文件扩展名可以省略不写。现阶段 \cls{njuthesis} 仅支持 \hologo{XeTeX}
-% 与 \hologo{LuaTeX} 引擎,以及 \hologo{biber} 文献工具。请注意,
-% 几种命令的输出文件基本相同,可以任取一种;但如果您不清楚这两种编译引擎的
-% 区别,或者对多步编译感到困惑,我们建议优先使用 |latexmk -xelatex|。
+% 文件扩展名可以省略不写。现阶段 \cls{njuthesis} 仅支持 \XeTeX
+% 与 \LuaTeX 引擎,以及 \biber 文献工具。请注意,几种命令的输出文件
+% 基本相同,可以任取一种;但如果您不清楚这两种编译引擎的区别,
+% 或者对多步编译感到困惑,我们建议优先使用 |latexmk -xelatex|。
%
%
-% \subparagraph{使用 \hologo{XeLaTeX}}
-% 标准的 \hologo{XeTeX} 引擎四步编译方法。
+% \subparagraph{使用 \XeLaTeX}
+% 标准的 \XeTeX 引擎四步编译方法。
%
% \begin{shellexample}[morekeywords={xelatex,biber}]
% xelatex njuthesis-sample
@@ -655,8 +811,8 @@ To produce the documentation run the original source files ending with
% \end{shellexample}
%
%
-% \subparagraph{使用 \hologo{LuaLaTeX}}
-% 标准的 \hologo{LuaTeX} 引擎四步编译方法。
+% \subparagraph{使用 \LuaLaTeX}
+% 标准的 \LuaTeX 引擎四步编译方法。
%
% \begin{shellexample}[morekeywords={lualatex,biber}]
% lualatex njuthesis-sample
@@ -680,9 +836,9 @@ To produce the documentation run the original source files ending with
% \begin{shellexample}[morekeywords={latexmk}]
% latexmk njuthesis-sample
% \end{shellexample}
-% 直接运行会调用 \hologo{pdfLaTeX} 引擎导致报错。
+% 直接运行会调用 \pdfLaTeX 引擎导致报错。
% 如需指定编译引擎,可以加入 |-xelatex| 或 |-lualatex| 参数。
-% 例如,指定 \hologo{XeLaTeX} 的命令为
+% 例如,指定 \XeLaTeX 的命令为
% \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
% latexmk -xelatex njuthesis-sample
% \end{shellexample}
@@ -696,24 +852,40 @@ To produce the documentation run the original source files ending with
% \subsection{在线编译}
% \label{subsec:onlinecompile}
%
-% 相信您在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如 \hologo{TeX} 编译器安装过程较为漫长\footnote{因此对于 Windows 推荐 \hologo{MiKTeX}。},占用空间过大\footnote{事实上,可以通过 |scheme-infraonly| 模式安装 \hologo{TeX}\,Live,随后利用 \pkg{tlmgr} 安装依赖宏包,这份宏包列表可以在 Git 仓库的 \file{.github/workflows/build.yml} 找到。},而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{出于文件 IO 速度的差异,同一个模板在 Linux 编译可以相对 Windows 节省约一半耗时。}。拒绝接受这些麻烦的同学可以尝试本节介绍的在线编译方法。
+% 相信您在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如 \TeX 编译器
+% 安装过程较为漫长\footnote{因此对于 Windows 推荐 \MiKTeX。},占用空间过大
+% \footnote{事实上,可以通过 |scheme-infraonly| 模式安装 \TL,随后利用 \pkg{tlmgr}
+% 安装依赖宏包,这份宏包列表可以在 Git 仓库的 \file{.github/workflows/build.yml}
+% 找到。},而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{出于文件 IO
+% 速度的差异,同一个模板在 Linux 编译可以相对 Windows 节省约一半耗时。}。
+% 拒绝接受这些麻烦的同学可以尝试本节介绍的在线编译方法。
%
% {\color{red}|[!]|} 请注意,在线编辑器不一定提供良好的文件恢复和版本管理机制。
% 请谨慎备份您的心血结晶。
%
-% \subsubsection{南大\hologo{TeX}平台简介}
-% \changes{v0.2}{2021/09/07}{添加对南大 \hologo{TeX} 的支持。}
+% \subsubsection{南大 \TeX 平台简介}
+% \changes{v0.2}{2021/09/07}{添加对南大 \TeX 的支持。}
%
-% \href{https://tex.nju.edu.cn}{南大 \hologo{TeX}} 基于开源的 Overleaf 社区版平台构建\footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正式上线,是 \href{https://sci.nju.edu.cn/}{eScience 中心}为南大在校师生提供的 \hologo{LaTeX} 在线编辑器,首次使用需凭学校邮箱自助注册账号。
+% \href{https://tex.nju.edu.cn}{南大 \TeX} 基于开源的 Overleaf 社区版平台构建
+% \footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到
+% 一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正
+% 式上线,是 \href{https://sci.nju.edu.cn/}{eScience 中心}为南大在校师生提供的
+% \LaTeX 在线编辑器,首次使用需凭学校邮箱自助注册账号。
%
-% {\color{red}|[!]|} 在 2022 年 5 月的运行中,该网站出现了多次崩溃事件,初步判断原因是由社区版并没有为高并发数做优化引发的。高峰时期,仍然建议在本地部署 \hologo{TeX} 发行版。
+% {\color{red}|[!]|} 在 2022 年 5 月的运行中,该网站出现了多次崩溃事件,
+% 初步判断原因是由社区版并没有为高并发数做优化引发的。
+% 高峰时期,仍然建议在本地部署 \TeX 发行版。
%
% \subsubsection{操作步骤}
%
-% 本说明手册开头的 \ref{subsec:first-things-first} 即呈现了网站内嵌的 \cls{njuthesis} 模板的使用方法。由于南大 \hologo{TeX} 网站已预装 \cls{njuthesis},可以直接编写正文,无需 \file{.cls} 等格式文件。如果有其他要求,也可以按如下步骤手动上传包含模板的压缩包。
+% 本说明手册开头的 \ref{subsec:first-things-first} 即呈现了网站内嵌的
+% \cls{njuthesis} 模板的使用方法。由于南大 \TeX 网站已预装 \cls{njuthesis},
+% 可以直接编写正文,无需 \file{.cls} 等格式文件。
+% 如果有其他要求,也可以按如下步骤手动上传包含模板的压缩包。
%
% \begin{enumerate}
-% \item 访问\href{https://tex.nju.edu.cn}{南大 \hologo{TeX} 网站},点击界面右上方“注册”按钮,使用\emph{南京大学邮箱}注册账号并登录
+% \item 访问\href{https://tex.nju.edu.cn}{南大 \TeX 网站},
+% 点击界面右上方“注册”按钮,使用\emph{南京大学邮箱}注册账号并登录
% \item 新建空白项目,或者上传 \ref{subsubsec:on-the-fly-installation} 节得到的压缩文件。
% \item 在项目页面左上角的“菜单”中,确认编译器为 |XeLaTeX| 或者 |LuaLaTeX|
% \item 仿照 \file{njuthesis-sample.tex} 编写论文
@@ -728,7 +900,9 @@ To produce the documentation run the original source files ending with
% \pkg{njuthesis} 现已支持 \href{https://www.overleaf.com/}{Overleaf} 平台。
%
% \subparagraph{TeXPage}
-% \href{https://www.texpage.com/}{TeXPage} 是国人研发的 \hologo{LaTeX} 在线编辑器,当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、编辑历史等实用工具,也可以作为一个备选项。
+% \href{https://www.texpage.com/}{TeXPage} 是国人研发的 \LaTeX 在线编辑器,
+% 当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、
+% 编辑历史等实用工具,也可以作为一个备选项。
%
%
% \subsection{版本升级}
@@ -746,7 +920,7 @@ To produce the documentation run the original source files ending with
% 文件覆盖旧版本。
%
% \subparagraph{没有}
-% 如果使用的是南大 \hologo{TeX},更新内置模板时会进行公告,一般为上传 CTAN
+% 如果使用的是南大 \TeX,更新内置模板时会进行公告,一般为上传 CTAN
% 后一周内。如果是本地安装,请直接使用包管理器进行更新:
% \begin{shellexample}[morekeywords={tlmgr},emph={update}]
% tlmgr update --all
@@ -759,7 +933,7 @@ To produce the documentation run the original source files ending with
%
% 典型的 \cls{njuthesis} 主文件结构应该如下所示:
%
-% \begin{latexexample}[moretexcs={\njusetup,\graphicspath,\tableofcontents,
+% \begin{latexexample}[moretexcs={\njusetup,\tableofcontents,
% \maketitle,\mainmatter,\chapter,\printbibliography},emph={[1]document}]
% \documentclass{njuthesis}
% \njusetup{}
@@ -784,27 +958,27 @@ To produce the documentation run the original source files ending with
% 下文中尖括号内列出了若干个允许的选项,其中加粗的为默认选项(缺省值)。
%
% \subsubsection{学位信息}
-% \begin{function}[added=2021-09-07]{degree}
+% \begin{function}[added=2021-09-07,updated=2022-07-23]{type}
% \begin{syntax}
-% degree = <(ug)|mg|mf|phd>
+% type = <(bachelor)|master|doctor|postdoc>
% \end{syntax}
-% 选择学位,分别为学士、学术型硕士、专业硕士、博士,默认为学士(即本科生)。
+% 选择毕业论文模板类型,这将决定模板整体的外观。
+% 可选值分别为学士(本科生)、硕士研究生和博士研究生,默认为学士。
% \end{function}
%
-% \begin{function}[added=2021-09-07]{type}
+% \begin{function}[added=2021-09-07,updated=2022-07-01]{degree}
% \begin{syntax}
-% type = <(thesis)|design>
+% degree = <(academic)|professional>
% \end{syntax}
-% 用于选择文档类型并将相关字段输出在封面和摘要页,
-% 可选值分别为毕业论文和毕业设计,默认为毕业论文。
+% 选择研究生的学位类型。可选值分别学术型和专业型,默认为学术型。
% \end{function}
%
%
% \subsubsection{特殊页面}
%
-% \begin{function}[added=2021-09-07]{nlcover}
+% \begin{function}[added=2021-09-07,updated=2022-07-05]{nl-cover}
% \begin{syntax}
-% nlcover = <\TFF>
+% nl-cover = <\TFF>
% \end{syntax}
% 是否使用国家图书馆封面,默认关闭。
% \end{function}
@@ -819,11 +993,12 @@ To produce the documentation run the original source files ending with
% 是否需要自动生成声明页面,默认关闭。
% \end{function}
%
-% 通过此项,对于本科生模板可在封面后添加的诚信承诺书,
-% 对于研究生模板可在封面后添加原创性声明,并且在最后一页添加学位论文出版授权书。
+% 通过此项,对于本科生模板可在封面后添加的诚信承诺书,对于研究生模板可在
+% 封面后添加原创性声明\footnote{其中的打勾符号依赖 \pkg{unicode-math}。},
+% 并且在最后一页添加学位论文出版授权书。
%
% 对于需要手动插入承诺书扫描页的情况,可以在导言区载入 \pkg{pdfpages} 宏包
-% \cite{pdfpages},并在所需位置使用该宏包提供的 \cs{includepdf} 命令。
+% \cite{pdfpages},并在所需位置使用该宏包提供的 \tn{includepdf} 命令。
% 例如,可以用如下所示的命令插入扫描件的第一页,并插入紧随的一个空白页。
% \begin{latexexample}[moretexcs={\includepdf},emph={[2]pages}]
% \includepdf[pages={1,{}}]{scanned.pdf}
@@ -839,7 +1014,7 @@ To produce the documentation run the original source files ending with
% 开启单面或双面模式,默认为双面模式。
% \end{function}
%
-% 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。
+% 本选项继承自 \LaTeXe \cls{book} 标准文档类。
% 单双面选项为全局选项,开启后会改变页码编号,以及部分宏包的行为。
% 在单面模式下,页面是连续的,不会产生空白页;在双面模式下,
% 新的一章以及封面、摘要、参考文献表等特殊页面都会从奇数页开始,
@@ -852,7 +1027,7 @@ To produce the documentation run the original source files ending with
% 是否开启草稿模式,默认关闭。
% \end{function}
%
-% 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。
+% 本选项继承自 \LaTeXe \cls{book} 标准文档类。
% 草稿模式为全局选项,启用这一选项将产生以下整体影响:
% \begin{itemize}
% \item 禁用封面的绘制(包括承诺和声明)
@@ -867,11 +1042,11 @@ To produce the documentation run the original source files ending with
% 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。
% 如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。
%
-% \begin{function}[added=2022-04-19]{blind}
+% \begin{function}[added=2022-04-19,updated=2022-07-04]{anonymous}
% \begin{syntax}
-% <blind>
+% anonymous = <\TFF>
% \end{syntax}
-% 是否开启盲审模式。这个选项并不包含 |=| 号。
+% 是否开启盲审模式。
% \end{function}
%
% 盲审模式会抹除论文中的学校和个人信息,效果包括:
@@ -882,6 +1057,47 @@ To produce the documentation run the original source files ending with
% \end{itemize}
%
%
+% \subsubsection{可选宏包}
+% \label{subsubsec:optional-pkg}
+%
+% \begin{function}[added=2022-08-03]{
+% biblatex,
+% cleveref,
+% ntheorem,
+% enumitem,
+% footmisc,
+% unicode-math}
+% \begin{syntax}
+% biblatex = <\TTF>
+% cleveref = <\TTF>
+% ntheorem = <\TTF>
+% enumitem = <\TTF>
+% footmisc = <\TTF>
+% unicode-math = <\TTF>
+% \end{syntax}
+% 是否默认载入某些宏包,默认均是。选项名和宏包名是一致的。
+% \end{function}
+%
+% \begin{function}[added=2022-08-03]{minimal}
+% \begin{syntax}
+% <minimal>
+% \end{syntax}
+% 最小化模式,禁用所有上述宏包。
+% \end{function}
+%
+% 本模板内置了一系列宏包以进行功能扩展。这些宏包为:
+% \begin{description}
+% \item[\pkg{biblatex}] 复杂参考文献数据的处理。
+% \item[\pkg{cleveref}] 按来源类型自动处理引用标签。
+% \item[\pkg{ntheorem}] 定理类环境定制。
+% \item[\pkg{enumitem}] 列表环境样式定制。
+% \item[\pkg{footmisc}] 脚注样式定制。
+% \item[\pkg{unicode-math}] 支持 Unicode 数学字体。
+% \end{description}
+%
+% 在某些情况下,这些宏包会与旧有的经验方法冲突,可以使用上述选项在模板
+% 中禁用这些宏包,从而手动配置相关功能。
+%
% \subsubsection{配置文件}
%
% \begin{function}[added=2022-02-23]{config}
@@ -891,7 +1107,7 @@ To produce the documentation run the original source files ending with
% 配置文件路径。
% \end{function}
%
-% 本选项可用于载入额外的用户配置文件。该文件支持 \hologo{LaTeX3} 语法。
+% 本选项可用于载入额外的用户配置文件。该文件支持 \LaTeX3 语法。
%
%
% \subsubsection{指定字体}
@@ -917,101 +1133,203 @@ To produce the documentation run the original source files ending with
% 在不同的操作系统上使用同一套配置会导致缺字、编译出错等后果。
% 因此,本模板对于中文字体和西文字体都提供了多种字体配置。
%
+% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec}
+% 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
+%
+% ^^A \begin{function}[added=2022-07-02]{font-path}
+% ^^A \begin{syntax}
+% ^^A font-path = \Arg{文件夹}
+% ^^A \end{syntax}
+% ^^A 字体文件目录。
+% ^^A \end{function}
+%
+% ^^A 本模板默认使用操作系统安装的字体。可以使用本选项从任意目录载入字体。
+%
+% \paragraph{中文}
+%
% 本模板提供的中文字体配置如表 \ref{tab:cjk-fontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
-% (见表中前三行,Windows 和 macOS 以外的系统采用 Fandol 配置)。
-% 此外,我们也单独提供了方正和思源两套中文字体配置。
-%
-% \begin{table}[htbp]
+% (见表中前三行,Windows 和 macOS 以外的系统采用
+% \href{https://www.ctan.org/pkg/fandol}{Fandol} 配置)。
+% 此外,我们也单独提供了\href{https://www.foundertype.com}
+% {方正}和\href{https://github.com/adobe-fonts}{思源}两套中文字体配置。
+%
+% \begin{table}[!htbp]
+% \def\FD{http://www.foundertype.com/index.php/FontInfo/index/id/1}
+% \def\MN{https://mirrors.nju.edu.cn/adobe-fonts/source-han-}
+% \def\OT{/OTF/SimplifiedChinese/}
+% \def\FZ#1#2{\href{\FD #1}{方正 #2}}
+% \def\SC#1#2{\href{\MN #1\OT}{思源 #2 体}}
% \centering
% \begin{talltblr}[
-% caption = {中文字体配置列表},
-% label = {tab:cjk-fontset},
-% note{a} = {请下载简繁扩展(即 GBK 编码)版本},
-% note{b} = {使用\ignorespaces
-% \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}
-% {方正小标宋}作为方正书宋的粗体},
-% note{c} = {使用\ignorespaces
-% \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}
-% {方正黑体}作为方正细黑一的粗体},
+% caption = {中文字体配置},
+% label = {tab:cjk-fontset},
+% note{a} = {请下载简繁扩展(即 GBK 编码)版本},
+% note{b} = {使用\href{\FD164}{方正小标宋}作为方正书宋的粗体},
+% note{c} = {使用\href{\FD131}{方正黑体}作为方正细黑一的粗体},
% note{d} = {在部分操作系统中可能已经预装 Google Noto 字体。
-% 考虑到获取字体的难易程度,单独安装时请采用
-% \href{https://mirrors.nju.edu.cn/download/Adobe%20Source%20Han}{Adobe Source Han}
-% 字体表示思源字体,请下载 Simplified Chinese(即后缀名为 SC)的版本},
-% note{e} = {思源字体并不包含楷书和仿宋,而 Adobe 楷体和仿宋难以直接下载,
-% 因此使用方正字体代替} ]
+% 考虑到获取字体的难易程度,单独安装时建议采用 Adobe Source Han 字体
+% 表示思源字体,请下载 Simplified Chinese(即后缀名为 SC)的版本},
+% note{e} = {思源字体并不包含楷书和仿宋,而 Adobe
+% 楷体和仿宋难以直接下载,因此使用方正字体代替} ]
% { cell{2}{2,4} = {white!70!njuyellow},
-% cell{4}{4} = {white!70!njuyellow},
-% row{1} = {font=\bfseries}, colspec = {ccccc} }
+% cell{4}{4} = {white!70!njuyellow},
+% colspec = {ccccc} }
% \toprule
-% 配置名称 & 宋体 & 黑体 & 楷书 & 仿宋 \\
+% 配置名称 & 宋体 & 黑体 & 楷书 & 仿宋 \\
% \midrule
-% Windows & 中易宋体 & 中易黑体 & 中易楷体 & 中易仿宋 \\
-% macOS & 华文宋体 & 华文黑体 & 华文楷体 & 华文仿宋 \\
-% \href{https://www.ctan.org/pkg/fandol} {Fandol}
-% & Fandol宋体 & Fandol黑体 & Fandol楷体 & Fandol仿宋 \\
-% \href{https://www.foundertype.com}{方正}\TblrNote{a}
-% & \href{http://www.foundertype.com/index.php/FontInfo/index/id/151}{方正书宋}\TblrNote{b}
-% & \href{http://www.foundertype.com/index.php/FontInfo/index/id/161}{方正细黑一}\TblrNote{c}
-% & \href{http://www.foundertype.com/index.php/FontInfo/index/id/137}{方正楷体}
-% & \href{http://www.foundertype.com/index.php/FontInfo/index/id/128}{方正仿宋} \\
-% \href{https://github.com/adobe-fonts}{思源}\TblrNote{d}
-% & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-serif/OTF/SimplifiedChinese/}{思源宋体}
-% & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-sans/OTF/SimplifiedChinese/}{思源黑体}
-% & 方正楷体\TblrNote{e} & 方正仿宋 \\
+% \opt{win} & 中易宋体 & 中易黑体 & 中易楷体 & 中易仿宋 \\
+% \opt{mac} & 华文宋体 & 华文黑体 & 华文楷体 & 华文仿宋 \\
+% \opt{fandol} & Fandol 宋体 & Fandol 黑体 & Fandol 楷体 & Fandol 仿宋 \\
+% \opt{founder}\TA & \FZ{51}{书宋}\TB & \FZ{61}{细黑一}\TC & \FZ{37}{楷体} & \FZ{28}{仿宋} \\
+% \opt{noto} \TD & 思源宋体 & 思源黑体 & 方正楷体\TE & 方正仿宋\TE \\
+% \opt{source} \TD & \SC{serif}{宋} & \SC{sans}{黑} & 方正楷体\TE & 方正仿宋\TE \\
% \bottomrule
% \end{talltblr}
% \end{table}
%
-% 由于各操作系统对自带字体的支持程度不同,本模板对不同字体加粗的方式有所差别,
-% 表 \ref{tab:cjk-fontset} 中,黄色底色的字体采用算法加粗。
-% 除此以外,各种字体在设计上也存在差异,因此本模板在不同操作系统下编译的结果可能存在细微不同,使用时请注意。
-% 若想要获得与 Word 版本模板最为贴近的体验,
-% 可以通过手动安装 Windows 自带的中易宋体、中易黑体、中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
+% 由于各操作系统对自带字体的支持程度不同,本模板对不同字体加粗的方式
+% 有所差别,表 \ref{tab:cjk-fontset} 中,黄色底色的字体采用算法加粗。
+% 除此以外,各种字体在设计上也存在差异,因此本模板在不同操作系统下编
+% 译的结果可能存在细微不同,使用时请注意。若想要获得与 Word 版本模板
+% 最为贴近的体验,可以通过手动安装 Windows 自带的中易宋体、中易黑体、
+% 中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
%
-% 本模板提供的西文字体配置如表 \ref{tab:latinfontset} 所示。
-% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
-% (见表中前三行,Windows 和 macOS 以外的系统采用 \opt{gyre} 配置)。
+% \paragraph{西文}
%
-% \begin{table}[htbp]
+% 本模板提供的西文字体配置如表 \ref{tab:latin-fontset} 所示。
+% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的
+% 字体配置。Windows 和 macOS 以外的系统采用 \opt{gyre} 配置。
+%
+% \begin{table}[!htbp]
% \centering
-% \caption{西文字体清单}
-% \label{tab:latinfontset}
-% \begin{tabular}{cccc}
+% \begin{talltblr} [
+% caption = {西文字体配置},
+% label = {tab:latin-fontset},
+% note{a} = {TG 表示 \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{\TeX~Gyre}。} ]
+% { colspec = {cccc} }
% \toprule
-% \bf 配置名称 & \bf 衬线体 & \bf 无衬线体 & \bf 等宽字体 \\
+% 配置名称 & 衬线体 & 无衬线体 & 等宽字体 \\
% \midrule
-% Windows & Times~New~Roman & Arial & Courier~New \\
-% macOS & Times~New~Roman & Arial & Menlo \\
-% \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{gyre}
-% & \Hologo{TeX}~Gyre~Termes & \Hologo{TeX}~Gyre~Heros & \Hologo{TeX}~Gyre~Cursor \\
+% \opt{win} & Times~New~Roman & Arial & Courier~New \\
+% \opt{mac} & Times~New~Roman & Arial & Menlo \\
+% \opt{gyre} & TG Termes & TG Heros & TG Cursor \\
% \bottomrule
-% \end{tabular}
+% \end{talltblr}
% \end{table}
%
-% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec} 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
%
-% 最后,出于统一格式的需要,本模板还选取了与正文字体相似度最高的数学字体(\href{https://github.com/aliftype/xits}{XITS 字体})用于公式排版。
+% \paragraph{数学}
+%
+% \begin{function}[added=2022-07-02]{math-font}
+% \begin{syntax}
+% math-font=<asana|cambria|fira|garamond|lm|...|termes|xits|none>
+% \end{syntax}
+% 设置数学字体。
+% \end{function}
+%
+% 本模板采用 \pkg{unicode-math} 宏包配置数学公式环境中使用的字体。
+% 与原生 \LaTeX{} 最接近的字体对应 \opt{lm},
+% 与 MS Word 最接近的字体对应 \opt{cambria}。
+%
+% \begin{table}[!htbp]
+% \centering
+% \begin{talltblr} [
+% caption = {数学字体配置},
+% label = {tab:math-fontset},
+% note{a} = {TG 表示 \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{\TeX~Gyre}。},
+% note{b} = {粗体使用 XITS Math Bold。} ]
+% { colspec = {ccl} }
+% \toprule
+% 配置名称 & 字体名称 & 描述 \\
+% \midrule
+% \opt{asana} & Asana Math & \\
+% \opt{cambria} & Cambria Math & 微软 Office 预装的数学字体 \\
+% \opt{fira} & Fira Math & 无衬线数学字体,Fira 风格 \\
+% \opt{garamond} & Garamond Math & Garamond 风格 \\
+% \opt{lm} & Latin Modern Math & Computer Modern 风格 \\
+% \opt{libertinus} & Libertinus Math & \\
+% \opt{stix} & STIX Math & Times 风格 \\
+% \opt{bonum} & TG Bonum Math \TblrNote{a} & \\
+% \opt{dejavu} & TG DejaVu Math \TblrNote{a} & DejaVu 风格 \\
+% \opt{pagella} & TG Pagella Math \TblrNote{a} & Palatino 风格 \\
+% \opt{schola} & TG Schola Math \TblrNote{a} & \\
+% \opt{termes} & TG Termes Math \TblrNote{a} & Times 风格 \\
+% \opt{xits} & XITS Math \TblrNote{b} & 基于 STIX,Times 风格 \\
+% \bottomrule
+% \end{talltblr}
+% \end{table}
%
-% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、两种思源字体和四种Fandol字体能够\emph{免费商用};
-% 英文字库中只有 Times New Roman、XITS 和三种 \Hologo{TeX} Gyre字体能够\emph{免费商用}。
+% \paragraph{授权}
+%
+% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、
+% 两种思源字体和四种Fandol字体能够\emph{免费商用};
+% 英文字库中只有 Times New Roman、XITS 和三种 \TeX Gyre字体能够\emph{免费商用}。
% 因此,若需要将本模板用于商业相关的活动,请咨询专业人士。
%
%
-% \subsection{个人信息}
+% \subsection{设置接口}
%
-% \begin{function}[added=2021-09-10]{\njusetup}
+% \begin{function}[added=2021-09-10,updated=2022-08-01]{\njusetup}
% \begin{syntax}
-% \tn{njusetup} \Arg{键值列表}
+% \tn{njusetup}\oarg{键路径}\marg{设置项}
% \end{syntax}
-% 是 \cls{njuthesis} 文档类的通用设置命令,用来设置各项功能。
-% \tn{njusetup} 的参数是一个使用英文半角逗号分隔的键值列表,
-% 通常形如 \meta{key}|=|\meta{value}。
+% \cls{njuthesis} 文档类的通用设置命令,提供自定义接口。
% \end{function}
%
-% 目前,\tn{njusetup} 仅包含用于设置个人信息的 |info| 类。
+% 根据可选参数填写方式不同,\tn{njusetup} 共有四种等效的使用方式,
+% 可以根据实际情况进行灵活选择。
+%
+% 在键路径留空时,为最基础的用法。此时设置项的参数是一个使用英文
+% 半角逗号分隔的键值列表,通常形如 \meta{key}|=|\meta{value}。
+%
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \njusetup{
+% info/title = {奇文},
+% info/author = {佚名},
+% bib/resource = {ref1.bib, ref1.bib}
+% }
+% \end{latexexample}
+%
+% 以上为最基础的填写方法,可以分组为:
+%
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \njusetup{
+% info = {
+% title = {奇文},
+% author = {佚名}
+% },
+% bib = {
+% resource = {ref1.bib, ref1.bib},
+% }
+% }
+% \end{latexexample}
+%
+% 在键路径填入模块(类)时,只能设定当前模块下的选项。此时参数是键值列表。
+%
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \njusetup[info]{
+% title = {奇文},
+% author = {佚名}
+% }
+% \njusetup[bib]{
+% resource = {ref1.bib, ref1.bib}
+% }
+% \end{latexexample}
+%
+% 在键路径填入具体选项名称时,只能设定该选项的值。
+%
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \njusetup[info/title]{奇文}
+% \njusetup[info/author]{佚名}
+% \njusetup[bib/resource]{ref1.bib, ref1.bib}
+% \end{latexexample}
+%
+%
+% \subsection{个人信息}
+%
+% |info| 类用于设置个人信息。
% 以下为全部的个人信息参数,其中带有星号的为对应的英文字段。
-% 请注意,部分参数已被弃置,列于后方。
%
% \begin{function}[updated=2022-01-14]{info/title,info/title*}
% \begin{syntax}
@@ -1050,10 +1368,10 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2021-10-01]{info/student-id}
% \begin{syntax}
-% student-id = \Arg{学号}
+% student-id = \Arg{学号或工号}
% \end{syntax}
-% 学号。南京大学本科生为9位数字学号,
-% 研究生为两位大写字母标识加上数字组成的学号。
+% 学号或工号。南京大学本科生为9位数字学号,
+% 研究生为两位大写字母标识加上数字组成的学号(2022级改为纯数字)。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/author,info/author*}
@@ -1155,84 +1473,87 @@ To produce the documentation run the original source files ending with
% 国家图书馆封面相关,包括中图分类号、密级、UDC 分类号和导师联系方式。
% \end{function}
%
-% \begin{function}{info/titlea,info/titleb,info/titlec,info/supervisora,info/supervisora*,info/supervisora-title,info/supervisora-title*,info/supervisorb,info/supervisorb*,info/supervisorb-title,info/supervisorb-title*}
-% 这些选项已在 v0.13 弃置,请不要使用。
-% \end{function}
-%
-% \begin{function}{info/supervisor-title,info/supervisor-title*,info/supervisor-ii-title,info/supervisor-ii-title*,info/submit-date*}
-% 这些选项已在 v0.14 弃置,请不要使用。
-% \end{function}
-%
%
% \subsubsection{输入示范}
%
% 本科生可以参考如下范例输入个人信息。注意不能有空行。
%
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
-% \njusetup {
-% info = {
-% title = {第一行标题\\第二行标题},
-% title* = {My title in English},
-% keywords = {我,就是,充数的,关键词},
-% keywords* = {Dummy, Keywords, Here, {it is}},
-% grade = {2018},
-% student-id = {189114514},
-% author = {周煜华},
-% author* = {Zhou Yuhua},
-% department = {化学化工学院},
-% department* = {School of Chemistry and Chemical Engineering},
-% major = {化学},
-% major* = {Chemistry},
-% supervisor = {李成殿,教授},
-% supervisor* = {Professor Li Chengdian},
-% submit-date = {2021-09-12}
-% }
-% }
+% \njusetup[info]{
+% title = {第一行标题\\第二行标题},
+% title* = {My title in English},
+% keywords = {我,就是,充数的,关键词},
+% keywords* = {Dummy, Keywords, Here, {it is}},
+% grade = {2018},
+% student-id = {189114514},
+% author = {周煜华},
+% author* = {Zhou Yuhua},
+% department = {化学化工学院},
+% department* = {School of Chemistry and Chemical Engineering},
+% major = {化学},
+% major* = {Chemistry},
+% supervisor = {李成殿,教授},
+% supervisor* = {Professor Li Chengdian},
+% submit-date = {2021-09-12}
+% }
% \end{latexexample}
%
% 研究生可以参考如下列表输入个人信息
%
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
-% \njusetup {
-% info = {
-% title = {第一行标题\\第二行标题\\第三行标题},
-% title* = {My title in English},
-% keywords = {我,就是,充数的,关键词},
-% keywords* = {Dummy,Keywords,Here,{it is}},
-% grade = {2018},
-% student-id = {DZ18114514},
-% author = {周煜华},
-% author* = {Zhou Yuhua},
-% department = {化学化工学院},
-% department* = {School of Chemistry and Chemical Engineering},
-% major = {化学},
-% major* = {Chemistry},
-% field = {物理化学},
-% field* = {Physical Chemistry},
-% supervisor = {李成殿,教授},
-% supervisor* = {Professor Li Chengdian},
-% submit-date = {2021-09-12},
-% defend-date = {2022-01-15},
-% email = {git+nju-lug-email-3104-issue-@yaoge123.cn}
-% }
-% }
+% \njusetup[info]{
+% title = {第一行标题\\第二行标题\\第三行标题},
+% title* = {My title in English},
+% keywords = {我,就是,充数的,关键词},
+% keywords* = {Dummy,Keywords,Here,{it is}},
+% grade = {2018},
+% student-id = {DZ18114514},
+% author = {周煜华},
+% author* = {Zhou Yuhua},
+% department = {化学化工学院},
+% department* = {School of Chemistry and Chemical Engineering},
+% major = {化学},
+% major* = {Chemistry},
+% field = {物理化学},
+% field* = {Physical Chemistry},
+% supervisor = {李成殿,教授},
+% supervisor* = {Professor Li Chengdian},
+% submit-date = {2021-09-12},
+% defend-date = {2022-01-15},
+% email = {git+nju-lug-email-3104-issue-@yaoge123.cn}
+% }
% \end{latexexample}
%
% 如果需要国家图书馆封面,还需要加入如下信息
%
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
-% \njusetup {
-% info = {
-% confer-date = {2022-05-20},
-% bottom-date = {2022-05-21},
-% chairman = {张晓山~教授},
-% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授},
-% clc = {0175.2},
-% secret-level = {限制},
-% udc = {004.72},
-% supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514}
-% }
-% }
+% \njusetup[info]{
+% confer-date = {2022-05-20},
+% bottom-date = {2022-05-21},
+% chairman = {张晓山~教授},
+% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授},
+% clc = {0175.2},
+% secret-level = {限制},
+% udc = {004.72},
+% supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514}
+% }
+% \end{latexexample}
+%
+% 博士后可以参考如下范例输入个人信息。
+%
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
+% \njusetup[info]{
+% title = {第一行标题\\第二行标题},
+% title* = {My title in English},
+% keywords = {我,就是,充数的,关键词},
+% keywords* = {Dummy, Keywords, Here, {it is}},
+% student-id = {189114514},
+% author = {周煜华},
+% department = {化学化工学院},
+% major = {化学},
+% supervisor = {李成殿,教授},
+% submit-date = {2021-09-12}
+% }
% \end{latexexample}
%
%
@@ -1241,17 +1562,8 @@ To produce the documentation run the original source files ending with
% 与导言区相对的是正文,位于 \env{document} 环境内。
%
% \begin{function}{\mainmatter}
-% \cs{mainmatter} 标志着正文的开始,使用阿拉伯数字重新进行页码编号,并设置页眉格式。
-% \end{function}
-%
-% \begin{function}{\chapter,\section,\subsection,\subsubsection}
-% \begin{syntax}
-% \tn{chapter}\oarg{短描述}\marg{完整的章标题}
-% \tn{section}\oarg{短描述}\marg{完整的节标题}
-% \tn{subsection}\oarg{短描述}\marg{完整的节标题}
-% \tn{subsection}\oarg{短描述}\marg{完整的节标题}
-% \end{syntax}
-% 对于过长的标题,目录和页眉中会使用其短描述。
+% \tn{mainmatter} 标志着正文的开始,使用阿拉伯数字重新进行页码编号,
+% 并设置页眉页脚格式。
% \end{function}
%
% \begin{function}{\chaptermark,\sectionmark}
@@ -1274,21 +1586,16 @@ To produce the documentation run the original source files ending with
%
% 考虑到各个院系对于页眉内容的规定并不一致,本模板提供了若干个自定义选项。
%
-% \begin{function}{style/header/format,style/footer/format,
-% style/header,style/header*,style/footer,style/footer*}
+% \begin{function}{header/content,header/content*,footer/content,footer/content*}
% \begin{syntax}
-% header/format = \Arg{格式}
-% footer/format = \Arg{格式}
-% header = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
-% header* = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
-% footer = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
-% footer* = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
+% content = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
+% content* = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
% \end{syntax}
% 页眉页脚的格式与内容设置。带有星号的设置项供单面模式下使用。
% \end{function}
%
-% 页眉页脚的内容设置是一个逗号分隔的列表,实际上是 \cs{fancyhead} 和
-% \cs{fancyfoot} 命令的选项。前一个花括号内为大写字母指定的位置选项,
+% 页眉页脚的内容设置是一个逗号分隔的列表,实际上是 \tn{fancyhead} 和
+% \tn{fancyfoot} 命令的选项。前一个花括号内为大写字母指定的位置选项,
% 可使用左(\opt{L})、中(\opt{C})、右(\opt{R})。
% 双面模式下可额外指定出现在奇数页(\opt{O})还是偶数页(\opt{E})。
% 详细说明请参考 \pkg{fancyhdr} 的手册。
@@ -1296,213 +1603,167 @@ To produce the documentation run the original source files ending with
% 接下来展示了一个手动设置页眉内容的例子。这里我们清空了页脚,
% 并将页眉格式设置成五号黑体,奇数页左侧为节名,右侧为页码,
% 偶数页左侧为页码,右侧为章名。
-% \begin{latexexample}[moretexcs={\njusetup,\sffamily},emph={[2]style}]
-% \njusetup {
-% style = {
-% header/format = \small \sffamily,
-% header = {
-% { OR } { \thepage }, { OL } { \rightmark },
-% { EL } { \thepage }, { ER } { \leftmark }
-% },
-% footer = {},
-% }
-% }
+% \begin{latexexample}[moretexcs={\njusetup,\sffamily,\njusetformat},
+% emph={[2]header,footer}]
+% \njusetup[header/content]{
+% { OR } { \thepage }, { OL } { \rightmark },
+% { EL } { \thepage }, { ER } { \leftmark }
+% },
+% \njusetup[footer/content]{}
+% \njusetformat{header}{\small\sffamily}
% \end{latexexample}
%
%
% \subsubsection{字形}
%
-% \begin{function}{\songti,\heiti,\kaishu,\fangsong,\zihao}
-% \begin{syntax}
-% \tn{zihao}\Arg{字号}
-% \end{syntax}
-% 字形与字号设置。
-% \end{function}
-%
% 本模板继承 \pkg{ctex} 宏集提供的字形字号设置,以备不时之需。换句话说,
-% 除非你有十足的把握,认为某处字体产生了偏差\footnote{在此情况下也应当直接到
-% GitHub 反馈},否则无需动用这些命令处理样式问题。
+% 除非你有十足的把握,认为某处字体产生了偏差\footnote{在此情况下也应当
+% 直接到 GitHub 仓库反馈},否则无需动用这些命令处理样式问题。
%
% \begin{function}[added=2021-09-22]{\njuline}
% \begin{syntax}
% \tn{njuline}\Arg{文字}
% \end{syntax}
% 为了避免原生 \tn{uline} 命令在中文环境下不能正常换行的问题,
-% 本模板使用 \tn{njuline} 作为替代方案,分别对 \hologo{XeLaTeX} 的
-% \pkg{xeCJKfntef} 包和 \hologo{LuaLaTeX} 的 \pkg{lua-ul}
+% 本模板使用 \tn{njuline} 作为替代方案,分别对 \XeLaTeX 的
+% \pkg{xeCJKfntef} 包和 \LuaLaTeX 的 \pkg{lua-ul}
% 包中的下划线命令进行了包装。
% \end{function}
%
% \subsubsection{列表}
%
-% \begin{function}{itemize,enumerate,description}
-% \begin{syntax}
-% \tn{begin}\marg{列表环境}
-% \tn{item}\oarg{标签1} \meta{条目1}
-% \tn{item}\oarg{标签2} \meta{条目2}
-% ...
-% \tn{end}\marg{列表环境}
-% \end{syntax}
-% 添加列表环境。
-% \end{function}
-%
% 模板默认载入 \pkg{enumitem} 宏包,对三个常用列表环境内的条目间距进行压缩。
+% 可以通过第 \ref{subsubsec:optional-pkg} 节提供的选项禁用该宏包。
%
-% \subsubsection{脚注}
+% \subsubsection{图片}
%
-% \begin{function}{\footnote}
+% \begin{function}[added=2022-08-06]{image/path}
% \begin{syntax}
-% \tn{footnote}\Arg{脚注}
+% path = \{\marg{路径1},\marg{路径2},...\}
% \end{syntax}
-% 添加脚注。
+% 图片搜索路径,等效于 \tn{graphicspath}。这个选项仅能设置一次。
% \end{function}
%
-% \begin{function}[added=2022-05-01]{style/footnote-style}
+% \subsubsection{脚注}
+%
+% \begin{function}[added=2022-05-01,updated=2022-08-03]{footnote/style}
% \begin{syntax}
-% footnote-style = <(plain)|pifont>
+% style = <(plain)|pifont>
% \end{syntax}
% 设置脚注编号样式。默认为普通数字,使用 |pifont|
% 选项可修改为带圈数字。单一页面内请尽量避免超过 10 条脚注。
% \end{function}
%
-% \subsubsection{图片}
-%
-% \begin{function}{\graphicspath}
-% \begin{syntax}
-% \tn{graphicspath}\{\marg{路径1}\marg{路径2}\}
-% \end{syntax}
-% 添加图像路径。
-% \end{function}
+% 脚注样式的调整依赖 \pkg{footmisc}。如果希望使用 \LaTeX 的默认样式,
+% 可以通过第 \ref{subsubsec:optional-pkg} 节提供的选项禁用该宏包。
%
-% \pkg{graphicx} 宏包会对一些常见路径进行搜索。使用自己的图片时,如果提示不能找到文件,需要在导言区通过本命令添加图片存放路径。
-%
-% 在使用特定类型的图片文件时,可以省略其扩展名,包括 \file{*.jpg}, \file{*.png}, \file{*.pdf}, \file{*.eps}。
-%
-% \paragraph{单张图片}
-%
-% 下面这个例子展示了如何插入一张名称为 \file{myfig.jpg},宽度占页面文字宽度一半的图片。注意标签命令 \tn{label} 必须放在图注命令 \tn{caption} 之后。
-% \begin{latexexample}[moretexcs={\includegraphics},emph={[1]figure}]
-% \begin{figure}[h]
-% \centering
-% \includegraphics[width=0.5\textwidth]{myfig}
-% \caption{我的图}
-% \label{fig:myfig}
-% \end{figure}
-% \end{latexexample}
+% \subsubsection{数学符号}
%
-% \emph{以下图片相关功能的实现均需要手动载入相关宏包}。
+% ^^A \url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf}
+% ^^A http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf
+% 模板使用 \pkg{unicode-math} 宏包配置数学字体,该方案目前不兼容
+% 传统的 \pkg{amsfonts}、\pkg{amssymb}、\pkg{bm}
+% \footnote{\url{https://tex.stackexchange.com/q/528831/}}
+% 、\pkg{upgreek} 等宏包。需要使用新方案提供的相应命令。
+% 例如,加粗数学符号的命令为 \tn{symbf}。
+% 更多细节请查阅 \pkg{unicode-math} 手册。
%
-% \paragraph{文字环绕}
+% 如果您对此并不熟悉,也可以通过第 \ref{subsubsec:optional-pkg}
+% 节提供的选项禁用该宏包。\footnote{禁用后本节提供的设置均不会生效。}
%
-% 对于较为瘦长,或者仅起到辅助作用的图像,可以使用 \pkg{wrapfig} 宏包提供的 \env{wrapfigure} 实现文字环绕效果。注意这个环境后紧跟的一行不能为空。
-% \begin{latexexample}[moretexcs={\includegraphics},emph={[1]wrapfigure}]
-% \begin{wrapfigure}{r}{0cm}
-% \centering
-% \includegraphics[width=0.15\textwidth]{myfig}
-% \caption{我的图}
-% \label{fig:myfig}
-% \end{wrapfigure}
-% <text>
-% \end{latexexample}
+% 中文论文的数学符号默认遵循 GB/T 3102--93《物理科学和技术中
+% 使用的数学符号》\cite{gb-3102-93},该标准参照采纳 ISO 31-11:1992,
+% \footnote{目前已更新为 ISO 80000-2:2019。},
+% 但是与 \TeX{} 默认的美国数学学会(AMS)的习惯有许多差异。
%
-% \paragraph{多张嵌套}
-%
-% 使用 \pkg{subcaption} 宏包提供的 \env{subfigure} 环境可以实现多张图片嵌套的效果。
-% \begin{latexexample}[moretexcs={\includegraphics},emph={[1]figure,subfigure}]
-% \begin{figure}
-% \begin{subfigure}{.32\textwidth}
-% \centering
-% \includegraphics[width=\textwidth]{fig1}
-% \caption{fig1}
-% \end{subfigure}
-% \begin{subfigure}{.32\textwidth}
-% \centering
-% \includegraphics[width=\textwidth]{fig2}
-% \caption{fig2}
-% \end{subfigure}
-% \begin{subfigure}{.32\textwidth}
-% \centering
-% \includegraphics[width=\textwidth]{fig3}
-% \caption{fig3}
-% \end{subfigure}
-% \caption{subfigures}
-% \end{figure}
-% \end{latexexample}
+% \begin{function}[added=2022-07-31]{math/style}
+% \begin{syntax}
+% style = <TeX|ISO|(GB)>
+% \end{syntax}
+% 数学符号风格。
+% \end{function}
%
-% 请尽量避免使用较为老旧的 \pkg{subfig} 宏包,完全不要使用过时的 \pkg{subfigure} 宏包。两者的 CTAN 页面上均建议转移至更新的 \pkg{subcaption} 宏包。
-%
-% \subsubsection{表格}
-%
-% 下面这个例子展示了如何插入一张表格。通过 \pkg{booktabs} 宏包提供的 \tn{toprule}、\tn{midrule} 和 \tn{bottomrule} 命令,我们可以很轻松地绘制出一张漂亮规范的三线表。
-% \begin{latexexample}[moretexcs={\toprule,\midrule,\bottomrule},emph={[1]table,tabular}]
-% \begin{table}[htbp]
-% \centering
-% \caption{我的表}
-% \label{tab:testtab}
-% \begin{tabular}{ccc}
-% \toprule
-% OS & TeX & 测试情况 \\
-% \midrule
-% 南大TeX & Overleaf & √ \\
-% \bottomrule
-% \end{tabular}
-% \end{table}
+% 默认的国标风格 \opt{GB} 相当于在导言区设置了
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]math}]
+% \njusetup[math]{
+% integral = upright,
+% integral-limits = false,
+% less-than-or-equal = slanted,
+% math-ellipsis = centered,
+% partial = upright,
+% real-part = roman,
+% vector = boldfont,
+% uppercase-greek = italic
+% }
% \end{latexexample}
%
-% \emph{以下表格功能的实现均需要手动载入相关宏包。}
+% 用户也可以逐项修改数学样式。
%
-% \paragraph{合并单元格}
-%
-% \begin{function}{\multirow,\multicolumn}
+% \begin{function}[added=2022-07-31]{math/integral}
% \begin{syntax}
-% \tn{multirow}\Arg{nrows}\oarg{bigstructs}\Arg{width}\oarg{fixup}\Arg{text}
-% \tn{multicolumn}\Arg{nrows}\Arg{width}\Arg{text}
+% integral = <upright|slanted>
% \end{syntax}
-% 合并单元格。
+% 积分号的正/斜体。
+% 该选项需要字体的支持,目前仅限 \opt{xits}、\opt{newcm}。
% \end{function}
%
-% TODO:\pkg{multirow} 宏包的使用方法,命令较为复杂。
-% \url{http://www.ctex.org/documents/packages/table/multirow.htm}
-%
-% \paragraph{更多样式}
-%
-% \pkg{tabularray} 宏包\cite{tabularray}运用 \hologo{LaTeX3} 语法重新实现了表格的绘制,提供了简明的用户接口与丰富的单元格样式,详见其使用手册。
-%
-%
-% \subsubsection{数学}
+% \begin{function}[added=2022-07-31]{math/integral-limits}
+% \begin{syntax}
+% integral-limits = <\TF>
+% \end{syntax}
+% 积分号上下限的位置,可选:\opt{true}(在上下)、\opt{false}(在右侧)。
+% 这个设置只影响行间公式,行内公式统一居右侧,不受影响。
+% \end{function}
%
-% 行内公式形如 |$\mathrm{e}^{(a+2b)x}$|。
+% \begin{function}[added=2022-07-31]{math/less-than-or-equal}
+% \begin{syntax}
+% less-than-or-equal = <slanted|horizontal>
+% \end{syntax}
+% 小于等于号和大于等于号的字形。
+% 这将控制 \tn{le}、\tn{ge}、\tn{leq} 和 \tn{geq} 的符号是
+% “$\leqslant$、$\geqslant$”还是“$\leq$、$\geq$”。
+% \end{function}
%
-% 带有编号的行间公式 \env{equation}。
-% \begin{latexexample}[emph={[1]equation}]
-% \begin{equation}\label{eq:myeqlabel}
-% \pi
-% \end{equation}
-% \end{latexexample}
+% \begin{function}[added=2022-07-31]{math/math-ellipsis}
+% \begin{syntax}
+% math-ellipsis = <centered|lower>
+% \end{syntax}
+% 省略号 \tn{dots} 的样式,可选:\opt{centered}(按照中文的习惯固定居中)、
+% \opt{lower}(取决于前后符号的位置)。
+% 其他的省略号命令如 \tn{lots}、\tn{cdots} 则不受影响。
+% \end{function}
%
-% 如不需要编号,可以用 \env{equation*} 或者 |\[|\meta{公式}|\]|,
-% 请不要使用可能引发问题的 |$$|\meta{公式}|$$|
-% \footnote{\url{https://tex.stackexchange.com/q/503/}}。
+% \begin{function}[added=2022-07-31]{math/partial}
+% \begin{syntax}
+% partial = <upright|italic>
+% \end{syntax}
+% 偏微分符号的正/斜体。
+% \end{function}
%
+% \begin{function}[added=2022-07-31]{math/real-part}
+% \begin{syntax}
+% real-part = <roman|fraktur>
+% \end{syntax}
+% 实部 \tn{Re} 和虚部 \tn{Im} 的字体。
+% \end{function}
%
-% \paragraph{符号和单位}
+% \begin{function}[added=2022-07-31]{math/vector}
+% \begin{syntax}
+% vector = <boldfont|arrow>
+% \end{syntax}
+% 向量的表示方法,可选粗斜体或箭头。
+% \end{function}
%
-% ^^A \url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf}
-% 模板使用 \pkg{unicode-math} 宏包配置数学字体,完整符号表可以参考
-% \href{http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf}{\file{unimath-symbols.pdf}}。
-% 该方案目前不兼容传统的 \pkg{amsfonts}、\pkg{amssymb}、\pkg{bm}
-% \footnote{\url{https://tex.stackexchange.com/q/528831/}}
-% 、\pkg{upgreek} 等宏包。需要使用新方案提供的相应命令。
-% 例如,加粗数学符号的命令为 \tn{symbf}。
-% 更多细节请查阅 \pkg{unicode-math} 手册。
+% \begin{function}[added=2022-07-31]{math/uppercase-greek}
+% \begin{syntax}
+% uppercase-greek = <upright|italic>
+% \end{syntax}
+% 大写希腊字母的正/斜体。
+% 有限增量符号 $\increment x$ 固定使用正体,推荐使用 \tn{increment} 表示。
+% \end{function}
%
-% ^^A 本段说明来自 THuThesis,待补充相应配置
-% 中文论文的数学符号默认遵循 GB/T 3102--93《物理科学和技术中
-% 使用的数学符号》\cite{gb-3102-93},该标准参照采纳 ISO 31-11:1992,
-% 但是与 \TeX{} 默认的美国数学学会(AMS)的习惯有许多差异。
-% 本模板尚未完成自动样式适配,一些需要写作时手动处理的要点包括:
+% 本模板的设置并不能覆盖所有符号,一些需要写作时手动处理的要点包括:
% \begin{itemize}
-% ^^A \item 小于等于号和大于等于号使用斜线($\leqslant$、$\geqslant$)
% \item 数学常数和特殊函数名用正体,如
% \begin{itemize}
% \item $\uppi$ 使用 |$\uppi$|
@@ -1514,91 +1775,43 @@ To produce the documentation run the original source files ending with
% \item $\mathrm{d} \varphi / \mathrm{d} t$
% 使用 |$\mathrm{d} \varphi / \mathrm{d} t$|
% \end{itemize}
-% ^^A 可以提供一个设置项,|\renewcommand{\vec}[1]{\symbf{#1}}|
-% \item 向量、矩阵和张量用粗斜体(\cs{symbf}),如
-% \begin{itemize}
-% \item $\symbf{\Sigma}$ 使用 |$\symbf{\Sigma}$|
-% \item $\symbfsf{T}$ 使用 |$\symbfsf{T}$|
-% \end{itemize}
% \end{itemize}
%
-% 单位默认遵循 GB 3100--93《国际单位制及其应用》\cite{gb-3100-93}和
-% GB 3101--93《有关量、单位和符号的一般原则》\cite{gb-3101-93},
-% SI 单位可通过载入 \pkg{siunitx} 宏包\cite{siunitx}进行输入。
-% ^^A \pkg{siunitx} 是一个更新频繁的包,可能会引发兼容性问题。
+% \subsubsection{定理环境}
%
-% \paragraph{定理环境}
+% 模板使用 \pkg{ntheorem} 宏包配置定理类环境,提供了一系列选项。
+% 您也可以通过第 \ref{subsubsec:optional-pkg} 节提供的选项禁用该宏包。
+% \footnote{禁用后本节提供的设置均不会生效。}
%
-% 本模板也提供了一系列的数学定理环境。
-%
-% \begin{function}[added=2022-04-21]{theorem/predefine}
-% \begin{syntax}
-% predefine = <\TTF>
-% \end{syntax}
-% 是否使用模板默认配置的定理环境。默认会载入 \pkg{ntheorem} 并进行相关设置。
-% \end{function}
-%
-% 全部预定义的数学定理环境如表~\ref{tab:mathenv} 所示。
-% 其中证明环境较为特殊,会在结尾添加证毕符号(\mdwhtsquare)。
-% 当然,你也可以创建属于自己的定理环境,其样式继承自前部的设定。
-%
-% \begin{function}{\newtheorem,\newtheorem*,\renewtheorem}
-% \begin{syntax}
-% \cs{newtheorem}\marg{环境名称}\marg{标题名称}\oarg{计数器范围}
-% \end{syntax}
-% 定义新的定理环境或者修改已有的定理环境。带星号的命令不包含计数器。
-% 本模板中请在 |\begin{document}| 后进行定制。
-% \end{function}
-%
-% \begin{table}[htbp]
-% \centering
-% \caption{预置的数学定理环境}
-% \label{tab:mathenv}
-% \begin{tabular}{cc|cc}
-% \toprule
-% \bf 标签 & \bf 名称 & \bf 标签 & \bf 名称 \\
-% \midrule
-% axiom & 公理 & lemma & 引理 \\
-% corollary & 推论 & proof & 证明 \\
-% definition & 定义 & theorem & 定理 \\
-% example & 例 & & \\
-% \bottomrule
-% \end{tabular}
-% \end{table}
-%
-% 使用示例如下。
-% \begin{latexexample}[emph={[1]proof,definition}]
-% \begin{proof}
-% 证明我是我
-% \end{proof}
-%
-% \begin{definition}[他人]
-% 定义他人即地狱
-% \end{definition}
-% \end{latexexample}
-%
-% 对于预置的定理环境样式,本模板也提供了一系列选项进行修改。
-% 这些选项目前只对模板预定义的若干种环境有效。
+% 以下选项用于定义定理类环境的样式。
%
% \begin{function}[added=2022-04-21]{theorem/style}
% \begin{syntax}
% style = <(plain)|break|change|margin|empty|...>
% \end{syntax}
-% 定理基本样式。等效于 \cs{theoremstyle}\marg{样式名称}。
+% 定理基本样式。等效于 \tn{theoremstyle}\marg{样式名称}。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/header-font}
% \begin{syntax}
% header-font = \meta{头部字体格式}
% \end{syntax}
-% 定理头部字体格式。等效于 \cs{theoremheaderfont}\marg{格式}。
+% 定理头部字体格式。等效于 \tn{theoremheaderfont}\marg{格式}。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/body-font}
% \begin{syntax}
% body-font = \meta{内部字体格式}
% \end{syntax}
-% 定理内部字体格式。等效于 \cs{theorembodyfont}\marg{格式}。
+% 定理内部字体格式。等效于 \tn{theorembodyfont}\marg{格式}。
+% \end{function}
+%
+% \begin{function}[added=2022-04-21]{theorem/qed-symbol}
+% \begin{syntax}
+% qed-symbol = \meta{证毕符号}
+% \end{syntax}
+% 证毕符号。等效于 \tn{theoremsymbol}\marg{符号}。默认为空心方块(\mdlgwhtsquare)。
+% 禁用 \pkg{unicode-math} 时为实心黑色方块(\rule{1ex}{1ex})。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/counter}
@@ -1610,99 +1823,99 @@ To produce the documentation run the original source files ending with
%
% 模板的默认设置等效于
%
-% \begin{latexexample}[moretexcs={\njusetup,\bfseries,\itshape,\mdwhtsquare},
+% \begin{latexexample}[moretexcs={\njusetup,\bfseries,\itshape,\mdlgwhtsquare},
% emph={[2]theorem}]
-% \njusetup {
-% theorem = {
-% predefine = true,
-% style = plain,
-% header=font = \normalfont \bfseries,
-% body-font = \itshape,
-% qed-symbol = \ensuremath { \mdwhtsquare },
-% counter = chapter
-% }
-% }
+% \njusetup[theorem]{
+% style = plain,
+% header-font = \normalfont \bfseries ,
+% body-font = \itshape ,
+% qed-symbol = \ensuremath { \mdlgwhtsquare },
+% counter = chapter
+% }
% \end{latexexample}
%
+% 以下选项用于创建定理类环境。
%
-% \subsubsection{代码}
-% \changes{v0.13}{2021/12/13}{提供简化的行内代码环境。}
-% \changes{v0.13}{2021/12/16}{默认不加载 \pkg{listings} 宏包。}
+% \begin{function}[added=2022-08-05]{theorem/type}
+% \begin{syntax}
+% type = \{\marg{环境名,类型标识} \marg{头名称},...\}
+% \end{syntax}
+% 需要定义的定理类型列表。在可选的 \meta{类型标识} 中,含有\emph{星号}表示
+% 需要编号,含有\emph{加号}需要证毕符号。该选项存储的是用来定义环境的参数,
+% 而\emph{不会直接创建环境},且每次调用都会覆盖前面定义的环境列表。
+% \end{function}
%
-% 如需展示代码,可以使用抄录环境 \tn{verb},格式如 |\verb!<code>!|。其中包裹代码的两个感叹号并不是绝对的,可以替换成任何两个相同的、没有在这段代码中出现过的符号。
+% \opt{theorem/type} 初始定义的环境列表如表~\ref{tab:mathenv} 所示。
+% 其中证明环境较为特殊,不编号且会在结尾添加证毕符号。
+% 这些环境并没有预先创建,使用方法见下面的例子。
%
-% 抄录环境仅会用等宽字体如实呈现代码本身,并无任何附加功能。若需格式更为多样的代码环境,可以使用 \pkg{listings} 宏包。v0.14.0 版以后,本模板默认不会调用该宏包,使用代码环境前请在导言区自行导入。
-% \begin{latexexample}
-% \usepackage{listings}
-% \end{latexexample}
+% \begin{table}[htbp]
+% \centering
+% \caption{预置的数学定理环境}
+% \label{tab:mathenv}
+% \begin{tabular}{cc|cc}
+% \toprule
+% \bf 标签 & \bf 名称 & \bf 标签 & \bf 名称 \\
+% \midrule
+% axiom & 公理 & lemma & 引理 \\
+% corollary & 推论 & proof & 证明 \\
+% definition & 定义 & theorem & 定理 \\
+% example & 例 & & \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
%
-% \pkg{listings} 宏包\cite{listings}提供了 \env{lstlisting} 环境,可以生成代码块,提供语法高亮功能,会如实输出缩进空格。且值得注意的是这个环境中的代码不会在草稿模式下显示。
-% 如需指定语言,可以使用 |language| 选项。如需自定义关键字,可以使用 |morekeywords| 选项。这一宏包也提供了为某种样式单独一种环境的方法,详见其手册,此处仅展示一个最简化的例子:
-% \begin{latexexample}[emph={[1]lstlisting},emph={[2]language},morekeywords={print}]
-% \begin{lstlisting}[language=python]
-% print("Hello World")
-% \end{lstlisting}
-% \end{latexexample}
+% \begin{function}[added=2022-08-05]{theorem/define}
+% \begin{syntax}
+% <define>
+% \end{syntax}
+% 创建定理环境。
+% \end{function}
%
-% 当然,默认提供的代码样式在本模板中并不和谐。可以参照以下代码在导言区设置代码环境通用样式。
-% \begin{latexexample}[moretexcs={\lstdefinestyle,\lstset},emph={[2]basewidth,lineskip,basicstyle,keywordstyle,commentstyle,numbers,captionpos,breaklines,xleftmargin,xrightmargin,style,flexiblecolumns}]
-% \lstdefinestyle { njulisting }
-% {
-% basewidth = 0.5 em, % 单个字体宽度
-% lineskip = 3 pt, % 在代码行间添加额外行距
-% basicstyle = \tiny\ttfamily, % 基本字体样式,小号等宽
-% keywordstyle = \bfseries, % 关键词样式,粗体
-% commentstyle = \itshape\color{gray}, % 注释样式,灰色斜体
-% numbers = left, % 行号位置,左侧
-% captionpos = t, % 题注位置,顶部
-% breaklines = true, % 是否允许自动折行
-% xleftmargin = 2 em, % 左侧边距
-% xrightmargin = 2 em % 右侧边距
-% }
-% \lstset{
-% style = njulisting, % 调用上述样式
-% flexiblecolumns % 允许调整字符宽度
-% }
-% \end{latexexample}
+% \opt{theorem/define} 并没有参数。这个选项在调用后会读取
+% \opt{theorem/type} 保存的列表以及前方的样式设置并创建相应环境。
+% 这也就意味着该选项在 \opt{theorem/type} 为空时会报错。
%
-% \pkg{listings} 同时提供了用于展示行内代码的 \tn{lstinline} 命令,用法同 \tn{verb}。但这一命令会被全局的代码字号设置污染。请参考如下使用方法:
-% \begin{latexexample}[moretexcs={\lstinline,\tt},deletetexcs={\usepackage},emph={[2]language,basicstyle}]
-% \lstinline[language=[LaTeX]TeX, basicstyle=\tt]!\usepackage{njuvisual}!
-% \end{latexexample}
+% 在下面这个例子中,我们先创建了预置的七种环境,随后将定理内部文字字体改为
+% 宋体,定义了 \env{exercise} 和 \env{solution} 两种定理环境,后者没有编号。
%
-% 简便起见,不妨单独创建使用简写的行内代码环境,指定某个符号后用其包裹代码即可。这个符号不可以出现在正文及其他命令中,请谨慎设置。
-% \begin{latexexample}[moretexcs={\lstMakeShortInline},emph={[2]style,basicstyle,columns}]
-% \lstMakeShortInline[
-% style = njulisting,
-% basicstyle = \normalsize\tt,
-% columns = fixed]|
+% \begin{latexexample}[moretexcs={\njusetup,\normalfont},
+% emph={[2]theorem}]
+% \njusetup[theorem]{
+% define,
+% body-font = \normalfont ,
+% type = {
+% { {exercise} {习题} },
+% { {solution,*} {解} }
+% },
+% define
+% }
% \end{latexexample}
%
%
-% \subsubsection{引用}
-%
-% \begin{function}{\cref}
-% \begin{syntax}
-% \tn{cref}\Arg{标签}
-% \end{syntax}
-% 使用 \pkg{cleveref} 宏包实现了带图、表等项目名称的智能引用。
-% \end{function}
+% \subsubsection{编号}
%
-% \begin{function}{\href,\url}
+% \begin{function}[added=2022-07-31]{label-sep/figure,label-sep/table,label-sep/equation}
% \begin{syntax}
-% \tn{href}\Arg{链接}\Arg{名称}
-% \tn{url}\Arg{链接}
+% figure = \meta{符号}
+% table = \meta{符号}
+% equation = \meta{符号}
% \end{syntax}
-% 超链接。\tn{href} 会将特定字符显示为可点击的超链接,\tn{url} 会输出可点击的链接原文。
+% 图片、表格、公式编号中的连接符样式,默认为短横线(en dash)。
% \end{function}
%
%
% \subsection{参考文献}
%
-% 本模板默认载入 \pkg{biblatex} 宏包,使用 \hologo{biber} 作为后端\footnote{出于简化命令的考虑,现阶段并不计划支持 \hologo{BibTeX}。},通过 \pkg{biblatex-gb7714-2015}\cite{biblatex-gb7714-2015} 实现 GB/T 7714--2015\cite{gb-t-7714-2015} 规定的参考文献著录规则国家标准。
-%
-% 需要使用 |biber| 命令编译才会显示正确的条目序号,详情请参照 \ref{subsubsec:compileseq}。
+% 本模板默认载入 \pkg{biblatex} 宏包,使用 \hologo{biber} 作为后端,
+% 通过 \pkg{biblatex-gb7714-2015}\cite{biblatex-gb7714-2015} 实现
+% GB/T 7714--2015 \cite{gb-t-7714-2015} 规定的参考文献著录规则国家标准。
+% 需要使用 |biber| 命令编译才会显示正确的条目序号,详情请参照第
+% \ref{subsubsec:compileseq} 节。本节提供的所有选项均基于此方案。
%
+% 出于简化命令的考虑,本模板并不计划支持 \hologo{BibTeX},但您可以通过第
+% \ref{subsubsec:optional-pkg} 节提供的选项禁用默认的参考文献工具,
+% 自行利用 \pkg{gbt7714} 等宏包完成参考文献样式的配置。
%
% \subsubsection{选项}
%
@@ -1714,14 +1927,21 @@ To produce the documentation run the original source files ending with
% 或自行填入任意其他 \pkg{biblatex} 样式。默认为顺序编码制。
% \end{function}
%
-% 参考文献样式是一个整体的设置,会对正文中引用的文献的标注方法和参考文献表的输出格式产生影响。根据国家规定\cite{gb-t-7714-2015},可以按照参考文献表的组织方式分为以下两种样式:
+% 参考文献样式是一个整体的设置,会对正文中引用的文献的标注方法和
+% 参考文献表的输出格式产生影响。根据国家规定\cite{gb-t-7714-2015},
+% 可以按照参考文献表的组织方式分为以下两种样式:
% \begin{description}
-% \item[顺序编码制] 顺序编码制是按正文中引用的文献出现的先后顺序连续编码,将序号置于方括号中。参考文献表采用顺序编码制组织时,各篇文献应按正文部分标注的序号依次列出。
-% \item[著者-出版年制] 正文引用的文献采用著者-出版年制时,各篇文献的标注内容由著者姓氏与出版年构成,并置于"()"内。参考文献表采用著者-出版年制组织时,各篇文献首先按文种集中,然后按著者字顺和出版年排列。
+% \item[顺序编码制] 顺序编码制是按正文中引用的文献出现的先后顺序连续
+% 编码,将序号置于方括号中。参考文献表采用顺序编码
+% 制组织时,各篇文献应按正文部分标注的序号依次列出。
+% \item[著者-出版年制] 正文引用的文献采用著者-出版年制时,各篇文献的
+% 标注内容由著者姓氏与出版年构成,并置于"()"内。
+% 参考文献表采用著者-出版年制组织时,各篇文献首
+% 先按文种集中,然后按著者字顺和出版年排列。
% \end{description}
%
% 对于本科生而言,学校规定文件表明参考文献表应当“用数字加方括号
-% 表示”\cite{nju2021},符合顺序编码制的格式,保持默认设置即可。
+% 表示”\cite{nju-bachelor-2022},符合顺序编码制的格式,保持默认设置即可。
%
% \begin{function}[added=2022-02-15]{bib/option}
% \begin{syntax}
@@ -1754,19 +1974,17 @@ To produce the documentation run the original source files ending with
% 其中 \opt{bib/option} 的内容旨在关闭部分不需显示的文献信息,
% 并采取仅首字母大写的作者姓名格式,可根据需要使用。
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib}]
-% \njusetup {
-% bib = {
-% style = author-year,
-% resource = {njuthesis-sample.bib},
-% option = {
-% doi = false,
-% isbn = false,
-% url = false,
-% eprint = false,
-% gbnamefmt = lowercase
-% }
-% }
-% }
+% \njusetup[bib]{
+% style = author-year,
+% resource = {njuthesis-sample.bib},
+% option = {
+% doi = false,
+% isbn = false,
+% url = false,
+% eprint = false,
+% gbnamefmt = lowercase
+% }
+% }
% \end{latexexample}
%
%
@@ -1779,17 +1997,16 @@ To produce the documentation run the original source files ending with
% 显然只有被引用过的条目才会被输出至参考文献表。
%
% 假如需要在每章末尾附上单独的参考文献表,导言区添加以下设置,
-% 并在每章后使用 \cs{printbibliography} 即可。
+% 并在每章后使用 \tn{printbibliography} 即可。
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib}]
-% \njusetup {
-% bib = { option = { refsection = chapter } }
-% }
+% \njusetup[bib/option]{refsection = chapter}
% \end{latexexample}
%
-% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题。
-% 对此,需要将 \pkg{biblatex-gb7714-2015} 宏包手动更新至 2022-04-16 以后的版本。
+% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题。对此,
+% 需要将 \pkg{biblatex-gb7714-2015} 宏包手动更新至 2022-04-16 以后的版本。
% 此外,由于 \TeX{} 预置的断词位置是有限的,不能覆盖学术上使用的复杂词汇,
-% 您也可以自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。
+% 您也可以自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene
+% 一词修改为 graph|\-|ene。
%
% \subsubsection{正文引用}
%
@@ -1801,14 +2018,16 @@ To produce the documentation run the original source files ending with
% 在正文中引用参考文献。
% \end{function}
%
-% 引用命令 \tn{cite} 含有多个变体,以便使用文献条目中不同的信息域。在两种参考文献样式下,这些命令的行为具体存在一些差异,详见表 \ref{tab:numeric-style} 和表 \ref{tab:author-year-style}。
+% 引用命令 \tn{cite} 含有多个变体,以便使用文献条目中不同的信息域。
+% 在两种参考文献样式下,这些命令的行为具体存在一些差异,
+% 详见表 \ref{tab:numeric-style} 和表 \ref{tab:author-year-style}。
%
% \begin{table}[ht]
% \centering
% \begin{talltblr} [
% caption = {顺序编码制下的引用样式},
% label = {tab:numeric-style} ]
-% { row{1} = {font=\bfseries}, colspec = {cll} }
+% { colspec = {cll} }
% \toprule
% 引用方式 & 命令 & 排版效果 \\
% \midrule
@@ -1829,7 +2048,7 @@ To produce the documentation run the original source files ending with
% caption = {著者-出版年制下的引用样式},
% label = {tab:author-year-style},
% note{a} = {在此样式下 \tn{parencite} 效果等同于 \tn{cite}。} ]
-% { row{1} = {font=\bfseries}, colspec = {cll} }
+% { colspec = {cll} }
% \toprule
% 引用方式 & 命令 & 排版效果 \\
% \midrule
@@ -1852,7 +2071,9 @@ To produce the documentation run the original source files ending with
%
% \subparagraph{使用 EndNote}
%
-% 南京大学信息化建设管理服务中心已购买 \href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote} 供全校师生免费使用,最新版为 EndNote 20。
+% 南京大学信息化建设管理服务中心已购买
+% \href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote}
+% 供全校师生免费使用,最新版为 EndNote 20。
%
% \subparagraph{使用 JabRef}
%
@@ -1863,7 +2084,10 @@ To produce the documentation run the original source files ending with
% \subparagraph{使用 Zotero}
%
% \href{https://www.zotero.org/}{Zotero} 也是一款开源、跨平台的文献管理软件。
-% Zotero 更为通用,其功能可以通过 \href{https://github.com/l0o0/jasminum}{Jasminum}、\href{https://github.com/retorquere/zotero-better-bibtex}{Better BibTeX}、\href{https://github.com/bwiernik/zotero-shortdoi}{DOI Manager} 等第三方插件,以及 Zotero Connector 浏览器插件进行增强。
+% Zotero 更为通用,其功能可以通过 \href{https://github.com/l0o0/jasminum}{Jasminum}、
+% \href{https://github.com/retorquere/zotero-better-bibtex}{Better BibTeX}、
+% \href{https://github.com/bwiernik/zotero-shortdoi}{DOI Manager} 等第三方插件,
+% 以及 Zotero Connector 浏览器插件进行增强。
%
%
% \subsection{特殊页面}
@@ -1878,17 +2102,17 @@ To produce the documentation run the original source files ending with
% \end{function}
%
% 本科生模板仅会生成中文封面;研究生模板会生成中英文封面。
-% 如果选择了 \opt{nlcover},\emph{仅仅}会生成研究生的国家图书馆封面。
+% 如果选择了 \opt{nl-cover},\emph{仅仅}会生成研究生的国家图书馆封面。
% 如果选择了 \opt{decl-page},会在封面后生成本科生的诚信承诺书或研究生的
% 原创性声明。在启用草稿模式后封面绘制将被禁用。
%
% \paragraph{封面图片}
%
-% \begin{function}[added=2021-12-23,updated=2022-02-22]{
-% style/emblem-img,style/name-img}
+% \begin{function}[added=2021-12-23,updated=2022-08-06]{
+% image/nju-emblem,image/nju-name}
% \begin{syntax}
-% emblem-img = \Arg{文件}
-% name-img = \Arg{文件}
+% nju-emblem = \Arg{文件}
+% nju-name = \Arg{文件}
% \end{syntax}
% 校名、校徽图片文件路径。
% \end{function}
@@ -1901,9 +2125,9 @@ To produce the documentation run the original source files ending with
% \subsubsection{摘要页}
% \changes{v0.11}{2021/10/01}{简化了摘要的编写方式。}
%
-% \begin{function}{abstract,abstract*}
+% \DescribeEnv{abstract}
+% \DescribeEnv{abstract*}
% 摘要。带星号的会生成英文摘要。
-% \end{function}
%
% \begin{latexexample}[emph={[1]abstract,abstract*}]
% \begin{abstract}
@@ -1915,17 +2139,17 @@ To produce the documentation run the original source files ending with
% \end{abstract*}
% \end{latexexample}
%
-% \begin{function}[added=2022-02-04]{style/abstract-in-toc}
+% \begin{function}[added=2022-02-04,updated=2022-07-31]{abstract/toc-entry}
% \begin{syntax}
-% abstract-in-toc = <\TTF>
+% toc-entry = <\TTF>
% \end{syntax}
% 是否将摘要条目插入目录,默认开启。
% 关闭此选项后摘要页将不会出现在目录中,仅保留其 PDF 书签。
% \end{function}
%
-% \begin{function}[added=2022-03-26]{style/abstract-title}
+% \begin{function}[added=2022-03-26,updated=2022-07-31]{abstract/title-style}
% \begin{syntax}
-% abstract-title = <(strict)|centered|natural>
+% title-style = <(strict)|centered|natural>
% \end{syntax}
% 选择研究生摘要标题样式。
% 默认为严格模式(\opt{strict}),即完全模仿材料包要求。
@@ -1944,9 +2168,8 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{前言页}
%
-% \begin{function}{preface}
+% \DescribeEnv{preface}
% 使用 \env{preface} 环境定义。
-% \end{function}
%
% \begin{latexexample}[emph={[1]preface,flushright}]
% \begin{preface}
@@ -1966,44 +2189,54 @@ To produce the documentation run the original source files ending with
% 分别生成目录、图片目录和表格目录。
% \end{function}
%
-% 目录页的标题名称一般无需修改。用户可以选择使用 \pkg{ctex} 宏集提供的 \tn{ctexset} 命令进行自定义。
-% \begin{latexexample}[moretexcs={\ctexset},emph={[1]contentsname,listfigurename,listtablename}]
-% \ctexset{
-% contentsname = { 目\hspace{2em}次 },
-% listfigurename = { 插图清单 },
-% listtablename = { 表格清单 }
-% }
-% \end{latexexample}
-% 实际上,根据《学位论文编写规则》国家标准\cite{gb-t-7713.1-2006},
-% 尽管“目录”这一说法已流传甚广,但学位论文中理应使用“目次”这一名称
-% 来指代篇目的列表。
+% \begin{function}[added=2022-08-08]{tableofcontents/dotline}
+% \begin{syntax}
+% dotline = <chapter|(section)>
+% \end{syntax}
+% 目录中的引导线设置。选择 \opt{chapter} 会为章标题后添加引导线。
+% \end{function}
%
-% \begin{function}[added=2022-02-04]{style/toc-in-toc}
+% \begin{function}[added=2022-02-04,updated=2022-07-31]{
+% tableofcontents/toc-entry,listoffigures/toc-entry,
+% listoftables/toc-entry}
% \begin{syntax}
-% toc-in-toc = <\TTF>
+% toc-entry = <\TTF>
% \end{syntax}
-% 是否在目录中显示目录自身的条目,默认开启。关闭此选项后目录、
+% 是否在目录中显示目录自身的条目,默认开启。关闭后目录、
% 插图目录和表格目录将不会出现在目录中,仅保留其 PDF 书签。
+% 注意,虽然名称一样,但这其实是对应三种目录的三个选项。
% \end{function}
%
+% 如果仅需要禁用插图目录和表格目录的条目,可以这样设置
+% \begin{latexexample}[moretexcs={\njusetup},
+% emph={[2]tableofcontents,listoffigures,listoftables}]
+% \njusetup{
+% tableofcontents/toc-entry = true, % 仅作展示,无需手动启用
+% listoffigures/toc-entry = false,
+% listoftables/toc-entry = false
+% }
+% \end{latexexample}
+%
+% 目录页的标题名称一般无需修改\footnote{尽管根据《学位论文编写规则》国家标准
+% \cite{gb-t-7713.1-2006},学位论文中理应使用“目次”这一名称来指代篇目的列表,
+% 我们仍然建议遵从学校给出的范例。}。如有需求,请参考 \ref{subsubsec:edit-text} 节。
%
% \subsubsection{符号表}
%
-% \begin{function}{notation,notation*}
-% \begin{syntax}
-% \tn{begin}\{notation\}\oarg{说明宽度}\oarg{符号宽度}
-% \quad\tn{item}\oarg{符号} \meta{说明}
-% \tn{end}\{notation\}
-% \end{syntax}
+% \DescribeEnv{notation}
+% \DescribeEnv{notation*}
% 符号表,或者称为术语表、缩略词对照表。带有星号的符号表环境不会插入目录。
-% \end{function}
+% \begin{syntax}
+% \tn{begin}\{notation\}\oarg{说明宽度}\oarg{符号宽度}
+% \quad\tn{item}\oarg{符号} \meta{说明}
+% \tn{end}\{notation\}
+% \end{syntax}
%
%
% \subsubsection{致谢页}
%
-% \begin{function}{acknowledgement}
+% \DescribeEnv{acknowledgement}
% 同前言,使用 \env{acknowledgement} 环境。
-% \end{function}
%
% \begin{latexexample}[emph={[1]acknowledgement}]
% \begin{acknowledgement}
@@ -2037,7 +2270,10 @@ To produce the documentation run the original source files ending with
% Nemec1997-209-214,Chiani1998-2998-3008,Chiani1998a}
% \end{latexexample}
%
-% 为了便于识别,成果列表中默认对发表年份进行加粗处理。而对作者姓名的处理较为复杂。利用 \pkg{biblatex} 的数据注解机制可以实现对特定文献信息的样式修改\footnote{\url{https://blog.csdn.net/xenonhu/article/details/120853247}},在此可以用来实现指定作者姓名的突出。经过注解后的一则参考文献条目如下所示:
+% 为了便于识别,成果列表中默认对发表年份进行加粗处理。而对作者姓名的处理较为复杂。
+% 利用 \pkg{biblatex} 的数据注解机制可以实现对特定文献信息的样式修改
+% \footnote{\url{https://blog.csdn.net/xenonhu/article/details/120853247}},
+% 在此可以用来实现指定作者姓名的突出。经过注解后的一则参考文献条目如下所示:
% \begin{latexexample}[emph={[1]@inproceedings},emph={[2]author}]
% @inproceedings{Nemec1997-209-214,
% title = {Force control of redundant robots},
@@ -2050,9 +2286,16 @@ To produce the documentation run the original source files ending with
% year = {1997}
% }
% \end{latexexample}
-% 其中 |author+an| 提供了注解的标记,格式为 \meta{序号}|=|\meta{标签},以上条目中即是将第二名作者加入了指定论文作者的注解。\tn{njupaperlist} 会识别 |thesisauthor| 标签,为其指代的作者姓名进行加粗下划线处理。
+% 其中 |author+an| 提供了注解的标记,格式为 \meta{序号}|=|\meta{标签},
+% 以上条目中即是将第二名作者加入了指定论文作者的注解。\tn{njupaperlist}
+% 会识别 |thesisauthor| 标签,为其指代的作者姓名进行加粗下划线处理。
%
-% 除手动进行标记以外,以下也提供一种自动化处理办法。下载 \href{https://github.com/hushidong/biblatex-map}{bibmap} 全部文件后,修改主目录下的 \file{bibmapaddauthoran.py} 中 |fieldsource| 为需要匹配的姓名,将需要进行标记的 \file{.bib} 文件拷贝至本目录(此处使用 \file{test.bib} 进行示范),运行以下命令生成的参考文献数据源即可被成果列表识别加粗。
+% 除手动进行标记以外,以下也提供一种自动化处理办法。
+% 下载 \href{https://github.com/hushidong/biblatex-map}{bibmap}
+% 全部文件后,修改主目录下的 \file{bibmapaddauthoran.py} 中 |fieldsource|
+% 为需要匹配的姓名,将需要进行标记的 \file{.bib} 文件拷贝至本目录
+% (此处使用 \file{test.bib} 进行示范),运行以下命令生成的参考文献数据源
+% 即可被成果列表识别加粗。
%
% \begin{shellexample}[morekeywords={python},deletekeywords={test}]
% python bibmap.py test.bib -m bibmapaddauthoran.py
@@ -2065,6 +2308,7 @@ To produce the documentation run the original source files ending with
% 势必需要为用户修改留出空间。这一节将提供一些定制方法。
%
% \subsubsection{固定文本}
+% \label{subsubsec:edit-text}
%
% \begin{function}{\njusetname,\njusetname*,\njusettext,\njusettext*}
% \begin{syntax}
@@ -2078,7 +2322,14 @@ To produce the documentation run the original source files ending with
% \ref{subsubsec:constant-text} 节。
% \end{function}
%
-% 譬如,将英文摘要页的小标题修改为仅首字母大写的样式,示例如下:
+% 譬如,修改目录标题名称,示例如下:
+
+% \begin{latexexample}[moretexcs={\njusetname}]
+% \njusetname{listoffigures}{插图清单}
+% \njusetname{listoftables}{表格清单}
+% \end{latexexample}
+%
+% 将英文摘要页的小标题修改为仅首字母大写的样式,示例如下:
%
% \begin{latexexample}[moretexcs={\njusetname*}]
% \njusetname*{abstract}[b]{Abstract}
@@ -2100,7 +2351,7 @@ To produce the documentation run the original source files ending with
% 譬如,将封面页填写个人信息的横线加长,示例如下:
%
% \begin{latexexample}[moretexcs={\njusetlength}]
-% \njusetlength{coveruline}{330pt}
+% \njusetlength{crulewd}{330pt}
% \end{latexexample}
%
% \subsubsection{样式}
@@ -2140,50 +2391,47 @@ To produce the documentation run the original source files ending with
%
% 在任何情况下,本模板都会\emph{显式}调用以下宏包(或文档类):
% \begin{itemize}
-% \item \pkg{xtemplate} 和 \pkg{l3keys2e},用于扩展 \hologo{LaTeX3} 编程环境。
+% \item \pkg{xtemplate} 和 \pkg{l3keys2e},用于扩展 \LaTeX3 编程环境。
% 它们属于 \pkg{l3packages} 宏集。
-% \item \cls{ctexbook},提供中文排版的通用框架。属于 C\hologo{TeX}
+% \item \cls{ctexbook},提供中文排版的通用框架。属于 C\TeX
% 宏集 \cite{CTeX}。
-% \item \pkg{mathtools},增强数学功能。
-% \item \pkg{unicode-math},负责处理 Unicode 编码的 OpenType 数学字体。
+% \item \pkg{amsmath},对 \LaTeX{} 的数学排版功能进行了全面扩展。
+% 属于 \hologo{AmSLaTeX} 套件。
% \item \pkg{geometry},用于调整页面尺寸。
% \item \pkg{setspace},调整行距。
% \item \pkg{fancyhdr},处理页眉页脚。
-% \item \pkg{footmisc},处理脚注。
-% \item \pkg{ntheorem},提供增强版的定理类环境。
-% \item \pkg{enumitem},调整列表环境。
% \item \pkg{graphicx},提供图形插入的接口。
% \item \pkg{booktabs},绘制三线表。
% \item \pkg{caption},用于设置题注。
% \item \pkg{hyperref},提供交叉引用、超链接、电子书签等功能。
-% \item \pkg{cleveref},用于自动生成引用标签。
-% \item \pkg{biblatex},提供参考文献解决方案。
% \end{itemize}
%
-% 以下宏包可能被隐式载入:
+% 以下宏包可以在文档类选项中禁用:
% \begin{itemize}
-% \item \pkg{xcolor},提供色彩支持。
-% \item \pkg{amsmath},对 \LaTeX{} 的数学排版功能进行了
-% 全面扩展。属于 \hologo{AmSLaTeX} 套件。
-% \item \pkg{biblatex-gb7714-2015},用于生成国标下的参考文献样式。
-% \item \pkg{xits},提供数学字体。
+% \item \pkg{amsthm} 和 \pkg{create-theorem},提供定理类环境支持。
+% \item \pkg{unicode-math},负责处理 Unicode 编码的 OpenType 数学字体。
+% \item \pkg{footmisc},处理脚注。
+% \item \pkg{enumitem},调整列表环境。
+% \item \pkg{cleveref},用于自动生成引用标签。
+% \item \pkg{biblatex} 和 \pkg{biblatex-gb7714-2015},用于生成国标下的参考文献样式。
% \end{itemize}
%
% 在开启某些选项时,本模板也会调用以下宏包:
% \begin{itemize}
-% \item \pkg{fandol}、\pkg{tex-gyre} 和 \pkg{tex-gyre-math},提供自由字体。
+% \item \pkg{fandol}、\pkg{tex-gyre}、\pkg{tex-gyre-math}、\pkg{xits} 等,
+% 提供自由字体。
% \item \pkg{emptypage},在双面模式下清空空白页的页眉、页脚和页码。
-% \item \pkg{njuvisual},用于绘制封面的校名校徽。
+% \item \pkg{tikz} 和 \pkg{njuvisual},用于绘制封面的校名校徽。
% \item \pkg{tabularray},用于绘制研究生的出版授权书信息表格。
% \item \pkg{xeCJKfntef} 或 \pkg{lua-ul},用于在对应引擎下绘制下划线。
% \end{itemize}
%
-% 下列宏包会与本模板产生冲突,或者不能发挥预期作用:
+% 下列宏包会与本模板的默认配置产生冲突,或者不能发挥预期作用:
% \begin{itemize}
% \item \pkg{natbib} 和 \pkg{gbt7714} 等 \hologo{BibTeX} 相关的参考文献宏包。
% \item \pkg{bm} 等使用传统数学字体配置方案的宏包。
% \item \pkg{babel} 在直接使用时会覆盖默认的中文名称设置。
-% \item \pkg{microtype} 在 \hologo{XeTeX} 和 \hologo{LuaTeX} 下支持有限。
+% \item \pkg{microtype} 在 \XeTeX 和 \LuaTeX 下支持有限。
% \end{itemize}
%
%
@@ -2216,7 +2464,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{install-latex-guide-zh-cn}
% 王然.
-% \newblock \textit{一份简短的关于 \hologo{LaTeX} 安装的介绍} [EB/OL].
+% \newblock \textit{一份简短的关于 \LaTeX 安装的介绍} [EB/OL].
% \newblock version 2021.12.1,
% \newblock (2021-12-01)
% \urlprefix\url{https://ctan.org/pkg/install-latex-guide-zh-cn}
@@ -2224,7 +2472,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{刘海洋2013latex入门}
% 刘海洋.
-% \newblock \textit{\hologo{LaTeX} 入门} [M].
+% \newblock \textit{\LaTeX 入门} [M].
% \newblock 北京: 电子工业出版社, 2013
%
%
@@ -2260,18 +2508,36 @@ To produce the documentation run the original source files ending with
% \newblock \textit{信息与文献\quad 参考文献著录规则: GB/T 7714--2015} [S].
% \newblock 北京: 中国标准出版社, 2015
%
-% \bibitem{nju2021}
+% \bibitem{nju-bachelor-2022}
% 南京大学本科生院.
% \newblock \textit{关于启动南京大学2022届本科毕业论文(设计)工作的通知} [EB/OL].
% \newblock (2021-12-14)
% \urlprefix\url{https://jw.nju.edu.cn/7c/86/c26263a556166/page.htm}
%
+% \bibitem{nju-master-2022}
+% 南京大学研究生院.
+% \newblock \textit{硕士研究生申请学位材料下载} [EB/OL].
+% \newblock (2022-04-26)
+% \urlprefix\url{https://grawww.nju.edu.cn/1077/list.htm}
+%
+% \bibitem{nju-doctor-2022}
+% 南京大学研究生院.
+% \newblock \textit{博士研究生申请学位材料下载} [EB/OL].
+% \newblock (2022-04-26)
+% \urlprefix\url{https://grawww.nju.edu.cn/1076/list.htm}
+%
+% \bibitem{nju-postdoc-2022}
+% 南京大学人力资源处.
+% \newblock \textit{博士后出站申请} [EB/OL].
+% \newblock (2022-07-27)
+% \urlprefix\url{https://hr.nju.edu.cn/6334/list.htm}
+%
%
% \subsection*{宏包}
%
% \bibitem{biblatex}
% \textsc{Lehman P}, \textsc{Wright J}, \textsc{Boruvka A}, \textsc{Kime P}.
-% \newblock \textit{Sophisticated Bibliographies in \hologo{LaTeX}} [EB/OL].
+% \newblock \textit{Sophisticated Bibliographies in \LaTeX} [EB/OL].
% \newblock version 3.17,
% \newblock (2022-02-02)
% \urlprefix\url{https://ctan.org/pkg/biblatex}
@@ -2295,7 +2561,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{latexmk}
% \textsc{Collins J}.
-% \newblock \textit{Fully automated \hologo{LaTeX} document generation} [EB/OL].
+% \newblock \textit{Fully automated \LaTeX document generation} [EB/OL].
% \newblock version 4.76,
% \newblock (2021-11-20)
% \urlprefix\url{https://www.ctan.org/pkg/latexmk}
@@ -2303,7 +2569,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{listings}
% \textsc{Heinz C}, \textsc{Moses B}, \textsc{Hoffmann J}.
-% \newblock \textit{Typeset source code listings using \hologo{LaTeX}} [EB/OL].
+% \newblock \textit{Typeset source code listings using \LaTeX} [EB/OL].
% \newblock version 1.8d,
% \newblock (2020-03-24)
% \urlprefix\url{https://www.ctan.org/pkg/listings}
@@ -2319,7 +2585,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{pdfpages}
% \textsc{Matthias A}.
-% \newblock \textit{Include PDF documents in \hologo{LaTeX}} [EB/OL].
+% \newblock \textit{Include PDF documents in \LaTeX} [EB/OL].
% \newblock version 0.5v,
% \newblock (2022-05-22)
% \urlprefix\url{https://www.ctan.org/pkg/pdfpages}
@@ -2335,7 +2601,7 @@ To produce the documentation run the original source files ending with
%
% \bibitem{tabularray}
% \textsc{Jianrui Lyu}.
-% \newblock \textit{Typeset tabulars and arrays with \hologo{LaTeX3}} [EB/OL].
+% \newblock \textit{Typeset tabulars and arrays with \LaTeX3} [EB/OL].
% \newblock version 2021Q,
% \newblock (2021-12-01)
% \urlprefix\url{https://ctan.org/pkg/tabularray}
@@ -2365,37 +2631,37 @@ To produce the documentation run the original source files ending with
%
% \bibitem{wenboyang2013}
% 杨文博.
-% \newblock \textit{南京大学学位论文 \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学学位论文 \LaTeX 模板} [EB/OL].
% \newblock (2018-06-23)
% \urlprefix\url{https://github.com/solrex/njuthesis}
%
% \bibitem{fireblue2013}
% \textsc{fireblue}.
-% \newblock \textit{南京大学学位论文 \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学学位论文 \LaTeX 模板} [EB/OL].
% \newblock (2013-04-13)
% \urlprefix\url{https://github.com/fireblue/NJUThesis}
%
% \bibitem{wenhai-zheng2013}
% \textsc{wenhai-zheng}.
-% \newblock \textit{南京大学本科毕业论文 \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学本科毕业论文 \LaTeX 模板} [EB/OL].
% \newblock (2013-08-12)
% \urlprefix\url{https://github.com/wenhai-zheng/NJUThesis}
%
% \bibitem{zenglecao2013}
% 曹增乐.
-% \newblock \textit{南京大学本科毕业论文(设计) \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学本科毕业论文(设计) \LaTeX 模板} [EB/OL].
% \newblock (2019-06-26)
% \urlprefix\url{https://github.com/ZLCao/NJUBachelor}
%
% \bibitem{haixinghu2013}
% 胡海星.
-% \newblock \textit{南京大学学位论文 \hologo{XeLaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学学位论文 \XeLaTeX 模板} [EB/OL].
% \newblock (2018-08-08)
% \urlprefix\url{https://github.com/Haixing-Hu/nju-thesis}
%
% \bibitem{chuhengzhang2016}
% 张楚珩.
-% \newblock \textit{南京大学本科生毕业论文 \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学本科生毕业论文 \LaTeX 模板} [EB/OL].
% \newblock (2016-06-01)
% \urlprefix\url{https://github.com/zhangchuheng123/NJUThesis}
%
@@ -2407,19 +2673,19 @@ To produce the documentation run the original source files ending with
%
% \bibitem{njuHan2018}
% \textsc{njuHan}.
-% \newblock \textit{南京大学学位论文(本科/硕士/博士),毕业论文 \hologo{LaTeX} 模板} [EB/OL].
+% \newblock \textit{南京大学学位论文(本科/硕士/博士),毕业论文 \LaTeX 模板} [EB/OL].
% \newblock (2021-06-15)
% \urlprefix\url{https://github.com/njuHan/njuthesis-nju-thesis-template}
%
% \bibitem{anyirao2018}
% 饶安逸.
-% \newblock \textit{南京大学本科生毕业论文 \hologo{LaTeX} 模板 2018 新版} [EB/OL].
+% \newblock \textit{南京大学本科生毕业论文 \LaTeX 模板 2018 新版} [EB/OL].
% \newblock (2018-06-24)
% \urlprefix\url{https://github.com/AnyiRao/NJUThesis2018}
%
% \bibitem{yichenzhao2021}
% 赵懿晨.
-% \newblock \textit{南京大学本科生毕业论文 \hologo{LaTeX} 模板(2021版)} [EB/OL].
+% \newblock \textit{南京大学本科生毕业论文 \LaTeX 模板(2021版)} [EB/OL].
% \newblock (2021-09-23)
% \urlprefix\url{https://github.com/FengChendian/NJUThesis2021}
%
@@ -2435,19 +2701,22 @@ To produce the documentation run the original source files ending with
% \section{代码实现}
% \changes{v0.10}{2021/09/26}{对代码实现部分进行了整理。}
%
-% 本模板使用 \hologo{LaTeX3} 语法编写,依赖 \pkg{expl3} 环境,
+% 本模板使用 \LaTeX3 语法编写,依赖 \pkg{expl3} 环境,
% 并需调用 \pkg{l3packages} 中的相关宏包。
%
-% 以下代码中有一些形如 \agrd{*class} 的标记,
-% 这是 \pkg{DocStrip} 中的“guard”,用来选择性地提取文件。
-% “|*|”和“|/|”分别表示该部分的开始和结束。不含
-% “|*|”和“|/|”的 guard 出现在行号右侧,它们用来确定
-% 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。
+% 以下代码中有一些形如\sgrd{class}的标记, 这是 \pkg{DocStrip} 中的
+% “guard”,用来选择性地提取文件。“|*|”和“|/|”分别表示该部分的开始和结
+% 束。不含“|*|”和“|/|”的 guard 出现在行号左侧,它们用来确定单独一行代
+% 码的归属。这些 guard 的颜色不一,用以明确分类关系。
%
-% 另有若干包含 \bgrd{@@} 的 guard,用以表示名空间(模块)。
-% 在删除注释生成格式文件时,源代码变量名称中的 |@@| 会被等号后的字段替换,
-% 譬如在本模板主体部分中 \bgrd{〈@@=nju〉}。
+% 下文中,本科生模板配置对应\pgrd{u},用于生成
+% \file{njuthesis-undergraduate.def};研究生模板配置对应\pgrd{g},
+% 用于生成 \file{njuthesis-graduate.def};博士后模板配置对应\pgrd{p},
+% 用于生成 \file{njuthesis-postdoctoral.def}。
%
+% 另有若干包含 \textsf{@@} 的 guard,用以表示名空间(模块)。
+% 在删除注释生成格式文件时,源代码变量名称中的 \textsf{@@} 会被等号后的字段替换,
+% 譬如在本模板主体部分中\grd{@@=nju}。
%
% \subsection{准备}
%
@@ -2458,7 +2727,7 @@ To produce the documentation run the original source files ending with
%
% \changes{v0.11}{2021/10/23}{添加了若干环境检查与警告信息。}
% \changes{v0.12}{2021/12/03}{放宽对于 \pkg{l3packages} 的版本要求。}
-% 检查 \hologo{LaTeX3} 编程环境。
+% 检查 \LaTeX3 编程环境。
% \begin{macrocode}
\RequirePackage { xtemplate, l3keys2e }
\msg_new:nnn { njuthesis } { l3-too-old }
@@ -2475,7 +2744,7 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
-% 目前 \cls{njuthesis} 仅支持 \hologo{XeTeX} 和 \hologo{LuaTeX}。
+% 目前 \cls{njuthesis} 仅支持 \XeTeX 和 \LuaTeX。
% \begin{macrocode}
\msg_new:nnn { njuthesis } { unsupported-engine }
{
@@ -2494,64 +2763,69 @@ To produce the documentation run the original source files ending with
%
% \subsection{定义变量}
%
-% 在变量名称中,|l| 代表局部变量,|g| 代表全局变量,|c| 代表常量,最后一个下划线后的内容指示其类型。
+% 本模板的变量名称通式为 |\|\meta{作用域}|_@@_|\meta{族}|_|\meta{描述}|_|\meta{类型}
+% (出现在源代码中)或 |\|\meta{作用域}|__nju_|\meta{族}|_|\meta{描述}|_|\meta{类型}
+% (出现在文档中)。作用域为单个字母,|l| 代表局部变量,|g| 代表全局变量,|c| 代表常
+% 量。最后一个下划线后的内容指示其类型,但引擎不会根据名称检查变量类型。
%
% \begin{variable}{
-% \l_@@_tmp_box,
-% \l_@@_tmp_clist,
-% \l_@@_tmpa_dim,\l_@@_tmpb_dim,
-% \l_@@_tmpa_int,\l_@@_tmpb_int,
-% \l_@@_tmpa_tl,\l_@@_tmpb_tl}
+% \l_@@_tmpa_box,\l_@@_tmpb_box,\l_@@_tmpc_box,\l_@@_tmp_clist,
+% \l_@@_tmpa_dim,\l_@@_tmpb_dim,\l_@@_tmpa_int,\l_@@_tmpb_int,
+% \l_@@_tmp_skip,\l_@@_tmpa_tl,\l_@@_tmpb_tl}
% 临时变量。
% \begin{macrocode}
-\box_new:N \l_@@_tmp_box
+\box_new:N \l_@@_tmpa_box
+\box_new:N \l_@@_tmpb_box
+\box_new:N \l_@@_tmpc_box
\clist_new:N \l_@@_tmp_clist
\dim_new:N \l_@@_tmpa_dim
\dim_new:N \l_@@_tmpb_dim
\int_new:N \l_@@_tmpa_int
\int_new:N \l_@@_tmpb_int
+\skip_new:N \l_@@_tmp_skip
\tl_new:N \l_@@_tmpa_tl
\tl_new:N \l_@@_tmpb_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_info_degree_int,
-% \g_@@_info_diploma_int,\g_@@_info_type_int}
+% \begin{variable}{
+% \g_@@_info_degree_int,
+% \g_@@_info_type_int}
% 用于存储学位类型的变量。
% \begin{macrocode}
\int_new:N \g_@@_info_degree_int
-\int_new:N \g_@@_info_diploma_int
\int_new:N \g_@@_info_type_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_info_degree_tl,\g_@@_info_diploma_tl,
-% \g_@@_info_type_tl,\g_@@_info_type_en_tl}
+% \begin{variable}{
+% \g_@@_info_degree_tl,
+% \g_@@_info_type_en_tl}
% 用于存储学位名称的变量。
% \begin{macrocode}
\tl_new:N \g_@@_info_degree_tl
-\tl_new:N \g_@@_info_diploma_tl
-\tl_new:N \g_@@_info_type_tl
\tl_new:N \g_@@_info_type_en_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_twoside_bool}
+% \begin{variable}{\g_@@_opt_twoside_bool}
% 定义用于判断是否使用双面模式的变量,初始值为使用双面模式。
% \begin{macrocode}
-\bool_new:N \g_@@_twoside_bool
-\bool_set_true:N \g_@@_twoside_bool
+\bool_new:N \g_@@_opt_twoside_bool
+\bool_set_true:N \g_@@_opt_twoside_bool
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_second_supv_bool}
+% \begin{variable}{\l_@@_second_supvbool}
% 定义用于判断是否有第二导师的变量。
% \begin{macrocode}
-\bool_new:N \l_@@_second_supv_bool
+\bool_new:N \l_@@_second_supvbool
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_info_supvfull_tl,\g_@@_info_supvfull_en_tl}
+% \begin{variable}{
+% \g_@@_info_supvfull_tl,
+% \g_@@_info_supvfull_en_tl}
% 用于存储导师姓名加职称的变量。
% \begin{macrocode}
\tl_new:N \g_@@_info_supvfull_tl
@@ -2559,11 +2833,30 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_latin_font_tl,\g_@@_cjk_font_tl}
-% 用于存储所使用字体名称的全局变量。
+% \begin{variable}{
+% \g_@@_font_latin_tl,
+% \g_@@_font_cjk_tl,
+% \g_@@_font_math_tl}
+% 存储所使用字体名称的全局变量。
% \begin{macrocode}
-\tl_new:N \g_@@_latin_font_tl
-\tl_new:N \g_@@_cjk_font_tl
+\tl_new:N \g_@@_font_latin_tl
+\tl_new:N \g_@@_font_cjk_tl
+\tl_new:N \g_@@_font_math_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_font_path_tl}
+% 存储字体路径的全局变量。
+% \begin{macrocode}
+\tl_new:N \g_@@_font_path_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_font_path_bool}
+% 是否使用独立的字体文件。
+% \begin{macrocode}
+\bool_new:N \g_@@_font_path_bool
+\bool_gset_false:N \g_@@_font_path_bool
% \end{macrocode}
% \end{variable}
%
@@ -2574,10 +2867,20 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_theorem_type_clist}
-% 定理类型。
+% \begin{variable}{\g_@@_thm_type_clist}
+% 默认定理类型、头名称,以及是否需要编号和证毕符号。
% \begin{macrocode}
-\clist_new:N \g_@@_theorem_type_clist
+\clist_new:N \g_@@_thm_type_clist
+\clist_gset:Nn \g_@@_thm_type_clist
+ {
+ { axiom } { 公理 },
+ { corollary } { 推论 },
+ { definition } { 定义 },
+ { example } { 例 },
+ { lemma } { 引理 },
+ { proof, *+ } { 证明 },
+ { theorem } { 定理 }
+ }
% \end{macrocode}
% \end{variable}
%
@@ -2593,25 +2896,25 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\c_@@_name_type_clist,\c_@@_name_type_en_clist,
-% \c_@@_name_degree_clist,\c_@@_name_degree_en_clist}
+% \begin{variable}{
+% \c_@@_name_type_clist,
+% \c_@@_name_type_en_clist,
+% \c_@@_name_degree_clist}
% 论文类型与学位类型。
% \begin{macrocode}
\clist_const:Nn \c_@@_name_type_clist
- { 毕业论文, 毕业设计 }
+ { 学士, 硕士, 博士 }
\clist_const:Nn \c_@@_name_type_en_clist
- { THESIS, DESIGN }
+ { Bachelor, Master, Doctor~of~Philosophy }
\clist_const:Nn \c_@@_name_degree_clist
- { 学士, 硕士, 硕士专业, 博士 }
-\clist_const:Nn \c_@@_name_degree_en_clist
- { Bachelor, Master, Master, Doctor~of~Philosophy }
+ { \c_empty_tl, 专业 }
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\c_@@_month_en_clist}
+% \begin{variable}{\c_@@_name_month_en_clist}
% 英文月份名称。
% \begin{macrocode}
-\clist_const:Nn \c_@@_month_en_clist
+\clist_const:Nn \c_@@_name_month_en_clist
{
January, February, March, April, May, June,
July, August, September, October, November, December
@@ -2619,19 +2922,21 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\c_@@_blind_info_clist,\c_@@_blind_info_en_clist,
-% \c_@@_blind_infolist_clist}
+% \begin{variable}{
+% \c_@@_name_anon_clist,
+% \c_@@_name_anon_en_clist,
+% \c_@@_name_anonlist_clist}
% 盲审模式下不显示的个人信息项。
% \begin{macrocode}
-\clist_const:Nn \c_@@_blind_info_clist
+\clist_const:Nn \c_@@_name_anon_clist
{
author, chairman, clc, dept, email, field, grade,
id, major, secretlv, supvcont, udc
}
-\clist_const:Nn \c_@@_blind_info_en_clist
- { author, dept, field, major, supv, supv_ii }
-\clist_const:Nn \c_@@_blind_infolist_clist
- { reviewer, supv, supv_ii }
+\clist_const:Nn \c_@@_name_anon_en_clist
+ { author, dept, field, major, supv, supvii }
+\clist_const:Nn \c_@@_name_anonlist_clist
+ { reviewer, supv, supvii }
% \end{macrocode}
% \end{variable}
%
@@ -2649,21 +2954,22 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\@@_vskip:,\@@_hskip:}
% 生成一个较小的 skip。
% \begin{macrocode}
-\cs_new:Nn \@@_vskip: { \skip_vertical:N \c_@@_smallvskip_dim }
-\cs_new:Nn \@@_hskip: { \skip_horizontal:N \c_@@_smallhskip_dim }
+\cs_new:Nn \@@_vskip: { \skip_vertical:N \c_@@_vsep_dim }
+\cs_new:Nn \@@_hskip: { \skip_horizontal:N \c_@@_hsep_dim }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_vskip:N}
-% 类似于 \hologo{LaTeX2e} 中的 \tn{vspace*},
+% 类似于 \LaTeXe 中的 \tn{vspace*}
+% \footnote{\url{https://tex.stackexchange.com/a/30065/251992}},
% 从上一个页面元素底部开始生成 |skip|。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vskip:N #1
+\cs_set_protected:Npn \@@_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
}
% \end{macrocode}
% \end{macro}
@@ -2699,43 +3005,50 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_add_theorem_type:nnn}
-% 添加已知的定理环境类型。
+% \begin{macro}{\@@_name:n,\@@_info:n,\@@_fmt:n}
+% 根据变量名调用名称、内容或格式信息。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_add_theorem_type:nnn #1#2#3
- {
- \clist_gput_right:Nn \g_@@_theorem_type_clist { #1 }
- \@@_define_name:nnn { #1 } { #2 } { #3 }
- }
+\cs_new:Npn \@@_name:n #1 { \tl_use:c { c_@@_name_ #1 _tl } }
+\cs_new:Npn \@@_info:n #1 { \tl_use:c { g_@@_info_ #1 _tl } }
+\cs_new:Npn \@@_fmt:n #1 { \tl_use:c { c_@@_fmt_ #1 _tl } }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_name:n,\@@_info:n}
-% 根据变量名调用名称和内容信息。
+% \begin{macro}{\@@_name:nn}
+% 根据变量名调用名称信息,可调整字符格式
% \begin{macrocode}
-\cs_new:Npn \@@_name:n #1 { \tl_use:c { c_@@_name_ #1 _tl } }
-\cs_new:Npn \@@_info:n #1 { \tl_use:c { g_@@_info_ #1 _tl } }
+\cs_new:Npn \@@_name:nn #1#2
+ { \group_begin: \@@_fmt:n {#1} \@@_name:n {#2} \group_end: }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_ulined_center_box:nn}
+% \begin{macro}{\@@_box_ulined:NN,\@@_box_ulined:Nc}
% 带有下划线的水平盒子。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 内容,可带有格式
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_ulined_center_box:nn #1#2
+\cs_new_protected:Npn \@@_box_ulined:NN #1#2
{
\mode_leave_vertical:
- \rule [ -0.55 ex ] { #1 } { 0.4 pt }
+ \rule [ \c_@@_ruledpi_dim ] { #1 } { \c_@@_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_generate_variant:Nn \@@_box_ulined:NN { Nc }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_spread_box:nnn,\@@_spread_box:nnV,\@@_spread_box:nnx}
+% \begin{macro}{\@@_box_ulined_info:Nn}
+% 以上盒子只用来打印 \cs{g_@@_info_\meta{描述}_tl} 变量。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_box_ulined_info:Nn #1#2
+ { \@@_box_ulined:Nc #1 { g_@@_info_ #2 _tl } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_box_spread:NNn,\@@_box_spread:NNv}
% \changes{v0.19}{2022/05/16}{对超出盒子宽度的文字进行水平压缩。}
% 分散对齐的水平盒子,拉伸算法来自 \cls{fduthesis}。
% 在文字宽度小于给定宽度时,在字符中间填补 \tn{hfil} 以增大字距。
@@ -2746,27 +3059,47 @@ To produce the documentation run the original source files ending with
% \item 内容,不可带有格式
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_spread_box:nnn #1#2#3
+\cs_new_protected:Npn \@@_box_spread:NNn #1#2#3
{
\mode_leave_vertical:
- \@@_get_text_width:Nn \l_@@_tmpa_dim { #2 #3 }
+ \@@_get_width:Nn \l_@@_tmpa_dim { #2 #3 }
\hbox_to_wd:nn { #1 }
{
\dim_compare:nTF { \l_@@_tmpa_dim > #1 }
{
- \scalebox
+ \tex_hfil:D \scalebox
{ \dim_to_decimal_in_unit:nn { #1 } { \l_@@_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 \@@_spread_box:nnn { nnV }
-\cs_generate_variant:Nn \@@_spread_box:nnn { nnx }
+\cs_generate_variant:Nn \@@_box_spread:NNn { NNv }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_multiline_box:NNNn}
+% \begin{macro}{\@@_box_spread_name:Nn,\@@_box_spread_name:NNn}
+% 以上盒子只用来打印 \cs{c_@@_name_\meta{描述}_tl} 变量。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_box_spread_name:Nn #1#2
+ { \@@_box_spread:NNv #1 \c_empty_tl { c_@@_name_ #2 _tl } }
+\cs_new_protected:Npn \@@_box_spread_name:NNn #1#2#3
+ { \@@_box_spread:NNv #1 #2 { c_@@_name_ #3 _tl } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_box_center:Nn}
+% 居中对齐的水平盒子。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_box_center:Nn #1#2
+ {
+ \mode_leave_vertical:
+ \hbox_to_wd:nn {#1} { \tex_hfil:D #2 \tex_hfil:D }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_box_multiline:NNNN}
% 多行固定长度的下划线内容,用于国家图书馆封面。
% \begin{arguments}
% \item 用于循环的 |int| 型变量
@@ -2776,16 +3109,15 @@ To produce the documentation run the original source files ending with
% \end{arguments}
% 默认绘制 4 条下划线。在评阅者人数超过 4 人时添加额外的条目。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_multiline_box:NNNn #1#2#3#4
+\cs_new_protected:Npn \@@_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 }
{
- \@@_ulined_center_box:nn { #4 }
- { \clist_item:Nn #3 { #1 } } \\
+ \clist_pop:NN #3 \l_@@_tmpa_tl
+ \@@_box_ulined:NN #4 \l_@@_tmpa_tl \tex_par:D
\int_incr:N #1
}
}
@@ -2801,30 +3133,31 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_uline:n #1
{
\mode_leave_vertical:
- \rule [ -0.55 ex ] { #1 } { 0.4 pt }
+ \rule [ \c_@@_ruledpi_dim ] { #1 } { \c_@@_rulehti_dim }
\skip_horizontal:n { -#1 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_uuline:n}
+% \begin{macro}{\@@_uuline:N}
% 指定宽度的双层下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_uuline:n #1
+\cs_new_protected:Npn \@@_uuline:N #1
{
\mode_leave_vertical:
- \rule [ -0.5 ex ] { #1 } { 0.4 pt }
+ \rule [ \c_@@_ruledpii_dim ] { #1 } { \c_@@_rulehtii_dim }
\skip_horizontal:n { -#1 }
- \rule [ -0.6 ex ] { #1 } { 0.4 pt }
+ \rule [ \c_@@_ruledpiii_dim ] { #1 } { \c_@@_rulehtii_dim }
\skip_horizontal:n { -#1 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_get_text_width:Nn,\@@_get_text_width:NV}
+% \begin{macro}{\@@_get_width:Nn,\@@_get_width:NV,\@@_get_width:Nv}
+% ^^A 来自 fduthesis
% 获取文本宽度。
% \begin{arguments}
% \item 存储宽度的 |dim| 型变量
@@ -2832,29 +3165,55 @@ To produce the documentation run the original source files ending with
% \end{arguments}
% 将内容放入 \tn{hbox} 后读取其宽度,存入 |dim| 型变量。
% \begin{macrocode}
-\cs_new:Npn \@@_get_text_width:Nn #1#2
+\cs_new:Npn \@@_get_width:Nn #1#2
{
- \hbox_set:Nn \l_@@_tmp_box {#2}
- \dim_set:Nn #1 { \box_wd:N \l_@@_tmp_box }
+ \hbox_set:Nn \l_@@_tmpa_box {#2}
+ \dim_set:Nn #1 { \box_wd:N \l_@@_tmpa_box }
}
-\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
+\cs_generate_variant:Nn \@@_get_width:Nn { NV }
+\cs_generate_variant:Nn \@@_get_width:Nn { Nv }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_full_uline:Nn,\@@_full_uline:NV}
+% \begin{macro}{\@@_get_max_width:NN}
+% ^^A 来自 fduthesis,调整了实现方法
+% 获取多个文本中的最大宽度,并存入 |dim| 型变量。
+% 本模板中此函数仅用于处理 |info| 类型文本变量,
+% 出现在博士后模板封面信息表。
+% \begin{arguments}
+% \item |dim| 型变量
+% \item 文本 |clist|
+% \end{arguments}
+% 当 \cs{l_@@_tmpa_clist} 非空时,弹出最后一个元素赋给 \cs{l_@@_tmpa_tl},
+% 获取其长度后与 |#1| 进行比较,二者中较大的那一个将成为 |#1| 的新值。
+% 不断循环,直至 \cs{l_@@_tmpa_clist} 为空。
+% \begin{macrocode}
+\cs_new:Npn \@@_get_max_width:NN #1#2
+ {
+ \clist_map_inline:Nn #2
+ {
+ \@@_get_width:Nv \l_@@_tmpa_dim { g_@@_info_ ##1 _tl }
+ \dim_gset:Nn #1 { \dim_max:nn {#1} { \l_@@_tmpa_dim } }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_full_uline:Nn,\@@_full_uline:Nx}
% 横跨整页的下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
% \end{arguments}
-% 先使用 \cs{@@_get_text_width:Nn} 获取文本内容宽度,该宽度存储在调用的 |dim| 型变量中。随后输出文本内容。
+% 先使用 \cs{@@_get_text_width:Nn} 获取文本内容宽度,
+% 该宽度存储在调用的 |dim| 型变量中。随后输出文本内容。
% \begin{macrocode}
\cs_new_protected:Npn \@@_full_uline:Nn #1#2
{
- \@@_get_text_width:Nn #1 { #2 }
+ \@@_get_width:Nn #1 { #2 }
\dim_set:Nn #1 { \textwidth - #1 } #2
}
-\cs_generate_variant:Nn \@@_full_uline:Nn { NV }
+\cs_generate_variant:Nn \@@_full_uline:Nn { Nx }
% \end{macrocode}
% \end{macro}
%
@@ -2869,8 +3228,8 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_uline_entry:Nnnn #1#2#3#4
{
- \@@_full_uline:NV #1 { \@@_name:n { #2 } #4 }
- \@@_ulined_center_box:nn { #1 } { \@@_info:n { #3 } }
+ \@@_full_uline:Nx #1 { \@@_name:n { #2 } #4 }
+ \@@_box_ulined_info:Nn #1 { #3 }
}
% \end{macrocode}
% \end{macro}
@@ -2886,15 +3245,17 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_uline_bientry:Nnnn #1#2#3#4
{
- \@@_full_uline:NV #1 { \@@_name:n { #2 } #4 }
+ \@@_full_uline:Nx #1 { \@@_name:n { #2 } #4 }
\dim_sub:Nn #1 { \textwidth / 2 }
- \@@_ulined_center_box:nn { #1 } { \@@_info:n { #3 } }
+ \@@_box_ulined_info:Nn #1 { #3 }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_date:www,\@@_date_en:www}
-% 将形如 |yyyy-mm-dd| 的 ISO 日期格式字符串转化为日期表示。该格式符合国际标准 ISO 8601 以及国内标准 GB/T 7408--2005《数据元和交换格式 信息交换 日期和时间表示法》。
+% 将形如 |yyyy-mm-dd| 的 ISO 日期格式字符串转化为日期表示。
+% 该格式符合国际标准 ISO 8601 以及国内标准 GB/T 7408--2005
+% 《数据元和交换格式 信息交换 日期和时间表示法》。
% \begin{arguments}
% \item 年份
% \item 月份
@@ -2908,7 +3269,7 @@ To produce the documentation run the original source files ending with
\cs_new:Npn \@@_date:www #1-#2-#3 \q_stop
{ \__zhnum_date_aux:nnn { #1 } { #2 } { #3 } }
\cs_new:Npn \@@_date_en:www #1-#2-#3 \q_stop
- { \clist_item:Nn \c_@@_month_en_clist { #2 } ~#3 , ~#1 }
+ { \clist_item:Nn \c_@@_name_month_en_clist { #2 } ~#3 , ~#1 }
% \end{macrocode}
% \end{macro}
%
@@ -2936,12 +3297,31 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% |w| 后的参数需要使用非括号包裹的形式完全展开。
% \begin{macrocode}
- { \exp_last_unbraced:cV { @@_date #2 :www } \l_@@_tmpa_tl \q_stop }
+ {
+ \exp_last_unbraced:cV { @@_date #2 :www }
+ \l_@@_tmpa_tl \q_stop
+ }
}
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_at_begin_document:n}
+% 封装 \LaTeX{} 的钩子管理机制,等效于 \tn{AtBeginDocument}。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_at_begin_document:n #1
+ { \hook_gput_next_code:nn { begin document } { #1 } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_cs_clear:N}
+% 清空命令。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_cs_clear:N #1
+ { \cs_set_eq:NN #1 \prg_do_nothing: }
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{封面相关}
% \changes{v0.16}{2022/03/10}{将封面和摘要内部函数定义移动到前部。}
%
@@ -2955,125 +3335,190 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
+% \begin{macro}{\@@_loop_until:nnn}
+% 等效于 plain \TeX 的 \tn{loop} 循环,原始结构为\\
+% \tn{loop}\meta{循环体1}\meta{终止条件}\meta{循环体2}\tn{repeat}。
+% \begin{arguments}
+% \item |bool| 表达式
+% \item 循环体1
+% \item 循环体2
+% \end{arguments}
+% 两个代码块交替执行,如果在\meta{循环体1}结束后满足条件,则退出循环。
+% \begin{macrocode}
+\cs_new:Npn \@@_loop_until:nnn #1#2#3
+ { #2 \bool_if:nF {#1} { #3 \@@_loop_until:nnn {#1} {#2} {#3} } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_breakpar_loop:n}
+% \changes{v1.0}{2022/08/01}{使用 \LaTeX3 语法重构下划线断行算法。}
+% 带下划线的自然断行算法。
+% \begin{arguments}
+% \item 循环体2的额外语句
+% \end{arguments}
+% \begin{macrocode}
+\cs_new:Npn \@@_breakpar_loop:n #1
+ {
+ \dim_set:Nn \l_@@_tmpa_dim
+ { - \tex_prevdepth:D - \c_@@_ruledpi_dim - \c_@@_rulehti_dim }
+ \hbox_gset:Nn \l_@@_tmpc_box { }
+ \@@_loop_until:nnn { \box_if_empty_p:N \l_@@_tmpb_box }
+ {
+ \box_gset_to_last:N \l_@@_tmpb_box
+ \tex_unskip:D \tex_unpenalty:D
+ }
+ {
+ \hbox_gset:Nn \l_@@_tmpc_box
+ {
+ \vbox_top:n
+ {
+ \box_use_drop:N \l_@@_tmpb_box
+ \__kernel_kern:n { \l_@@_tmpa_dim }
+ \tex_hrule:D
+ }
+ \tex_penalty:D
+ \l_@@_tmpa_box
+ \hbox_unpack_drop:N \l_@@_tmpc_box
+ }
+ #1
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_breakpar_print:nn}
+% 打印带下划线的自然断行算法结果。
+% \begin{macrocode}
+\cs_new:Npn \@@_breakpar_print:nn #1#2
+ {
+ \group_begin:
+ \tex_noindent:D #1
+ \hbox_unpack_drop:N \l_@@_tmpc_box #2
+ \tex_par:D
+ \group_end:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_uline_title:}
% \changes{v0.17}{2022/04/09}{优化封面标题的断行方式。}
-% 多行带下划线标题。使用 \hologo{TeX} 原生断行算法实现。
+% 多行带下划线标题。使用 \TeX 原生断行算法实现。
% \begin{macrocode}
\cs_new_protected:Npn \@@_uline_title:
{
- \setbox0 = \vbox{
- \leftskip=0.5em plus 1 fill
- \rightskip=\leftskip \parskip=1cm
- \parindent=\z@ \g_@@_info_title_tl \par
- \global\setbox2=\hbox{}
- \loop
- \setbox1=\lastbox \unskip\unpenalty
- \unless\ifvoid1
- \global\setbox2=\hbox{\@@_uline_box:\penalty0\unhbox2}
- \repeat
+ \vbox_set:Nn \l_@@_tmpa_box
+ {
+ \skip_set:Nn \tex_leftskip:D { .5 em plus 1 fill }
+ \skip_set_eq:NN \tex_rightskip:D \tex_leftskip:D
+ \g_@@_info_title_tl \tex_par:D
+% \end{macrocode}
+% 使用循环寻找断行点,存入已被清空的 3 号盒子。
+% \begin{macrocode}
+ \@@_breakpar_loop:n { }
}
- { \noindent \unhbox2 \par }
+% \end{macrocode}
+% 输出绘制好的标题。
+% \begin{macrocode}
+ \@@_breakpar_print:nn { } { }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_entry_title:nnn}
+% \begin{macro}{\@@_cover_entry_title:NNN}
% 生成普通封面页的标题条目,包括标签和标题本身。
% \begin{arguments}
-% \item 内容格式
% \item 名称盒子宽度,|dim| 型变量
% \item 内容盒子宽度,|dim| 型变量
+% \item 标签格式
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_entry_title:nnn #1#2#3
+\cs_new_protected:Npn \@@_cover_entry_title:NNN #1#2#3
{
\tl_if_empty:NT \g_@@_info_title_tl
{ \msg_error:nn { njuthesis } { missing-title } }
- \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_title_tl
+ \@@_box_spread_name:NNn #1 #3 { title }
\mode_leave_vertical: \@@_hskip:
% \end{macrocode}
-% 这里需要存储 \tn{baselineskip} 的值,以使 \tn{parbox} 后行距正确。
+% 这里需要存储 \tn{prevdepth} 的值,以使 \tn{parbox} 后行距正确。
% \footnote{\url{https://tex.stackexchange.com/q/34971/}}
% \begin{macrocode}
- \parbox [ t ] { #3 }
+ \parbox [ t ] { #2 }
{
- \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim
- #1 \@@_uline_title:
- \dim_gset_eq:NN \l_@@_tmpa_dim \prevdepth
+ \dim_set_eq:NN \tex_baselineskip:D \c_@@_clineskip_dim
+ \c_@@_fmt_covertitle_tl \@@_uline_title:
+ \dim_gset_eq:NN \l_@@_tmpa_dim \tex_prevdepth:D
}
- \par \prevdepth \l_@@_tmpa_dim
+ \tex_par:D
+ \dim_set_eq:NN \tex_prevdepth:D \l_@@_tmpa_dim
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_entry:nnn}
+% \begin{macro}{\@@_cover_entry:NNNn}
% 生成单项信息条目。
% \begin{arguments}
-% \item 条目名称
% \item 名称盒子宽度,|dim| 型变量
% \item 内容盒子宽度,|dim| 型变量
+% \item 标签格式
+% \item 条目名称
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_entry:nnn #1#2#3
+\cs_new_protected:Npn \@@_cover_entry:NNNn #1#2#3#4
{
- \@@_spread_box:nnx { #2 } { \kaishu } { \@@_name:n { #1 } }
- \@@_hskip:
- \@@_ulined_center_box:nn { #3 } { \@@_info:n { #1 } }
- \par
+ \@@_box_spread_name:NNn #1 #3 { #4 } \@@_hskip:
+ \@@_box_ulined_info:Nn #2 { #4 } \tex_par:D
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_bientry:nnnn}
+% \begin{macro}{\@@_cover_entry:NNNnn}
% 生成两项信息条目,仅用于本科生封面。
% \begin{arguments}
-% \item 左侧条目名称
-% \item 右侧条目名称
% \item 名称盒子宽度,|dim| 型变量
% \item 内容盒子宽度,|dim| 型变量
+% \item 标签格式
+% \item 左侧条目名称
+% \item 右侧条目名称
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_bientry:nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_cover_entry:NNNnn #1#2#3#4#5
{
- \@@_spread_box:nnx { #3 } { \kaishu } { \@@_name:n { #1 } }
- \@@_hskip:
- \@@_ulined_center_box:nn { #4 } { \@@_info:n { #1 } }
- \@@_hskip:
- \@@_spread_box:nnx { #3 } { \kaishu } { \@@_name:n { #2 } }
- \@@_hskip:
- \@@_ulined_center_box:nn { #4 } { \@@_info:n { #2 } }
- \par
+ \@@_box_spread_name:NNn #1 #3 { #4 } \@@_hskip:
+ \@@_box_ulined_info:Nn #2 { #4 } \@@_hskip:
+ \@@_box_spread_name:NNn #1 #3 { #5 } \@@_hskip:
+ \@@_box_ulined_info:Nn #2 { #5 } \tex_par:D
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_entry_supv:nnn}
+% \begin{macro}{\@@_cover_entry_supv:NNNn}
% 生成两项导师信息条目,仅用于本科生封面。
% \begin{arguments}
-% \item 条目名称
% \item 长内容盒子宽度,|dim| 型变量
% \item 短内容盒子宽度,|dim| 型变量
+% \item 标签格式
+% \item 条目名称
% \end{arguments}
+% |clist| 最后一个元素为空时弹出的是无法展开的 \cs{q_novalue_tl},
+% 需要简单处理以使用分散对齐的盒子。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_entry_supv:nnn #1#2#3
+\cs_new_protected:Npn \@@_cover_entry_supv:NNNn #1#2#3#4
{
- \@@_spread_box:nnx { #2 } { \kaishu } { \@@_name:n { #1 } }
- \@@_hskip:
- \@@_ulined_center_box:nn { #3 }
- { \clist_item:cn { g_@@_info_ #1 _clist } { 1 } }
- \@@_hskip:
- \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_supv_ttl_tl
- \@@_hskip:
- \@@_ulined_center_box:nn { #3 }
- { \clist_item:cn { g_@@_info_ #1 _clist } { 2 } }
- \par
+ \tl_set:Nn \l_@@_tmpa_tl
+ { \clist_item:cn { g_@@_info_ #4 _clist } { 1 } }
+ \tl_set:Nn \l_@@_tmpb_tl
+ { \clist_item:cn { g_@@_info_ #4 _clist } { 2 } }
+ \@@_box_spread_name:NNn #1 #3 { #4 } \@@_hskip:
+ \@@_box_ulined:NN #2 \l_@@_tmpa_tl \@@_hskip:
+ \@@_box_spread_name:NNn #1 #3 { supvtitle } \@@_hskip:
+ \@@_box_ulined:NN #2 \l_@@_tmpb_tl \tex_par:D
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_emblem:N,\@@_name:N}
% 封装图片绘制命令,参数为图片宽度。
-% 此时 \cs{njuemblem}、\cs{njuname} 和相关长度都是没有定义的。
+% 此时 \tn{njuemblem}、\tn{njuname} 和相关长度都是没有定义的。
% \begin{macrocode}
\cs_new_protected:Npn \@@_emblem:N #1
{ \njuemblem [ \c_@@_fmt_emblemcolor_tl ] { #1 } { ! } }
@@ -3091,35 +3536,24 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_abs_bookmark:nn #1#2
{
\phantomsection
- \bool_if:NTF \g_@@_abs_in_toc_bool
- { \@@_add_tocline:n { #1 } }
- { \pdfbookmark [0] { #1 } { #2 } }
+ \@@_bookmark:Nnn \g_@@_abs_showentry_bool {#1} {#2}
\@@_chapter_header:n { #1 }
}
\cs_generate_variant:Nn \@@_abs_bookmark:nn { Vn }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_abs_title:n,\@@_abs_title:V}
+% \begin{macro}{\@@_abs_title:N}
% 摘要标题双层下划线格式。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_abs_title:n #1
+\cs_new_protected:Npn \@@_abs_title:N #1
{
- \@@_get_text_width:Nn \l_@@_tmpa_dim {#1}
- \@@_uuline:n { \l_@@_tmpa_dim } #1
+ \@@_get_width:NV \l_@@_tmpa_dim #1
+ \@@_uuline:N \l_@@_tmpa_dim #1
}
-\cs_generate_variant:Nn \@@_abs_title:n { V }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@_uline_box:}
-% 用于摘要标题的下划线盒子。
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_uline_box:
- { \vtop{\box1\kern-\prevdepth\kern0.5ex\hrule} }
% \end{macrocode}
% \end{macro}
%
@@ -3131,60 +3565,60 @@ To produce the documentation run the original source files ending with
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.
}
% \end{macrocode}
%
-% \begin{macro}{\@@_uline_list:nnn,\@@_uline_list:xnn}
+% \begin{macro}{\@@_uline_list:NNn,\@@_uline_list:NNx}
% \changes{v0.16}{2022/03/25}{使用原生断行算法处理摘要页标题。}
% 用于研究生摘要页面的多行标题。
% \begin{arguments}
-% \item 标签名
% \item 内容
% \item 左边距
+% \item 标签
% \end{arguments}
-% 这里使用了 Primitive \TeX{} 语法以利用原生的断行算法
-% \footnote{\url{https://tex.stackexchange.com/q/637861/}}。
-% 对其语法的简要介绍可以参考
-% \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。
+% 这里转化了使用 plain \TeX{} 语法实现的的断行算法。
+% \footnote{\url{https://tex.stackexchange.com/q/637861/},对其语法的简要介绍可以参考
+% \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_uline_list:nnn #1#2#3
+\cs_new_protected:Npn \@@_uline_list:NNn #1#2#3
{
- \hbox_set:Nn \l_@@_tmp_box {#1}
- \setbox0 = \vbox{\hangindent=\wd\l_@@_tmp_box \hangafter=-1
- \leftskip=#3 \rightskip=\leftskip \parindent=\z@ #2\par
- \global\setbox2=\hbox{}
+ \vbox_set:Nn \l_@@_tmpa_box
+ {
+ \@@_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
+% \end{macrocode}
+% 使用循环寻找断行点,存入已被清空的 3 号盒子,同时统计行数。
+% \begin{macrocode}
\int_gzero:N \l_@@_tmpa_int
- \loop
- \setbox1=\lastbox \unskip\unpenalty
- \unless\ifvoid1
- \global\setbox2=\hbox{\@@_uline_box:\penalty0\unhbox2}
- \int_gincr:N \l_@@_tmpa_int
- \repeat
+ \@@_breakpar_loop:n { \int_gincr:N \l_@@_tmpa_int }
}
- {
- \noindent\copy\l_@@_tmp_box\unhbox2
+ \@@_breakpar_print:nn { #3 }
+ {
% \end{macrocode}
% 在使用自然断行算法后,研究生的摘要标题可选择 \opt{strict}
% 或者 \opt{natural} 模式。前者会为少于两行的标题补齐下划线,
% 并对多于三行的标题生成警告信息。这里通过行数处理边界条件,
% 包括标题未填写、标题只有一行,以及标题过长的情况。
% \begin{macrocode}
- \bool_if:NT \g_@@_strict_abs_title_bool
+ \bool_if:NT \g_@@_abs_title_strict_bool
{
\int_case:nnF { \l_@@_tmpa_int }
{
{ 0 } { \msg_error:nn { njuthesis } { missing-title } }
{ 1 } { \@@_uline:n { \textwidth } }
- { 2 } { \prg_do_nothing: }
+ { 2 } { }
}
{ \msg_warning:nn { njuthesis } { abs-title-too-long } }
- \par
+ \tex_par:D
}
}
}
-\cs_generate_variant:Nn \@@_uline_list:nnn { xnn }
+\cs_generate_variant:Nn \@@_uline_list:NNn { NNx }
% \end{macrocode}
% \end{macro}
%
@@ -3207,12 +3641,15 @@ To produce the documentation run the original source files ending with
\DeclareObjectType { nju } { \c_zero_int }
% \end{macrocode}
%
-% 定义元素模板。
+% \subsubsection{元素模板}
+% \changes{v1.0}{2022/08/02}{修正元素对象的底部间距设置。}
+%
% \begin{macrocode}
%<@@=njuelem>
% \end{macrocode}
%
-% 声明页面元素模板接口。
+% \begin{macro}{\@@_align:}
+% 声明元素模板接口。
% 元素是一个页面的基本组成单位,包括文段、图片等等。
% 一个抽象的元素应当具备以下属性:
% \begin{description}
@@ -3231,7 +3668,7 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
-% 声明页面元素模板代码。涉及的变量将被自动创建。
+% 声明元素模板代码。涉及的变量将被自动创建。
% \begin{macrocode}
\DeclareTemplateCode { nju } { element } { \c_zero_int }
{
@@ -3240,37 +3677,37 @@ To produce the documentation run the original source files ending with
bottom-skip = \l_@@_bottom_skip,
align =
{
- l =
- { \tl_set_eq:NN \l_@@_begin_align_tl \flushleft
- \tl_set_eq:NN \l_@@_end_align_tl \endflushleft },
- r =
- { \tl_set_eq:NN \l_@@_begin_align_tl \flushright
- \tl_set_eq:NN \l_@@_end_align_tl \endflushright },
- c =
- { \tl_set_eq:NN \l_@@_begin_align_tl \center
- \tl_set_eq:NN \l_@@_end_align_tl \endcenter },
- n =
- { \tl_clear:N \l_@@_begin_align_tl
- \tl_clear:N \l_@@_end_align_tl }
+ l = { \cs_set_eq:NN \@@_align: \raggedright },
+ r = { \cs_set_eq:NN \@@_align: \raggedleft },
+ c = { \cs_set_eq:NN \@@_align: \centering },
+ n = { \__nju_cs_clear:N \@@_align: }
}
}
{
\AssignTemplateKeys
\group_begin:
- \l_@@_begin_align_tl
- \l_@@_format_tl
- \l_@@_content_tl \par
- \l_@@_end_align_tl
+ \@@_align:
+ \l_@@_format_tl \l_@@_content_tl \tex_par:D
\group_end:
\__nju_vskip:N \l_@@_bottom_skip
}
% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{页面模板}
+% \changes{v1.0}{2022/07/27}{为页面模板添加书签选项。}
%
-% 定义页面模板。
% \begin{macrocode}
%<@@=njupage>
% \end{macrocode}
%
+% \begin{macro}{\exp_args:NVV}
+% \begin{macrocode}
+\exp_args_generate:n { NVV }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_bookmark:nn}
% 声明页面模板接口。
% 页面是元素的集合。一个抽象的页面应当具备以下属性:
% \begin{description}
@@ -3279,6 +3716,9 @@ To produce the documentation run the original source files ending with
% \item[\opt{format}] 格式,例如行距
% \item[\opt{top-skip}] 上间距,即与页面顶部的距离
% \item[\opt{bottom-skip}] 下间距,即与页面底部的距离
+% \item[\opt{bm-text}] PDF 书签名称
+% \item[\opt{bm-name}] PDF 书签锚点名
+% \item[\opt{bookmark}] 添加书签的类型,分别为目录条目、仅 PDF 书签、不显示。
% \end{description}
% \begin{macrocode}
\DeclareTemplateInterface { nju } { page } { \c_zero_int }
@@ -3287,7 +3727,10 @@ To produce the documentation run the original source files ending with
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
}
% \end{macrocode}
%
@@ -3299,13 +3742,26 @@ To produce the documentation run the original source files ending with
prefix = \l_@@_prefix_tl,
format = \l_@@_format_tl,
top-skip = \l_@@_top_skip,
- bottom-skip = \l_@@_bottom_skip
+ bottom-skip = \l_@@_bottom_skip,
+ bm-text = \l_@@_bm_text_tl,
+ bm-name = \l_@@_bm_name_tl,
+ bookmark =
+ {
+ toc = { \cs_set_eq:NN \@@_bookmark:nn \__nju_bookmark_toc:nn },
+ pdf = { \cs_set_eq:NN \@@_bookmark:nn \__nju_bookmark_pdf:nn },
+ none = { \cs_set:Nn \@@_bookmark:nn { } }
+ }
}
{
\AssignTemplateKeys
\clearpage
\thispagestyle { empty }
+% \end{macrocode}
+% 由于起始位置没有内容,\tn{vspace*} 会使第一个元素的位置与上边距有一定距离。
+% \begin{macrocode}
\__nju_vskip:N \l_@@_top_skip
+ \exp_args:NVV \@@_bookmark:nn
+ \l_@@_bm_text_tl \l_@@_bm_name_tl
\group_begin:
\l_@@_format_tl
\clist_map_inline:Nn \l_@@_element_clist
@@ -3313,8 +3769,10 @@ To produce the documentation run the original source files ending with
\group_end:
\__nju_vskip:N \l_@@_bottom_skip
}
-%<@@=nju>
% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{外部接口}
%
% \begin{macro}{\@@_declare_element:nn,\@@_declare_page:nn}
% 封装 \pkg{xtemplate} 提供的函数,简化创建实例的过程。
@@ -3323,9 +3781,10 @@ To produce the documentation run the original source files ending with
% \item 参数列表
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_declare_element:nn #1#2
+%<@@=nju>
+\cs_new:Npn \@@_declare_element:nn #1#2
{ \DeclareInstance { nju } {#1} { element } {#2} }
-\cs_new_protected:Npn \@@_declare_page:nn #1#2
+\cs_new:Npn \@@_declare_page:nn #1#2
{ \DeclareInstance { nju } {#1} { page } {#2} }
% \end{macrocode}
% \end{macro}
@@ -3339,50 +3798,52 @@ To produce the documentation run the original source files ending with
{
% \end{macrocode}
%
-% \begin{macro}{degree}
-% 学位类型,默认为本科。
+% \begin{macro}{type}
+% \changes{v1.0}{2022/06/30}{修改类型选项。}
+% 学位,默认为学士。
% \begin{macrocode}
- degree .choices:nn = { ug, mg, mf, phd }
- { \int_gset_eq:NN \g_@@_info_degree_int \l_keys_choice_int },
- degree .initial:n = ug,
+ type .choices:nn = { bachelor, master, doctor, postdoc }
+ { \int_gset_eq:NN \g_@@_info_type_int \l_keys_choice_int },
+ type .initial:n = bachelor,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{type}
-% 论文类型,默认为毕业论文。
+% \begin{macro}{degree}
+% \changes{v1.0}{2022/06/30}{修改学位选项。}
+% 研究生的学位类型,默认为学术学位。
% \begin{macrocode}
- type .choices:nn = { thesis, design }
- { \int_gset_eq:NN \g_@@_info_type_int \l_keys_choice_int },
- type .initial:n = thesis,
+ degree .choices:nn = { academic, professional }
+ { \int_gset_eq:NN \g_@@_info_degree_int \l_keys_choice_int },
+ degree .initial:n = academic,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{nlcover}
-% 是否需要国家图书馆封面(仅对研究生有效,默认关闭)。
+% \begin{macro}{nl-cover,\g_@@_opt_nlcover_bool}
+% 是否需要国家图书馆封面。本选项仅用于研究生模板,默认关闭。
% \footnote{nl 代表 National Library。}
% \begin{macrocode}
- nlcover .bool_set:N = \g_@@_nlcover_bool,
- nlcover .initial:n = false,
+ nl-cover .bool_set:N = \g_@@_opt_nlcover_bool,
+ nl-cover .initial:n = false,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{decl-page}
+% \begin{macro}{decl-page,\g_@@_opt_decl_bool}
% \changes{v0.13}{2021/12/15}{新增诚信承诺书选项。}
% \changes{v0.14}{2022/01/06}{修改选项名称。}
% 是否需要诚信承诺书或原创性声明(默认关闭)。
% \footnote{原创性声明的英文翻译为 Declaration of Originality,
% 为了使选项表义更清晰同时缩减名称长度,将其修改为“声明页”这一名称。}
% \begin{macrocode}
- decl-page .bool_set:N = \g_@@_decl_bool,
+ decl-page .bool_set:N = \g_@@_opt_decl_bool,
decl-page .initial:n = false,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{draft}
+% \begin{macro}{draft,\g_@@_opt_draft_bool}
% \changes{v0.13}{2021/12/15}{新增草稿模式选项。}
% 是否开启草稿模式(默认关闭)。
% \begin{macrocode}
- draft .bool_gset:N = \g_@@_draft_bool,
+ draft .bool_gset:N = \g_@@_opt_draft_bool,
draft .initial:n = false,
% \end{macrocode}
% \end{macro}
@@ -3393,76 +3854,235 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
oneside .value_forbidden:n = true,
twoside .value_forbidden:n = true,
- oneside .bool_gset_inverse:N = \g_@@_twoside_bool,
+ oneside .bool_gset_inverse:N = \g_@@_opt_twoside_bool,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{blind}
+% \begin{macro}{anonymous}
% \changes{v0.18}{2022/04/19}{新增盲审模式选项。}
+% \changes{v1.0}{2022/07/05}{重命名盲审模式选项。}
+% \begin{macro}{\g_@@_opt_anon_bool}
% 盲审模式。
% \begin{macrocode}
- blind .value_forbidden:n = true,
- blind .bool_set:N = \g_@@_blind_bool,
+ anonymous .bool_set:N = \g_@@_opt_anon_bool,
+ anonymous .initial:n = false,
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{latin-font,cjk-font}
% \changes{v0.14}{2021/12/12}{简化字体选项名称。}
-% 字体选项。
+% 中英文字体选项。
% \begin{macrocode}
latin-font .choices:nn =
{ gyre, mac, win, none }
- { \tl_set_eq:NN \g_@@_latin_font_tl \l_keys_choice_tl },
+ { \tl_set_eq:NN \g_@@_font_latin_tl \l_keys_choice_tl },
cjk-font .choices:nn =
{ fandol, founder, mac, noto, source, win, none }
- { \tl_set_eq:NN \g_@@_cjk_font_tl \l_keys_choice_tl },
+ { \tl_set_eq:NN \g_@@_font_cjk_tl \l_keys_choice_tl },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math-font}
+% \changes{v1.0}{2022/07/02}{增加数学字库选择功能。}
+% 数学字体选项。
+% 由 \pkg{unicode-math} 指定 \XeTeX 和 \LuaTeX 下使用的数学字体。
+% \begin{macrocode}
+ math-font .choices:nn =
+ {
+ asana, cambria, fira, garamond, lm, libertinus, newcm,
+ stix, bonum, dejavu, pagella, schola, termes, xits, none
+ }
+ { \tl_set_eq:NN \g_@@_font_math_tl \l_keys_choice_tl },
+ math-font .initial:n = xits,
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{font-path}
+% 独立字体文件的路径。
+% \begin{macrocode}
+ font-path .code:n =
+ {
+ \bool_set_true:N \g_@@_font_path_bool
+ \tl_set_eq:NN \g_@@_font_path_tl \l_keys_choice_tl
+ },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{zihao}
+% \changes{v1.0}{2022/07/04}{新增字号选项。}
+% \begin{macro}{\g_@@_opt_zihao_tl}
+% 字号。默认为小四号。
+% \begin{macrocode}
+ zihao .tl_set:N = \g_@@_opt_zihao_tl,
+ zihao .initial:n = -4,
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{linespread}
+% \changes{v1.0}{2022/07/04}{新增行距选项。}
+% \begin{macro}{\g_@@_opt_linespread_tl}
+% 行距。\LaTeX 默认1.2行距,MS Word 默认行距是1.3,要求1.5倍
+% Word 行距,故默认值为 $1.5\times\frac{1.3}{1.2} = 1.625$。
+% 更详细的说明请参考 \pkg{zhlineskip} 宏包文档。
+% \begin{macrocode}
+ linespread .tl_set:N = \g_@@_opt_linespread_tl,
+ linespread .initial:n = 1.625,
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
-% \begin{macro}{config}
+% \begin{macro}{config,\g_@@_config_clist}
% \changes{v0.16}{2022/02/23}{新增 \opt{config} 选项。}
% 配置文件路径。
% \begin{macrocode}
- config .tl_set:N = \g_@@_config_clist
+ config .clist_set:N = \g_@@_config_clist
}
% \end{macrocode}
% \end{macro}
%
-% 在定义完全部设置以后从导言区输入参数。
+% \begin{macro}{\g_@@_name_optional_pkg_clist}
+% \begin{macrocode}
+\clist_new:N \g_@@_name_optional_pkg_clist
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_define_pkg_keys:nnn}
+% \begin{arguments}
+% \item 宏包名
+% \item 简写名称,一般为宏包使用的名空间
+% \item 是否默认载入
+% \end{arguments}
+% 定义是否载入宏包的的文档类选项,以及相应的载入命令。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_define_pkg_keys:nnn #1#2#3
+ {
+ \keys_define:nn { nju }
+ {
+ #1 .bool_gset:c = { g_@@_opt_load_ #2 _bool },
+ #1 .initial:n = #3
+ }
+ \cs_new_protected:cpn { @@_loadpkg_ #2 : }
+ {
+ \bool_if:cT { g_@@_opt_load_ #2 _bool }
+ { \RequirePackage { #1 } }
+ }
+ \clist_put_right:Nn \g_@@_name_optional_pkg_clist {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% biblatex,
+% cleveref,
+% enumitem,
+% footmisc,
+% ntheorem,
+% unicode-math,
+% \g_@@_opt_load_blx_bool,
+% \g_@@_opt_load_cref_bool,
+% \g_@@_opt_load_nthm_bool,
+% \g_@@_opt_load_enit_bool,
+% \g_@@_opt_load_fm_bool,
+% \g_@@_opt_load_um_bool,
+% \@@_loadpkg_blx:,
+% \@@_loadpkg_cref:,
+% \@@_loadpkg_enit:,
+% \@@_loadpkg_fm:,
+% \@@_loadpkg_nthm:,
+% \@@_loadpkg_um:}
+% \begin{macrocode}
+\clist_map_inline:nn
+ {
+ { biblatex } { blx } { true },
+ { cleveref } { cref } { true },
+ { ntheorem } { nthm } { true },
+ { enumitem } { enit } { true },
+ { footmisc } { fm } { true },
+ { unicode-math } { um } { true }
+ }
+ { \@@_define_pkg_keys:nnn #1 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{minimal}
+% \changes{v1.0}{2022/08/03}{新增最小化载入宏包选项。}
+% 最小化模式,不载入进行功能拓展的额外宏包。
+% \begin{macrocode}
+\keys_define:nn { nju }
+ {
+ minimal .value_forbidden:n = true,
+ minimal .code:n =
+ {
+ \clist_map_inline:Nn \g_@@_name_optional_pkg_clist
+ { \keys_set:nn { nju } { ##1 = false } }
+ \keys_set:nn { nju } { math-font = none }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% 获取输入的文档类选项。
% \begin{macrocode}
\ProcessKeysOptions { nju }
% \end{macrocode}
%
+% 处理单双面模式选项。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_twoside_bool
+ { \tl_const:Nn \c_@@_name_pagemode_tl { twoside } }
+ { \tl_const:Nn \c_@@_name_pagemode_tl { oneside } }
+% \end{macrocode}
+%
%
% \subsection{用户接口}
%
-% \begin{macro}{bib,info,style,theorem}
-% 定义元(meta)键值对。为 v1.0 升级预留了新的接口。
+% \begin{macro}{abstract, bib, image, footer, footnote, header,
+% info, label-sep, listoffigures, listoftables,
+% math, style, theorem, tableofcontents}
+% 定义模块名的元(meta)键值对。
% \begin{macrocode}
-\keys_define:nn { nju }
+\clist_map_inline:nn
{
- % 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 }
+ 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} } }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\njusetup}
% \changes{v0.6}{2021/09/10}{改用键值对输入信息。}
-% 定义用于设置信息的命令。
+% \changes{v1.0}{2022/08/01}{增加输入键路径的可选参数。}
+% 定义设置接口。
+% \begin{arguments}
+% \item 可选的键路径
+% \item 设置项
+% \end{arguments}
+% \cls{njuthesis} 的键值对设置一共三层:最外层为指示名空间的
+% \opt{nju},第二层为上方设定的模块名称,最内层为具体设置项。
+% 在路径留空时,本接口仅使用最外层名空间,向下兼容旧版设置;
+% 在路径填入模块名时,第二个参数为键值对类型,可以减少一层缩进;
+% 在路径填入完整设置项时,第二个参数为具体的值。
% \begin{macrocode}
-\NewDocumentCommand \njusetup { m } { \keys_set:nn { nju } { #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} }
+ }
+ }
% \end{macrocode}
% \end{macro}
+% \tn{njusetup} 仅能在导言区使用。
+% \begin{macrocode}
+\@onlypreamble \njusetup
+% \end{macrocode}
%
% \begin{macro}{\njusetformat}
% \changes{v0.17}{2022/04/09}{提供修改默认样式的接口。}
@@ -3513,24 +4133,23 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_tokenlist:nnnnn #1#2#3#4#5
{
- \tl_if_novalue:nTF { #3 }
- { \tl_clear:N \l_@@_tmpa_tl }
- { \tl_set:Nn \l_@@_tmpa_tl { _ #3 } }
- \bool_if:nTF { #1 }
- { \tl_set:Nn \l_@@_tmpb_tl { _en } }
- { \tl_clear:N \l_@@_tmpb_tl }
- \tl_gset:cn { c_@@_ #5 _ #2 \l_@@_tmpa_tl \l_@@_tmpb_tl _tl } {#4}
+ \bool_if:nTF { #1 }
+ { \tl_set_eq:NN \l_@@_tmpb_tl \c_@@_name_suffix_en_tl }
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \tl_gset:cn { c_@@_ #5 _ #2 #3 \l_@@_tmpb_tl _tl } {#4}
}
% \end{macrocode}
% \end{macro}
%
%
-% \subsection{载入宏包}
+% \subsection{外部宏包}
+%
+% \subsubsection{默认选项}
%
% \changes{v0.12}{2021/12/07}{重新组织宏包载入顺序。}
% 将选项传入 \cls{ctexbook} 文档类。
% \begin{macrocode}
-\PassOptionsToClass
+\exp_args:Nx \PassOptionsToClass
{
a4paper,
UTF8,
@@ -3538,24 +4157,23 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 传入单双面模式选项。
% \begin{macrocode}
- \bool_if:NTF \g_@@_twoside_bool { twoside, } { oneside, }
+ \c_@@_name_pagemode_tl,
% \end{macrocode}
% 开启草稿模式后传入 |draft| 选项。
% \begin{macrocode}
- \bool_if:NT \g_@@_draft_bool { draft, }
+ \bool_if:NT \g_@@_opt_draft_bool { draft, }
% \end{macrocode}
-% 关于行距,\hologo{LaTeX} 默认1.2行距,MS Word 默认行距是1.3,要求1.5倍
-% Word 行距,故 $1.5\times\frac{1.3}{1.2} = 1.625$
+% 行距。
% \begin{macrocode}
- linespread = 1.625,
+ linespread = \g_@@_opt_linespread_tl,
% \end{macrocode}
% 默认不载入任何字体,供本模板自行设置。
% \begin{macrocode}
- fontset = none,
+ fontset = none,
% \end{macrocode}
-% 正文字体设置为小四号。
+% 正文字号设置。
% \begin{macrocode}
- zihao = -4
+ zihao = \g_@@_opt_zihao_tl
}
{ ctexbook }
% \end{macrocode}
@@ -3566,43 +4184,50 @@ To produce the documentation run the original source files ending with
{
{ no-math } { fontspec },
{ perpage } { footmisc },
- { hyphens } { url },
- { warnings-off={ mathtools-colon, mathtools-overbracket } }
- { unicode-math },
{ capitalise, nameinlink, noabbrev }
{ cleveref }
}
{ \PassOptionsToPackage #1 }
% \end{macrocode}
%
+% \subsubsection{载入文档类}
+%
% 使用\pkg{ctexbook}作为基础文档类。
% \begin{macrocode}
\LoadClass { ctexbook } [ 2018/04/01 ]
% \end{macrocode}
%
-% \changes{v0.14}{2021/12/21}{移除内置的 \pkg{hologo}。}
-% \changes{v0.15}{2022/01/17}{移除内置的 \pkg{url}。}
+% \subsubsection{载入宏包}
+%
+% \changes{v0.14}{2021/12/21}{移除 \pkg{hologo}。}
+% \changes{v0.15}{2022/01/17}{移除 \pkg{url}。}
+% \changes{v0.13}{2021/12/13}{使用 \pkg{ntheorem} 创建定理环境,
+% 移除 \pkg{amsthm} 和 \pkg{thmtools}。}
+% \changes{v0.16}{2022/03/19}{不显式载入 \pkg{amsmath}。}
+% \changes{v0.18}{2022/04/20}{不强制载入 \pkg{ntheorem}。}
+% \changes{v1.0}{2022/07/03}{移除 \pkg{mathtools}。}
+% \changes{v1.0}{2022/08/03}{选择性载入 \pkg{ntheorem}。}
+%
+% \begin{macrocode}
+\@@_loadpkg_enit:
+\@@_loadpkg_fm:
+% \end{macrocode}
+% 为保证 \pkg{cleveref} 在 \pkg{unicode-math}
+% 缺失的情况下也能正常工作,载入了 \pkg{amsmath}。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_load_um_bool
+ { \RequirePackage { unicode-math } }
+ { \RequirePackage { amsmath } }
+% \end{macrocode}
+%
% 载入各种宏包。
% \begin{macrocode}
\RequirePackage
{
geometry,
fancyhdr,
- footmisc,
setspace,
% \end{macrocode}
-% \changes{v0.13}{2021/12/13}{使用 \pkg{ntheorem} 创建定理环境,删除
-% \pkg{amsthm} 和 \pkg{thmtools}。}
-% \changes{v0.16}{2022/03/19}{不显式载入 \pkg{amsmath}。}
-% \changes{v0.18}{2022/04/20}{不强制载入 \pkg{ntheorem}。}
-% 数学相关的宏包。其中,\pkg{amsmath} 会被 \pkg{unicode-math} 自动载入。
-% \pkg{unicode-math} 指定了 \hologo{XeTeX} 和 \hologo{LuaTeX} 下所使用的
-% 数学字体。用于配置数学环境的 \pkg{mathtools} 会与 \pkg{unicode-math}
-% 发生冲突,需要手动消除其警告。
-% \begin{macrocode}
- mathtools,
- unicode-math,
-% \end{macrocode}
% \changes{v0.14}{2021/12/21}{移除内置的 \pkg{multirow}、\pkg{subcaption}
% 和 \pkg{wrapfig}。}
% 图片与表格。
@@ -3611,31 +4236,36 @@ To produce the documentation run the original source files ending with
caption,
graphicx,
% \end{macrocode}
-% 列表环境。
-% \begin{macrocode}
- enumitem,
-% \end{macrocode}
% 按以下顺序加载两个关于引用的包。
% \pkg{hyperref} 覆写了大量命令,因此需要在其他包最后载入。
% 仅有 \pkg{cleveref} 需要在 \pkg{hyperref} 后载入,否则会报错。
% \begin{macrocode}
- hyperref,
- cleveref
+ hyperref
+ }
+\@@_loadpkg_cref:
+% \end{macrocode}
+%
+% \pkg{ntheorem} 依赖 \pkg{amsthm} 和 \pkg{thmmarks} 实现 QED 符号等功能。
+% \begin{macrocode}
+\bool_if:NT \g_@@_opt_load_nthm_bool
+ {
+ \PassOptionsToPackage { amsmath, thmmarks, noconfig } { ntheorem }
+ \RequirePackage { ntheorem }
}
% \end{macrocode}
%
% 在双面模式下,使用 \pkg{emptypage} 清除空白页的页眉、页脚和页码。
% \begin{macrocode}
-\bool_if:NT \g_@@_twoside_bool { \RequirePackage{ emptypage } }
+\bool_if:NT \g_@@_opt_twoside_bool { \RequirePackage { emptypage } }
% \end{macrocode}
%
-% \changes{v0.13}{2021/12/13}{删除会与 \pkg{ntheorem} 冲突的 \pkg{microtype}。}
+% \changes{v0.13}{2021/12/13}{移除会与 \pkg{ntheorem} 冲突的 \pkg{microtype}。}
% \begin{macro}{\njuline}
% 针对编译引擎,使用不同的宏包构建可以对中文正常换行的下划线命令。
% \begin{macrocode}
\sys_if_engine_xetex:T
{
- \RequirePackage{xeCJKfntef}
+ \RequirePackage { xeCJKfntef }
\NewDocumentCommand \njuline { m } { \CJKunderline{#1} }
}
% \end{macrocode}
@@ -3643,7 +4273,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\sys_if_engine_luatex:T
{
- \RequirePackage{lua-ul}
+ \RequirePackage { lua-ul }
\NewDocumentCommand \njuline { m } { \underLine{#1} \null }
}
% \end{macrocode}
@@ -3651,11 +4281,20 @@ To produce the documentation run the original source files ending with
%
% 使用 \pkg{tabularray} 绘制研究生的出版授权书。
% \begin{macrocode}
-\bool_lazy_and:nnT
- { \g_@@_decl_bool }
- { !\int_compare_p:n { \g_@@_info_degree_int == 1 } }
- { \RequirePackage { tabularray } }
+%</class>
+%<def-g>\bool_if:NT \g_@@_opt_decl_bool { \RequirePackage { tabularray } }
+%<*class>
+% \end{macrocode}
+%
+% \subsubsection{检查宏包}
+%
+% \begin{macro}{\@@_if_pkg_loaded:nTF}
+% 等效于 \tn{IfPackageLoadedTF}。
+% \begin{macrocode}
+% \prg_new_conditional:Npnn \@@_if_pkg_loaded:n #1 { T }
+% { \@ifpackageloaded {#1} { \prg_return_true: } { \prg_return_false: } }
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@@_check_pkg_version:nnn}
% 检查宏包版本是否过时。
@@ -3684,16 +4323,13 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
%
% \changes{v0.18}{2022/04/28}{增加宏包冲突检查。}
-% \begin{macrocode}
-\RequirePackage { filehook }
-% \end{macrocode}
+% \changes{v1.0}{2022/08/03}{移除 \pkg{filehook},改用 \pkg{ctex} 内置的宏包钩子。}
%
% \begin{macro}{\@@_check_pkg_conflict:nn}
% 检查用户载入的宏包是否会与预置宏包发生冲突。
% \begin{arguments}
% \item 模板载入的宏包
% \item 产生冲突的宏包
-% \item 替代的解决办法
% \end{arguments}
% \begin{macrocode}
\msg_new:nnn { njuthesis } { package-conflict }
@@ -3704,40 +4340,45 @@ To produce the documentation run the original source files ending with
}
\cs_new_protected:Npn \@@_check_pkg_conflict:nn #1#2
{
- \AtEndOfPackageFile * { #1 }
- {
- \AtBeginOfPackageFile * { #2 }
- { \msg_error:nnnn { njuthesis } { package-conflict } {#1} {#2} }
- }
+ \ctex_at_begin_package:nn { #2 }
+ { \msg_warning:nnnn { njuthesis } { package-conflict } {#1} {#2} }
}
% \end{macrocode}
% \end{macro}
%
% 检查数学宏包冲突。
% \begin{macrocode}
-\clist_map_inline:nn
+\bool_if:NT \g_@@_opt_load_um_bool
{
- amscd, amsfonts, amssymb, bbm, bm, eucal,
- eufrak, mathrsfs, newtxmath, upgreek
+ \clist_map_inline:nn
+ {
+ amscd, amsfonts, amssymb, bbm, bm, eucal,
+ eufrak, mathrsfs, newtxmath, upgreek
+ }
+ { \@@_check_pkg_conflict:nn { unicode-math } { #1 } }
}
- { \@@_check_pkg_conflict:nn { unicode-math } { #1 } }
% \end{macrocode}
%
% \subsection{配置文件}
%
-% \cls{njuthesis} 包含\emph{本科生}和\emph{研究生}两套区别较大的模板配置。
-% 出于定义的简洁起见,本模板将其拆分为两个单独的参数配置文件,
-% 编译过程中将会根据设置的学位信息,载入相应默认配置。
-% 注意,尽管在手册的实现细节部分封面、摘要、常量等位于靠后部分,
-% 拆分后实际上是在此处载入运行的,务必要注意逻辑顺序。
-%
-% 下文中,本科生模板配置对应 \agrd{definition-ug},用于生成
-% \file{njuthesis-undergraduate.def};研究生模板配置对应
-% \agrd{definition-g},用于生成 \file{njuthesis-graduate.def}。
+% \cls{njuthesis} 包含三套区别较大的模板配置,分别适用于\emph{本科生}、
+% \emph{研究生}和\emph{博士后}。出于定义的简洁起见,本模板将其不同之处
+% 拆分为单独的参数配置文件,编译过程中将会根据导言区设置的类型选项,载
+% 入对应默认配置。注意,尽管在手册中封面、摘要、常量等的代码实现位于靠
+% 后部分,拆分后实际上是在此处载入运行的,务必要注意处理的逻辑顺序。
% \begin{macrocode}
-\int_compare:nTF { \g_@@_info_degree_int == 1 }
- { \file_input:n { njuthesis-undergraduate.def } }
- { \file_input:n { njuthesis- graduate.def } }
+\exp_args:Nx \file_input:n
+ {
+ njuthesis-
+ \int_case:nn { \g_@@_info_type_int }
+ {
+ { 1 } { undergraduate }
+ { 2 } { graduate }
+ { 3 } { graduate }
+ { 4 } { postdoctoral }
+ }
+ .def
+ }
% \end{macrocode}
%
% 载入用户设置,可用于对模板做额外修改。
@@ -3817,8 +4458,8 @@ To produce the documentation run the original source files ending with
% \begin{macro}{info/supervisor-ii,info/supervisor-ii*}
% 第二导师信息。
% \begin{macrocode}
- supervisor-ii .clist_set:N = \g_@@_info_supv_ii_clist,
- supervisor-ii* .tl_set:N = \g_@@_info_supv_ii_en_tl,
+ supervisor-ii .clist_set:N = \g_@@_info_supvii_clist,
+ supervisor-ii* .tl_set:N = \g_@@_info_supvii_en_tl,
% \end{macrocode}
% \end{macro}
%
@@ -3886,17 +4527,20 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \changes{v0.16}{2022/03/06}{正确处理学位和类型信息。}
-% 设置学位信息。该设置需要放在 \cs{ProcessKeysOptions}
+% 设置学位信息。该设置需要放在 \tn{ProcessKeysOptions}
% 命令以及载入配置文件中的常量信息后进行。
% \begin{macrocode}
+\tl_set:Nx \g_@@_info_type_tl
+ {
+ \clist_item:Nn \c_@@_name_type_clist
+ { \g_@@_info_type_int }
+ }
\tl_set:Nx \g_@@_info_degree_tl
{
+ \g_@@_info_type_tl
\clist_item:Nn \c_@@_name_degree_clist
{ \g_@@_info_degree_int }
}
-\int_compare:nTF { \g_@@_info_degree_int == 1 }
- { \tl_set:Nn \g_@@_info_diploma_tl { ug } }
- { \tl_set:Nn \g_@@_info_diploma_tl { g } }
% \end{macrocode}
%
% \changes{v0.15}{2022/01/22}{正确处理双导师信息。}
@@ -3908,32 +4552,36 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 设置类型信息。
% \begin{macrocode}
- \tl_set:Nx \g_@@_info_type_tl
- { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } }
\tl_set:Nx \g_@@_info_type_en_tl
{ \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
- \tl_put_left:Nx \g_@@_info_type_tl
- { \tl_use:c { c_@@_name_ \g_@@_info_diploma_tl _tl } }
% \end{macrocode}
% 拼合双导师的姓名和职称。
% \begin{macrocode}
- \bool_set:Nn \l_@@_second_supv_bool
- { ! \clist_if_empty_p:N \g_@@_info_supv_ii_clist }
+ \bool_set:Nn \l_@@_second_supvbool
+ { ! \clist_if_empty_p:N \g_@@_info_supvii_clist }
\tl_set:Nx \g_@@_info_supvfull_tl
{
\clist_use:Nn \g_@@_info_supv_clist { \@@_hskip: }
- \bool_if:NT \l_@@_second_supv_bool
+ \bool_if:NT \l_@@_second_supvbool
{
\@@_quad:
- \clist_use:Nn \g_@@_info_supv_ii_clist { \@@_hskip: }
+ \clist_use:Nn \g_@@_info_supvii_clist { \@@_hskip: }
}
}
\tl_set:Nx \g_@@_info_supvfull_en_tl
{
\g_@@_info_supv_en_tl
- \bool_if:NT \l_@@_second_supv_bool
- { \@@_quad: \g_@@_info_supv_ii_en_tl }
+ \bool_if:NT \l_@@_second_supvbool
+ { \@@_quad: \g_@@_info_supvii_en_tl }
}
+ }
+%</class>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*(def-u|def-g|def-p)>
+\ctex_at_end_preamble:n
+ {
% \end{macrocode}
% \begin{variable}{\g_@@_info_submitdate_tl}
% 将 ISO 格式的原始日期字符串格式化为中文日期表示。
@@ -3942,47 +4590,52 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_info_submitdate_en_tl,\g_@@_info_defenddate_tl}
+% \begin{variable}{
+% \g_@@_info_submitdate_en_tl,
+% \g_@@_info_defenddate_tl}
% 英文提交日期以及答辩日期仅用于研究生封面。
% \begin{macrocode}
- \int_compare:nF { \g_@@_info_degree_int == 1 }
- {
- \@@_date_en:n { submit }
- \@@_date:n { defend }
+%<*def-g>
+ \@@_date_en:n { submit }
+ \@@_date:n { defend }
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_info_bottomdate_tl,
-% \g_@@_info_conferdate_tl,\g_@@_info_confer_tl}
+% \begin{variable}{
+% \g_@@_info_bottomdate_tl,
+% \g_@@_info_conferdate_tl,
+% \g_@@_info_confer_tl}
% 底部日期以及学位授予日期仅用于国家图书馆封面。
% \begin{macrocode}
- \bool_if:NT \g_@@_nlcover_bool
+ \bool_if:NT \g_@@_opt_nlcover_bool
+ {
+ \@@_date:n { bottom }
+ \@@_date:n { confer }
+ \tl_new:N \g_@@_info_confer_tl
+ \tl_set:Nn \g_@@_info_confer_tl
{
- \@@_date:n { bottom }
- \@@_date:n { confer }
- \tl_new:N \g_@@_info_confer_tl
- \tl_set:Nn \g_@@_info_confer_tl
- {
- \textbf { \c_@@_name_nju_tl } \hfil
- \g_@@_info_conferdate_tl
- }
+ \textbf { \c_@@_name_nju_tl } \hfil
+ \g_@@_info_conferdate_tl
}
}
+%</def-g>
}
+%</(def-u|def-g|def-p)>
% \end{macrocode}
% \end{variable}
%
% 盲审模式下抹去个人信息和学校名称。
% \begin{macrocode}
-\bool_if:NT \g_@@_blind_bool
+%<*class>
+\bool_if:NT \g_@@_opt_anon_bool
{
\ctex_at_end_preamble:n
{
- \clist_map_inline:Nn \c_@@_blind_info_clist
+ \clist_map_inline:Nn \c_@@_name_anon_clist
{ \tl_gclear:c { g_@@_info_ #1 _tl } }
- \clist_map_inline:Nn \c_@@_blind_info_en_clist
+ \clist_map_inline:Nn \c_@@_name_anon_en_clist
{ \tl_gclear:c { g_@@_info_ #1 _en_tl } }
- \clist_map_inline:Nn \c_@@_blind_infolist_clist
+ \clist_map_inline:Nn \c_@@_name_anonlist_clist
{ \clist_gclear:c { g_@@_info_ #1 _clist } }
\tl_gclear:N \c_@@_name_nju_tl
\tl_gclear:N \c_@@_name_nju_en_tl
@@ -4001,8 +4654,8 @@ To produce the documentation run the original source files ending with
% 则使用系统预装字体覆盖字体选项。
% \begin{macrocode}
\bool_lazy_or:nnT
- { \tl_if_empty_p:N \g_@@_latin_font_tl }
- { \tl_if_empty_p:N \g_@@_cjk_font_tl }
+ { \tl_if_empty_p:N \g_@@_font_latin_tl }
+ { \tl_if_empty_p:N \g_@@_font_cjk_tl }
% \end{macrocode}
% 进行操作系统检测。
% 检测 Windows 的命令由 \pkg{l3kernel} 提供,
@@ -4012,18 +4665,18 @@ To produce the documentation run the original source files ending with
{
\sys_if_platform_windows:TF
{
- \tl_set:Nn \g_@@_latin_font_tl { win }
- \tl_set:Nn \g_@@_cjk_font_tl { win }
+ \tl_set:Nn \g_@@_font_latin_tl { win }
+ \tl_set:Nn \g_@@_font_cjk_tl { win }
}
{
\ctex_if_platform_macos:TF
{
- \tl_set:Nn \g_@@_latin_font_tl { mac }
- \tl_set:Nn \g_@@_cjk_font_tl { mac }
+ \tl_set:Nn \g_@@_font_latin_tl { mac }
+ \tl_set:Nn \g_@@_font_cjk_tl { mac }
}
{
- \tl_set:Nn \g_@@_latin_font_tl { gyre }
- \tl_set:Nn \g_@@_cjk_font_tl { fandol }
+ \tl_set:Nn \g_@@_font_latin_tl { gyre }
+ \tl_set:Nn \g_@@_font_cjk_tl { fandol }
}
}
}
@@ -4034,55 +4687,59 @@ To produce the documentation run the original source files ending with
%
% 接下来逐个定义所需要使用的字库。
%
-% \begin{macro}{\@@_load_latin_font_win:}
+% \begin{macro}{\@@_loadfont_latin_win:}
% Windows 西文字体
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_latin_font_win:
+\cs_new_protected:Npn \@@_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 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_latin_font_mac:}
+% \begin{macro}{\@@_loadfont_latin_mac:}
% macOS 西文字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_latin_font_mac:
+\cs_new_protected:Npn \@@_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 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_latin_font_gyre:}
+% \begin{macro}{\@@_loadfont_latin_gyre:}
% 开源的 gyre 西文字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_latin_font_gyre:
+\cs_new_protected:Npn \@@_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,
@@ -4090,7 +4747,8 @@ To produce the documentation run the original source files ending with
BoldItalicFont = *-bolditalic,
Scale = MatchLowercase,
Ligatures = CommonOff
- ]
+ }
+ { texgyrecursor }
}
% \end{macrocode}
% \end{macro}
@@ -4106,10 +4764,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_cjk_font_win:}
+% \begin{macro}{\@@_loadfont_cjk_win:}
% Windows 中文字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_win:
+\cs_new_protected:Npn \@@_loadfont_cjk_win:
{
\setCJKmainfont { SimSun }
[ AutoFakeBold = 2.17, ItalicFont = KaiTi ]
@@ -4124,11 +4782,11 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
%
-% \begin{macro}{\@@_load_cjk_font_mac:}
+% \begin{macro}{\@@_loadfont_cjk_mac:}
% macOS 字体。
-% TODO: 修复 macOS 字体支持,实现开箱即用。
+% ^^A TODO: 修复 macOS 字体支持,实现开箱即用。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_mac:
+\cs_new_protected:Npn \@@_loadfont_cjk_mac:
{
\@@_hide_no_script_msg:
\setCJKmainfont{Songti~SC~Light}[
@@ -4146,10 +4804,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_cjk_font_fandol:}
+% \begin{macro}{\@@_loadfont_cjk_fandol:}
% Fandol 字体
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_fandol:
+\cs_new_protected:Npn \@@_loadfont_cjk_fandol:
{
\@@_hide_no_script_msg:
\setCJKmainfont { FandolSong-Regular }
@@ -4187,13 +4845,13 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
%
-% \begin{macro}{\@@_load_cjk_font_founder:}
+% \begin{macro}{\@@_loadfont_cjk_founder:}
% 方正字库(简繁扩展)
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_founder:
+\cs_new_protected:Npn \@@_loadfont_cjk_founder:
{
% \end{macrocode}
-% 调整方正字体括号位置。\footnote{\hologo{XeTeX} 的调整方法来自 \url{https://www.zhihu.com/question/46241367/answer/101660183}。}
+% 调整方正字体括号位置。\footnote{\XeTeX 的调整方法来自 \url{https://www.zhihu.com/question/46241367/answer/101660183}。}
% \begin{macrocode}
\sys_if_engine_xetex:T
{ \xeCJKEditPunctStyle {quanjiao} { optimize-kerning = true } }
@@ -4215,10 +4873,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_cjk_font_noto:}
+% \begin{macro}{\@@_loadfont_cjk_noto:}
% Noto 思源字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_noto:
+\cs_new_protected:Npn \@@_loadfont_cjk_noto:
{
\setCJKmainfont
[
@@ -4248,11 +4906,11 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_load_cjk_font_source:}
+% \begin{macro}{\@@_loadfont_cjk_source:}
% \changes{v0.14}{2021/12/20}{增加 Adobe Source Han 作为思源字体。}
% Source Han 思源字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_cjk_font_source:
+\cs_new_protected:Npn \@@_loadfont_cjk_source:
{
\setCJKmainfont
[
@@ -4285,35 +4943,161 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{定义数学字库}
%
-% \begin{macro}{\@@_load_math_font:}
-% 设置数学字体 (XITS, 或者 \href{https://www.stixfonts.org}{STIX}, 与 Times New Roman 最为相近)
-% 通用数学字体。
+% \begin{macro}{\@@_define_math_font:nn}
+% 批量定义数学字体配置。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_math_font:
+\cs_new:Npn \@@_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 { @@_loadfont_math_ #1 : }
+ { \__um_setmathfont:nn { } { #2 } }
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{
+% \@@_loadfont_math_asana:,
+% \@@_loadfont_math_fira:,
+% \@@_loadfont_math_garamond:,
+% \@@_loadfont_math_lm:,
+% \@@_loadfont_math_libertinus:,
+% \@@_loadfont_math_stix:,
+% \@@_loadfont_math_bonum:,
+% \@@_loadfont_math_dejavu:,
+% \@@_loadfont_math_pagella:,
+% \@@_loadfont_math_schola:,
+% \@@_loadfont_math_termes:}
+% 批量定义若干数学字体的载入命令。
+% \begin{macrocode}
+\clist_map_inline:nn
+ {
+ { 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 }
+ }
+ { \@@_define_math_font:nn #1 }
+% \end{macrocode}
+% \end{macro}
%
-% \subsubsection{载入指定字库}
+% \begin{macro}{\@@_loadfont_math_cambria:}
+% Cambria Math 字体配置。
+% \begin{macrocode}
+\cs_new:Npn \@@_loadfont_math_cambria:
+ {
+ \bool_if:NTF \g_@@_font_path_bool
+ {
+ \__um_setmathfont:nn
+ { Path = \g_@@_font_path_tl/, FontIndex = 1 }
+ { cambria.ttc }
+ }
+ { \__um_setmathfont:nn { } { Cambria~Math } }
+ }
+% \end{macrocode}
+% \end{macro}
%
-% 载入字体命令。
+% \begin{macro}{\@@_loadfont_math_xits:}
+% XITS Math 字体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_load_font:
+\cs_new:Npn \@@_loadfont_math_xits:
{
- \use:c { @@_load_latin_font_ \g_@@_latin_font_tl : }
- \use:c { @@_load_cjk_font_ \g_@@_cjk_font_tl : }
+ \bool_if:NTF \g_@@_opt_math_int_bool
+ { \tl_set:Nn \l_@@_tmpa_tl { 8 } }
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = \l_@@_tmpa_tl,
+ BoldFont = XITSMath-Bold
+ }
+ { XITSMath-Regular }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = 1,
+ range = {cal,bfcal}
+ }
+ { XITSMath-Regular }
+ }
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_loadfont_math_newcm:}
+% New Computer Modern Math 字体。
+% \begin{macrocode}
+\cs_new:Npn \@@_loadfont_math_newcm:
+ {
+ \bool_if:NTF \g_@@_opt_math_int_bool
+ { \tl_set:Nn \l_@@_tmpa_tl { 2 } }
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \__um_setmathfont:nn
+ {
+ Extension = .otf,
+ StylisticSet = \l_@@_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 }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_loadfont_math_none:}
+% 不进行数学字体配置。
+% \begin{macrocode}
+\cs_new:Npn \@@_loadfont_math_none: { }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{载入指定字库}
% \changes{v0.10}{2021/09/28}{修正了数学字体。}
+%
+% \begin{macro}{\@@_loadfont:}
+% 载入字体命令。
% \begin{macrocode}
- \@@_load_math_font:
+\cs_new_protected:Npn \@@_loadfont:
+ {
+ \use:c { @@_loadfont_latin_ \g_@@_font_latin_tl : }
+ \use:c { @@_loadfont_cjk_ \g_@@_font_cjk_tl : }
% \end{macrocode}
% 自行定义 \pkg{ctex} 中的四类字体命令。
% \begin{macrocode}
@@ -4322,16 +5106,19 @@ To produce the documentation run the original source files ending with
\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
% \end{macrocode}
+% \begin{macro}{\bigger}
% 重定义字号命令。
% \begin{macrocode}
- \RenewDocumentCommand \large { } { \zihao { 4 } }
+ \NewDocumentCommand \bigger { } { \ctex_zihao:n { 4 } }
}
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
-% 载入设置的字体。此处设置与文档类一同载入,否则在导言区后载入字体可能导致一部分覆盖字体的命令失效。
+% 载入设置的字体。^^A 为了吸收导言区的设置,放在其后载入。
% \begin{macrocode}
-% \BeforeBeginEnvironment { document } { \@@_load_font: }
-\@@_load_font:
+% \BeforeBeginEnvironment { document } { \@@_loadfont: }
+\@@_loadfont:
% \end{macrocode}
%
%
@@ -4351,70 +5138,58 @@ To produce the documentation run the original source files ending with
%
% 草稿模式下显示页面文字范围边界以及页眉、页脚线。
% \begin{macrocode}
-\bool_if:NT \g_@@_draft_bool { \geometry { showframe } }
+\bool_if:NT \g_@@_opt_draft_bool { \geometry { showframe } }
% \end{macrocode}
%
%
% \subsubsection{页眉页脚}
-% ^^A TODO: 删除 header/format 和 footer/format
-% 提供设置页眉页脚的用户接口。在 \cs{fancyhead} 的可选参数中,
+% \changes{v1.0}{2022/07/01}{删除 |header/format| 和 |footer/format|。}
+% \changes{v1.0}{2022/08/01}{页眉接口更名为 \opt{header} 类。}
+% \changes{v1.0}{2022/08/01}{页脚接口更名为 \opt{footer} 类。}
+%
+% 提供设置页眉页脚的用户接口。在 \tn{fancyhead} 的可选参数中,
% \opt{E} 和 \opt{O} 分别表示在偶数页(even)和奇数页(odd),
% 而 \opt{L}、\opt{R} 和 \opt{C} 则分别表示左(left)、右
% (right)和中间(center)。按照通常的排版规则,在双面模式下,
% 偶数页的中间页眉文字在左,奇数页则在右。单面模式下,左右页眉都要显示。
% \begin{macrocode}
-\keys_define:nn { nju / style }
+\keys_define:nn { nju / header }
{
% \end{macrocode}
-% \begin{macro}{style/header/format}
-% \changes{v0.16}{2022/03/18}{可手动指定页眉样式。}
-% 页眉格式。
-% \begin{macrocode}
- header/format .tl_gset:N = \c_@@_fmt_header_tl,
-% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{style/header,style/header*}
+% \begin{macro}{header/content,header/content*}
% \changes{v0.16}{2022/03/18}{可手动指定页眉内容。}
% 页眉内容,分别对应双面模式和单面模式。
% 为了便于指定复杂的页眉样式,这里用 |clist| 存储位置和内容信息。
% \begin{macrocode}
- header .clist_gset:N = \g_@@_header_twoside_clist,
- header* .clist_gset:N = \g_@@_header_oneside_clist,
- header .initial:n =
- {
- { EL } { \leftmark }, { OR } { \rightmark }
- },
- header* .initial:n =
- {
- { L } { \leftmark }, { R } { \rightmark }
- },
+ content .clist_gset:N = \g_@@_header_twoside_clist,
+ content* .clist_gset:N = \g_@@_header_oneside_clist,
+ content .initial:n =
+ { { EL } { \leftmark }, { OR } { \rightmark } },
+ content* .initial:n =
+ { { L } { \leftmark }, { R } { \rightmark } }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{style/footer/format}
-% \changes{v0.16}{2022/03/19}{可手动指定页脚样式。}
-% 页脚格式。
% \begin{macrocode}
- footer/format .tl_gset:N = \c_@@_fmt_footer_tl,
+ }
+\keys_define:nn { nju / footer }
+ {
% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{style/footer,style/footer*}
+% \begin{macro}{footer/content,footer/content*}
% \changes{v0.16}{2022/03/18}{可手动指定页脚内容。}
% 页脚内容,同页眉。
% \begin{macrocode}
- footer .clist_gset:N = \g_@@_footer_twoside_clist,
- footer* .clist_gset:N = \g_@@_footer_oneside_clist,
- footer .initial:n = { { C } { \thepage } },
- footer* .initial:n = { { C } { \thepage } }
+ content .clist_gset:N = \g_@@_footer_twoside_clist,
+ content* .clist_gset:N = \g_@@_footer_oneside_clist,
+ content .initial:n = { { C } { \thepage } },
+ content* .initial:n = { { C } { \thepage } }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_header_clist,\g_@@_footer_clist}
-% 设置页眉页脚。
+% 存储页眉页脚内容。
% \begin{macrocode}
\clist_new:N \g_@@_header_clist
\clist_new:N \g_@@_footer_clist
@@ -4425,15 +5200,10 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\ctex_at_end_preamble:n
{
- \bool_if:NTF \g_@@_twoside_bool
- {
- \clist_set_eq:NN \g_@@_header_clist \g_@@_header_twoside_clist
- \clist_set_eq:NN \g_@@_footer_clist \g_@@_footer_twoside_clist
- }
- {
- \clist_set_eq:NN \g_@@_header_clist \g_@@_header_oneside_clist
- \clist_set_eq:NN \g_@@_footer_clist \g_@@_footer_oneside_clist
- }
+ \clist_set_eq:Nc \g_@@_header_clist
+ { g_@@_header_ \c_@@_name_pagemode_tl _clist }
+ \clist_set_eq:Nc \g_@@_footer_clist
+ { g_@@_footer_ \c_@@_name_pagemode_tl _clist }
}
% \end{macrocode}
%
@@ -4447,9 +5217,9 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% 重定义 \pkg{fancyhdr} 的 \opt{plain} 样式,即本科生正文和部分特殊页面使用的的
-% 页眉页脚样式。页眉无内容;页脚为居中的页码,使用五号新罗马体数字。注意标记页眉
-% 页脚横线宽度的变量并不是 |dim| 类型的,但是采取了该类型的格式。
+% 重定义 \pkg{fancyhdr} 的 \opt{plain} 样式,即本科生正文和部分特殊页面使用的
+% 页眉页脚样式。页眉无内容;页脚为居中的页码,使用五号新罗马体数字。
+% 标记页眉页脚横线宽度的变量并不属于 |dim| 类型,但是采取了该类型的格式。
% \begin{macrocode}
\fancypagestyle { plain }
{
@@ -4482,7 +5252,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
%
% \begin{macro}{\frontmatter}
-% 重定义 \cs{frontmatter},设置前言区默认的页眉页脚以及页码样式。
+% 重定义 \tn{frontmatter},设置前言区默认的页眉页脚以及页码样式。
% \begin{macrocode}
\RenewDocumentCommand \frontmatter { }
{
@@ -4496,7 +5266,7 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\mainmatter}
% \changes{v0.12}{2021/12/03}{修复了摘要页字体格式泄漏到正文的问题。}
% \changes{v0.12}{2021/12/03}{修复了页眉上长标题重叠的问题。}
-% 重定义 \cs{mainmatter},在论文主体部分载入页面样式设置,
+% 重定义 \tn{mainmatter},在论文主体部分载入页面样式设置,
% 使用阿拉伯数字重新进行页码编号。
% \begin{macrocode}
\RenewDocumentCommand \mainmatter { }
@@ -4522,25 +5292,58 @@ To produce the documentation run the original source files ending with
%
% \subsection{章节标题格式}
%
-% \begin{macro}{\@@_add_tocline:n,\@@_add_tocline:V}
+% \begin{macro}{\@@_bookmark_toc:n,\@@_bookmark_toc:V}
% 为无编号章添加目录条目,需手动指定格式为四号、不加粗、黑体。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_add_tocline:n #1
+\cs_new:Npn \@@_bookmark_toc:n #1
{ \addcontentsline { toc } { chapter } { \c_@@_fmt_chapterintoc_tl #1 } }
-\cs_generate_variant:Nn \@@_add_tocline:n { V }
+\cs_generate_variant:Nn \@@_bookmark_toc:n { V }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_bookmark_toc:nn}
+% 为了保持形式一致,进行封装。
+% \begin{macrocode}
+\cs_new:Npn \@@_bookmark_toc:nn #1#2
+ { \phantomsection \_@@_bookmark_toc:n {#1} }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_bookmark_pdf_nosec:nn,\@@_bookmark_pdf:nn}
+% 封装 \pkg{hyperref} 的 PDF 书签命令。
+% \begin{macrocode}
+\cs_new:Npn \@@_bookmark_pdf_nosec:nn #1#2
+ { \pdfbookmark [0] { #1 } { #2 } }
+\cs_new:Npn \@@_bookmark_pdf:nn #1#2
+ { \phantomsection \@@_bookmark_pdf_nosec:nn {#1} {#2} }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_bookmark:Nnn}
+% 书签。
+% \begin{macrocode}
+\cs_new:Npn \@@_bookmark:Nnn #1#2#3
+ {
+ \bool_if:NTF #1
+ { \_@@_bookmark_toc:n { #2 } }
+ { \_@@_bookmark_pdf_nosec:nn { #2 } { #3 } }
+ }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_chapter:n,\@@_chapter:V}
+% \begin{macro}{\@@_chapter:Nnn,\@@_chapter:cnn,\@@_chapter:n,\@@_chapter:V}
% 含有目录和 PDF 标签的无编号章。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_chapter:n #1
+\cs_new:Npn \@@_chapter:Nnn #1#2#3
{
- \chapter * { #1 }
- \@@_add_tocline:n { #1 }
- \@@_chapter_header:n { #1 }
+ \chapter * { #2 }
+ \@@_bookmark:Nnn #1 { #2 } { #3 }
+ \@@_chapter_header:n { #2 }
}
-\cs_generate_variant:Nn \@@_chapter:n { V }
+\cs_new:Npn \@@_chapter:n #1
+ { \@@_chapter:Nnn \c_true_bool {#1} { } }
+\cs_generate_variant:Nn \@@_chapter:Nnn { cnn }
+\cs_generate_variant:Nn \@@_chapter:n { V }
% \end{macrocode}
% \end{macro}
%
@@ -4550,7 +5353,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_chapter_header:n #1
{
- \bool_if:NTF \g_@@_twoside_bool
+ \bool_if:NTF \g_@@_opt_twoside_bool
{ \markboth { #1 } { #1 } }
{ \markboth { \hfill #1 \hfill } { } }
}
@@ -4564,12 +5367,12 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% |\keys_set:nn{ctex}| 实际相当于 \cs{ctexset}。
+% |\keys_set:nn{ctex}| 实际相当于 \tn{ctexset}。
% \begin{macrocode}
\keys_set:nn { ctex }
{
- chapter / beforeskip = 10 pt,
- chapter / afterskip = 60 pt,
+ chapter / beforeskip = \c_@@_chapterbefore_dim,
+ chapter / afterskip = \c_@@_chapterafter_dim,
chapter / format = \c_@@_fmt_chapter_tl,
section / format = \c_@@_fmt_section_tl,
subsection / format = \c_@@_fmt_subsection_tl,
@@ -4590,24 +5393,11 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 设置目录中章标题的样式。
% \begin{macrocode}
- chapter / tocline = \c_@@_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\keys_define:nn { nju / style }
- {
-% \end{macrocode}
-% \begin{macro}{style/toc-in-toc}
-% \changes{v0.15}{2022/02/04}{可选择目录自身是否出现在目录中。}
-% 是否在目录中显示目录自身。
-% \begin{macrocode}
- toc-in-toc .bool_gset:N = \g_@@_toc_in_toc_bool,
- toc-in-toc .initial:n = true
+ chapter / tocline = \c_@@_fmt_chapterintoc_tl \CTEXnumberline {#1} #2
}
% \end{macrocode}
-% \end{macro}
%
+% \changes{v1.0}{2022/08/01}{整合目录设置项。}
% \begin{macro}{\@@_make_toc:nn,\@@_make_toc:Vn}
% 通过 group 内修改标题设置,将目录页标题格式单独设置为三号粗宋体。
% 目录自身不出现在目录中时需特别处理。参考
@@ -4618,46 +5408,96 @@ To produce the documentation run the original source files ending with
\group_begin:
\keys_set:nn { ctex }
{ chapter/format = \c_@@_fmt_toctitle_tl }
- \bool_if:NTF \g_@@_toc_in_toc_bool
- { \@@_chapter:n { #1 } }
- {
- \chapter * { #1 }
- \pdfbookmark [0] { #1 } { #2 }
- \@@_chapter_header:n { #1 }
- }
+ \@@_chapter:cnn { g_@@_ #2 _showentry_bool } {#1} {#2}
\group_end:
\@starttoc { #2 }
}
-\cs_generate_variant:Nn \@@_make_toc:nn { Vn }
+\cs_generate_variant:Nn \@@_make_toc:nn { vn }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tableofcontents,\listoffigures,\listoftables}
+% \changes{v0.15}{2022/02/04}{可选择目录自身是否出现在目录中。}
+% \begin{macro}{\@@_define_toc_cmd:nnn}
% 重定义目录命令,修改标题格式并插入书签。
% \begin{macrocode}
-\RenewDocumentCommand \tableofcontents { }
- { \@@_make_toc:Vn \contentsname { toc } }
-\RenewDocumentCommand \listoffigures { }
- { \@@_make_toc:Vn \listfigurename { lof } }
-\RenewDocumentCommand \listoftables { }
- { \@@_make_toc:Vn \listtablename { lot } }
+\cs_new_protected:Npn \@@_define_toc_cmd:nnn #1#2#3
+ {
+ \keys_define:nn { nju / #1 }
+ {
+ toc-entry .bool_set:c = { g_@@_ #3 _showentry_bool },
+ toc-entry .initial:n = true
+ }
+ \exp_args:Nc \RenewDocumentCommand { #1 } { }
+ { \@@_make_toc:vn { #2 name } { #3 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \tableofcontents,\listoffigures,\listoftables,
+% tableofcontents/toc-entry,
+% listoffigures/toc-entry,
+% listoftables/toc-entry,
+% \g_@@_toc_showentry_bool,
+% \g_@@_lof_showentry_bool,
+% \g_@@_lot_showentry_bool}
+% \begin{macrocode}
+\clist_map_inline:nn
+ {
+ { tableofcontents } { contents } { toc },
+ { listoffigures } { listfigure } { lof },
+ { listoftables } { listtable } { lot }
+ }
+ { \@@_define_toc_cmd:nnn #1 }
+% \end{macrocode}
+% \end{macro}
+%
+% 如果不显示主目录的条目,则插图目录和表格目录一并不显示。
+% \begin{macrocode}
+\ctex_at_end_preamble:n
+ {
+ \bool_if:NF \g_@@_toc_showentry_bool
+ {
+ \bool_set_false:N \g_@@_lof_showentry_bool
+ \bool_set_false:N \g_@@_lot_showentry_bool
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macro}{tableofcontents/dotline}
+% \changes{v1.0}{2022/08/08}{可选择是否为目录中的章名添加引导线。}
+% 修改 \cls{book} 文档类中的命令以添加引导线。
+% \begin{macrocode}
+\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 = { }
+ }
% \end{macrocode}
% \end{macro}
%
%
% \subsection{参考文献}
%
-% \begin{variable}{\g_@@_biblatex_option_clist}
+% \begin{variable}{\g_@@_blx_option_clist}
% 存储传入 \pkg{biblatex} 的选项列表。
% \begin{macrocode}
-\clist_new:N \g_@@_biblatex_option_clist
+\clist_new:N \g_@@_blx_option_clist
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_bib_resource_clist}
+% \begin{variable}{\g_@@_blx_resource_clist}
% 存储参考文献数据源列表。
% \begin{macrocode}
-\clist_new:N \g_@@_bib_resource_clist
+\clist_new:N \g_@@_blx_resource_clist
% \end{macrocode}
% \end{variable}
%
@@ -4685,19 +5525,16 @@ To produce the documentation run the original source files ending with
style .choice:,
style / numeric .code:n =
{
- \clist_gput_right:Nn \g_@@_biblatex_option_clist
+ \clist_gput_right:Nn \g_@@_blx_option_clist
{ style = gb7714-2015 }
},
style / author-year .code:n =
{
- \clist_gput_right:Nn \g_@@_biblatex_option_clist
+ \clist_gput_right:Nn \g_@@_blx_option_clist
{ style = gb7714-2015ay }
},
style / unknown .code:n =
- {
- \clist_gput_right:Nx \g_@@_biblatex_option_clist
- { style = \l_keys_value_tl }
- },
+ { \clist_gput_right:Nn \g_@@_blx_option_clist { style = #1 } },
style .initial:n = numeric,
% \end{macrocode}
% \end{macro}
@@ -4714,7 +5551,7 @@ To produce the documentation run the original source files ending with
\tl_if_in:VnTF \l_keys_value_tl { style = }
{ \msg_error:nn { njuthesis } { extra-bib-style } }
{
- \clist_gput_right:NV \g_@@_biblatex_option_clist
+ \clist_gput_right:NV \g_@@_blx_option_clist
\l_keys_value_tl
}
},
@@ -4727,7 +5564,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
resource .code:n =
{
- \clist_gput_right:NV \g_@@_bib_resource_clist
+ \clist_gput_right:NV \g_@@_blx_resource_clist
\l_keys_value_tl
},
}
@@ -4736,32 +5573,35 @@ To produce the documentation run the original source files ending with
%
% \begin{macro}{\addbibresource}
% 为了吸收用户在导言区设置的选项,\pkg{biblatex} 宏包被设置在导言区末尾才会载
-% 入。此处单独定义了可以在导言区使用的 \cs{addbibresource} 命令,用于兼容传统的
+% 入。此处单独定义了可以在导言区使用的 \tn{addbibresource} 命令,用于兼容传统的
% 添加参考文献数据源的方法。
% \begin{macrocode}
-\NewDocumentCommand \addbibresource { m }
- { \clist_gput_right:Nn \g_@@_bib_resource_clist { #1 } }
+\bool_if:NT \g_@@_opt_load_blx_bool
+ {
+ \NewDocumentCommand \addbibresource { m }
+ { \clist_gput_right:Nn \g_@@_blx_resource_clist { #1 } }
+ }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_biblatex_pre_setup:}
-% 载入 \pkg{biblatex} 宏包前,必须禁用自行定义的 \cs{addbibresource}
+% \begin{macro}{\@@_blx_pre_setup:}
+% 载入 \pkg{biblatex} 宏包前,必须禁用自行定义的 \tn{addbibresource}
% 命令,并传入用户设置的选项。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_biblatex_pre_setup:
+\cs_new_protected:Npn \@@_blx_pre_setup:
{
\cs_undefine:N \addbibresource
- \clist_gput_right:Nn \g_@@_biblatex_option_clist { backend = biber }
+ \clist_gput_right:Nn \g_@@_blx_option_clist { backend = biber }
\exp_args:NV \PassOptionsToPackage
- \g_@@_biblatex_option_clist { biblatex }
+ \g_@@_blx_option_clist { biblatex }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_biblatex_post_setup:}
+% \begin{macro}{\@@_blx_post_setup:}
% \pkg{biblatex} 宏包载入后的设置。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_biblatex_post_setup:
+\cs_new_protected:Npn \@@_blx_post_setup:
{
% \end{macrocode}
% \changes{v0.12}{2021/12/06}{设置输出参考文献的默认选项。}
@@ -4775,9 +5615,9 @@ To produce the documentation run the original source files ending with
{ \DeclarePrintbibliographyDefaults { heading = subbibintoc } }
{ \DeclarePrintbibliographyDefaults { heading = njubibintoc } }
% \end{macrocode}
-% 传入参考文献源文件,此时可正常使用 \cs{addbibresource} 命令。
+% 传入参考文献源文件,此时可正常使用 \tn{addbibresource} 命令。
% \begin{macrocode}
- \clist_map_inline:Nn \g_@@_bib_resource_clist
+ \clist_map_inline:Nn \g_@@_blx_resource_clist
{ \addbibresource { ##1 } }
}
% \end{macrocode}
@@ -4788,9 +5628,12 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\BeforeBeginEnvironment { document }
{
- \@@_biblatex_pre_setup:
- \RequirePackage { biblatex }
- \@@_biblatex_post_setup:
+ \bool_if:NT \g_@@_opt_load_blx_bool
+ {
+ \@@_blx_pre_setup:
+ \RequirePackage { biblatex }
+ \@@_blx_post_setup:
+ }
}
% \end{macrocode}
%
@@ -4804,13 +5647,13 @@ To produce the documentation run the original source files ending with
\ctex_at_end_preamble:n
{
% \end{macrocode}
-% 忽略 PDF 字符串中的换行符,从而抑制 \pkg{hyperref} 警告。
+% 忽略 PDF 字符串中的特定命令,从而抑制 \pkg{hyperref} 警告。
% \begin{macrocode}
\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 }
+ { \@@_cs_clear:N #1 }
}
\hypersetup
{
@@ -4829,35 +5672,33 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
-% \begin{macro}{\@@_cref_name:n,\@@_cref_name:V}
-% 用于修改 \pkg{cleverref} 的标签名称的辅助函数。
+% \begin{macro}{\@@_cref_name:n}
+% 用于修改 \pkg{cleveref} 的标签名称的辅助函数。
+% \begin{arguments}
+% \item 标签名
+% \end{arguments}
% \begin{macrocode}
\cs_new_protected:Npn \@@_cref_name:n #1
- {
- \clist_map_inline:nn { #1 }
- {
- \crefname { ##1 }
- { \@@_name:n { ##1 } } { \@@_name:n { ##1 _en } }
- }
- }
-\cs_generate_variant:Nn \@@_cref_name:n { V }
+ { \crefname {#1} { \@@_name:n {#1} } { \@@_name:n {#1} } }
% \end{macrocode}
% \end{macro}
%
-% 修改 \pkg{cleverref} 的标签格式。默认在名称后面添加空格,删除公式编号的括号。
+% 修改 \pkg{cleveref} 的标签格式。默认在名称后面添加空格,删除公式编号的括号。
% \begin{macrocode}
-\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~小节 }
+\bool_if:NT \g_@@_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~小节 }
% \end{macrocode}
-%
-% 修改 \pkg{cleverref} 的标签名称。
+% 修改 \pkg{cleveref} 的标签名称。
% \begin{macrocode}
-\@@_cref_name:n { figure, table, appendix, proof }
-\@@_cref_name:V \g_@@_theorem_type_clist
+ \clist_map_inline:nn { figure, table, appendix, proof }
+ { \@@_cref_name:n { #1 } }
+ }
% \end{macrocode}
%
%
@@ -4865,18 +5706,18 @@ To produce the documentation run the original source files ending with
% \changes{v0.18}{2022/05/01}{提供脚注设置项。}
% ^^A 来自 fduthesis
% \begin{macrocode}
-\tl_new:N \l_@@_fn_style_tl
-\keys_define:nn { nju / style }
+\tl_new:N \g_@@_fn_style_tl
+\keys_define:nn { nju / footnote }
{
% \end{macrocode}
-% \begin{macro}{style/footnote-style}
+% \begin{macro}{footnote/style}
% \begin{macrocode}
- footnote-style .choices:nn = { plain, pifont }
+ style .choices:nn = { plain, pifont }
% \end{macrocode}
% 若使用 \opt{pifont} 类型,则需引入 \pkg{pifont} 宏包。
% \begin{macrocode}
{
- \tl_gset_eq:NN \l_@@_fn_style_tl \l_keys_choice_tl
+ \tl_gset_eq:NN \g_@@_fn_style_tl \l_keys_choice_tl
\int_compare:nT { \l_keys_choice_int = 2 }
{ \RequirePackage { pifont } }
}
@@ -4899,7 +5740,7 @@ To produce the documentation run the original source files ending with
\tl_const:Nn \c_@@_fn_style_pifont_tl { pifont }
\cs_new:Npn \@@_footnote_number:N #1
{
- \tl_case:NnF \l_@@_fn_style_tl
+ \tl_case:NnF \g_@@_fn_style_tl
{
% \end{macrocode}
% \opt{plain} 类型直接使用计数器 |footnote| 的值。
@@ -4924,7 +5765,9 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\thefootnote}
% 重定义脚注编号。
% \begin{macrocode}
-\cs_set:Npn \thefootnote { \@@_footnote_number:N \c@footnote }
+\bool_if:NT \g_@@_opt_load_fm_bool
+ {
+ \cs_set:Npn \thefootnote { \@@_footnote_number:N \c@footnote }
% \end{macrocode}
% \end{macro}
%
@@ -4932,14 +5775,15 @@ To produce the documentation run the original source files ending with
%
% \begin{macro}[int]{\@makefntext}
% 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \qty{1.5}{em}。
-% 见 \url{http://tex.stackexchange.com/q/19844} 和
-% \url{https://www.zhihu.com/question/53030087}。
+% \footnote{\url{http://tex.stackexchange.com/q/19844},
+% \url{https://www.zhihu.com/question/53030087}}
% \begin{macrocode}
-\cs_set:Npn \@makefntext #1
- {
- \mode_leave_vertical:
- \hbox_to_wd:nn { 1.5 em } { \@thefnmark \hfil }
- #1
+ \cs_set:Npn \@makefntext #1
+ {
+ \mode_leave_vertical:
+ \hbox_to_wd:nn { 1.5 em } { \@thefnmark \tex_hfil:D }
+ #1
+ }
}
% \end{macrocode}
% \end{macro}
@@ -4947,15 +5791,51 @@ To produce the documentation run the original source files ending with
%
% \subsection{图片表格}
%
+% \begin{macro}{image/path}
+% \changes{v1.0}{2021/08/06}{提供图片路径设置。}
+% 外置图片路径,等效于 \tn{graphicspath}。
+% \begin{macrocode}
+\keys_define:nn { nju / image } { path .code:n = { \graphicspath {#1} } }
+% \end{macrocode}
+% \end{macro}
+%
% 设置默认图片扩展名,允许在不键入扩展名时自动进行补全。
% \begin{macrocode}
\DeclareGraphicsExtensions { .pdf, .eps, .jpg, .png }
% \end{macrocode}
%
% \changes{v0.16}{2022/03/11}{表格内字体设为五号。}
+% \changes{v1.0}{2022/08/06}{兼容 \pkg{tabularray} 设置。}
% 表格默认居中,字号设置为五号。^^A https://www.zhihu.com/question/366803177/answer/977853129
% \begin{macrocode}
\BeforeBeginEnvironment { tabular } { \centering \zihao {5} }
+\ctex_at_end_package:nn { tabularray }
+ {
+% \end{macrocode}
+% 等效于 \tn{UseTblrLibrary}、\tn{SetTblrInner} 与 \tn{SetTblrOuter}。
+% \begin{macrocode}
+ \__tblr_use_lib_booktabs:
+ \tl_set:Nn \l_@@_tmpb_tl
+ { , abovesep = 4 pt, stretch = 0.8, cells = { font = \small } }
+ \tl_put_right:NV \l__tblr_default_tblr_inner_tl \l_@@_tmpb_tl
+ \tl_put_right:NV \l__tblr_default_talltblr_inner_tl \l_@@_tmpb_tl
+ \tl_put_right:Nn \l__tblr_default_talltblr_outer_tl { , headsep = -4 pt }
+% \end{macrocode}
+% 处理 \env{talltblr} 表注的限宽问题。
+% \footnote{\url{https://github.com/lvjr/tabularray/issues/255}}
+% \begin{macrocode}
+ \DefTblrTemplate { caption-tag } { default }
+ { \c_@@_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 }
+ }
% \end{macrocode}
%
% \changes{v0.12}{2021/12/06}{删除了可能导致冲突的 \pkg{floatrow}。}
@@ -4973,98 +5853,383 @@ To produce the documentation run the original source files ending with
\captionsetup [ table ] { style = njucap }
% \end{macrocode}
%
+% \begin{macro}{\ctex_patch_cmd:Nnn}
+% \begin{macrocode}
+\cs_generate_variant:Nn \ctex_patch_cmd:Nnn { cnv }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{label-sep/figure,label-sep/table,label-sep/equation}
+% \changes{1.0}{2022/07/31}{添加编号连接符设置项。}
+% 修改图片、表格、公式编号中的连接符。
+% \footnote{\url{https://tex.stackexchange.com/q/61756/}}
+% \begin{macrocode}
+\clist_map_inline:nn { figure, table, equation }
+ {
+ \keys_define:nn { nju / label-sep }
+ {
+ #1 .tl_set:c = { g_@@_sep_ #1 _tl },
+% \end{macrocode}
+% 根据本科生撰写规范的建议,默认连接符为短横线(en dash)。
+% \begin{macrocode}
+ #1 .initial:n = { - }
+ }
+ \@@_at_begin_document:n
+ { \ctex_patch_cmd:cnv { the #1 } {.} { g_@@_sep_ #1 _tl } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
%
% \subsection{列表环境}
% \changes{v0.12}{2021/12/07}{删除了 \pkg{enumitem} 的部分列表环境设置。}
%
% 缩减列表环境的条目间距。
% \begin{macrocode}
-\setlist { noitemsep }
+\bool_if:NT \g_@@_opt_load_enit_bool { \setlist { noitemsep } }
% \end{macrocode}
%
%
% \subsection{定理环境}
-%
% \changes{v0.18}{2022/04/21}{新增定理环境的若干定制项。}
%
+% \begin{macro}{\c_@@_name_qed_tl}
+% 证毕符号使用 \tn{mdlgwhtsquare} 绘制,对应于 |U+25A1| 字符。
+% \footnote{\url{https://tex.stackexchange.com/q/567135/}}
+% 如果 \pkg{unicode-math} 未载入,则使用黑色方块代替。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_load_um_bool
+ { \tl_const:Nn \c_@@_name_qed_tl { \ensuremath { \mdlgwhtsquare } } }
+ { \tl_const:Nn \c_@@_name_qed_tl { \ensuremath { \rule {1ex} {1ex} } } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\keys_define:nn { nju / theorem }
+ {
+% \end{macrocode}
% \begin{macro}{theorem/style,theorem/header-font,theorem/body-font,
% theorem/qed-symbol,theorem/counter}
-% 定义 |nju/theorem| 键值类。
+% 定义 |nju/theorem| 键值类。^^A 这是否也可以抽象到 xtemplate?
% 目前这套选项只适用于模板预定义的若干种定理环境。
% \begin{macrocode}
-\keys_define:nn { nju / theorem }
- {
- predefine .bool_set:N = \g_@@_thm_predefine_bool,
- style .tl_set:N = \l_@@_thm_style_tl,
- header-font .tl_set:N = \l_@@_thm_header_font_tl,
- body-font .tl_set:N = \l_@@_thm_body_font_tl,
- qed-symbol .tl_set:N = \l_@@_thm_qed_symbol_tl,
- counter .tl_set:N = \l_@@_thm_counter_tl,
+ style .tl_set:N = \l_@@_thm_style_tl,
+ header-font .tl_set:N = \l_@@_thm_header_font_tl,
+ body-font .tl_set:N = \l_@@_thm_body_font_tl,
+ qed-symbol .tl_set:N = \l_@@_thm_qed_symbol_tl,
+ counter .tl_set:N = \l_@@_thm_counter_tl,
% \end{macrocode}
% 定理环境的缺省值。
% \begin{macrocode}
- 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 .initial:n = plain,
+ header-font .initial:n = \normalfont \bfseries,
+ body-font .initial:n = \itshape,
+ qed-symbol .initial:V = \c_@@_name_qed_tl,
+ counter .initial:n = chapter,
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{theorem/type,theorem/define}
+% 定义和创建定理类环境的接口。
+% \begin{macrocode}
+ type .clist_set:N = \g_@@_thm_type_clist,
+ define .value_forbidden:n = true,
+ define .code:n =
+ {
+ \clist_if_empty:NT \g_@@_thm_type_clist
+ { \msg_error:nn { njuthesis } { empty-theorem-type } }
+ \clist_map_inline:Nn \g_@@_thm_type_clist
+ { \@@_thm_define:nn ##1 }
+ }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_new_theorem:Nn,\@@_new_theorem:NV}
-% 用于定义普通定理环境的辅助函数。
-% \begin{arguments}
-% \item 定理名称列表,|clist| 型变量
-% \item 编号范围
-% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_new_theorem:Nn #1#2
+\msg_new:nnn { njuthesis } { empty-theorem-type }
{
- \clist_map_inline:Nn #1
- { \newtheorem { ##1 } { \@@_name:n { ##1 } } [#2] }
+ Empty~ theorem~ list~ to~ define.\\
+ The~ key~ "theorem/type"~ should~ not~ be~ set~ empty.
+ }
+\msg_new:nnn { njuthesis } { missing-ntheorem }
+ {
+ "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 \@@_new_theorem:Nn { NV }
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\@@_ntheorem_post_setup:}
-% 载入 \pkg{ntheorem} 后的相应设置。
+% \begin{macro}{\@@_thm_define:nn}
+% 配置定理环境。
+% \begin{arguments}
+% \item 环境名与类型标识,|clist| 型变量
+% \item 定理头名称
+% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_ntheorem_post_setup:
+\cs_new_protected:Npn \@@_thm_define:nn #1#2
{
+ \bool_if:NF \g_@@_opt_load_nthm_bool
+ { \msg_error:nn { njuthesis } { missing-ntheorem } }
\exp_args:NV \theoremstyle \l_@@_thm_style_tl
\exp_args:NV \theoremheaderfont \l_@@_thm_header_font_tl
\exp_args:NV \theorembodyfont \l_@@_thm_body_font_tl
- \exp_args:NV \theoremsymbol \l_@@_thm_qed_symbol_tl
% \end{macrocode}
-% 定义证明环境。证毕符号使用 \tn{mdlgwhtsquare} 绘制,对应于 |U+25A1| 字符
-% \footnote{\url{https://tex.stackexchange.com/q/567135/}}。
+% 拆分环境名与类型标识。这里是考虑到标识符不一定出现在环境名中,
+% 典型如 \env{proof} 环境默认无编号但也不含星号。
% \begin{macrocode}
- \newtheorem* { proof } { \c_@@_name_proof_tl }
+ \clist_set:Nn \l_@@_tmp_clist { #1 }
+ \clist_pop:NN \l_@@_tmp_clist \l_@@_tmpa_tl
+ \clist_pop:NN \l_@@_tmp_clist \l_@@_tmpb_tl
% \end{macrocode}
-% 定义普通定理环境。清除预设的证毕符号,并排除 \env{proof}。
+% 判断是否需要证毕符号或编号。
+% \begin{macrocode}
+ \tl_if_in:NnT \l_@@_tmpb_tl { + }
+ { \exp_args:NV \theoremsymbol \l_@@_thm_qed_symbol_tl }
+ \tl_if_in:NnTF \l_@@_tmpb_tl { * }
+ { \@@_thm_new:VVn \l_@@_tmpa_tl \c_novalue_tl {#2} }
+ { \@@_thm_new:VVn \l_@@_tmpa_tl \l_@@_thm_counter_tl {#2} }
+ \bool_if:NT \g_@@_opt_load_cref_bool
+ { \crefname { \l_@@_tmpa_tl } {#2} {#2} }
+% \end{macrocode}
+% 清除保存的证毕符号。
% \begin{macrocode}
\theoremsymbol { }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_thm_new:nnn,\@@_thm_new:VVn}
+% 包装 \tn{newtheorem} 以便展开输入的变量。根据 \file{interface3.pdf}
+% 手册 5.3 节最后一段建议的展开顺序,这里将 |V| 型参数放在靠前的位置。
+% \begin{arguments}
+% \item 环境名
+% \item 计数器名
+% \item 头名称
+% \end{arguments}
+% 根据环境结束命令是否存在可以判断该环境是否有定义,
+% 相应地可以利用局部定义切换定义和重定义环境的命令。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_thm_new:nnn #1#2#3
+ {
\group_begin:
- \clist_remove_all:Nn \g_@@_theorem_type_clist { proof }
- \@@_new_theorem:NV \g_@@_theorem_type_clist \l_@@_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:
}
+\cs_generate_variant:Nn \@@_thm_new:nnn { VVn }
% \end{macrocode}
% \end{macro}
%
-% 在导言区末尾,通过吸收的用户设置,选择是否载入并设置 \pkg{ntheorem}。
+%
+% \subsection{公式样式}
+% \changes{v1.0}{2022/07/31}{新增若干公式样式设置。}
+%
+% \begin{variable}{
+% \g_@@_opt_math_re_bool,
+% \g_@@_opt_math_int_bool,
+% \g_@@_opt_math_leq_bool,
+% \g_@@_opt_math_vec_bool}
+% 用于以下若干选项的 |bool| 变量。
% \begin{macrocode}
-\ctex_at_end_preamble:n
+\bool_new:N \g_@@_opt_math_re_bool
+\bool_new:N \g_@@_opt_math_int_bool
+\bool_new:N \g_@@_opt_math_leq_bool
+\bool_new:N \g_@@_opt_math_vec_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_name_integral_tl}
+% 保存 \pkg{unicode-math} 内置的所有积分号命令。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_load_um_bool
+ { \tl_set_eq:NN \c_@@_name_integral_tl \l__um_nolimits_tl }
+ { \tl_set_eq:NN \c_@@_name_integral_tl \c_empty_tl }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_um_setup:n}
+% 封装 \tn{unimathsetup}。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_load_um_bool
+ { \cs_new:Npn \@@_um_setup:n #1 { \keys_set:nn { unicode-math } {#1} } }
+ { \cs_new:Npn \@@_um_setup:n #1 { } }
+% \end{macrocode}
+% \end{macro}
+%
+% ^^A 选项名称来自 thuthesis
+% \begin{macrocode}
+\keys_define:nn { nju / math }
+ {
+% \end{macrocode}
+% \begin{macro}{math/integral}
+% 积分号样式,直立或倾斜。
+% \begin{macrocode}
+ integral .choice:,
+ integral / upright .code:n =
+ { \bool_set_true:N \g_@@_opt_math_int_bool },
+ integral / slanted .code:n =
+ { \bool_set_false:N \g_@@_opt_math_int_bool },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/integral-limits}
+% 积分号上下限的位置,在上下或在右侧。
+% 两个选项分别相当于 \tn{removenolimits} 和 \tn{addnolimits}。
+% \begin{macrocode}
+ 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_@@_name_integral_tl },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/less-than-or-equal}
+% 小于等于号和大于等于号的横线样式,倾斜或水平。
+% \begin{macrocode}
+ less-than-or-equal .choice:,
+ less-than-or-equal / slanted .code:n =
+ { \bool_set_true:N \g_@@_opt_math_leq_bool },
+ less-than-or-equal / horizontal .code:n =
+ { \bool_set_false:N \g_@@_opt_math_leq_bool },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/math-ellipsis}
+% 省略号的样式,居中或底部。
+% \begin{macrocode}
+ math-ellipsis .choice:,
+ math-ellipsis / centered .code:n =
+ {
+ \DeclareRobustCommand \mathellipsis
+ { \mathinner { \unicodecdots } }
+ },
+ math-ellipsis / lower .code:n =
+ {
+ \DeclareRobustCommand \mathellipsis
+ { \mathinner { \unicodeellipsis } }
+ },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/partial}
+% 偏微分号样式,正体或斜体。
+% \begin{macrocode}
+ partial .choices:nn =
+ { upright, italic } { \@@_um_setup:n { partial = #1 } },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/real-part}
+% 实部和虚部符号的样式,罗马体或花体。
+% \begin{macrocode}
+ real-part .choice:,
+ real-part / roman .code:n =
+ { \bool_set_true:N \g_@@_opt_math_re_bool },
+ real-part / fraktur .code:n =
+ { \bool_set_false:N \g_@@_opt_math_re_bool },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/vector}
+% 向量符号样式,粗斜体或箭头。
+% \begin{macrocode}
+ vector .choice:,
+ vector / boldfont .code:n =
+ { \bool_set_true:N \g_@@_opt_math_vec_bool },
+ vector / arrow .code:n =
+ { \bool_set_false:N \g_@@_opt_math_vec_bool },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/uppercase-greek}
+% 大写希腊字母的样式,正体或斜体。
+% \begin{macrocode}
+ uppercase-greek .choice:,
+ uppercase-greek / upright .code:n =
+ { \@@_um_setup:n { math-style = ISO } },
+ uppercase-greek / italic .code:n =
+ { \@@_um_setup:n { math-style = TeX } },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{math/style}
+% 整体样式。
+% \begin{macrocode}
+ 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
+ }
+ \@@_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
+ }
+ \@@_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
+ }
+ \@@_um_setup:n { bold-style = ISO }
+ },
+ style .initial:n = GB
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% 在 |\begin{document}| 处载入字体以兼容 \pkg{mathtools},
+% 并设置小于等于号和实部符号等的样式。
+% \begin{macrocode}
+\@@_at_begin_document:n
{
- \bool_if:NT \g_@@_thm_predefine_bool
+ \use:c { @@_loadfont_math_ \g_@@_font_math_tl : }
+ \bool_if:NT \g_@@_opt_math_leq_bool
{
- \PassOptionsToPackage { amsmath, thmmarks } { ntheorem }
- \RequirePackage { ntheorem }
- \@@_ntheorem_post_setup:
+ \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_@@_opt_math_re_bool
+ {
+ \cs_set:Npn \Re { \operatorname { Re } }
+ \cs_set:Npn \Im { \operatorname { Im } }
+ }
+ \bool_if:NT \g_@@_opt_math_vec_bool
+ { \cs_set_eq:NN \vec \symbf }
}
%</class>
% \end{macrocode}
@@ -5072,217 +6237,302 @@ To produce the documentation run the original source files ending with
%
% \subsection{封面}
%
-%
% \subsubsection{绘制部件}
-%
% \changes{v0.16}{2022/03/01}{将封面部件分离到 \file{.def} 文件。}
%
% \paragraph{本科生}
%
-% \begin{macro}{cover/ug/emblem-img}
+% \subparagraph{封面}
+%
+% \begin{macro}{u/cover/emblem-img}
% 本科生封面校徽图片实例。
% \begin{macrocode}
-%<*definition-ug>
-\@@_declare_element:nn { cover / ug / emblem-img }
+%<*def-u>
+\@@_declare_element:nn { u / cover / emblem-img }
{
- content = \@@_emblem:N \c_@@_emblemwidth_dim,
- bottom-skip = 1 cm,
+ content = \@@_emblem:N \c_@@_emblemwd_dim,
+ bottom-skip = 10 pt,
align = l
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/ug/name-img}
+% \begin{macro}{u/cover/name-img}
% 本科生封面校名图片实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / ug / name-img }
+\@@_declare_element:nn { u / cover / name-img }
{
- content = \@@_name:N \c_@@_namewidth_dim,
- bottom-skip = 1 cm
+ content = \@@_name:N \c_@@_namewd_dim,
+ bottom-skip = 10 pt,
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/ug/title}
+% \begin{macro}{u/cover/title}
% 本科生封面标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / ug / title }
+\@@_declare_element:nn { u / cover / title }
{
- content =
- \@@_spread_box:nnV { 9 em } { \bf } \g_@@_info_type_tl,
- format = \zihao { -1 },
- bottom-skip = 0 pt plus 1.5 fill
+ content =
+ \dim_set:Nn \l_@@_tmpb_dim { 217 pt }
+ \@@_box_spread_name:Nn \l_@@_tmpb_dim { type },
+ format = \zihao { -1 } \bfseries,
+ bottom-skip = 10 pt plus 1 fill
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/ug/info}
+% \begin{macro}{u/cover/info}
% 本科生封面信息栏实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / ug / info }
+\@@_declare_element:nn { u / cover / info }
{
- content =
- \@@_cover_info_ug:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim,
- format = \zihao { 3 }
+ content =
+ \@@_u_cover_info:NNNN
+ \c_@@_clabelwd_dim
+ \c_@@_crulewd_dim
+ \c_@@_hsep_dim
+ \c_@@_fmt_coverlabel_tl,
+ format = \zihao { 3 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_info_ug:NN}
+% \begin{macro}{\@@_u_cover_info:NNNN}
% 本科生封面信息栏。
% \begin{arguments}
% \item 名称盒子宽度,|dim| 型变量
% \item 长内容盒子宽度,|dim| 型变量
+% \item 间隔宽度,|dim| 型变量
+% \item 标签格式
% \end{arguments}
-% 短内容盒子的长度值是通过计算得到的。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_info_ug:NN #1#2
+\cs_new_protected:Npn \@@_u_cover_info:NNNN #1#2#3#4
+ {
+ \dim_set_eq:NN \tex_baselineskip:D \c_@@_clineskip_dim
+ \@@_cover_entry:NNNn #1 #2 #4 { dept }
+ \@@_cover_entry:NNNn #1 #2 #4 { major }
+ \@@_cover_entry_title:NNN #1 #2 #4
+% \end{macrocode}
+% 短内容盒子的长度值是通过计算得到的。|dim| 型变量的乘除需要采取
+% \cs{dim_ratio:nn} 提供的形式。
+% \begin{macrocode}
+ \dim_set:Nn \l_@@_tmpb_dim { #2 * 1/2 - #1 * 1/2 - #3 }
+ \@@_cover_entry:NNNnn #1 \l_@@_tmpb_dim #4 { grade } { id }
+ \@@_cover_entry:NNNn #1 #2 #4 { author }
+ \@@_cover_entry_supv:NNNn #1 \l_@@_tmpb_dim #4 { supv }
+ \bool_if:NT \l_@@_second_supvbool
+ { \@@_cover_entry_supv:NNNn #1 \l_@@_tmpb_dim #4 { supvii } }
+ \@@_cover_entry:NNNn #1 #2 #4 { submitdate }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subparagraph{诚信承诺书}
+%
+% \begin{macro}{u/decl/orig/emblem}
+% 本科生诚信承诺书校徽实例。
+% \begin{macrocode}
+\@@_declare_element:nn { u / decl / orig / emblem }
+ {
+ content = \@@_emblem:N \c_@@_emblemwdi_dim,
+ bottom-skip = 30 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{u/decl/orig/title}
+% 本科生诚信承诺书标题实例。
+% \begin{macrocode}
+\@@_declare_element:nn { u / decl / orig / title }
+ {
+ content = \c_@@_name_origdecl_tl,
+ format = \zihao { -1 } \sffamily,
+ bottom-skip = 50 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{u/decl/orig/text}
+% 本科生诚信承诺书文本实例。
+% \begin{macrocode}
+\@@_declare_element:nn { u / decl / orig / text }
+ {
+ content = \c_@@_text_origdecl_tl,
+ format = \zihao { -3 },
+ align = n,
+ bottom-skip = 0 pt plus 1 fil
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{u/decl/orig/sign}
+% 本科生诚信承诺书签名区实例。
+% \begin{macrocode}
+\@@_declare_element:nn { u / decl / orig / sign }
+ {
+ content = \@@_decl_sign:,
+ format = \zihao { -3 },
+ align = r
+ }
+%</def-u>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_decl_sign:}
+% 通用的承诺书签名区。
+% \begin{macrocode}
+%<*(def-u|def-g)>
+\cs_new_protected:Npn \@@_decl_sign:
{
- \begin{minipage} { #1 + #2 + \c_@@_smallhskip_dim }
- \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim
- \dim_set:Nn \l_@@_tmpb_dim { .5 #2 - .5 #1 - \c_@@_smallhskip_dim }
- \@@_cover_entry:nnn { dept } { #1 } { #2 }
- \@@_cover_entry:nnn { major } { #1 } { #2 }
- \@@_cover_entry_title:nnn { \bf } { #1 } { #2 }
- \@@_cover_bientry:nnnn { grade } { id } { #1 } { \l_@@_tmpb_dim }
- \@@_cover_entry:nnn { author } { #1 } { #2 }
- \@@_cover_entry_supv:nnn { supv } { #1 } { \l_@@_tmpb_dim }
- \bool_if:NT \l_@@_second_supv_bool
- { \@@_cover_entry_supv:nnn { supv_ii } { #1 } { \l_@@_tmpb_dim } }
- \@@_cover_entry:nnn { submitdate } { #1 } { #2 }
- \end{minipage}
+%<def-u> \clist_map_inline:nn { origsign, id, date }
+%<def-g> \clist_map_inline:nn { origsign, date }
+ { \@@_vskip: \@@_name:n { ##1 } : \@@_uline:n { 7 em } }
}
-%</definition-ug>
+%</(def-u|def-g)>
% \end{macrocode}
% \end{macro}
%
% \paragraph{研究生}
+% \changes{v1.0}{2022/06/30}{调整研究生封面布局。}
%
% \subparagraph{正面} 包括校名、校徽、标题、信息栏。
%
-% \begin{macro}{cover/g/emblem-img}
+% \begin{macro}{g/cover-front/emblem-img}
% 研究生封面校徽图片实例。
% \begin{macrocode}
-%<*definition-g>
-\@@_declare_element:nn { cover / g / emblem-img }
+%<*def-g>
+\@@_declare_element:nn { g / cover-front / emblem-img }
{
- content = \@@_emblem:N \c_@@_emblemwidthi_dim,
- bottom-skip = 1.5 cm
+ content = \@@_emblem:N \c_@@_emblemwdi_dim,
+ bottom-skip = 20 pt
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/name-img}
+% \begin{macro}{g/cover-front/name-img}
% 研究生封面校名图片实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / name-img }
+\@@_declare_element:nn { g / cover-front / name-img }
{
- content = \@@_name:N \c_@@_namewidth_dim,
- bottom-skip = 2 cm
+ content = \@@_name:N \c_@@_namewd_dim,
+ bottom-skip = 70 pt
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/type}
+% \begin{macro}{g/cover-front/type}
% 研究生封面标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / type }
+\@@_declare_element:nn { g / cover-front / type }
{
content =
- \@@_spread_box:nnV { 9 em } { } \g_@@_info_type_tl,
- format = \zihao { -1 } \bfseries,
- bottom-skip = 1 cm
+ \dim_set:Nn \l_@@_tmpb_dim { 266 pt }
+ \@@_box_spread_name:Nn \l_@@_tmpb_dim { type },
+ format = \zihao { 1 } \bfseries,
+ bottom-skip = 20 pt
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/degree}
+% \begin{macro}{g/cover-front/degree}
% 研究生封面标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / degree }
+\@@_declare_element:nn { g / cover-front / degree }
{
content = \c_@@_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
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/info}
+% \begin{macro}{g/cover-front/info}
% 研究封面信息栏实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / info }
+\@@_declare_element:nn { g / cover-front / info }
{
content =
- \@@_cover_info_g:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim,
- bottom-skip = 0 pt plus 1.5 fil
+ \@@_g_cover_info:NNNN
+ \c_@@_clabelwd_dim
+ \c_@@_crulewd_dim
+ \c_@@_hsep_dim
+ \c_@@_fmt_coverlabel_tl,
+ bottom-skip = 20 pt plus 1 fill
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/date}
+% \begin{macro}{g/cover-front/date}
% 研究封面日期实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / date }
+\@@_declare_element:nn { g / cover-front / date }
{ content = \g_@@_info_submitdate_tl }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_info_g:NN}
+% \begin{macro}{\@@_g_cover_info:NNNN}
% 研究生封面信息栏。
% \begin{arguments}
% \item 名称盒子宽度,|dim| 型变量
% \item 内容盒子宽度,|dim| 型变量
+% \item 间隔宽度,|dim| 型变量
+% \item 标签格式
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_info_g:NN #1#2
+\cs_new_protected:Npn \@@_g_cover_info:NNNN #1#2#3#4
{
- \begin{minipage} { #1 + #2 + \c_@@_smallhskip_dim }
- \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim
- \@@_cover_entry_title:nnn { } { #1 } { #2 }
- \clist_map_inline:nn { author, major, field, supvfull }
- { \@@_cover_entry:nnn { ##1 } { #1 } { #2 } }
- \end{minipage}
+ \dim_set_eq:NN \tex_baselineskip:D \c_@@_clineskip_dim
+ \@@_cover_entry_title:NNN #1 #2 #4
+ \clist_map_inline:nn { author, major, field, supvfull }
+ { \@@_cover_entry:NNNn #1 #2 #4 { ##1 } }
}
% \end{macrocode}
% \end{macro}
%
% \subparagraph{背面}
%
-% \begin{macro}{cover/g/back}
+% \begin{macro}{g/cover-back/info}
% 研究生封面背面信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / back }
+\@@_declare_element:nn { g / cover-back / info }
{
- content = \@@_cover_back_g:,
+ content =
+ \@@_g_cover_back:NN
+ \c_@@_clabelwd_dim
+ \c_@@_fmt_coverlabel_tl,
align = l
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_back_g:}
+% \begin{macro}{\@@_cover_back_g:NN}
% 研究生封面背面信息。格式存在变化,没有使用循环来简化。
+% \begin{arguments}
+% \item 名称盒子宽度,|dim| 型变量
+% \item 标签格式
+% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cover_back_g:
+\cs_new_protected:Npn \@@_g_cover_back:NN #1#2
{
- \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_id_tl
- { : \@@_quad: } \g_@@_info_id_tl
- \@@_vskip:
- \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_defenddate_tl
- { : \@@_quad: } \g_@@_info_defenddate_tl
- \@@_vskip:
- \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_supvfull_tl
- { : \@@_quad: } \skip_horizontal:n { 8 em } \c_@@_name_sign_tl
+ \dim_set_eq:NN \tex_baselineskip:D \c_@@_clineskip_dim
+ \@@_box_spread_name:NNn #1 #2 { id }
+ \c_@@_name_colon_tl \g_@@_info_id_tl \tex_par:D
+ \@@_box_spread_name:NNn #1 #2 { defenddate }
+ \c_@@_name_colon_tl \g_@@_info_defenddate_tl \tex_par:D
+ \@@_box_spread_name:NNn #1 #2 { supvfull }
+ \c_@@_name_colon_tl \skip_horizontal:n { 8 em }
+ { #2 \c_@@_name_sign_tl }
}
% \end{macrocode}
% \end{macro}
%
% \subparagraph{英文封面} 包括标题、顶部、中部、校徽、底部。
%
-% \begin{macro}{cover/g/en/title}
+% \begin{macro}{g/cover-en/title}
% 研究生英文封面标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / en / title }
+\@@_declare_element:nn { g / cover-en / title }
{
content = \g_@@_info_title_en_tl,
format = \bf \sffamily \zihao { 2 },
@@ -5291,10 +6541,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/en/top}
+% \begin{macro}{g/cover-en/top}
% 研究生英文封面顶部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / en / top }
+\@@_declare_element:nn { g / cover-en / top }
{
content =
{ by }
@@ -5310,14 +6560,14 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/en/middle}
+% \begin{macro}{g/cover-en/middle}
% 研究生英文封面中部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / en / middle }
+\@@_declare_element:nn { g / cover-en / middle }
{
content =
\c_@@_text_cover_en_tl \@@_vskip:
- \textsc { \clist_item:Nn \c_@@_name_degree_en_clist
+ \textsc { \clist_item:Nn \c_@@_name_type_en_clist
{ \g_@@_info_degree_int } }
\@@_vskip: { in } \@@_vskip:
\g_@@_info_major_en_tl,
@@ -5326,21 +6576,21 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/en/emblem-img}
+% \begin{macro}{g/cover-en/emblem-img}
% 研究生英文封面校徽图片实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / en / emblem-img }
+\@@_declare_element:nn { g / cover-en / emblem-img }
{
- content = \@@_emblem:N \c_@@_emblemwidthii_dim,
+ content = \@@_emblem:N \c_@@_emblemwdii_dim,
bottom-skip = 1.5 cm
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/g/en/bottom}
+% \begin{macro}{g/cover-en/bottom}
% 研究生英文封面底部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / g / en / bottom }
+\@@_declare_element:nn { g / cover-en / bottom }
{
content =
\g_@@_info_dept_en_tl \skip_vertical:N \c_zero_skip
@@ -5352,10 +6602,10 @@ To produce the documentation run the original source files ending with
%
% \subparagraph{国家图书馆封面} 包括顶部、题名、标题、中部、底部、日期。
%
-% \begin{macro}{cover/nl/top}
+% \begin{macro}{cover-nl/top}
% 国家图书馆封面顶部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / top }
+\@@_declare_element:nn { cover-nl / top }
{
content = \@@_cover_top_nl:,
bottom-skip = 2 cm
@@ -5363,23 +6613,24 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/nl/name}
+% \begin{macro}{cover-nl/name}
% 国家图书馆封面标题名称实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / name }
+\@@_declare_element:nn { cover-nl / name }
{
content =
- \@@_spread_box:nnV { 6 em } { } \c_@@_name_title_b_tl,
+ \dim_set:Nn \l_@@_tmpa_dim { 6 em }
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { titleb },
format = \zihao { -0 },
bottom-skip = 0 pt plus 1 fil
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/nl/title}
+% \begin{macro}{cover-nl/title}
% 国家图书馆封面标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / title }
+\@@_declare_element:nn { cover-nl / title }
{
content = \@@_cover_title_nl:,
format = \zihao { 1 },
@@ -5388,10 +6639,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/nl/middle}
+% \begin{macro}{cover-nl/middle}
% 国家图书馆封面中部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / middle }
+\@@_declare_element:nn { cover-nl / middle }
{
content = \@@_cover_info_nl:,
format = \zihao { 4 },
@@ -5400,10 +6651,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/nl/bottom}
+% \begin{macro}{cover-nl/bottom}
% 国家图书馆封面底部信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / bottom }
+\@@_declare_element:nn { cover-nl / bottom }
{
content = \@@_cover_bottom_nl:,
bottom-skip = 1 cm,
@@ -5412,10 +6663,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover/nl/date}
+% \begin{macro}{cover-nl/date}
% 国家图书馆封面底部日期实例。
% \begin{macrocode}
-\@@_declare_element:nn { cover / nl / date }
+\@@_declare_element:nn { cover-nl / date }
{
content = \g_@@_info_bottomdate_tl,
format = \kaishu \zihao { 3 }
@@ -5428,12 +6679,14 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_top_nl:
{
- \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_clc_tl \@@_hskip:
- \@@_ulined_center_box:nn { 9 em } { \g_@@_info_clc_tl } \hfill
- \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_secretlv_tl \@@_hskip:
- \@@_ulined_center_box:nn { 9 em } { \g_@@_info_secretlv_tl } \\
- \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_udc_tl \@@_hskip:
- \@@_ulined_center_box:nn { 9 em } { \g_@@_info_udc_tl } \hfill \null
+ \dim_set:Nn \l_@@_tmpa_dim { 3.2 em }
+ \dim_set:Nn \l_@@_tmpb_dim { 9 em }
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { clc } \@@_hskip:
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { clc } \tex_hfill:D
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { secretlv } \@@_hskip:
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { secretlv } \tex_par:D
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { udc } \@@_hskip:
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { udc } \tex_hfill:D \hbox:n { }
}
% \end{macrocode}
% \end{macro}
@@ -5443,11 +6696,12 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_title_nl:
{
- \parbox [ b ] { 15 em } { \@@_uline_title: } \par
+ \parbox [ b ] { 15 em } { \@@_uline_title: } \tex_par:D
\skip_vertical:n { - 0.5 cm }
{ \zihao { 4 } \c_@@_name_subtitle_tl }
\skip_vertical:N \c_zero_skip
- \@@_ulined_center_box:nn { 4.5 em } { \g_@@_info_author_tl }
+ \dim_set:Nn \l_@@_tmpa_dim { 4.5 em }
+ \@@_box_ulined_info:Nn \l_@@_tmpa_dim { author }
\skip_vertical:n { - 0.5 cm }
{ \zihao { 4 } { ( } \c_@@_name_author_tl { ) } }
}
@@ -5461,18 +6715,20 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_info_nl:
{
- \@@_uline_list:nnn { \c_@@_name_supvinfo_tl }
+ \skip_set:Nn \l_@@_tmp_skip { 1 em plus 1 fill }
+ \@@_uline_list:NNn \c_@@_name_supvinfo_tl \l_@@_tmp_skip
{
- \clist_use:Nn \g_@@_info_supv_clist { ~ }
- \clist_use:Nn \g_@@_info_supv_ii_clist { ~ }
+ \clist_use:Nn \g_@@_info_supv_clist { ~ }
+ \clist_use:Nn \g_@@_info_supvii_clist { ~ }
\@@_hskip: \g_@@_info_supvcont_tl
}
- { 1 em plus 1 fill }
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { degree } { degree } { }
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { major_b } { major } { } \\
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { submitdate } { submitdate } { }
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { defenddate } { defenddate } { } \\
- \@@_uline_entry:Nnnn \l_@@_tmpa_dim { confer } { confer } { }
+ \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { degree } { degree } { }
+ \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { majorb } { major } { }
+ \tex_par:D
+ \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { submitdate } { submitdate } { }
+ \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { defenddate } { defenddate } { }
+ \tex_par:D
+ \@@_uline_entry:Nnnn \l_@@_tmpa_dim { confer } { confer } { }
}
% \end{macrocode}
% \end{macro}
@@ -5484,33 +6740,71 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_bottom_nl:
{
+ \dim_set:Nn \l_@@_tmpa_dim { 9 em }
\c_@@_name_chairman_tl \@@_hskip:
- \@@_ulined_center_box:nn { 9 em } { \g_@@_info_chairman_tl } \\
+ \@@_box_ulined_info:Nn \l_@@_tmpa_dim { chairman } \tex_par:D
\c_@@_name_reviewer_tl \@@_hskip:
- \@@_multiline_box:NNNn \l_@@_tmpa_int \l_@@_tmpb_int
- \g_@@_info_reviewer_clist { 9 em }
+ \@@_box_multiline:NNNN \l_@@_tmpa_int \l_@@_tmpb_int
+ \g_@@_info_reviewer_clist \l_@@_tmpa_dim
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subparagraph{原创性声明}
+%
+% \begin{macro}{g/decl/orig/title}
+% 研究生原创性声明标题实例。
+% \begin{macrocode}
+\@@_declare_element:nn { g / decl / orig / title }
+ {
+ content = \c_@@_name_origdecl_tl,
+ format = \c_@@_fmt_chapter_tl,
+ bottom-skip = \c_@@_chapterafter_dim
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{g/decl/orig/text}
+% 研究生原创性声明文本实例。
+% \begin{macrocode}
+\@@_declare_element:nn { g / decl / orig / text }
+ {
+ content = \c_@@_text_origdecl_tl,
+ align = n,
+ bottom-skip = 0 pt plus 1 fil
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{g/decl/orig/sign}
+% 研究生原创性声明签名区实例。
+% \begin{macrocode}
+\@@_declare_element:nn { g / decl / orig / sign }
+ {
+ content = \@@_decl_sign:,
+ align = r
}
% \end{macrocode}
% \end{macro}
%
% \subparagraph{出版授权书}
%
-% \begin{macro}{authdecl/g/title}
-% 出版授权书标题实例。
+% \begin{macro}{g/decl/auth/title}
+% 研究生出版授权书标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { authdecl / g / title }
+\@@_declare_element:nn { g / decl / auth / title }
{
content = \c_@@_name_authdecl_tl,
format = \c_@@_fmt_chapter_tl,
- bottom-skip = 3 cm
+ bottom-skip = \c_@@_chapterafter_dim
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{authdecl/g/text}
-% 出版授权书文本实例。
+% \begin{macro}{g/decl/auth/text}
+% 研究生出版授权书文本实例。
% \begin{macrocode}
-\@@_declare_element:nn { authdecl / g / text }
+\@@_declare_element:nn { g / decl / auth / text }
{
content = \c_@@_text_authdecl_tl,
align = n,
@@ -5519,24 +6813,24 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{authdecl/g/sign}
-% 出版授权书签名区实例。
+% \begin{macro}{g/decl/auth/sign}
+% 研究生出版授权书签名区实例。
% \begin{macrocode}
-\@@_declare_element:nn { authdecl / g / sign }
+\@@_declare_element:nn { g / decl / auth / sign }
{
- content = \@@_authdecl_sign_g:,
+ content = \@@_g_decl_auth_sign:,
align = r,
- bottom-skip = 0pt plus 1 fill
+ bottom-skip = 0 pt plus 1 fill
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{authdecl/g/info}
-% 出版授权书信息表格实例。
+% \begin{macro}{g/decl/auth/info}
+% 研究生出版授权书信息表格实例。
% \begin{macrocode}
-\@@_declare_element:nn { authdecl / g / info }
+\@@_declare_element:nn { g / decl / auth / info }
{
- content = \@@_authdecl_info_g:,
+ content = \@@_g_decl_auth_info:,
format = \zihao { 5 } ,
align = l,
bottom-skip = 2 cm
@@ -5544,10 +6838,10 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{authdecl/g/date}
-% 出版授权书保密信息实例。
+% \begin{macro}{g/decl/auth/date}
+% 研究生出版授权书保密信息实例。
% \begin{macrocode}
-\@@_declare_element:nn { authdecl / g / date }
+\@@_declare_element:nn { g / decl / auth / date }
{
content = \@@_authdecl_secretlv_g:,
format = \zihao { 5 } ,
@@ -5557,11 +6851,12 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \begin{macro}{\@@_degree_checkbox:n}
-% 信息栏的学位复选框。
+% 信息栏的学位复选框。打勾符号对应 |U+2713|。
% \begin{macrocode}
\cs_new_protected:Npn \@@_degree_checkbox:n #1
{
- \int_compare:nNnTF { #1 } { = } { \g_@@_info_degree_int }
+ \int_compare:nNnTF { #1 } { = }
+ { \g_@@_info_degree_int * \g_@@_info_type_int }
{
\makebox [ 0 pt ] [l] { \ensuremath { \mdwhtsquare } }
\hspace { 0.1 em } \ensuremath { \checkmark }
@@ -5571,50 +6866,51 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_authdecl_info_g:}
+% \begin{macro}{\@@_g_decl_auth_info:}
% 信息栏内容。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_authdecl_info_g:
+\cs_new_protected:Npn \@@_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_@@_name_title_c_tl & \g_@@_info_title_tl \\
- \c_@@_name_id_a_tl & \g_@@_info_id_tl &
- \c_@@_name_dept_a_tl & \g_@@_info_dept_tl &
+ \c_@@_name_titlec_tl & \g_@@_info_title_tl \\
+ \c_@@_name_ida_tl & \g_@@_info_id_tl &
+ \c_@@_name_depta_tl & \g_@@_info_dept_tl &
\c_@@_name_year_tl &
\tl_range:Nnn \g_@@_info_submitdate_raw_tl {1} {4} \\
- \c_@@_name_degree_a_tl &
+ \c_@@_name_degreea_tl &
{
\@@_degree_checkbox:n { 2 } 学术学位硕士 \qquad{}
- \@@_degree_checkbox:n { 3 } 专业学位硕士 \\
- \@@_degree_checkbox:n { 4 } 学术学位博士 \qquad{}
- \@@_degree_checkbox:n { 5 } 专业学位博士
+ \@@_degree_checkbox:n { 4 } 专业学位硕士 \\
+ \@@_degree_checkbox:n { 3 } 学术学位博士 \qquad{}
+ \@@_degree_checkbox:n { 6 } 专业学位博士
} \\
\c_@@_name_email_tl & \g_@@_info_email_tl \\
- \c_@@_name_supv_b_tl &
+ \c_@@_name_supvb_tl &
\clist_item:Nn \g_@@_info_supv_clist {1}
- \bool_if:NT \l_@@_second_supv_bool
+ \bool_if:NT \l_@@_second_supvbool
{
\@@_quad:
- \clist_item:Nn \g_@@_info_supv_ii_clist {1}
+ \clist_item:Nn \g_@@_info_supvii_clist {1}
} \\
\end{tblr}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_authdecl_sign_g:}
+% \begin{macro}{\@@_g_decl_auth_sign:}
% 签名区内容。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_authdecl_sign_g:
+\cs_new_protected:Npn \@@_g_decl_auth_sign:
{
- \c_@@_name_authsign_tl \par
- \c_@@_name_blankdate_a_tl
+ \c_@@_name_authsign_tl \tex_par:D
+ \c_@@_name_blankdatea_tl
}
% \end{macrocode}
% \end{macro}
@@ -5624,111 +6920,351 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_authdecl_secretlv_g:
{
- \c_@@_name_secretstatus_tl \par
- \ensuremath { \mdwhtsquare } \c_@@_name_secretfree_tl \par
+ \c_@@_name_secretstatus_tl \tex_par:D
+ \ensuremath { \mdwhtsquare } \c_@@_name_secretfree_tl \tex_par:D
\ensuremath { \mdwhtsquare } \c_@@_name_secretdate_tl
}
-%</definition-g>
+%</def-g>
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{博士后}
+%
+% \begin{macro}{p/cover/name-img}
+% 博士后封面校名图片实例。
+% \begin{macrocode}
+%<*def-p>
+\@@_declare_element:nn { p / cover / name-img }
+ {
+ content = \@@_name:N \c_@@_namewd_dim,
+ bottom-skip = 40 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/cover/report}
+% 博士后封面报告字样实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / cover / report }
+ {
+ content = \c_@@_name_report_tl,
+ format = \zihao { 0 } \sffamily,
+ bottom-skip = 40 pt plus 1.5 fil
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/cover/title}
+% 博士后封面报告标题实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / cover / title }
+ {
+ content =
+ \c_@@_name_title_tl
+ \c_@@_name_colon_tl
+ \g_@@_info_title_tl,
+ format = \zihao { 4 },
+ bottom-skip = 80 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/cover/info}
+% 博士后封面信息栏实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / cover / info }
+ {
+ content =
+ \@@_p_cover_info:NN
+ \c_@@_clabelwd_dim
+ \c_@@_fmt_coverlabel_tl,
+ format = \zihao { -4 },
+ bottom-skip = 0 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_p_cover_info:NN}
+% 博士后封面信息栏。
+% \begin{arguments}
+% \item 名称盒子宽度,|dim| 型变量
+% \item 标签格式
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_p_cover_info:NN #1#2
+ {
+ \clist_set:Nn \l_@@_tmp_clist
+ { author, supvfull, dept, id, major, submitdate }
+% \end{macrocode}
+% 设置信息栏右侧宽度。读取各字段,并将最宽者的宽度赋给
+% \cs{l_@@_tmpb_dim}。
+% \begin{macrocode}
+ \@@_get_max_width:NN \l_@@_tmpb_dim \l_@@_tmp_clist
+% \end{macrocode}
+% 用循环输出各字段。
+% \begin{macrocode}
+ \dim_set_eq:NN \tex_baselineskip:D \c_@@_clineskip_dim
+ \clist_map_inline:Nn \l_@@_tmp_clist
+ {
+ \@@_box_spread_name:NNn #1 #2 { ##1 }
+ \c_@@_name_colon_tl
+ \@@_box_center:Nn \l_@@_tmpb_dim { \@@_info:n { ##1 } }
+ \tex_par:D
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subparagraph{原创性声明和出版授权书}
+%
+% \begin{macro}{p/decl/orig/title}
+% 原创性声明标题实例。^^A 这个实例与研究生的完全一样
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / orig / title }
+ {
+ content = \c_@@_name_origdecl_tl,
+ format = \c_@@_fmt_chapter_tl,
+ bottom-skip = \c_@@_chapterafter_dim
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/decl/orig/text}
+% 原创性声明文本实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / orig / text }
+ {
+ content = \c_@@_text_origdecl_tl,
+ align = n,
+ bottom-skip = 2 cm
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/decl/orig/sign}
+% 原创性声明签名区实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / orig / sign }
+ {
+ content = \@@_p_decl_sign:nn { origsign } { date },
+ bottom-skip = 0 pt plus 1 fill
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/decl/auth/title}
+% 出版授权书标题实例。^^A 这个实例与研究生的完全一样
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / auth / title }
+ {
+ content = \c_@@_name_authdecl_tl,
+ format = \c_@@_fmt_chapter_tl,
+ bottom-skip = \c_@@_chapterafter_dim
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/decl/auth/text}
+% 出版授权书文本实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / auth / text }
+ {
+ content = \c_@@_text_authdecl_tl,
+ align = n,
+ bottom-skip = 2 cm
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{p/decl/auth/sign}
+% 出版授权书签名区实例。
+% \begin{macrocode}
+\@@_declare_element:nn { p / decl / auth / sign }
+ {
+ content =
+ \@@_p_decl_sign:nn { authsign } { date }
+ \@@_p_decl_sign:nn { authsigna } { date },
+ bottom-skip = 0 pt plus 1 fill
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_p_decl_sign:nn}
+% 原创性声明签名区内容。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_p_decl_sign:nn #1#2
+ {
+ \@@_name:n {#1} \c_@@_name_colon_tl \hfill
+ \@@_name:n {#2} \c_@@_name_colon_tl
+ \skip_horizontal:n { 160 pt } \null \@@_vskip:
+ }
+%</def-p>
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{绘制封面}
-% \changes{v0.13}{2021/12/10}{使用 \hologo{LaTeX3} 语法重构本科生封面。}
-% \changes{v0.13}{2021/12/11}{使用 \hologo{LaTeX3} 语法重构研究生封面。}
-% \changes{v0.13}{2021/12/12}{使用 \hologo{LaTeX3} 语法重构国家图书馆封面。}
+% \changes{v0.13}{2021/12/10}{使用 \LaTeX3 语法重构本科生封面。}
+% \changes{v0.13}{2021/12/11}{使用 \LaTeX3 语法重构研究生封面。}
+% \changes{v0.13}{2021/12/12}{使用 \LaTeX3 语法重构国家图书馆封面。}
% \changes{v0.15}{2022/01/25}{将封面页面封装为对象。}
%
% 定义封面页面的具体配置参数。
%
-% \begin{macro}{cover-ug-default}
+% \begin{macro}{cover-u}
% 默认本科生封面实例。
% \begin{macrocode}
-%<*definition-ug>
-\@@_declare_page:nn { cover-ug-default }
+%<*def-u>
+\@@_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
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{origdecl-u}
+% 默认诚信承诺书实例。
+% \begin{macrocode}
+\@@_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
}
-%</definition-ug>
+%</def-u>
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover-g-front-default}
+% \begin{macro}{cover-g-front}
% 默认研究生普通封面正面实例。
% \begin{macrocode}
-%<*definition-g>
-\@@_declare_page:nn { cover-g-front-default }
+%<*def-g>
+\@@_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
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover-g-back-default}
+% \begin{macro}{cover-g-back}
% 默认研究生普通封面背面实例。
% \begin{macrocode}
-\@@_declare_page:nn { cover-g-back-default }
+\@@_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
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover-g-en-default}
+% \begin{macro}{cover-g-en}
% 默认研究生英文封面实例。
% \begin{macrocode}
-\@@_declare_page:nn { cover-g-en-default }
+\@@_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
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{cover-nl-default}
+% \begin{macro}{cover-nl}
% 默认国家图书馆封面实例。
% \begin{macrocode}
-\@@_declare_page:nn { cover-nl-default }
+\@@_declare_page:nn { cover-nl }
{
element = { top, name, title, middle, bottom, date },
- prefix = cover / nl /,
+ prefix = cover-nl /,
format = \kaishu
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{authdecl-g-default}
+% \begin{macro}{origdecl-g}
+% 默认原创性声明实例。
+% \begin{macrocode}
+\@@_declare_page:nn { origdecl-g }
+ {
+ element = { title, text, sign },
+ prefix = g / decl / orig /,
+ top-skip = \c_@@_chapterbefore_dim,
+ bottom-skip = 0 pt plus 1 fil,
+ bm-text = \c_@@_name_origdecl_tl,
+ bm-name = origdecl
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{authdecl-g}
% 默认出版授权书实例。
% \begin{macrocode}
-\@@_declare_page:nn { authdecl-g-default }
+\@@_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_@@_chapterbefore_dim,
+ bottom-skip = 0.5 cm plus 1.5 fill,
+ bm-text = \c_@@_name_authdecl_tl,
+ bm-name = authdecl,
+ bookmark = toc
}
-%</definition-g>
+%</def-g>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{cover-p}
+% 默认博士后封面实例。
+% \begin{macrocode}
+%<*def-p>
+\@@_declare_page:nn { cover-p }
+ {
+ element = { name-img, report, title, info },
+ prefix = p / cover /,
+ format = \bfseries,
+ top-skip = 100 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{authdecl-p}
+% 默认出版授权书实例。
+% \begin{macrocode}
+\@@_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_@@_chapterbefore_dim,
+ bottom-skip = 0 pt
+ }
+%</def-p>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_make_cover:}
% 生成本科生或研究生的普通封面。
% \begin{macrocode}
-%<*(definition-ug|definition-g)>
+%<*(def-u|def-g|def-p)>
\cs_new_protected:Npn \@@_make_cover:
{
-%<definition-ug> \UseInstance { nju } { cover-ug-default }
-%<definition-g> \clist_map_inline:nn { front, back, en }
-%<definition-g> { \UseInstance { nju } { cover-g- ##1 -default } }
+%<def-u> \UseInstance { nju } { cover-u }
+%<def-g> \clist_map_inline:nn { front, back, en }
+%<def-g> { \UseInstance { nju } { cover-g- ##1 } }
+%<def-p> \UseInstance { nju } { cover-p }
}
% \end{macrocode}
% \end{macro}
@@ -5736,97 +7272,86 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\@@_make_cover_nl:}
% 生成研究生的国家图书馆封面。
% \begin{macrocode}
-%<definition-g>\cs_new_protected:Npn \@@_make_cover_nl:
-%<definition-g> { \UseInstance { nju } { cover-nl-default } }
+%<def-g>\cs_new_protected:Npn \@@_make_cover_nl:
+%<def-g> { \UseInstance { nju } { cover-nl } }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_make_origdecl: }
+% \begin{macro}{\@@_make_decl_i:}
% \changes{v0.13}{2021/12/15}{加入本科生的诚信承诺书。}
% \changes{v0.19}{2022/05/22}{跟进新版本科生诚信承诺书样式。}
-% ^^A TODO: 使用 xtemplate 重构
+% 位于封面后的承诺书页面。
% 生成本科生的诚信承诺书或研究生的学位论文原创性声明。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_make_origdecl:
+\cs_new_protected:Npn \@@_make_decl_i:
{
-%<definition-ug> \cleardoublepage
-%<definition-g> \chapter* { \c_@@_name_origdecl_tl }
- \thispagestyle { empty }
-%<*definition-ug>
- \begin{center}
- \njuemblem{2cm}{!}\\
- {\zihao{-1}\sffamily \c__nju_name_origdecl_tl }
- \end{center}
- \zihao{-3}
- \hspace{2em}
-%</definition-ug>
- \c_@@_text_origdecl_tl
- \vfil
- \begin{flushright}
-%<definition-ug> \clist_map_inline:nn { origsign, id, origdate }
-%<definition-g> \clist_map_inline:nn { origsign, origdate }
- { \@@_vskip: \@@_name:n { ##1 } : \@@_uline:n { 7 em } }
- \end{flushright}
- \vfil
-%<definition-ug> \normalfont \normalsize
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@_make_authdecl: }
+ \cleardoublepage
+%<def-u> \UseInstance { nju } { origdecl-u }
+%<def-g> \UseInstance { nju } { origdecl-g }
+%<def-p> \UseInstance { nju } { authdecl-p }
+ \cleardoublepage
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_make_decl_ii:}
% \changes{v0.17}{2022/04/04}{加入研究生的学位论文出版授权书。}
-% 生成研究生的学位论文出版授权书。
+% 位于封底的承诺书页面。生成研究生的学位论文出版授权书。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_make_authdecl:
+\cs_new_protected:Npn \@@_make_decl_ii:
{
-%<definition-ug> \prg_do_nothing:
-%<definition-g> \UseInstance { nju } { authdecl-g-default }
+%<*def-g>
+ \AtEndEnvironment { document }
+ {
+ \cleardoublepage
+ \UseInstance { nju } { authdecl-g }
+ \cleardoublepage
+ }
+%</def-g>
}
-%</(definition-ug|definition-g)>
+%</(def-u|def-g|def-p)>
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{用户接口}
%
-% \begin{macro}{\@@_new_img_cmd:nn,\@@_new_img_cmd:nV}
+% \begin{macro}{\@@_new_img_cmd:nn}
% 用于定义插入图片命令的辅助函数。
% \begin{macrocode}
%<*class>
\cs_new_protected:Npn \@@_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 \@@_new_img_cmd:nn { nV }
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.0}{2022/08/01}{外置图片接口更名为 \opt{image} 类。}
% \begin{macrocode}
-\keys_define:nn { nju / style }
+\keys_define:nn { nju / image }
{
% \end{macrocode}
-% \begin{macro}{style/emblem-img,\njuemblem}
+% \begin{macro}{image/nju-emblem,\njuemblem}
% \changes{v0.14}{2021/12/23}{提供选择外置校徽图片的接口。}
% 校徽图片路径。
% \begin{macrocode}
- emblem-img .code:n =
- { \@@_new_img_cmd:nV { njuemblem } \l_keys_value_tl },
+ nju-emblem .code:n = { \@@_new_img_cmd:nn { emblem } {#1} },
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{style/name-img,\njuname}
+% \begin{macro}{image/nju-name,\njuname}
% \changes{v0.14}{2021/12/23}{提供选择外置校名图片的接口。}
% 校名图片路径。
% \begin{macrocode}
- name-img .code:n =
- { \@@_new_img_cmd:nV { njuname } \l_keys_value_tl }
+ nju-name .code:n = { \@@_new_img_cmd:nn { name } {#1} }
}
% \end{macrocode}
% \end{macro}
%
% \changes{v0.16}{2022/02/22}{不再默认载入 \pkg{njuvisual}。}
-% 检查 \cs{njuemblem} 和 \cs{njuname} 命令是否有定义。
+% 检查 \tn{njuemblem} 和 \tn{njuname} 命令是否有定义。
% \begin{macrocode}
\msg_new:nnn { njuthesis } { missing-image }
{
@@ -5851,10 +7376,10 @@ To produce the documentation run the original source files ending with
\msg_warning:nn { njuthesis } { missing-image }
\RequirePackage { njuvisual }
}
- \bool_if:NT \g_@@_blind_bool
+ \bool_if:NT \g_@@_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 } { }
}
}
% \end{macrocode}
@@ -5863,19 +7388,19 @@ To produce the documentation run the original source files ending with
% \changes{v0.12}{2021/12/01}{仅会生成国家图书馆封面或者普通封面之一。}
% \changes{v0.13}{2021/12/12}{重新绘制封面。}
% \changes{v0.13}{2021/12/15}{草稿模式下不绘制封面。}
-% 重定义 \cs{maketitle} 以生成封面。
+% 重定义 \tn{maketitle} 以生成封面。
% 在草稿模式下,封面绘制将被禁用,有助于提升编译速度。
% \begin{macrocode}
\RenewDocumentCommand \maketitle { }
{
- \bool_if:NF \g_@@_draft_bool
+ \bool_if:NF \g_@@_opt_draft_bool
{
\pagenumbering { gobble }
% \end{macrocode}
% 如果在研究生模板中选择了 \opt{nlcover},就生成用于申请学位的国家图书馆封面,
% 反之生成普通封面。
% \begin{macrocode}
- \bool_if:NTF \g_@@_nlcover_bool
+ \bool_if:NTF \g_@@_opt_nlcover_bool
{ \@@_make_cover_nl: }
{ \@@_make_cover: }
}
@@ -5887,17 +7412,12 @@ To produce the documentation run the original source files ending with
% 如果在选择了 \opt{decl-page},就生成本科生的诚信承诺书,
% 或研究生的原创性声明和出版授权书。
% \begin{macrocode}
- \bool_if:NF \g_@@_draft_bool
+ \bool_if:NF \g_@@_opt_draft_bool
{
- \bool_if:NT \g_@@_decl_bool
+ \bool_if:NT \g_@@_opt_decl_bool
{
- \@@_make_origdecl:
- \AtEndEnvironment { document }
- {
- \cleardoublepage
- \@@_make_authdecl:
- \cleardoublepage
- }
+ \@@_make_decl_i:
+ \@@_make_decl_ii:
}
}
% \end{macrocode}
@@ -5921,40 +7441,46 @@ To produce the documentation run the original source files ending with
% \begin{macro}{abstract/title}
% 中文摘要标题实例。
% \begin{macrocode}
-%<*(definition-ug|definition-g)>
+%<*(def-u|def-g|def-p)>
\@@_declare_element:nn { abstract / title }
{
- content = \@@_abs_title:V \c_@@_name_abstracttitle_tl,
- format = \bfseries \kaishu \zihao { -2 },
- bottom-skip = 1.2 cm
+%<def-u|def-g> content = \@@_abs_title:N \c_@@_name_abstracttitle_tl,
+%<def-p> content = \g_@@_info_title_tl,
+%<def-u|def-g> format = \bfseries \kaishu \zihao { -2 },
+%<def-p> format = \bfseries,
+ bottom-skip = 20 pt
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{abstract/info}
-% 中文摘要信息栏实例。
+% \begin{macro}{abstract/en/title}
+% 英文摘要标题实例。
% \begin{macrocode}
-\@@_declare_element:nn { abstract / info }
+\@@_declare_element:nn { abstract / en / title }
{
-%<definition-ug> content = \@@_abs_info_ug:nn { } { : },
-%<definition-g> content = \@@_abs_info_g:n { : },
-%<definition-ug> format = \zihao { -4 } \kaishu,
-%<definition-g> format = \zihao { 4 } \kaishu,
-%<definition-ug> bottom-skip = 1 cm,
-%<definition-g> bottom-skip = 2 cm,
- align = l
+%<def-u|def-g> content = \@@_abs_title:N \c_@@_name_abstracttitle_en_tl,
+%<def-p> content = \g_@@_info_title_en_tl,
+%<def-u|def-g> format = \bfseries \kaishu \zihao { -2 },
+%<def-p> format = \bfseries,
+ bottom-skip = 20 pt
}
+%</(def-u|def-g|def-p)>
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{abstract/en/title}
-% 英文摘要标题实例。
+% \begin{macro}{abstract/info}
+% 中文摘要信息栏实例。
% \begin{macrocode}
-\@@_declare_element:nn { abstract / en / title }
+%<*(def-u|def-g)>
+\@@_declare_element:nn { abstract / info }
{
- content = \@@_abs_title:V \c_@@_name_abstracttitle_en_tl,
- format = \bfseries \kaishu \zihao { -2 },
- bottom-skip = 1.2 cm
+%<def-u> content = \@@_abs_info_u:,
+%<def-g> content = \@@_abs_info_g:,
+%<def-u> format = \zihao { -4 } \kaishu,
+%<def-g> format = \zihao { 4 } \kaishu,
+%<def-u> bottom-skip = 15 pt,
+%<def-g> bottom-skip = 30 pt,
+ align = l
}
% \end{macrocode}
% \end{macro}
@@ -5964,22 +7490,60 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\@@_declare_element:nn { abstract / en / info }
{
-%<definition-ug> content = \@@_abs_info_ug:nn { _en } { :~ },
-%<definition-g> content = \@@_abs_info_en_g:n { :~ },
-%<definition-ug> format = \zihao { -4 },
-%<definition-g> format = \zihao { 4 },
-%<definition-ug> bottom-skip = 1 cm,
-%<definition-g> bottom-skip = 2 cm,
+%<def-u> content = \@@_abs_info_en_u:,
+%<def-g> content = \@@_abs_info_en_g:,
+%<def-u> format = \zihao { -4 },
+%<def-g> format = \zihao { 4 },
+%<def-u> bottom-skip = 15 pt,
+%<def-g> bottom-skip = 30 pt,
align = l
}
-%</(definition-ug|definition-g)>
+%</(def-u|def-g)>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{abstract/mark}
+% 英文摘要标签实例。
+% \begin{macrocode}
+%<*(def-g|def-p)>
+\@@_declare_element:nn { abstract / mark }
+ {
+ content = \c_@@_name_abstractb_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 15 pt
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{abstract/en/mark}
+% 英文摘要标签实例。
+% \begin{macrocode}
+\@@_declare_element:nn { abstract / en / mark }
+ {
+ content = \c_@@_name_abstractb_en_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 15 pt
+ }
+%</(def-g|def-p)>
% \end{macrocode}
% \end{macro}
%
% \paragraph{本科生}
-% \changes{v0.13}{2021/12/12}{使用 \hologo{LaTeX3} 语法重构本科生摘要。}
+% \changes{v0.13}{2021/12/12}{使用 \LaTeX3 语法重构本科生摘要。}
+% \changes{v1.0}{2022/06/16}{统一本科生摘要页的标签格式。}
%
-% \begin{macro}{\@@_abs_info_ug:nn}
+% \begin{macro}{\@@_abs_info_u:,\@@_abs_info_en_u:}
+% 封装好的本科生摘要信息栏。
+% \begin{macrocode}
+%<*def-u>
+\cs_new_protected:Npn \@@_abs_info_u:
+ { \@@_abs_info_u:nn { } { \c_@@_name_colon_tl } }
+\cs_new_protected:Npn \@@_abs_info_en_u:
+ { \@@_abs_info_u:nn { _en } { \c_@@_name_colon_en_tl } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_abs_info_u:nn}
% 绘制本科生摘要信息栏。
% \begin{arguments}
% \item 语言,空置为中文,|_en| 为英文
@@ -5987,119 +7551,89 @@ To produce the documentation run the original source files ending with
% \end{arguments}
% 本科生摘要页面不含下划线,因而不用确定文本宽度,绘制命令较为简单。
% \begin{macrocode}
-%<*definition-ug>
-\cs_new_protected:Npn \@@_abs_info_ug:nn #1#2
+\cs_new_protected:Npn \@@_abs_info_u:nn #1#2
{
% \end{macrocode}
-% 确定标题类型。
-% \begin{macrocode}
- \tl_if_blank:eTF { #1 }
- { \c_@@_name_title_tl }
- { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
- #2 \tl_use:c { g_@@_info_title #1 _tl } \\
-% \end{macrocode}
% 由于作者姓名使用的字样发生了变动,这里进行替换以便嵌入循环。
% \begin{macrocode}
- \tl_set_eq:NN \c_@@_name_author_tl \c_@@_name_author_a_tl
+ \tl_set_eq:NN \c_@@_name_author_tl \c_@@_name_authora_tl
% \end{macrocode}
% 使用循环输出院系、专业、作者、导师信息。
% \begin{macrocode}
- \clist_map_inline:nn { dept, major, author, supvfull }
- { \@@_name:n { ##1 #1 } #2 \@@_info:n { ##1 #1 } \\ }
- \@@_name:n { abstract #1 } #2
+ \clist_map_inline:nn { title, dept, major, author, supvfull }
+ {
+ \@@_name:nn { abslabel #1 } { ##1 #1 } #2
+ \@@_info:n { ##1 #1 } \\
+ }
+ \@@_name:nn { abslabel #1 } { abstract #1 } #2
}
-%</definition-ug>
+%</def-u>
% \end{macrocode}
% \end{macro}
%
% \paragraph{研究生}
-% \changes{v0.13}{2021/12/12}{使用 \hologo{LaTeX3} 语法重构研究生摘要。}
+% \changes{v0.13}{2021/12/12}{使用 \LaTeX3 语法重构研究生摘要。}
%
-% \begin{macro}{abstract/mark}
-% 英文摘要标题实例。
+% \begin{macro}{\@@_abs_info_g:,\@@_abs_info_en_g:}
+% 封装好的研究生摘要信息栏。
% \begin{macrocode}
-%<*definition-g>
-\@@_declare_element:nn { abstract / mark }
- {
- content = \c_@@_name_abstract_b_tl,
- format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
- }
+%<*def-g>
+\cs_new_protected:Npn \@@_abs_info_g:
+ { \@@_abs_info_g:N \c_@@_name_colon_tl }
+\cs_new_protected:Npn \@@_abs_info_en_g:
+ { \@@_abs_info_en_g:N \c_@@_name_colon_en_tl }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{abstract/en/mark}
-% 英文摘要标题实例。
-% \begin{macrocode}
-\@@_declare_element:nn { abstract / en / mark }
- {
- content = \c_@@_name_abstract_b_en_tl,
- format = \sffamily \zihao { -3 },
- bottom-skip = 1 cm
- }
-% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\@@_abs_info_g:n}
+% \begin{macro}{\@@_abs_info_g:N}
% 绘制研究生中文摘要信息栏。
% \begin{arguments}
% \item 分隔符
% \end{arguments}
-% 研究生中文摘要页包括下划线以及若干特殊的对齐方式,实现方式较为繁琐。使用 \cs{@@_full_uline:NV} 确定内容宽度后,调用 \cs{@@_uline:n} 或 \cs{@@_ulined_center_box:nn} 命令以绘制横穿页面的下划线。前两行为标题。
+% 研究生中文摘要页包括下划线以及若干特殊的对齐方式,实现方式较为繁琐。
+% 使用 \cs{@@_full_uline:NV} 确定内容宽度后,调用 \cs{@@_uline:n} 或
+% \cs{@@_ulined_center_box:nn} 命令以绘制横穿页面的下划线。前两行为标题。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_abs_info_g:n #1
+\cs_new_protected:Npn \@@_abs_info_g:N #1
{
- \@@_uline_list:xnn
- {
- \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int }
- \c_@@_name_title_a_tl #1
- }
- { \g_@@_info_title_tl } { \g_@@_abs_title_left_skip }
+ \@@_uline_list:NNx \g_@@_info_title_tl \g_@@_abs_title_left_skip
+ { \c_@@_name_titlea_tl #1 }
% \end{macrocode}
% 专业、年级、姓名。
% \begin{macrocode}
- \@@_full_uline:NV \l_@@_tmpa_dim
+ \@@_full_uline:Nx \l_@@_tmp_skip
{
- \@@_ulined_center_box:nn { 11 em } { \g_@@_info_major_tl }
- \c_@@_name_major_a_tl
- \@@_ulined_center_box:nn { 4 em } { \g_@@_info_grade_tl }
- \c_@@_name_grade_tl \c_@@_name_author_a_tl #1
+ \dim_set:Nn \l_@@_tmpa_dim { 11 em }
+ \dim_set:Nn \l_@@_tmpb_dim { 4 em }
+ \@@_box_ulined_info:Nn \l_@@_tmpa_dim { major }
+ \c_@@_name_majora_tl
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { grade }
+ \c_@@_name_grade_tl \c_@@_name_authora_tl #1
}
- \@@_ulined_center_box:nn { \l_@@_tmpa_dim }
- { \g_@@_info_author_tl } \\
+ \@@_box_ulined_info:Nn \l_@@_tmp_skip { author } \tex_par:D
% \end{macrocode}
% 导师姓名、职称。
% \begin{macrocode}
- \@@_full_uline:NV \l_@@_tmpa_dim
- { \c_@@_name_supv_a_tl #1 }
- \@@_ulined_center_box:nn { \l_@@_tmpa_dim }
- { \g_@@_info_supvfull_tl }
+ \@@_full_uline:Nx \l_@@_tmpa_dim { \c_@@_name_supva_tl #1 }
+ \@@_box_ulined_info:Nn \l_@@_tmpa_dim { supvfull }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_abs_info_en_g:n}
+% \begin{macro}{\@@_abs_info_en_g:N}
+% \changes{v1.0}{2022/07/01}{移除研究生英文摘要的下划线。}
% 绘制研究生英文摘要信息栏。
% \begin{arguments}
% \item 分隔符
% \end{arguments}
-% 前两行为标题。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_abs_info_en_g:n #1
+\cs_new_protected:Npn \@@_abs_info_en_g:N #1
{
- \@@_uline_list:xnn { \g_@@_info_type_en_tl #1 }
- { \g_@@_info_title_en_tl } { \g_@@_abs_title_left_skip }
-% \end{macrocode}
-% 使用循环输出专业、姓名、导师。注意这里将 |\\| 放置在前部,
-% 以避免末尾生成多余的换行符产生 |Underfull \vbox| 信息。
-% \begin{macrocode}
- \clist_map_inline:nn { major, author, supvfull }
- {
- \@@_uline_entry:Nnnn \l_@@_tmpa_dim
- { ##1 _en } { ##1 _en } { #1 } \par
- }
+ \clist_map_inline:nn { title, major, author, supvfull }
+ { \@@_name:n { ##1 _en } #1 \@@_info:n { ##1 _en } \\ }
}
-%</definition-g>
+%</def-g>
% \end{macrocode}
% \end{macro}
%
@@ -6118,9 +7652,11 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_print_keywords:nn #1#2
{
\tl_set:Nv \l_@@_tmpa_tl { c_@@_name_keywords #1 _tl }
- \@@_get_text_width:NV \l_@@_tmpa_dim \l_@@_tmpa_tl
- \dim_add:Nn \l_@@_tmpa_dim { 1 em }
- \exp_args:NNv \tl_put_right:Nn \l_@@_tmpa_tl { c_@@_name_comma #1 _tl }
+ \exp_args:NNv \tl_put_left:Nn
+ \l_@@_tmpa_tl { c_@@_fmt_abslabel #1 _tl }
+ \exp_args:NNv \tl_put_right:Nn
+ \l_@@_tmpa_tl { c_@@_name_colon #1 _tl }
+ \@@_get_width:NV \l_@@_tmpa_dim \l_@@_tmpa_tl
% \end{macrocode}
% 关键词列表的悬挂缩进样式由 \tn{list} 环境产生。
% \begin{macrocode}
@@ -6134,7 +7670,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 使用粗体作为标签样式。
% \begin{macrocode}
- \cs_set_eq:NN \makelabel \textbf
+ \__nju_cs_clear:N \makelabel
}
\item \clist_use:cn { g_@@_info_keywords #1 _clist } { #2 }
\endlist
@@ -6150,20 +7686,20 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\@@_make_abstract:,\@@_make_abstract_en:}
% 绘制摘要页面。
% \begin{macrocode}
-%<*(definition-ug|definition-g)>
+%<*(def-u|def-g|def-p)>
\cs_new_protected:Npn \@@_make_abstract:
{
\UseInstance { nju } { abstract / title }
- \UseInstance { nju } { abstract / info }
-%<definition-g> \UseInstance { nju } { abstract / mark }
+%<def-u|def-g> \UseInstance { nju } { abstract / info }
+%<def-g|def-p> \UseInstance { nju } { abstract / mark }
}
\cs_new_protected:Npn \@@_make_abstract_en:
{
\UseInstance { nju } { abstract / en / title }
- \UseInstance { nju } { abstract / en / info }
-%<definition-g> \UseInstance { nju } { abstract / en / mark }
+%<def-u|def-g> \UseInstance { nju } { abstract / en / info }
+%<def-g|def-p> \UseInstance { nju } { abstract / en / mark }
}
-%</(definition-ug|definition-g)>
+%</(def-u|def-g|def-p)>
% \end{macrocode}
% \end{macro}
%
@@ -6178,40 +7714,41 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.0}{2022/08/01}{整合摘要设置项。}
% \begin{macrocode}
-\keys_define:nn { nju / style }
+\keys_define:nn { nju / abstract }
{
% \end{macrocode}
-% \begin{macro}{style/abstract-in-toc}
+% \begin{macro}{abstract/toc-entry}
% \changes{v0.15}{2022/02/04}{可选择摘要是否出现在目录中。}
% 是否将摘要添加到目录。
% \begin{macrocode}
- abstract-in-toc .bool_gset:N = \g_@@_abs_in_toc_bool,
- abstract-in-toc .initial:n = true,
+ toc-entry .bool_set:N = \g_@@_abs_showentry_bool,
+ toc-entry .initial:n = true,
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{style/abstract-title}
+% \begin{macro}{style/title-style}
% \changes{v0.16}{2022/03/26}{可选择研究生摘要标题样式。}
% 选择摘要样式,默认为 \opt{strict}。
% \begin{macrocode}
- abstract-title .choice:,
- abstract-title / strict .code:n =
+ title-style .choice:,
+ title-style / strict .code:n =
{
- \bool_gset_true:N \g_@@_strict_abs_title_bool
- \skip_gset:Nn \g_@@_abs_title_left_skip { 1 em }
+ \bool_set_true:N \g_@@_abs_title_strict_bool
+ \skip_set:Nn \g_@@_abs_title_left_skip { .5 em }
},
- abstract-title / centered .code:n =
+ title-style / centered .code:n =
{
- \bool_gset_true:N \g_@@_strict_abs_title_bool
- \skip_gset:Nn \g_@@_abs_title_left_skip { 0 pt plus 1 fill }
+ \bool_set_true:N \g_@@_abs_title_strict_bool
+ \skip_set:Nn \g_@@_abs_title_left_skip { .5 em plus 1 fill }
},
- abstract-title / natural .code:n =
+ title-style / natural .code:n =
{
- \bool_gset_false:N \g_@@_strict_abs_title_bool
- \skip_gset:Nn \g_@@_abs_title_left_skip { 0 pt plus 1 fill }
+ \bool_set_false:N \g_@@_abs_title_strict_bool
+ \skip_set:Nn \g_@@_abs_title_left_skip { .5 em plus 1 fill }
},
- abstract-title .initial:n = strict
+ title-style .initial:n = strict
}
% \end{macrocode}
% \end{macro}
@@ -6224,7 +7761,7 @@ To produce the documentation run the original source files ending with
{
\cleardoublepage
\thispagestyle { plain }
- \@@_abs_bookmark:Vn \c_@@_name_abstract_a_tl { abstract }
+ \@@_abs_bookmark:Vn \c_@@_name_abstracta_tl { abstract }
\@@_make_abstract:
\group_begin: \kaishu \zihao { -4 } #1
}
@@ -6239,7 +7776,7 @@ To produce the documentation run the original source files ending with
{
\cleardoublepage
\thispagestyle { plain }
- \@@_abs_bookmark:Vn \c_@@_name_abstract_a_en_tl { abstract-en }
+ \@@_abs_bookmark:Vn \c_@@_name_abstracta_en_tl { abstract-en }
\@@_make_abstract_en:
\group_begin: \zihao { -4 } #1
}
@@ -6317,14 +7854,14 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\@@_notation_label:n}
% 左对齐的标签格式,用于符号表。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_notation_label:n #1 { #1 \hfil }
+\cs_new_protected:Npn \@@_notation_label:n #1 { #1 \tex_hfil:D }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_make_notation:nn}
% 生成符号表。由于符号表只有符号和说明两列,相比于 \env{longtable} 环境,
% \env{description} 环境的语法更为简洁直观,且说明文字可以换行,因而此处使用
-% \hologo{LaTeX2e} 的列表环境进行封装,定义和语法参见 \file{source2e.pdf} 中的
+% \LaTeXe 的列表环境进行封装,定义和语法参见 \file{source2e.pdf} 中的
% File I \quad ltlists.dtx 一章。
% \begin{macrocode}
\cs_new_protected:Npn \@@_make_notation:nn #1#2
@@ -6344,7 +7881,7 @@ To produce the documentation run the original source files ending with
% 右侧说明文字区域的宽度无法直接指定,而是靠计算左右边距 \tn{leftmargin} 和
% \tn{rightmargin} 得到的。
% \begin{macrocode}
- \leftmargin .5\l_@@_tmpa_dim
+ \leftmargin .5\l_@@_tmpa_dim
\rightmargin \leftmargin
\advance \leftmargin #2
\cs_set_eq:NN \makelabel \@@_notation_label:n
@@ -6378,7 +7915,7 @@ To produce the documentation run the original source files ending with
\chapter * { \c_@@_name_notation_tl }
\@@_make_notation:nn { #1 } { #2 }
}
- { \endlist }
+ { \endlist \cleardoublepage }
%</class>
% \end{macrocode}
% \end{environment}
@@ -6393,29 +7930,124 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{名称}
% \label{subsubsec:constant-name}
-% ^^A TODO: 将所有名称合并后使用 guard 进行本科生/研究生的区分
-% ^^A TODO: supv -> supvi, supv_ii -> supvii
+%
+% \changes{v0.19}{2022/05/22}{更正研究生普通封面专业字样。}
+% \changes{v0.19}{2022/05/22}{更正国家图书馆封面学位论文字样。}
+% \changes{v1.0}{2022/06/19}{合并名称常量的定义位置。}
+% \changes{v1.0}{2022/06/19}{更名:supv_ii -> supvii,supv_ttl -> supvtitle。}
%
% 由于同一名称在不同位置具有不同变体,本模板使用字母后缀名进行了区分,
% 并在易混淆处添加了注释。
%
% 通用默认名称。注意空格是忽略掉的。
% \begin{macrocode}
-%<*(definition-ug|definition-g)>
+%<*(def-u|def-g|def-p)>
\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 } { 职称 }
+ { acknowledgement } { 致 \qquad{} 谢 },
+%<def-g> { apply } {(申请 \g_@@_info_degree_tl 学位)},
+%<def-g> { auth decl } { 学位论文出版授权书 },
+%<def-p> { auth decl } { 研究报告使用授权书 },
+%<def-p> { author } { 作者 },
+% \end{macrocode}
+% 用于摘要的作者名称字样
+% \begin{macrocode}
+%<def-u> { author a } { 本科生姓名 },
+%<def-g> { author a } { \g_@@_info_type_tl 生姓名 },
+%<def-g> { auth sign } { 作者签名:\njuline{\hspace{6em}} },
+%<def-p> { auth sign } { 本人签名 },
+%<def-p> { auth sign a } { 导师签名 },
+%<def-g> { chairman } { 答辩委员会主席: },
+%<def-g> { clc } { 分类号 },
+%<def-g> { confer } { 学位授予单位和日期 },
+ { date } { 日期 },
+%<def-g> { defend date } { 论文答辩日期 },
+%<def-g> { degree } { 申请学位级别 },
+% \end{macrocode}
+% 用于出版授权书的学位名称字样
+% \begin{macrocode}
+%<def-g> { degree a } { 论文级别 },
+%<def-p> { dept } { 系别 },
+% \end{macrocode}
+% 用于出版授权书的院系名称字样
+% \begin{macrocode}
+%<def-g> { dept a } { 所在院系 },
+%<def-g> { email } { 作者 Email },
+%<def-g> { field } { 研究方向 },
+%<def-u> { grade } { 年级 },
+%<def-g> { grade } { 级 },
+%<def-u|def-g> { id } { 学号 },
+%<def-p> { id } { 工号 },
+% \end{macrocode}
+% 用于出版授权书的学号名称字样
+% \begin{macrocode}
+%<def-g> { id a } { 研究生学号 },
+ { listoffigures } { 插图目录 },
+ { listoftables } { 表格目录 },
+%<def-p> { major } { 学科专业 },
+% \end{macrocode}
+% 用于摘要的专业名称字样
+% \begin{macrocode}
+%<def-g> { major a } { 专业 },
+% \end{macrocode}
+% 用于国家图书馆封面的专业名称字样
+% \begin{macrocode}
+%<def-g> { major b } { 专业名称 },
+ { notation } { 符号表 },
+%<def-u> { orig decl }
+%<def-u> { 南京大学本科毕业论文(设计) \\ 诚信承诺书 },
+%<def-g> { orig decl } { 南京大学学位论文原创性声明 },
+%<def-p> { orig decl } { 研究报告原创性声明 },
+%<def-u> { orig sign } { 作者签名 },
+%<def-g> { orig sign } { 研究生签名 },
+%<def-p> { orig sign } { 研究报告作者签名 },
+ { paper list } { 发表文章目录 },
+ { pdf creator } { LaTeX~ with~ njuthesis~ class },
+ { preface } { 前 \qquad{} 言 },
+%<def-p> { report } { 博士后研究工作报告 },
+%<def-g> { reviewer } { 评阅人: },
+%<def-g> { secret lv } { 密级 },
+%<def-g> { secret status } { 论文涉密情况: },
+%<def-g> { secret free } { 不保密 },
+%<def-g> { secret date }
+%<def-g> { 保密,保密期( \c_@@_name_blankdatea_tl 至
+%<def-g> \c_@@_name_blankdatea_tl ) },
+%<def-g> { sign } { (签字) },
+%<def-u> { submit date } { 提交日期 },
+%<def-g> { submit date } { 论文提交日期 },
+%<def-p> { submit date } { 完成日期 },
+%<def-g> { subtitle } { (题名和副题名) },
+%<def-u> { supv } { 指导教师 },
+%<def-g> { supv } { 导师 },
+%<def-p> { supv full } { 合作导师 },
+% \end{macrocode}
+% 用于摘要的导师名称字样
+% \begin{macrocode}
+%<def-g> { supv a } { 指导教师(姓名、职称) },
+% \end{macrocode}
+% 用于出版授权书的导师名称字样
+% \begin{macrocode}
+%<def-g> { supv b } { 导师姓名 },
+%<def-g> { supv info }
+%<def-g> { 指导教师姓名、职务、职称、学位、单位名称及地址 },
+ { supv ii } { 第二导师 },
+ { supv title } { 职称 },
+ { tableofcontents } { 目 \qquad{} 录 },
+%<def-p> { title } { 报告题目 },
+% \end{macrocode}
+% 用于摘要的标题名称字样
+% \begin{macrocode}
+%<def-g> { title a } { 毕业论文题目 },
+% \end{macrocode}
+% 用于国家图书馆封面的标题名称字样
+% \begin{macrocode}
+%<def-g> { title b } { 学位论文 },
+% \end{macrocode}
+% 用于出版授权书的标题名称字样
+% \begin{macrocode}
+%<def-g> { title c } { 论文题名 },
+%<def-g> { udc } { U D C },
+%<def-g> { year } { 学位年度 }
}
{ \@@_define_name:nn #1 }
% \end{macrocode}
@@ -6424,144 +8056,52 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\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 }
- }
- { \@@_define_name:nnn #1 }
-% \end{macrocode}
-%
-% 本科生模板默认名称。
-% \begin{macrocode}
-%<*definition-ug>
-\clist_map_inline:nn
- {
- % 用于摘要的作者名称字样
- { author_a } { 本科生姓名 },
- { grade } { 年级 },
- { origdecl } { \c_@@_name_nju_tl
- 本科毕业论文(设计) \\ 诚信承诺书 },
- { origsign } { 作者签名 },
- { submitdate } { 提交日期 },
- { supv } { 指导教师 },
- { title } { 题目 },
- { type } { 本科生毕业论文(设计、作品) },
- { ug } { 本科 }
- }
- { \@@_define_name:nn #1 }
-\clist_map_inline:nn
- {
- { abstracttitle }
- {
- \c_@@_name_nju_tl \c_@@_name_type_tl
- \c_@@_name_lang_tl \c_@@_name_abstract_tl
- }
- {
- \c_@@_name_nju_tl \c_@@_name_type_tl
- \c_@@_name_lang_en_tl \c_@@_name_abstract_tl
- },
- { author } { 学生姓名 } { UNDERGRADUATE },
- { major } { 专业 } { SPECIALIZATION },
- { supvfull } { 指导教师(姓名、职称) } { MENTOR }
- }
- { \@@_define_name:nnn #1 }
-%</definition-ug>
-% \end{macrocode}
-%
-% \changes{v0.19}{2022/05/22}{更正研究生普通封面专业字样。}
-% \changes{v0.19}{2022/05/22}{更正国家图书馆封面学位论文字样。}
-% 研究生模板默认名称。
-% \begin{macrocode}
-%<*definition-g>
-\clist_map_inline:nn
- {
- { apply } {(申请 \g_@@_info_degree_tl 学位)},
- { authdecl } { 学位论文出版授权书 },
- { author_a }
- { \tl_item:Nn \g_@@_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_@@_name_nju_tl 学位论文原创性声明 },
- { origsign } { 研究生签名 },
- { reviewer } { 评阅人: },
- { secretlv } { 密级 },
- { secretstatus } { 论文涉密情况: },
- { secretfree } { 不保密 },
- { secretdate }
- { 保密,保密期( \c_@@_name_blankdate_a_tl 至
- \c_@@_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 } { 学位年度 }
- }
- { \@@_define_name:nn #1 }
-\clist_map_inline:nn
- {
- { abstracttitle }
- { \c_@@_name_nju_tl \g_@@_info_type_tl 中文摘要首页用纸 }
- { \c_@@_name_nju_tl \g_@@_info_type_tl 英文摘要首页用纸 },
- { author } { 作者姓名 } { POSTGRADUATE },
- { major } { 专业名称 } { SPECIALIZATION },
- { supvfull } { 指导教师 } { MENTOR }
+ { abstract } { 摘要 } { ABSTRACT },
+% \end{macrocode}
+% 用于书签的摘要名称字样
+% \begin{macrocode}
+ { abstract a } { 中文摘要 } { ABSTRACT },
+% \end{macrocode}
+% 用于小标题的摘要名称字样
+% \begin{macrocode}
+ { abstract b } { 摘\qquad{}要 } { ABSTRACT },
+%<def-u|def-g> { abstracttitle }
+%<def-u> { 南京大学本科生毕业论文(设计、作品)中文摘要 }
+%<def-u> { 南京大学本科生毕业论文(设计、作品)英文摘要 },
+%<def-g> { 南京大学研究生毕业论文中文摘要首页用纸 }
+%<def-g> { 南京大学研究生毕业论文英文摘要首页用纸 },
+ { appendix } { 附录 } { appendix },
+%<def-u> { author } { 学生姓名 } { UNDERGRADUATE },
+%<def-g> { author } { 作者姓名 } { POSTGRADUATE },
+ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { },
+ { blankdate a } { \njuline{\qquad\qquad} 年
+ \njuline{\qquad} 月 \njuline{\qquad} 日 } { },
+ { colon } { : } { : \c_space_tl },
+%<def-u|def-g> { dept } { 院系 } { DEPARTMENT },
+ { figure } { 图 } { figure },
+ { keywords } { 关键词 } { KEYWORDS },
+ { lang } { 中文 } { 英文 },
+%<def-u> { major } { 专业 } { SPECIALIZATION },
+%<def-g> { major } { 专业名称 } { SPECIALIZATION },
+ { nju } { 南京大学 } { Nanjing~ University },
+ { suffix } { } { _en },
+%<def-u> { supv full } { 指导教师(姓名、职称) } { MENTOR },
+%<def-g> { supv full } { 指导教师 } { MENTOR },
+ { table } { 表 } { table },
+%<def-u> { title } { 题目 } { THESIS },
+%<def-g> { title } { 论文题目 } { THESIS },
+%<def-u> { type } { 本科毕业论文 } { u }
+%<def-g> { type } { 研究生毕业论文 } { g }
}
{ \@@_define_name:nnn #1 }
% \end{macrocode}
%
% 对专业硕士的封面条目进行临时修改。
% \begin{macrocode}
-\int_compare:nT { \g_@@_info_degree_int == 3 }
- { \njusetname{major}{专业学位类别(领域)} }
-%</definition-g>
+%<*def-g>
+\int_compare:nT { \g_@@_info_degree_int == 2 }
+ { \tl_set:Nn \c_@@_name_major_tl { 专业学位类别(领域) } }
+%</def-g>
% \end{macrocode}
%
% \subsubsection{文本}
@@ -6572,20 +8112,26 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\tl_const:Nn \c_@@_text_origdecl_tl
{
-%<*definition-ug>
+%<*def-u>
本人郑重承诺:所呈交的毕业论文(设计)(题目: \g_@@_info_title_tl )
是在指导教师的指导下严格按照学校和院系有关规定由本人独立完成的。
本毕业论文(设计)中引用他人观点及参考资源的内容均已标注引用,
如出现侵犯他人知识产权的行为,由本人承担相应法律责任。
本人承诺不存在抄袭、伪造、篡改、代写、买卖毕业论文(设计)等违纪行为。
-%</definition-ug>
-%<*definition-g>
+%</def-u>
+%<*def-g>
本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作所
取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或集体
- 已经发表或撰写过的研究成果,也不包含为获得 \c_@@_name_nju_tl 或其他教
- 育机构的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,
- 均已在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。
-%</definition-g>
+ 已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构的学位
+ 证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已在论文的
+ 致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。
+%</def-g>
+%<*def-p>
+ 本人郑重声明:所呈交的研究报告,是本人独立进行研究工作所取得的成果。除
+ 文中已经注明引用的内容外,本报告不含任何其他个人或集体已经发表或撰写过
+ 的作品成果。对本报告的研究做出重要贡献的个人和集体,均已在报告中以明确
+ 方式标明。本人完全意识到本声明的法律结果由本人承担。
+%</def-p>
}
% \end{macrocode}
% \end{variable}
@@ -6593,70 +8139,104 @@ To produce the documentation run the original source files ending with
% \begin{variable}{\c_@@_text_authdecl_tl}
% 研究生的学位论文出版授权书。
% \begin{macrocode}
-%<*definition-g>
+%<*(def-g|def-p)>
\tl_const:Nn \c_@@_text_authdecl_tl
{
- 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》
- (以下简称“章程”),愿意将本人的学位论文提交“中国学术期刊
- (光盘版)电子杂志社”在《中国博士学位论文全文数据库》、
- 《中国优秀硕士学位论文全文数据库》中全文发表。《中国博士
- 学位论文全文数据库》、《中国优秀硕士学位论文全文数据库》
- 可以以电子、网络及其他数字媒体形式公开出版,并同意编入
- 《中国知识资源总库》,在《中国博硕士学位论文评价数据库》
- 中使用和在互联网上传播,同意按“章程”规定享受相关权益。
- }
+%<*def-g>
+ 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》(以下简称“章
+ 程”),愿意将本人的学位论文提交“中国学术期刊(光盘版)电子杂志社”在《
+ 中国博士学位论文全文数据库》、《中国优秀硕士学位论文全文数据库》中全文
+ 发表。《中国博士学位论文全文数据库》、《中国优秀硕士学位论文全文数据库
+ 》可以以电子、网络及其他数字媒体形式公开出版,并同意编入《中国知识资源
+ 总库》,在《中国博硕士学位论文评价数据库》中使用和在互联网上传播,同意
+ 按“章程”规定享受相关权益。
+%</def-g>
+%<*def-p>
+ 本研究报告作者完全了解南京大学有关保留和使用该报告的规定,即:博士后在
+ 职期间的知识产权单位属南京大学。学校有权保留并向国家有关部门或机构送交
+ 研究报告的复印件和电子版,允许研究报告被查阅和借阅;学校可以公布研究报
+ 告的全部或部分内容,可以允许采用影印、缩印或其它复制手段保存、汇编研究
+ 报告。保密的研究报告在解密后适用于本授权书。
+%</def-p>
+ }
+%</(def-g|def-p)>
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\c_@@_text_cover_en_tl}
% 研究生的英文封面字样。
% \begin{macrocode}
+%<*def-g>
\tl_const:Nn \c_@@_text_cover_en_tl
{
A~ dissertation~ submitted~ to \\
the~ graduate~ school~ of~ \c_@@_name_nju_en_tl \\
in~ partial~ fulfilment~ of~ the~ requirements~ for~ the~ degree~ of
}
-%</definition-g>
+%</def-g>
% \end{macrocode}
% \end{variable}
%
-% \subsubsection{定理}
-%
-% 默认定理类型和头名称。
-% \begin{macrocode}
-\clist_map_inline:nn
- {
- { axiom } { 公理 } { Axiom },
- { corollary } { 推论 } { Corollary },
- { definition } { 定义 } { Definition },
- { example } { 例 } { Example },
- { lemma } { 引理 } { Lemma },
- { proof } { 证明 } { Proof },
- { theorem } { 定理 } { Theorem }
- }
- { \@@_add_theorem_type:nnn #1 }
-% \end{macrocode}
-%
% \subsubsection{长度}
% \label{subsubsec:constant-length}
%
% \changes{v0.17}{2022/04/09}{将长度值分离到 \file{.def} 文件。}
-% 默认长度值。
+% \changes{v1.0}{2022/06/11}{可以单独指定下划线的宽度和偏移。}
+% 默认固定长度值。
% \begin{macrocode}
\clist_map_inline:nn
{
-%<definition-ug> { coverlabel } { 68 pt },
-%<definition-g> { coverlabel } { 100 pt },
- { coverlineskip } { 40 pt },
- { coveruline } { 270 pt },
-%<definition-ug> { emblemwidth } { 68 pt },
-%<definition-g> { emblemwidthi } { 46 pt },
-%<definition-g> { emblemwidthii } { 61 pt },
-%<definition-ug> { namewidth } { 300 pt },
-%<definition-g> { namewidth } { 126 pt },
- { smallhskip } { 5 pt },
- { smallvskip } { 1 ex }
+% \end{macrocode}
+% 封面信息栏的行距。此处的空格仅用来提升可读性,在生成变量名时会被删去。
+% \begin{macrocode}
+%<def-u> { c lineskip } { 36 pt },
+%<def-g> { c lineskip } { 32 pt },
+%<def-p> { c lineskip } { 28 pt },
+% \end{macrocode}
+% 封面信息栏标签的宽度。
+% \begin{macrocode}
+%<def-u> { c label wd } { 68 pt },
+%<def-g> { c label wd } { 80 pt },
+%<def-p> { c label wd } { 50 pt },
+% \end{macrocode}
+% 封面信息栏横线的宽度。
+% \begin{macrocode}
+%<def-u> { c rule wd } { 270 pt },
+%<def-g> { c rule wd } { 240 pt },
+% \end{macrocode}
+% 校徽图片的宽度。
+% \begin{macrocode}
+%<def-u> { emblem wd } { 68 pt },
+%<def-u> { emblem wd i } { 68 pt },
+%<def-g> { emblem wd i } { 46 pt },
+%<def-g> { emblem wd ii } { 61 pt },
+% \end{macrocode}
+% 校名图片的宽度。
+% \begin{macrocode}
+%<def-u> { name wd } { 300 pt },
+%<def-g> { name wd } { 126 pt },
+%<def-p> { name wd } { 220 pt },
+% \end{macrocode}
+% 下划线高度(厚度)。下划线绘制命令是通用的,因此没有作文件区分。
+% \begin{macrocode}
+ { rule ht i } { .4 pt },
+ { rule ht ii } { .8 pt },
+% \end{macrocode}
+% 下划线深度(偏移量)。
+% \begin{macrocode}
+ { rule dp i } { -.7 ex },
+ { rule dp ii } { -.9 ex },
+ { rule dp iii } { -1.2 ex },
+% \end{macrocode}
+% 小幅空格。
+% \begin{macrocode}
+ { h sep } { 5 pt },
+ { v sep } { 1 ex },
+% \end{macrocode}
+% 章节标题前后间距。
+% \begin{macrocode}
+ { chapter before } { 10 pt },
+ { chapter after } { 60 pt }
}
{ \@@_define_dim:nn #1 }
% \end{macrocode}
@@ -6670,23 +8250,30 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\clist_map_inline:nn
{
-%<definition-ug> { pagestyle } { plain },
-%<definition-g> { pagestyle } { headings },
- { emblemcolor } { black },
- { namecolor } { black },
- { section } { \large \normalfont \sffamily },
- { chapter } { \c_@@_fmt_section_tl \centering },
- { chapterintoc } { \c_@@_fmt_section_tl },
- { subsection } { \c_@@_fmt_section_tl },
- { subsubsection } { \c_@@_fmt_section_tl },
- { paragraph } { \c_@@_fmt_section_tl },
- { subparagraph } { \c_@@_fmt_section_tl },
- { toctitle } { \centering \zihao { 3 } \bfseries },
+%<def-u> { pagestyle } { plain },
+%<def-g|def-p> { pagestyle } { headings },
+ { abslabel } { \bfseries },
+ { abslabel_en } { },
+%<def-u> { cover title } { \bfseries },
+%<def-g> { cover title } { },
+%<def-u> { cover label } { \kaishu },
+%<def-g> { cover label } { \bfseries },
+%<def-p> { cover label } { },
+ { emblem color } { black },
+ { name color } { black },
+ { section } { \bigger \normalfont \sffamily },
+ { chapter } { \c_@@_fmt_section_tl \centering },
+ { chapterintoc } { \c_@@_fmt_section_tl },
+ { subsection } { \c_@@_fmt_section_tl },
+ { subsubsection } { \c_@@_fmt_section_tl },
+ { paragraph } { \c_@@_fmt_section_tl },
+ { subparagraph } { \c_@@_fmt_section_tl },
+ { toc title } { \centering \zihao { 3 } \bfseries },
{ header } { \small \kaishu },
{ footer } { \small \rmfamily }
}
{ \@@_define_fmt:nn #1 }
-%</(definition-ug|definition-g)>
+%</(def-u|def-g|def-p)>
% \end{macrocode}
%
% \end{implementation}