From 29bacc2ed13a988db81626180c697ecff8583672 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 May 2022 03:04:05 +0000 Subject: CTAN sync 202205020304 --- macros/unicodetex/latex/njuthesis/njuthesis.dtx | 980 ++++++++++++++++-------- macros/unicodetex/latex/njuthesis/njuthesis.ins | 4 +- macros/unicodetex/latex/njuthesis/njuthesis.pdf | Bin 1221585 -> 1261937 bytes 3 files changed, 683 insertions(+), 301 deletions(-) (limited to 'macros/unicodetex') diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx index f333e6d6b3..faeaa2defc 100644 --- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx +++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx @@ -111,7 +111,7 @@ To produce the documentation run the original source files ending with % %\NeedsTeXFormat{LaTeX2e} %<*!(driver|install)> -%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG $ +%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.18.0 2022-05-01 12:40:00 +0800 NJU LUG $ % {Thesis template for Nanjing University} %\ProvidesExplClass{njuthesis} % {Undergraduate definition file for njuthesis} @@ -124,7 +124,7 @@ To produce the documentation run the original source files ending with %<*driver> \ProvidesFile{njuthesis.dtx} \documentclass[fontset=fandol]{ctxdoc} -\usepackage{listings,njuvisual,tabularray} +\usepackage{listings,njuvisual,tabularray,unicode-math} \usepackage[firstpage=true]{background} \backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm} \colorlet{at@guard}{njuviolet} @@ -144,7 +144,10 @@ To produce the documentation run the original source files ending with \SetTblrStyle{caption-tag}{font=\bfseries} \SetTblrInner{row{1}={font=\bfseries}} \DefTblrTemplate{caption-sep}{default}{\quad} -\lstdefinestyle{style@base} +\setmathfont{XITSMath-Regular}[ + BoldFont = XITSMath-Bold, + Extension = .otf] + \lstdefinestyle{style@base} { basewidth = 0.5 em, gobble = 3, @@ -200,7 +203,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.17.0 \quad 2022-04-09} +% \date{v0.18.0 \quad 2022-05-01} % % \changes{v0.1}{2021/09/04}{开始开发。} % \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。} @@ -811,7 +814,7 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % -% \subsubsection{单双面模式} +% \subsubsection{页面模式} % % \begin{function}[added=2022-01-14]{oneside,twoside} % \begin{syntax} @@ -822,17 +825,15 @@ To produce the documentation run the original source files ending with % % 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。 % 单双面选项为全局选项,开启后会改变页码编号,以及部分宏包的行为。 -% 在单面模式下,页面是连续的,不会产生空白页;在双面模式下,封面、摘要、 -% 参考文献表等特殊页面,以及新的章节都会从奇数页开始,更适合印刷输出。 -% -% -% \subsubsection{草稿模式} +% 在单面模式下,页面是连续的,不会产生空白页;在双面模式下, +% 新的一章以及封面、摘要、参考文献表等特殊页面都会从奇数页开始, +% 在奇数页结束的内容后会补上一页空页,更适合印刷输出。 % % \begin{function}[added=2021-12-15]{draft} % \begin{syntax} % draft = <\TFF> % \end{syntax} -% 选择是否开启草稿模式,默认关闭。 +% 是否开启草稿模式,默认关闭。 % \end{function} % % 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。 @@ -850,6 +851,20 @@ To produce the documentation run the original source files ending with % 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。 % 如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。 % +% \begin{function}[added=2022-04-19]{blind} +% \begin{syntax} +% +% \end{syntax} +% 是否开启盲审模式。这个选项并不包含 |=| 号。 +% \end{function} +% +% 盲审模式会抹除论文中的学校和个人信息,效果包括: +% \begin{itemize} +% \item 不显示校名校徽图片 +% \item 不显示“南京大学”字样 +% \item 不显示作者、导师等基本信息 +% \end{itemize} +% % % \subsubsection{配置文件} % @@ -1124,21 +1139,21 @@ To produce the documentation run the original source files ending with % \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} +% 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} @@ -1148,30 +1163,30 @@ To produce the documentation run the original source files ending with % \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}, -% chairman = {张晓山~教授}, -% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授}, -% clc = {0175.2}, +% 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}, +% chairman = {张晓山~教授}, +% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授}, +% clc = {0175.2}, % secret-level = {限制}, -% udc = {004.72}, +% udc = {004.72}, % supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514} % } % } @@ -1252,7 +1267,7 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % -% \subsubsection{文字} +% \subsubsection{字形} % % \begin{function}{\songti,\heiti,\kaishu,\fangsong,\zihao} % \begin{syntax} @@ -1269,9 +1284,29 @@ To produce the documentation run the original source files ending with % \begin{syntax} % \tn{njuline}\Arg{文字} % \end{syntax} -% 为了避免原生\tn{uline}命令在中文环境下不能正常换行的问题,本模板使用\tn{njuline}作为替代方案,分别对 \hologo{XeLaTeX} 的 \pkg{xeCJKfntef} 包和 \hologo{LuaLaTeX} 的 \pkg{lua-ul} 包中的下划线命令进行了包装。 +% 为了避免原生 \tn{uline} 命令在中文环境下不能正常换行的问题, +% 本模板使用 \tn{njuline} 作为替代方案,分别对 \hologo{XeLaTeX} 的 +% \pkg{xeCJKfntef} 包和 \hologo{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} 宏包,对三个常用列表环境内的条目间距进行压缩。 +% +% \subsubsection{脚注} +% % \begin{function}{\footnote} % \begin{syntax} % \tn{footnote}\Arg{脚注} @@ -1279,6 +1314,13 @@ To produce the documentation run the original source files ending with % 添加脚注。 % \end{function} % +% \begin{function}[added=2022-05-01]{style/footnote-style} +% \begin{syntax} +% footnote-style = <(plain)|pifont> +% \end{syntax} +% 设置脚注编号样式。默认为普通数字,使用 |pifont| +% 选项可修改为带圈数字。单一页面内请尽量避免超过 10 条脚注。 +% \end{function} % % \subsubsection{图片} % @@ -1293,8 +1335,7 @@ To produce the documentation run the original source files ending with % % 在使用特定类型的图片文件时,可以省略其扩展名,包括 \file{*.jpg}, \file{*.png}, \file{*.pdf}, \file{*.eps}。 % -% -% \paragraph{图片} +% \paragraph{单张图片} % % 下面这个例子展示了如何插入一张名称为 \file{myfig.jpg},宽度占页面文字宽度一半的图片。注意标签命令 \tn{label} 必须放在图注命令 \tn{caption} 之后。 % \begin{latexexample}[moretexcs={\includegraphics},emph={[1]figure}] @@ -1308,7 +1349,6 @@ To produce the documentation run the original source files ending with % % \emph{以下图片相关功能的实现均需要手动载入相关宏包}。 % -% % \paragraph{文字环绕} % % 对于较为瘦长,或者仅起到辅助作用的图像,可以使用 \pkg{wrapfig} 宏包提供的 \env{wrapfigure} 实现文字环绕效果。注意这个环境后紧跟的一行不能为空。 @@ -1322,7 +1362,6 @@ To produce the documentation run the original source files ending with % % \end{latexexample} % -% % \paragraph{多张嵌套} % % 使用 \pkg{subcaption} 宏包提供的 \env{subfigure} 环境可以实现多张图片嵌套的效果。 @@ -1349,7 +1388,6 @@ To produce the documentation run the original source files ending with % % 请尽量避免使用较为老旧的 \pkg{subfig} 宏包,完全不要使用过时的 \pkg{subfigure} 宏包。两者的 CTAN 页面上均建议转移至更新的 \pkg{subcaption} 宏包。 % -% % \subsubsection{表格} % % 下面这个例子展示了如何插入一张表格。通过 \pkg{booktabs} 宏包提供的 \tn{toprule}、\tn{midrule} 和 \tn{bottomrule} 命令,我们可以很轻松地绘制出一张漂亮规范的三线表。 @@ -1370,7 +1408,6 @@ To produce the documentation run the original source files ending with % % \emph{以下表格功能的实现均需要手动载入相关宏包。} % -% % \paragraph{合并单元格} % % \begin{function}{\multirow,\multicolumn} @@ -1384,7 +1421,6 @@ To produce the documentation run the original source files ending with % TODO:\pkg{multirow} 宏包的使用方法,命令较为复杂。 % \url{http://www.ctex.org/documents/packages/table/multirow.htm} % -% % \paragraph{更多样式} % % \pkg{tabularray} 宏包\cite{tabularray}运用 \hologo{LaTeX3} 语法重新实现了表格的绘制,提供了简明的用户接口与丰富的单元格样式,详见其使用手册。 @@ -1402,29 +1438,78 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % 如不需要编号,可以用 \env{equation*} 或者 |\[|\meta{公式}|\]|, -% 请不要使用可能引发问题的 |$$|\meta{公式}|$$|\footnote{\url{https://tex.stackexchange.com/questions/503/why-is-preferable-to}}。 +% 请不要使用可能引发问题的 |$$|\meta{公式}|$$| +% \footnote{\url{https://tex.stackexchange.com/q/503/}}。 % % % \paragraph{符号和单位} % -% 模板使用 \pkg{unicode-math} 配置数学字体,可以替代传统方案下的 \pkg{bm}、 -% \pkg{mathrsfs} 等宏包\footnote{\url{https://tex.stackexchange.com/questions/528831/why-doesnt-the-bm-package-work-with-the-unicode-math-package}}。 -% 相应地,也需要使用新方案提供的命令。例如,加粗数学符号的命令可以使用 -% \tn{symbf}。更多细节请查阅 \pkg{unicode-math} 手册。 -% -% 符号表可以参考 \url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf}。 -% -% 单位请参考相关国家标准\footnote{GB 3100-1993, GB/T 3101-1993, GB/T 3102-1993},使用 \pkg{siunitx} 宏包。\pkg{siunitx} 是一个更新频繁的包,可能会引发兼容性问题。 +% ^^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} 手册。 +% +% ^^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$| +% \item $\symup{i}$ 使用 |$\symup{e}$| +% \item $\symup{e}$ 使用 |$\symup{i}$| +% \end{itemize} +% \item 微分号使用正体,如 +% \begin{itemize} +% \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} 是一个更新频繁的包,可能会引发兼容性问题。 % % \paragraph{定理环境} % % 本模板也提供了一系列的数学定理环境。 -% 全部预定义的数学定理环境如表~\ref{tab:mathenv} 所示。其中证明环境较为特殊,会在结尾添加证毕符号(\mdwhtsquare)。用户也可以选择使用 \tn{newtheorem} 定义新的定理环境。 +% +% \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{数学定理环境} +% \caption{预置的数学定理环境} % \label{tab:mathenv} % \begin{tabular}{cc|cc} % \toprule @@ -1449,6 +1534,53 @@ To produce the documentation run the original source files ending with % \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{样式名称}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/header-font} +% \begin{syntax} +% header-font = \meta{头部字体格式} +% \end{syntax} +% 定理头部字体格式。等效于 \cs{theoremheaderfont}\marg{格式}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/body-font} +% \begin{syntax} +% body-font = \meta{内部字体格式} +% \end{syntax} +% 定理内部字体格式。等效于 \cs{theorembodyfont}\marg{格式}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/counter} +% \begin{syntax} +% counter = +% \end{syntax} +% 定理计数器范围。 +% \end{function} +% +% 模板的默认设置等效于 +% +% \begin{latexexample}[moretexcs={\njusetup,\bfseries,\itshape,\mdwhtsquare}, +% emph={[2]theorem}] +% \njusetup { +% theorem = { +% predefine = true, +% style = plain, +% header=font = \normalfont \bfseries, +% body-font = \itshape, +% qed-symbol = \ensuremath { \mdwhtsquare }, +% counter = chapter +% } +% } +% \end{latexexample} +% % % \subsubsection{代码} % \changes{v0.13}{2021/12/13}{提供简化的行内代码环境。} @@ -1611,14 +1743,10 @@ To produce the documentation run the original source files ending with % } % \end{latexexample} % -% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题,这时就要果断假装没有看到。 -% 该问题的产生是由于 \hologo{LaTeX} 中只有固定的字母组合中间可以断行。使条目右侧平齐的方法有如下两种 -% \footnote{详见 \url{https://github.com/nju-lug/NJUThesis/issues/57}。很不幸,\pkg{microtype} 与 \pkg{babel} 没能在我们的模板中解决问题。}: -% \begin{itemize} -% \item 自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。缺点是需要逐条手动排查,建议在定稿时进行修改。 -% \item 在 |\printbibliography| 前添加 |\sloppy| 命令拉伸词间距,缺点是可能降低美观度。 -% \end{itemize} -% +% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题。 +% 对此,需要将 \pkg{biblatex-gb7714-2015} 宏包手动更新至 2022-04-16 以后的版本。 +% 此外,由于 \TeX{} 预置的断词位置是有限的,不能覆盖学术上使用的复杂词汇, +% 您也可以自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。 % % \subsubsection{正文引用} % @@ -2059,6 +2187,21 @@ To produce the documentation run the original source files ending with % % \subsection*{标准、规范} % +% \bibitem{gb-3100-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{国际单位制及其应用: GB 3100--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% +% \bibitem{gb-3101-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{有关量、单位和符号的一般原则: GB 3101--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% +% \bibitem{gb-3102-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{物理科学和技术中使用的数学符号: GB/T 3102--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% % \bibitem{gb-t-7408-2005} % 全国信息与文献标准化技术委员会. % \newblock \textit{数据元和交换格式\quad 信息交换~ 日期和时间表示法: GB/T 7408--2005} [S]. @@ -2131,6 +2274,14 @@ To produce the documentation run the original source files ending with % \urlprefix\url{https://ctan.org/pkg/njuvisual} % \urlprefix\CTANurl[文档:]{macros/latex/contrib/njuvisual/njuvisual.pdf} % +% \bibitem{siunitx} +% \textsc{Wright J}. +% \newblock \textit{A comprehensive (SI) units package} [EB/OL]. +% \newblock version 3.1.0, +% \newblock (2022-04-25) +% \urlprefix\url{https://www.ctan.org/pkg/siunitx} +% \urlprefix\CTANurl[文档:]{macros/latex/contrib/siunitx/siunitx.pdf} +% % \bibitem{tabularray} % \textsc{Jianrui Lyu}. % \newblock \textit{Typeset tabulars and arrays with \hologo{LaTeX3}} [EB/OL]. @@ -2398,17 +2549,17 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_name_type_clist,\g_@@_name_type_en_clist, -% \g_@@_name_degree_clist,\g_@@_name_degree_en_clist} +% \begin{variable}{\c_@@_name_type_clist,\c_@@_name_type_en_clist, +% \c_@@_name_degree_clist,\c_@@_name_degree_en_clist} % 论文类型与学位类型。 % \begin{macrocode} -\clist_const:Nn \g_@@_name_type_clist +\clist_const:Nn \c_@@_name_type_clist { 毕业论文, 毕业设计 } -\clist_const:Nn \g_@@_name_type_en_clist +\clist_const:Nn \c_@@_name_type_en_clist { THESIS, DESIGN } -\clist_const:Nn \g_@@_name_degree_clist +\clist_const:Nn \c_@@_name_degree_clist { 学士, 硕士, 硕士专业, 博士 } -\clist_const:Nn \g_@@_name_degree_en_clist +\clist_const:Nn \c_@@_name_degree_en_clist { Bachelor, Master, Master, Doctor~of~Philosophy } % \end{macrocode} % \end{variable} @@ -2424,6 +2575,22 @@ 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{macrocode} +\clist_const:Nn \c_@@_blind_info_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 } +% \end{macrocode} +% \end{variable} +% % % \subsection{内部函数} % @@ -2438,8 +2605,8 @@ 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 \g_@@_smallvskip_dim } -\cs_new:Nn \@@_hskip: { \skip_horizontal:N \g_@@_smallhskip_dim } +\cs_new:Nn \@@_vskip: { \skip_vertical:N \c_@@_smallvskip_dim } +\cs_new:Nn \@@_hskip: { \skip_horizontal:N \c_@@_smallhskip_dim } % \end{macrocode} % \end{macro} % @@ -2461,16 +2628,11 @@ To produce the documentation run the original source files ending with % 用来定义默认名称的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_name:nn #1#2 - { - \tl_new:c { g_@@_name_ #1 _tl } - \tl_gset:cn { g_@@_name_ #1 _tl } { #2 } - } + { \tl_const:cn { c_@@_name_ #1 _tl } { #2 } } \cs_new_protected:Npn \@@_define_name:nnn #1#2#3 { - \tl_new:c { g_@@_name_ #1 _tl } - \tl_gset:cn { g_@@_name_ #1 _tl } { #2 } - \tl_new:c { g_@@_name_ #1 _en_tl } - \tl_gset:cn { g_@@_name_ #1 _en_tl } { #3 } + \tl_const:cn { c_@@_name_ #1 _tl } { #2 } + \tl_const:cn { c_@@_name_ #1 _en_tl } { #3 } } % \end{macrocode} % \end{macro} @@ -2479,10 +2641,7 @@ To produce the documentation run the original source files ending with % 用来定义默认样式的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_fmt:nn #1#2 - { - \tl_new:c { g_@@_fmt_ #1 _tl } - \tl_gset:cn { g_@@_fmt_ #1 _tl } { #2 } - } + { \tl_const:cn { c_@@_fmt_ #1 _tl } { #2 } } % \end{macrocode} % \end{macro} % @@ -2490,15 +2649,9 @@ To produce the documentation run the original source files ending with % 用来定义默认间距的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_dim:nn #1#2 - { - \dim_new:c { g_@@_ #1 _dim } - \dim_gset:cn { g_@@_ #1 _dim } { #2 } - } + { \dim_const:cn { c_@@_ #1 _dim } { #2 } } \cs_new_protected:Npn \@@_define_skip:nn #1#2 - { - \skip_new:c { g_@@_ #1 _skip } - \skip_gset:cn { g_@@_ #1 _skip } { #2 } - } + { \skip_const:cn { c_@@_ #1 _skip } { #2 } } % \end{macrocode} % \end{macro} % @@ -2516,7 +2669,7 @@ To produce the documentation run the original source files ending with % \begin{macro}{\@@_name:n,\@@_info:n} % 根据变量名调用名称和内容信息。 % \begin{macrocode} -\cs_new:Npn \@@_name:n #1 { \tl_use:c { g_@@_name_ #1 _tl } } +\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 } } % \end{macrocode} % \end{macro} @@ -2579,24 +2732,6 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_put_inempty_seg:nnn} -% 将固定长度的非空字符串插入 |clist|。 -% \begin{arguments} -% \item 原始字符串 -% \item 起始位置 -% \item 长度 -% \end{arguments} -% \begin{macrocode} -\cs_new_protected:Npn \@@_put_inempty_seg:nnn #1#2#3 - { - \tl_set:Nx \l_@@_tmpa_tl - { \tl_range:Nnn { #1 } { #2 } { #2 + #3 - 1 } } - \tl_if_empty:NF \l_@@_tmpa_tl - { \clist_put_right:NV \l_@@_tmp_clist { \l_@@_tmpa_tl } } - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_uline:n} % 指定宽度的下划线。 % \begin{arguments} @@ -2761,17 +2896,17 @@ To produce the documentation run the original source files ending with { \tl_if_empty:NT \g_@@_info_title_tl { \msg_error:nn { njuthesis } { missing-title } } - \@@_spread_box:nnV { #2 } { \kaishu } \g_@@_name_title_tl + \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_title_tl \mode_leave_vertical: \@@_hskip: % \end{macrocode} % 这里需要存储 \tn{baselineskip} 的值,以使 \tn{parbox} 后行距正确。 -% \footnote{\url{https://tex.stackexchange.com/questions/34971/how-to-keep-a-constant-baselineskip-when-using-minipages-or-parboxes}} +% \footnote{\url{https://tex.stackexchange.com/q/34971/}} % \begin{macrocode} \parbox [ t ] { #3 } { - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim + \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim #1 \@@_uline_title: - \dim_set_eq:NN \l_@@_tmpa_dim \prevdepth + \dim_gset_eq:NN \l_@@_tmpa_dim \prevdepth } \par \prevdepth \l_@@_tmpa_dim } @@ -2834,7 +2969,7 @@ To produce the documentation run the original source files ending with \@@_ulined_center_box:nn { #3 } { \clist_item:cn { g_@@_info_ #1 _clist } { 1 } } \@@_hskip: - \@@_spread_box:nnV { #2 } { \kaishu } \g_@@_name_supv_ttl_tl + \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_supv_ttl_tl \@@_hskip: \@@_ulined_center_box:nn { #3 } { \clist_item:cn { g_@@_info_ #1 _clist } { 2 } } @@ -2843,6 +2978,17 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_emblem:N,\@@_name:N} +% 封装图片绘制命令,参数为图片宽度。 +% 此时 \cs{njuemblem}、\cs{njuname} 和相关长度都是没有定义的。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_emblem:N #1 + { \njuemblem [ black ] { #1 } { ! } } +\cs_new_protected:Npn \@@_name:N #1 + { \njuname [ black ] { #1 } { ! } } +% \end{macrocode} +% \end{macro} +% % \subsubsection{摘要相关} % % \begin{macro}{\@@_abs_bookmark:nn,\@@_abs_bookmark:Vn} @@ -2905,8 +3051,10 @@ To produce the documentation run the original source files ending with % \item 内容 % \item 左边距 % \end{arguments} -% 这里使用了 Primitive \TeX{} 语法以利用原生的断行算法\footnote{\url{https://tex.stackexchange.com/questions/637861/underline-list-item-to-page-width}}。 -% 对其语法的简要介绍可以参考 \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。 +% 这里使用了 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}}。 % \begin{macrocode} \cs_new_protected:Npn \@@_uline_list:nnn #1#2#3 { @@ -3062,7 +3210,8 @@ To produce the documentation run the original source files ending with } { \AssignTemplateKeys - \newpage + \clearpage + \thispagestyle { empty } \__nju_vskip:N \l_@@_top_skip \group_begin: \l_@@_format_tl @@ -3155,6 +3304,15 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % +% \begin{macro}{blind} +% \changes{v0.18}{2022/04/19}{新增盲审模式选项。} +% 盲审模式。 +% \begin{macrocode} + blind .value_forbidden:n = true, + blind .bool_set:N = \g_@@_blind_bool, +% \end{macrocode} +% \end{macro} +% % \begin{macro}{latin-font,cjk-font} % \changes{v0.14}{2021/12/12}{简化字体选项名称。} % 字体选项。 @@ -3185,14 +3343,22 @@ To produce the documentation run the original source files ending with % % \subsection{用户接口} % -% \begin{macro}{bib,info,style} -% 定义元(meta)键值对。 +% \begin{macro}{bib,info,style,theorem} +% 定义元(meta)键值对。为 v1.0 升级预留了新的接口。 % \begin{macrocode} \keys_define:nn { nju } { - bib .meta:nn = { nju / bib } { #1 }, - info .meta:nn = { nju / info } { #1 }, - style .meta:nn = { nju / style } { #1 } + % 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 } } % \end{macrocode} % \end{macro} @@ -3210,7 +3376,7 @@ To produce the documentation run the original source files ending with % 定义修改固定文本的接口。 % \begin{macrocode} \NewDocumentCommand \njusetformat { m m } - { \tl_gset:cn { g_@@_fmt_ #1 _tl } { #2 } } + { \tl_gset:cn { c_@@_fmt_ #1 _tl } { #2 } } % \end{macrocode} % \end{macro} % @@ -3221,8 +3387,8 @@ To produce the documentation run the original source files ending with \NewDocumentCommand \njusetlength { s m m } { \bool_if:nTF { #1 } - { \skip_gset:cn { g_@@_ #2 _skip } { #3 } } - { \dim_gset:cn { g_@@_ #2 _dim } { #3 } } + { \skip_gset:cn { c_@@_ #2 _skip } { #3 } } + { \dim_gset:cn { c_@@_ #2 _dim } { #3 } } } % \end{macrocode} % \end{macro} @@ -3256,7 +3422,7 @@ To produce the documentation run the original source files ending with \bool_if:nTF { #1 } { \tl_set:Nn \l_@@_tmpb_tl { _en } } { \tl_clear:N \l_@@_tmpb_tl } - \tl_gset:cn { g_@@_ #5 _ #2 \l_@@_tmpa_tl \l_@@_tmpb_tl _tl } {#4} + \tl_gset:cn { c_@@_ #5 _ #2 \l_@@_tmpa_tl \l_@@_tmpb_tl _tl } {#4} } % \end{macrocode} % \end{macro} @@ -3303,7 +3469,6 @@ To produce the documentation run the original source files ending with { { no-math } { fontspec }, { perpage } { footmisc }, - { amsmath, thmmarks } { ntheorem }, { hyphens } { url }, { warnings-off={ mathtools-colon, mathtools-overbracket } } { unicode-math }, @@ -3326,19 +3491,20 @@ To produce the documentation run the original source files ending with { 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}。} -% 数学相关的宏包。其中,\pkg{amsmath} 必须在 \pkg{unicode-math} 前加载。 +% \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, - ntheorem, % \end{macrocode} % \changes{v0.14}{2021/12/21}{移除内置的 \pkg{multirow}、\pkg{subcaption} % 和 \pkg{wrapfig}。} @@ -3394,8 +3560,8 @@ To produce the documentation run the original source files ending with { \RequirePackage { tabularray } } % \end{macrocode} % -% \begin{macro}{\@@_check_package:nnn} -% 检查过时宏包。 +% \begin{macro}{\@@_check_pkg_version:nnn} +% 检查宏包版本是否过时。 % \begin{macrocode} \msg_new:nnn { njuthesis } { package-too-old } { @@ -3405,7 +3571,7 @@ To produce the documentation run the original source files ending with Please~ update~ an~ up-to-date~ version~ of~ it~ using~ your TeX~ package~ manager~ or~ from~ CTAN. } -\cs_new_protected:Npn \@@_check_package:nnn #1#2#3 +\cs_new_protected:Npn \@@_check_pkg_version:nnn #1#2#3 { \@ifpackagelater {#1} {#2} { } { \msg_error:nnnn { njuthesis } { package-too-old } {#1} {#3} } @@ -3417,9 +3583,48 @@ To produce the documentation run the original source files ending with % 解决了下划线中断问题,然而在 2021-10-24 的更新才提供了正确的内嵌日期。 % \begin{macrocode} \sys_if_engine_luatex:T - { \@@_check_package:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } + { \@@_check_pkg_version:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } +% \end{macrocode} +% +% \changes{v0.18}{2022/04/28}{增加宏包冲突检查。} +% \begin{macrocode} +\RequirePackage { filehook } +% \end{macrocode} +% +% \begin{macro}{\@@_check_pkg_conflict:nn} +% 检查用户载入的宏包是否会与预置宏包发生冲突。 +% \begin{arguments} +% \item 模板载入的宏包 +% \item 产生冲突的宏包 +% \item 替代的解决办法 +% \end{arguments} +% \begin{macrocode} +\msg_new:nnn { njuthesis } { package-conflict } + { + The~ "#2"~ package~ is~ incompatible~ with~ "#1".\\ + I~ have~ loaded~ "#1"~ by~ default.~ Maybe~ You~ should~ + refer~ to~ section~ 4~ of~ the~ "njuthesis"~ manual. + } +\cs_new_protected:Npn \@@_check_pkg_conflict:nn #1#2 + { + \AtEndOfPackageFile * { #1 } + { + \AtBeginOfPackageFile * { #2 } + { \msg_error:nnnn { njuthesis } { package-conflict } {#1} {#2} } + } + } % \end{macrocode} +% \end{macro} % +% 检查数学宏包冲突。 +% \begin{macrocode} +\clist_map_inline:nn + { + amscd, amsfonts, amssymb, bbm, bm, eucal, + eufrak, mathrsfs, newtxmath, upgreek + } + { \@@_check_pkg_conflict:nn { unicode-math } { #1 } } +% \end{macrocode} % % \subsection{配置文件} % @@ -3552,7 +3757,7 @@ To produce the documentation run the original source files ending with clc .tl_set:N = \g_@@_info_clc_tl, secret-level .tl_set:N = \g_@@_info_secretlv_tl, udc .tl_set:N = \g_@@_info_udc_tl, - supervisor-contact .tl_set:N = \g_@@_info_supv_cont_tl, + supervisor-contact .tl_set:N = \g_@@_info_supvcont_tl, % \end{macrocode} % \end{macro} % @@ -3571,7 +3776,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \tl_set:Nx \g_@@_info_degree_tl { - \clist_item:Nn \g_@@_name_degree_clist + \clist_item:Nn \c_@@_name_degree_clist { \g_@@_info_degree_int } } \int_compare:nTF { \g_@@_info_degree_int == 1 } @@ -3582,11 +3787,29 @@ To produce the documentation run the original source files ending with % 设置类型信息。 % \begin{macrocode} \tl_set:Nx \g_@@_info_type_tl - { \clist_item:Nn \g_@@_name_type_clist { \g_@@_info_type_int } } + { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } } \tl_set:Nx \g_@@_info_type_en_tl - { \clist_item:Nn \g_@@_name_type_en_clist { \g_@@_info_type_int } } + { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } } \tl_put_left:Nx \g_@@_info_type_tl - { \tl_use:c { g_@@_name_ \g_@@_info_diploma_tl _tl } } + { \tl_use:c { c_@@_name_ \g_@@_info_diploma_tl _tl } } +% \end{macrocode} +% +% 盲审模式下抹去个人信息和学校名称。 +% \begin{macrocode} +\bool_if:NT \g_@@_blind_bool + { + \ctex_at_end_preamble:n + { + \clist_map_inline:Nn \c_@@_blind_info_clist + { \tl_gclear:c { g_@@_info_ #1 _tl } } + \clist_map_inline:Nn \c_@@_blind_info_en_clist + { \tl_gclear:c { g_@@_info_ #1 _en_tl } } + \clist_map_inline:Nn \c_@@_blind_infolist_clist + { \clist_gclear:c { g_@@_info_ #1 _clist } } + \tl_gclear:N \c_@@_name_nju_tl + \tl_gclear:N \c_@@_name_nju_en_tl + } + } % \end{macrocode} % % \changes{v0.15}{2022/01/22}{正确处理双导师信息。} @@ -4190,7 +4413,7 @@ To produce the documentation run the original source files ending with % 为无编号章添加目录条目,需手动指定格式为四号、不加粗、黑体。 % \begin{macrocode} \cs_new_protected:Npn \@@_add_tocline:n #1 - { \addcontentsline { toc } { chapter } { \g_@@_fmt_chapterintoc_tl #1 } } + { \addcontentsline { toc } { chapter } { \c_@@_fmt_chapterintoc_tl #1 } } \cs_generate_variant:Nn \@@_add_tocline:n { V } % \end{macrocode} % \end{macro} @@ -4234,10 +4457,12 @@ To produce the documentation run the original source files ending with { chapter / beforeskip = 10 pt, chapter / afterskip = 60 pt, - chapter / format = \g_@@_fmt_chapter_tl, - section / format = \g_@@_fmt_section_tl, - subsection / format = \g_@@_fmt_subsection_tl, - subsubsection / format = \g_@@_fmt_subsubsection_tl, + chapter / format = \c_@@_fmt_chapter_tl, + section / format = \c_@@_fmt_section_tl, + subsection / format = \c_@@_fmt_subsection_tl, + subsubsection / format = \c_@@_fmt_subsubsection_tl, + paragraph / format = \c_@@_fmt_paragraph_tl, + subparagraph / format = \c_@@_fmt_subparagraph_tl, % \end{macrocode} % % @@ -4246,13 +4471,13 @@ To produce the documentation run the original source files ending with % % 设置目录标题默认名称。 % \begin{macrocode} - contentsname = \g_@@_name_tableofcontents_tl, - listfigurename = \g_@@_name_listoffigures_tl, - listtablename = \g_@@_name_listoftables_tl, + contentsname = \c_@@_name_tableofcontents_tl, + listfigurename = \c_@@_name_listoffigures_tl, + listtablename = \c_@@_name_listoftables_tl, % \end{macrocode} % 设置目录中章标题的样式。 % \begin{macrocode} - chapter / tocline = \g_@@_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2 + chapter / tocline = \c_@@_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2 } % \end{macrocode} % @@ -4279,7 +4504,7 @@ To produce the documentation run the original source files ending with { \group_begin: \keys_set:nn { ctex } - { chapter/format = \g_@@_fmt_toctitle_tl } + { chapter/format = \c_@@_fmt_toctitle_tl } \bool_if:NTF \g_@@_toc_in_toc_bool { \@@_chapter:n { #1 } } { @@ -4486,7 +4711,7 @@ To produce the documentation run the original source files ending with pdftitle = \g_@@_info_title_tl, pdfauthor = \g_@@_info_author_tl, pdfkeywords = \g_@@_info_keywords_clist, - pdfcreator = \g_@@_name_pdfcreator_tl + pdfcreator = \c_@@_name_pdfcreator_tl } } % \end{macrocode} @@ -4523,6 +4748,90 @@ To produce the documentation run the original source files ending with % \end{macrocode} % % +% \subsection{脚注} +% \changes{v0.18}{2022/05/01}{提供脚注设置项。} +% ^^A 来自 fduthesis +% \begin{macrocode} +\tl_new:N \l_@@_fn_style_tl +\keys_define:nn { nju / style } + { +% \end{macrocode} +% \begin{macro}{style/footnote-style} +% \begin{macrocode} + footnote-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 + \int_compare:nT { \l_keys_choice_int = 2 } + { \RequirePackage { pifont } } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_fn_symbol_pifont:n} +% \opt{pifont} 普通版。以下四种都只包含 \numrange{1}{10}。 +% \begin{macrocode} +\cs_new:Npn \@@_fn_symbol_pifont:n #1 + { \ding { \int_eval:n { 171 + #1 } } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_footnote_number:N} +% 脚注编号样式。 +% \begin{macrocode} +\tl_const:Nn \c_@@_fn_style_plain_tl { plain } +\tl_const:Nn \c_@@_fn_style_pifont_tl { pifont } +\cs_new:Npn \@@_footnote_number:N #1 + { + \tl_case:NnF \l_@@_fn_style_tl + { +% \end{macrocode} +% \opt{plain} 类型直接使用计数器 |footnote| 的值。 +% \begin{macrocode} + \c_@@_fn_style_plain_tl + { \int_use:N #1 } +% \end{macrocode} +% \opt{pifont} 类型无需进行额外的操作。 +% \begin{macrocode} + \c_@@_fn_style_pifont_tl + { \@@_fn_symbol_pifont:n {#1} } + } +% \end{macrocode} +% 变量 \cs{l_@@_fn_style_tl} 保存的类型未知时,默认使用 \opt{plain} +% 类型。 +% \begin{macrocode} + { \int_use:N #1 } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thefootnote} +% 重定义脚注编号。 +% \begin{macrocode} +\cs_set:Npn \thefootnote { \@@_footnote_number:N \c@footnote } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{整体样式} +% +% \begin{macro}[int]{\@makefntext} +% 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \qty{1.5}{em}。 +% 见 \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 + } +% \end{macrocode} +% \end{macro} +% +% % \subsection{图片表格} % % 设置默认图片扩展名,允许在不键入扩展名时自动进行补全。 @@ -4562,35 +4871,87 @@ To produce the documentation run the original source files ending with % % \subsection{定理环境} % -% \begin{macro}{\@@_new_theorem:N} +% \changes{v0.18}{2022/04/21}{新增定理环境的若干定制项。} +% +% \begin{macro}{theorem/style,theorem/header-font,theorem/body-font, +% theorem/qed-symbol,theorem/counter} +% 定义 |nju/theorem| 键值类。 +% 目前这套选项只适用于模板预定义的若干种定理环境。 +% \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, +% \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 + } +% \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:N #1 +\cs_new_protected:Npn \@@_new_theorem:Nn #1#2 { - \theoremsymbol { } \clist_map_inline:Nn #1 - { \newtheorem { ##1 } { \@@_name:n { ##1 } } } + { \newtheorem { ##1 } { \@@_name:n { ##1 } } [#2] } } +\cs_generate_variant:Nn \@@_new_theorem:Nn { NV } % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_ntheorem_post_setup:} +% 载入 \pkg{ntheorem} 后的相应设置。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_ntheorem_post_setup: + { + \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/questions/567135/how-get-box-like-symbol-with-xelatex}}。 +% \footnote{\url{https://tex.stackexchange.com/q/567135/}}。 +% \begin{macrocode} + \newtheorem* { proof } { \c_@@_name_proof_tl } +% \end{macrocode} +% 定义普通定理环境。清除预设的证毕符号,并排除 \env{proof}。 % \begin{macrocode} -\theoremsymbol { \ensuremath { \mdwhtsquare } } -\newtheorem* { proof } { \g_@@_name_proof_tl } + \theoremsymbol { } + \group_begin: + \clist_remove_all:Nn \g_@@_theorem_type_clist { proof } + \@@_new_theorem:NV \g_@@_theorem_type_clist \l_@@_thm_counter_tl + \group_end: + } % \end{macrocode} +% \end{macro} % -% 定义普通定理环境,需要排除 \env{proof}。 +% 在导言区末尾,通过吸收的用户设置,选择是否载入并设置 \pkg{ntheorem}。 % \begin{macrocode} -\group_begin: - \clist_remove_all:Nn \g_@@_theorem_type_clist { proof } - \@@_new_theorem:N \g_@@_theorem_type_clist -\group_end: +\ctex_at_end_preamble:n + { + \bool_if:NT \g_@@_thm_predefine_bool + { + \PassOptionsToPackage { amsmath, thmmarks } { ntheorem } + \RequirePackage { ntheorem } + \@@_ntheorem_post_setup: + } + } % % \end{macrocode} % @@ -4610,9 +4971,9 @@ To produce the documentation run the original source files ending with %<*definition-ug> \@@_declare_element:nn { cover / ug / emblem-img } { - content = \njuemblem [ black ] { ! } { 3.35 cm }, + content = \@@_emblem:N \c_@@_emblemwidth_dim, bottom-skip = 1 cm, - align = l + align = l } % \end{macrocode} % \end{macro} @@ -4622,7 +4983,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / ug / name-img } { - content = \njuname [ black ] { ! } { 3 cm }, + content = \@@_name:N \c_@@_namewidth_dim, bottom-skip = 1 cm } % \end{macrocode} @@ -4647,7 +5008,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / ug / info } { content = - \@@_cover_info_ug:NN \g_@@_coverlabel_dim \g_@@_coveruline_dim, + \@@_cover_info_ug:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim, format = \zihao { 3 } } % \end{macrocode} @@ -4663,18 +5024,18 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_ug:NN #1#2 { - \begin{minipage} { #1 + #2 + \g_@@_smallhskip_dim } - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim - \dim_set:Nn \l_@@_tmpb_dim { .5 #2 - .5 #1 - \g_@@_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 } + \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 } + \@@_cover_entry:nnn { submitdate } { #1 } { #2 } \end{minipage} } % @@ -4691,8 +5052,8 @@ To produce the documentation run the original source files ending with %<*definition-g> \@@_declare_element:nn { cover / g / emblem-img } { - content = \njuemblem [ black ] { ! } { 1.9 cm }, - bottom-skip = 1 cm + content = \@@_emblem:N \c_@@_emblemwidthi_dim, + bottom-skip = 1.5 cm } % \end{macrocode} % \end{macro} @@ -4702,7 +5063,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / name-img } { - content = \njuname [ black ] { 4.4 cm } { ! }, + content = \@@_name:N \c_@@_namewidth_dim, bottom-skip = 2 cm } % \end{macrocode} @@ -4726,7 +5087,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / degree } { - content = \g_@@_name_apply_tl, + content = \c_@@_name_apply_tl, format = \zihao { -1 } \bfseries, bottom-skip = 1 cm plus 1.5 fil } @@ -4739,7 +5100,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / g / info } { content = - \@@_cover_info_g:NN \g_@@_coverlabel_dim \g_@@_coveruline_dim, + \@@_cover_info_g:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim, bottom-skip = 0 pt plus 1.5 fil } % \end{macrocode} @@ -4762,8 +5123,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_g:NN #1#2 { - \begin{minipage} { #1 + #2 + \g_@@_smallhskip_dim } - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim + \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 } } @@ -4790,14 +5151,14 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_back_g: { - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_id_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_id_tl { : \@@_quad: } \g_@@_info_id_tl \@@_vskip: - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_defenddate_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_defenddate_tl { : \@@_quad: } \g_@@_info_defenddate_tl \@@_vskip: - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_supvfull_tl - { : \@@_quad: } \skip_horizontal:n { 8 em } \g_@@_name_sign_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_supvfull_tl + { : \@@_quad: } \skip_horizontal:n { 8 em } \c_@@_name_sign_tl } % \end{macrocode} % \end{macro} @@ -4841,8 +5202,8 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / g / en / middle } { content = - \g_@@_text_cover_en_tl \@@_vskip: - \textsc { \clist_item:Nn \g_@@_name_degree_en_clist + \c_@@_text_cover_en_tl \@@_vskip: + \textsc { \clist_item:Nn \c_@@_name_degree_en_clist { \g_@@_info_degree_int } } \@@_vskip: { in } \@@_vskip: \g_@@_info_major_en_tl, @@ -4856,7 +5217,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / en / emblem-img } { - content = \njuemblem [ black ] { ! } { 2.5 cm }, + content = \@@_emblem:N \c_@@_emblemwidthii_dim, bottom-skip = 1.5 cm } % \end{macrocode} @@ -4869,7 +5230,7 @@ To produce the documentation run the original source files ending with { content = \g_@@_info_dept_en_tl \skip_vertical:N \c_zero_skip - \g_@@_name_nju_en_tl \skip_vertical:n { 1 cm } + \c_@@_name_nju_en_tl \skip_vertical:n { 1 cm } \g_@@_info_submitdate_en_tl } % \end{macrocode} @@ -4894,7 +5255,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / nl / name } { content = - \@@_spread_box:nnV { 6 em } { } \g_@@_name_title_tl, + \@@_spread_box:nnV { 6 em } { } \c_@@_name_title_tl, format = \zihao { -0 }, bottom-skip = 0 pt plus 1 fil } @@ -4953,11 +5314,11 @@ 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 } { } \g_@@_name_clc_tl \@@_hskip: + \@@_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 } { } \g_@@_name_secretlv_tl \@@_hskip: + \@@_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 } { } \g_@@_name_udc_tl \@@_hskip: + \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_udc_tl \@@_hskip: \@@_ulined_center_box:nn { 9 em } { \g_@@_info_udc_tl } \hfill \null } % \end{macrocode} @@ -4970,11 +5331,11 @@ To produce the documentation run the original source files ending with { \parbox [ b ] { 15 em } { \@@_uline_title: } \par \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } \g_@@_name_title_b_tl } + { \zihao { 4 } \c_@@_name_title_b_tl } \skip_vertical:N \c_zero_skip \@@_ulined_center_box:nn { 4.5 em } { \g_@@_info_author_tl } \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } { ( } \g_@@_name_author_tl { ) } } + { \zihao { 4 } { ( } \c_@@_name_author_tl { ) } } } % \end{macrocode} % \end{macro} @@ -4985,18 +5346,18 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_nl: { - \@@_uline_list:nnn { \g_@@_name_supvinfo_tl } + \@@_uline_list:nnn { \c_@@_name_supvinfo_tl } { \clist_use:Nn \g_@@_info_supv_clist { ~ } - \clist_use:Nn \g_@@_info_supv_ii_clist { ~ } ~ - \g_@@_info_supv_cont_tl + \clist_use:Nn \g_@@_info_supv_ii_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 } { } \\ - \@@_full_uline:Nn \l_@@_tmpa_dim { \g_@@_name_confer_tl } + \@@_full_uline:Nn \l_@@_tmpa_dim { \c_@@_name_confer_tl } \@@_uline:n { \l_@@_tmpa_dim } } % \end{macrocode} @@ -5023,8 +5384,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { authdecl / g / title } { - content = \g_@@_name_authdecl_tl, - format = \g_@@_fmt_chapter_tl, + content = \c_@@_name_authdecl_tl, + format = \c_@@_fmt_chapter_tl, bottom-skip = 3 cm } % \end{macrocode} @@ -5035,7 +5396,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { authdecl / g / text } { - content = \g_@@_text_authdecl_tl, + content = \c_@@_text_authdecl_tl, align = n, bottom-skip = 2 cm } @@ -5106,22 +5467,26 @@ To produce the documentation run the original source files ending with cell{1}{2} = {c=5}{m}, cell{3}{2} = {c=5}{m}, cell{4}{2} = {c=5}{m}, cell{5}{2} = {c=5}{m} } - \g_@@_name_title_c_tl & \g_@@_info_title_tl \\ - \g_@@_name_id_a_tl & \g_@@_info_id_tl & - \g_@@_name_dept_a_tl & \g_@@_info_dept_tl & - \g_@@_name_year_tl & + \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_year_tl & \tl_range:Nnn \g_@@_info_submitdate_raw_tl {1} {4} \\ - \g_@@_name_degree_a_tl & + \c_@@_name_degree_a_tl & { \@@_degree_checkbox:n { 2 } 学术学位硕士 \qquad{} \@@_degree_checkbox:n { 3 } 专业学位硕士 \\ \@@_degree_checkbox:n { 4 } 学术学位博士 \qquad{} \@@_degree_checkbox:n { 5 } 专业学位博士 } \\ - \g_@@_name_email_tl & \g_@@_info_email_tl \\ - \g_@@_name_supv_b_tl & - \clist_item:Nn \g_@@_info_supv_clist {1} - \clist_item:Nn \g_@@_info_supv_ii_clist {1} \\ + \c_@@_name_email_tl & \g_@@_info_email_tl \\ + \c_@@_name_supv_b_tl & + \clist_item:Nn \g_@@_info_supv_clist {1} + \bool_if:NT \l_@@_second_supv_bool + { + \@@_quad: + \clist_item:Nn \g_@@_info_supv_ii_clist {1} + } \\ \end{tblr} } % \end{macrocode} @@ -5132,8 +5497,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_authdecl_sign_g: { - \g_@@_name_authsign_tl \par - \g_@@_name_blankdate_tl + \c_@@_name_authsign_tl \par + \c_@@_name_blankdate_tl } % \end{macrocode} % \end{macro} @@ -5143,9 +5508,9 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_authdecl_secretlv_g: { - \g_@@_name_secretstatus_tl \par - \ensuremath { \mdwhtsquare } \g_@@_name_secretfree_tl \par - \ensuremath { \mdwhtsquare } \g_@@_name_secretdate_tl + \c_@@_name_secretstatus_tl \par + \ensuremath { \mdwhtsquare } \c_@@_name_secretfree_tl \par + \ensuremath { \mdwhtsquare } \c_@@_name_secretdate_tl } % % \end{macrocode} @@ -5266,9 +5631,9 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_make_origdecl: { - \chapter* { \g_@@_name_origdecl_tl } + \chapter* { \c_@@_name_origdecl_tl } \thispagestyle { empty } - \g_@@_text_origdecl_tl + \c_@@_text_origdecl_tl \vfil \begin{flushright} % \clist_map_inline:nn { origsign, id, origdate } @@ -5286,12 +5651,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_make_authdecl: { -% \prg_do_nothing: -%<*definition-g> - \thispagestyle{empty} - \UseInstance { nju } { authdecl-g-default } - \cleardoublepage -% +% \prg_do_nothing: +% \UseInstance { nju } { authdecl-g-default } } % % \end{macrocode} @@ -5362,6 +5723,11 @@ 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 + { + \RenewDocumentCommand \njuemblem { o m m } { \prg_do_nothing: } + \RenewDocumentCommand \njuname { o m m } { \prg_do_nothing: } + } } % \end{macrocode} % @@ -5393,15 +5759,19 @@ To produce the documentation run the original source files ending with % 如果在选择了 \opt{decl-page},就生成本科生的诚信承诺书, % 或研究生的原创性声明和出版授权书。 % \begin{macrocode} -\bool_if:NF \g_@@_draft_bool - { - \bool_if:NT \g_@@_decl_bool + \bool_if:NF \g_@@_draft_bool { - \@@_make_origdecl: - \AtEndEnvironment { document } - { \@@_make_authdecl: } + \bool_if:NT \g_@@_decl_bool + { + \@@_make_origdecl: + \AtEndEnvironment { document } + { + \cleardoublepage + \@@_make_authdecl: + \cleardoublepage + } + } } - } % \end{macrocode} % 在标题页后使用大写罗马字母页码,恢复正常字体设置。 % \begin{macrocode} @@ -5426,7 +5796,7 @@ To produce the documentation run the original source files ending with %<*(definition-ug|definition-g)> \@@_declare_element:nn { abstract / title } { - content = \@@_abs_title:V \g_@@_name_abstracttitle_tl, + content = \@@_abs_title:V \c_@@_name_abstracttitle_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -5454,7 +5824,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / en / title } { - content = \@@_abs_title:V \g_@@_name_abstracttitle_en_tl, + content = \@@_abs_title:V \c_@@_name_abstracttitle_en_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -5496,13 +5866,13 @@ To produce the documentation run the original source files ending with % 确定标题类型。 % \begin{macrocode} \tl_if_blank:eTF { #1 } - { \g_@@_name_title_tl } - { \clist_item:Nn \g_@@_name_type_en_clist { \g_@@_info_type_int } } + { \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 \g_@@_name_author_tl \g_@@_name_author_a_tl + \tl_set_eq:NN \c_@@_name_author_tl \c_@@_name_author_a_tl % \end{macrocode} % 使用循环输出院系、专业、作者、导师信息。 % \begin{macrocode} @@ -5522,7 +5892,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / mark } { - content = \g_@@_name_abstract_b_tl, + content = \c_@@_name_abstract_b_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } @@ -5534,7 +5904,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / en / mark } { - content = \g_@@_name_abstract_b_en_tl, + content = \c_@@_name_abstract_b_en_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } @@ -5553,8 +5923,8 @@ To produce the documentation run the original source files ending with { \@@_uline_list:xnn { - \clist_item:Nn \g_@@_name_type_clist { \g_@@_info_type_int } - \g_@@_name_title_a_tl #1 + \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 } % \end{macrocode} @@ -5563,9 +5933,9 @@ To produce the documentation run the original source files ending with \@@_full_uline:NV \l_@@_tmpa_dim { \@@_ulined_center_box:nn { 11 em } { \g_@@_info_major_tl } - \g_@@_name_major_a_tl + \c_@@_name_major_a_tl \@@_ulined_center_box:nn { 4 em } { \g_@@_info_grade_tl } - \g_@@_name_grade_tl \g_@@_name_author_a_tl #1 + \c_@@_name_grade_tl \c_@@_name_author_a_tl #1 } \@@_ulined_center_box:nn { \l_@@_tmpa_dim } { \g_@@_info_author_tl } \\ @@ -5573,7 +5943,7 @@ To produce the documentation run the original source files ending with % 导师姓名、职称。 % \begin{macrocode} \@@_full_uline:NV \l_@@_tmpa_dim - { \g_@@_name_supv_a_tl #1 } + { \c_@@_name_supv_a_tl #1 } \@@_ulined_center_box:nn { \l_@@_tmpa_dim } { \g_@@_info_supvfull_tl } } @@ -5618,7 +5988,7 @@ To produce the documentation run the original source files ending with %<*class> \cs_new_protected:Npn \@@_print_keywords:nn #1#2 { - \tl_set:Nv \l_@@_tmpa_tl { g_@@_name_keywords #1 _tl } + \tl_set:Nv \l_@@_tmpa_tl { c_@@_name_keywords #1 _tl } \@@_get_text_width:NV \l_@@_tmpa_dim \l_@@_tmpa_tl % \end{macrocode} % 关键词列表的悬挂缩进样式由 \tn{list} 环境产生。 @@ -5723,7 +6093,7 @@ To produce the documentation run the original source files ending with { \cleardoublepage \thispagestyle { plain } - \@@_abs_bookmark:Vn \g_@@_name_abstract_a_tl { abstract } + \@@_abs_bookmark:Vn \c_@@_name_abstract_a_tl { abstract } \@@_make_abstract: \group_begin: \kaishu \zihao { -4 } #1 } @@ -5738,7 +6108,7 @@ To produce the documentation run the original source files ending with { \cleardoublepage \thispagestyle { plain } - \@@_abs_bookmark:Vn \g_@@_name_abstract_a_en_tl { abstract-en } + \@@_abs_bookmark:Vn \c_@@_name_abstract_a_en_tl { abstract-en } \@@_make_abstract_en: \group_begin: \zihao { -4 } #1 } @@ -5754,9 +6124,11 @@ To produce the documentation run the original source files ending with % 单独制作的前言致谢页。 % \begin{macrocode} \NewDocumentEnvironment { preface } { +b } - { \@@_chapter:V \g_@@_name_preface_tl #1 } { } + { \@@_chapter:V \c_@@_name_preface_tl #1 } + { \cleardoublepage } \NewDocumentEnvironment { acknowledgement } { +b } - { \@@_chapter:V \g_@@_name_acknowledgement_tl #1 } { } + { \@@_chapter:V \c_@@_name_acknowledgement_tl #1 } + { \cleardoublepage } % \end{macrocode} % \end{environment} % \end{environment} @@ -5770,7 +6142,7 @@ To produce the documentation run the original source files ending with % 成果列表。 % \begin{macrocode} \NewDocumentCommand \njupaperlist - { O { \g_@@_name_paperlist_tl } m } + { O { \c_@@_name_paperlist_tl } m } { \group_begin: % \end{macrocode} @@ -5848,10 +6220,10 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \NewDocumentEnvironment { notation } { O { 10 em } O { 5 em } } { - \@@_chapter:V \g_@@_name_notation_tl + \@@_chapter:V \c_@@_name_notation_tl \@@_make_notation:nn { #1 } { #2 } } - { \endlist } + { \endlist \cleardoublepage } % \end{macrocode} % \end{environment} % @@ -5860,7 +6232,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \NewDocumentEnvironment { notation* } { O { 10 em } O { 5 em } } { - \chapter * { \g_@@_name_notation_tl } + \chapter * { \c_@@_name_notation_tl } \@@_make_notation:nn { #1 } { #2 } } { \endlist } @@ -5872,6 +6244,7 @@ To produce the documentation run the original source files ending with % \subsection{配置常量} % \label{subsec:constant-config} % \changes{v0.16}{2022/02/23}{将名称常量分离到 \file{.def} 文件。} +% \changes{v0.18}{2022/04/20}{使用 |const| 类型统一定义常量。} % % 本节内容用于生成常量的默认定义,分为本科生和研究生模板两种。 % @@ -5931,7 +6304,7 @@ To produce the documentation run the original source files ending with { author_a } { 本科生姓名 }, { grade } { 年级 }, { origdecl } - { \g_@@_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, + { \c_@@_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, { origsign } { 作者签名 }, { submitdate } { 提交日期 }, { supv } { 导师 }, @@ -5944,12 +6317,12 @@ To produce the documentation run the original source files ending with { { abstracttitle } { - \g_@@_name_nju_tl \g_@@_name_type_tl - \g_@@_name_lang_tl \g_@@_name_abstract_tl + \c_@@_name_nju_tl \c_@@_name_type_tl + \c_@@_name_lang_tl \c_@@_name_abstract_tl } { - \g_@@_name_nju_tl \g_@@_name_type_tl - \g_@@_name_lang_en_tl \g_@@_name_abstract_tl + \c_@@_name_nju_tl \c_@@_name_type_tl + \c_@@_name_lang_en_tl \c_@@_name_abstract_tl }, { author } { 学生姓名 } { UNDERGRADUATE }, { major } { 专业 } { SPECIALIZATION }, @@ -5991,15 +6364,16 @@ To produce the documentation run the original source files ending with { major_a } { 专业 }, % 用于国家图书馆封面的专业名称字样 { major_b } { 专业名称 }, - { origdecl } { 南京大学学位论文原创性声明 }, + { origdecl } + { \c_@@_name_nju_tl 学位论文原创性声明 }, { origsign } { 研究生签名 }, { reviewer } { 评阅人: }, { secretlv } { 密级 }, { secretstatus } { 论文涉密情况: }, { secretfree } { 不保密 }, { secretdate } - { 保密,保密期( \g_@@_name_blankdate_tl 至 - \g_@@_name_blankdate_tl ) }, + { 保密,保密期( \c_@@_name_blankdate_tl 至 + \c_@@_name_blankdate_tl ) }, { sign } { (签字) }, { submitdate } { 论文提交日期 }, { supv } { 导师 }, @@ -6024,11 +6398,11 @@ To produce the documentation run the original source files ending with \clist_map_inline:nn { { abstracttitle } - { 南京大学 \g_@@_info_type_tl 中文摘要首页用纸 } - { 南京大学 \g_@@_info_type_tl 英文摘要首页用纸 }, - { author } { 作者姓名 } { POSTGRADUATE }, - { major } { 专业方向 } { SPECIALIZATION }, - { supvfull } { 指导教师 } { MENTOR } + { \c_@@_name_nju_tl \g_@@_info_type_tl 中文摘要首页用纸 } + { \c_@@_name_nju_tl \g_@@_info_type_tl 英文摘要首页用纸 }, + { author } { 作者姓名 } { POSTGRADUATE }, + { major } { 专业方向 } { SPECIALIZATION }, + { supvfull } { 指导教师 } { MENTOR } } { \@@_define_name:nnn #1 } % @@ -6037,10 +6411,10 @@ To produce the documentation run the original source files ending with % \subsubsection{文本} % \label{subsubsec:constant-text} % -% \begin{variable}{\g_@@_text_origdecl_tl} +% \begin{variable}{\c_@@_text_origdecl_tl} % 本科生的学位论文诚信承诺书,或研究生的学位论文原创性声明。 % \begin{macrocode} -\tl_const:Nn \g_@@_text_origdecl_tl +\tl_const:Nn \c_@@_text_origdecl_tl { %<*definition-ug> 本人郑重承诺:所呈交的毕业论文(设计)(题目: \g_@@_info_title_tl ) @@ -6050,21 +6424,21 @@ To produce the documentation run the original source files ending with 本人承诺不存在抄袭、伪造、篡改、代写、买卖毕业论文(设计)等违纪行为。 % %<*definition-g> - 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作 - 所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或 - 集体已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构 - 的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已 - 在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 + 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作所 + 取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或集体 + 已经发表或撰写过的研究成果,也不包含为获得 \c_@@_name_nju_tl 或其他教 + 育机构的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体, + 均已在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 % } % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_text_authdecl_tl} +% \begin{variable}{\c_@@_text_authdecl_tl} % 研究生的学位论文出版授权书。 % \begin{macrocode} %<*definition-g> -\tl_gset:Nn \g_@@_text_authdecl_tl +\tl_const:Nn \c_@@_text_authdecl_tl { 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》 (以下简称“章程”),愿意将本人的学位论文提交“中国学术期刊 @@ -6078,13 +6452,13 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_text_cover_en_tl} +% \begin{variable}{\c_@@_text_cover_en_tl} % 研究生的英文封面字样。 % \begin{macrocode} -\tl_gset:Nn \g_@@_text_cover_en_tl +\tl_const:Nn \c_@@_text_cover_en_tl { A~ dissertation~ submitted~ to \\ - the~ graduate~ school~ of~ Nanjing~ University \\ + the~ graduate~ school~ of~ \c_@@_name_nju_en_tl \\ in~ partial~ fulfilment~ of~ the~ requirements~ for~ the~ degree~ of } % @@ -6112,6 +6486,7 @@ To produce the documentation run the original source files ending with % \label{subsubsec:constant-length} % % \changes{v0.17}{2022/04/09}{将长度值分离到 \file{.def} 文件。} +% \changes{v0.18}{2022/04/20}{统一管理校名校徽尺寸。} % 默认长度值。 % \begin{macrocode} \clist_map_inline:nn @@ -6120,6 +6495,11 @@ To produce the documentation run the original source files ending with % { coverlabel } { 100 pt }, { coverlineskip } { 40 pt }, { coveruline } { 270 pt }, +% { emblemwidth } { 68 pt }, +% { emblemwidthi } { 46 pt }, +% { emblemwidthii } { 61 pt }, +% { namewidth } { 300 pt }, +% { namewidth } { 126 pt }, { smallhskip } { 5 pt }, { smallvskip } { 1 ex } } @@ -6134,12 +6514,14 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \clist_map_inline:nn { - { chapterintoc } { \large \normalfont \sffamily }, - { chapter } { \large \normalfont \sffamily \centering }, - { section } { \large \normalfont \sffamily }, - { subsection } { \large \normalfont \sffamily }, - { subsubsection } { \large \normalfont \sffamily }, - { toctitle } { \centering \zihao { 3 } \bfseries } + { 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 } } { \@@_define_fmt:nn #1 } % diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.ins b/macros/unicodetex/latex/njuthesis/njuthesis.ins index 131bf3bb9c..5efc57a52f 100644 --- a/macros/unicodetex/latex/njuthesis/njuthesis.ins +++ b/macros/unicodetex/latex/njuthesis/njuthesis.ins @@ -78,13 +78,13 @@ To produce the documentation run the original source files ending with \endbatchfile \__nju_declare_element:nn { abstract / mark } { - content = \g__nju_name_abstract_b_tl, + content = \c__nju_name_abstract_b_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } \__nju_declare_element:nn { abstract / en / mark } { - content = \g__nju_name_abstract_b_en_tl, + content = \c__nju_name_abstract_b_en_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf index 4863e8f027..97e9015106 100644 Binary files a/macros/unicodetex/latex/njuthesis/njuthesis.pdf and b/macros/unicodetex/latex/njuthesis/njuthesis.pdf differ -- cgit v1.2.3