Newer
Older
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8
% by Nanjing University Linux User Group <nju.lug@yaoge123.cn>
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Yu Xiong.
%
% This work consists of the files njuthesis.dtx,
% and the derived files njuthesis.ins,
% njuthesis.cls,
% njuthesis.pdf,
% and README.md.
%
% -----------------------------------------------------------------------
% The development version of the template can be found at
% https://github.com/nju-lug/NJUThesis
%
% for those people who are interested.
%
%<*internal>
\iffalse
%</internal>
%
%<*internal>
\fi
\begingroup
\def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
\keepsilent
\askforoverwritefalse
\preamble
by Nanjing University Linux User Group <nju.lug@yaoge123.cn>
This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c of this license
or (at your option) any later version. The latest version of this
license is in:
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.
To produce the documentation run the original source files ending with `.dtx'
through XeTeX.
\endpreamble
\generate{
\usedir{tex/latex/njuthesis}
\file{\jobname.cls} {\from{\jobname.dtx}{class}}
%<*internal>
\usedir{source/latex/njuthesis}
%</internal>
}
\obeyspaces
\Msg{*************************************************************}
\Msg{* *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* files into a directory searched by TeX: *}
\Msg{* *}
\Msg{* The recommended directory is TDS:tex/latex/njuthesis *}
\Msg{* *}
\Msg{* njuthesis.cls *}
\Msg{* njuthesis.ins *}
\Msg{* *}
\Msg{* To produce the documentation, run the file njuthesis.dtx *}
\Msg{* through XeLaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
\Msg{*************************************************************}
\endbatchfile
%
%<*internal>
\fi
%</internal>
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\RequirePackage{expl3}
%<class>\GetIdInfo $Id: njuthesis.dtx 0.14.0 2022-01-06 20:00:00 +0800 NJU LUG <nju.lug@yaoge123.cn> $
%<class> { Thesis template for Nanjing University }
%<class>\ProvidesExplClass{njuthesis}
%<class>{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\usepackage[firstpage=true]{background}
\backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm}
pdftitle = {The njuthesis class - LaTeX thesis template for Nanjing University},
citecolor = njublue,
linkcolor = njuviolet,
urlcolor = njumagenta}
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
\DefTblrTemplate{caption-sep}{default}{\quad}
\lstdefinestyle{style@base}
{
basewidth = 0.5 em,
gobble = 3,
lineskip = 3 pt,
frame = l,
framerule = 1 pt,
framesep = 0 pt,
xleftmargin = 2 em,
xrightmargin = 3 em,
escapeinside = {(*}{*)},
basicstyle = \small\ttfamily,
keywordstyle = \bfseries\color{njuviolet},
commentstyle = \itshape\color{white!50!gray},
stringstyle = \color{nju-chem-red},
backgroundcolor = \color{white!95!gray}
}
\lstdefinestyle{style@shell}
{
style = style@base,
rulecolor = \color{njumagenta},
language = bash,
alsoletter = {-},
}
\lstdefinestyle{style@latex}
{
style = style@base,
rulecolor = \color{njublue},
language = [LaTeX]TeX,
alsoletter = {*, -},
texcsstyle = *\color{njuviolet},
emphstyle = [1]\color{nju-ai-orange},
emphstyle = [2]\color{nju-cs-green}
}
\lstnewenvironment{shellexample}[1][]{%
\lstset{style=style@shell, #1}}{}
\lstnewenvironment{latexexample}[1][]{%
\lstset{style=style@latex, #1}}{}
% \title{\color{njuviolet}{The \cls{njuthesis} class\\ 南京大学学位论文模板}}
% Nanjing University Linux User Group
% \thanks{E-mail: \href{mailto:nju.lug@yaoge123.cn}{nju.lug@yaoge123.cn}}}
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
% \changes{v0.3}{2021/09/09}{使用自动构建工具进行测试。}
% \changes{v0.4}{2021/09/09}{将个人信息使用内置命令输入。}
% \changes{v0.5}{2021/09/10}{新增了对第二导师的支持。}
% \changes{v0.6}{2021/09/10}{封装个人信息}
% \changes{v0.6}{2021/09/10}{实现自动打包发布。}
% \changes{v0.7}{2021/09/11}{增加对研究生模板的支持}
% \changes{v0.7}{2021/09/12}{将njuthesis发布在CTAN。}
% \changes{v0.9}{2021/09/15}{使用 DocStrip 合并模板文件。}
% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合 \hologo{LaTeX3} 规范。}
% 南京大学学位论文 \hologo{LaTeX} 模板 \cls{njuthesis} 基于本科生院的论文撰写
% 规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学
% 位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书
% 写的方便。
% The \cls{njuthesis} class is intended for typesetting Nanjing University
% dissertations with \hologo{LaTeX}, providing support for bachelor, master,
% and doctoral thesis.
% 在使用本模板时,我们默认您同意以下内容:
% \begin{enumerate}
% \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件。
% \item 本模板与学校官方部门并不存在合作关系,作者不对使用本模板产生的格式审查问题负责。
% \item 遇到本文档没有覆盖的问题属于正常情况,欢迎提交反馈意见。
% \end{enumerate}
% 我们的 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{Linux 用户组}始终欢迎
% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 Linux 用户组维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
% 本模板使用的本科生毕业论文模板格式依据《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju2021},研究生学位论文格式依据研究生院提供的材料包。
% 在本文正式介绍 \cls{njuthesis} 论文模板前,您也许并不熟悉 \hologo{TeX} 排版系统。话不多说,请先完整体验一遍下述的工作流程:
%
% \bigskip
% \fcolorbox{njublue}{gray!5}{\parbox{\textwidth-5em}{%
% \begin{enumerate}
% \item 访问 \url{https://tex.nju.edu.cn}
% \item 点击右上角 Register,用南大邮箱注册账号
% \item 登录您的账号
% \item 点击左上角 New Project 按钮,选择 \textcolor{njuviolet}{NJUThesis Project}
% \item 随意取名,点击 Create 按钮
% 稍等片刻,您会在浏览器右侧发现一份新生成的空白论文。如果它的效果令您满意,不妨以此为基础开始写作。
% 是,但也不一定。有人坚持认为应该做一些\emph{直观、清晰、有手就行、一条路走到底}的教程,而不是
% \emph{长篇累牍的精细介绍},其核心论据在于:现代人类总体上需要快速取得成就感,而且大部分可能用
% 到本模板的同学不会具备必要的基础知识。反驳的观点在于过分简单的实验总是浪费时间的,尤其是在您
% 可能早已掌握基本用法的情况下。但,不论如何,这番操作总会使您预览到 \cls{njuthesis} 论文模板的
% 实际样式。
% 具体是哪里不满意?如果是\emph{样式存在偏差},请联系模板的作者;如果\emph{不能访问前文提到的在
% 线编译网站},请考虑检查网络连接,依次咨询本校
% \href{https://itsc.nju.edu.cn}{信息化管理建设服务中心} 和该网站的维护者
% \href{mailto:my@yaoge123.cn}{姚舸老师};如果\emph{报错},请点击左上角的菜单按钮,查看编译器是
% 否显示为 |XeLaTeX|;再如果\emph{还有其他原因},通过这几分钟的实验我们也可以得到一个相当有益的
% 结论:\emph{也许 Word 模板更加适合您}。这可以节省下掌握 \hologo{TeX} 排版软件使用方法所需的可
% 观时间。
% \item 杨文博(\href{http://yangwenbo.com/}{@solrex})的 njuthesis(2010 - 2018) \cite{wenboyang2013}
% \item \href{https://github.com/fireblue}{@fireblue} 基于杨文博模板的 NJUThesis(2013)\cite{fireblue2013}
% \item \href{https://github.com/wenhai-zheng}{@wenhai-zheng} 的 NJUThesis(2013)\cite{wenhai-zheng2013}
% \item 曹增乐(\href{https://github.com/ZLCao}{@ZLCao})的 NJUBachelor(2013 - 2016)\cite{zenglecao2013}
% \item 胡海星(\href{http://haixing-hu.github.io/}{@Haixing-Hu})的 NJU-Thesis(2013 - 2018)\cite{haixinghu2013}
% \item 张楚珩(\href{https://github.com/zhangchuheng123}{@zhangchuheng123})基于胡海星模板的 NJUThesis(2016)\cite{chuhengzhang2016}
% \item 蒋炎岩(\href{http://ics.nju.edu.cn/~jyy/}{@jiangyy})的 njuthesis(2017 - 2019)\cite{yanyanjiang2017}
% \item \href{https://github.com/njuHan}{@njuHan} 基于胡海星模板的 NJU-Thesis(2018 - 2021)
% \item 饶安逸(\href{https://anyirao.com/}{@AnyiRao})基于张楚珩模板的 NJU Thesis 2018(2018)\cite{anyirao2018}
% \item 赵懿晨(\href{https://fengchendian.github.io/about.html}{@FengChendian})基于饶安逸模板的 NJU Thesis 2021(2021)\cite{yichenzhao2021}
% \end{enumerate}
% 至于不幸而未进行代码版本管理的,甚至于说以压缩包形式流传于各人硬盘中的,就更不可计数了。
%
% 与其让一千个学生做一千种不同的模板,不如有人牵起头来,集中力量办大事。因此,南
% 京大学 Linux User Group 的有志之士在2021年暑期联合起来,参考以上的现成模板,兼
% 顾友校 \cls{fduthesis}\cite{fduthesis}、\textsc{THuThesis}\cite{thuthesis} 等
% 优秀项目,构建了这一全新模板,力求通过 \hologo{LaTeX3} 语法和清晰的接口实现良
% 好的易用性和可维护性。
% \hologo{LaTeX} 并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听
% 到“\emph{给毕业论文交差也得写代码}”这种事情就头疼,实在是我们不愿意见到而必须
% 要面对的情况。目前,中文互联网上的 \hologo{LaTeX} 写作教程可谓汗牛充栋,然而
% 如何快速准确找到所需要的用法,尤其是 \hologo{LaTeX3} 的新接口,需要一定的时间
% 或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您
% 的相关知识体系,只能\emph{尽力做到有求必应},在需要的地方顺带提一嘴,以期使您
% 少走点弯路。
% \item[\textit{lshort}] 著名的介绍文档,已被译为多种语言,可以参考英文版\cite{lshort}及其中文翻译版\cite{lshort-zh-cn}。
% 本模板通过 \textsc{DocStrip} 进行维护,实际上是一种\emph{文学编程}。文学编程的
% 本体是那些用来说明的文字,按写书写文章的方式组织。\file{njuthesis.dtx} 包含
% \cls{njuthesis} 文档类的所有信息。前半部分为模板说明,即各种常用命令与必要的使
% 用方法;后半部分为代码实现,为带有详细注释的 \hologo{TeX} 源代码。后者配合附
% 录,为有意了解本模板实现细节的同学提供必要指引。
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,无衬线字体的
% \pkg{pkg-example} 为宏包名,等宽字体的 \file{file-example.xxx} 为文件名,等宽
% 字体的 \opt{opt-example}为选项名,等宽字体的 \env{env-example}为需要
% |\begin{}|和|\end{}|的环境名,等。本手册提供的代码示例中,左侧边线呈现南大标
% 准洋红色 {\color{njumagenta}$\blacksquare$} 的属于终端命令,呈南大标准蓝色
% {\color{njublue}$\blacksquare$} 的属于 \hologo{LaTeX} 源代码。
%
% \subsection{许可说明}
%
% \file{njuthesis.dtx} 文件以及由其直接产生的所有文件被称为 \cls{njuthesis} 文档类,或者在本文中简称为本模板。
%
% \subparagraph{版权信息}
% 本模板之版权隶属于 2021 南京大学 Linux 用户组。
%
% \subparagraph{发布和修改}
% 本模板的发布和(或)修改遵守 LaTeX Project Public License(版本 1.3c 或更高)的条款。该许可证的最新版本位于 \url{http://www.latex-project.org/lppl.txt},1.3c 及更新的版本随附于 2003/12/01 版本以后的所有 \hologo{LaTeX} 发行版。
%
% \subparagraph{联系作者}
% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,请通过 GitHub Issue 或者 QQ 群聊联系 NJU LUG。
% \cls{njuthesis} 目前处于积极的维护中,其文件主要可通过以下途径获取:
%
% \subparagraph{CTAN} \href{https://ctan.org/}{CTAN}\footnote{The Comprehensive \hologo{TeX} Archive Network} 是所有 \hologo{TeX} 相关材料的中枢。\href{https://ctan.org/pkg/njuthesis}{本模板的 CTAN 页面}\footnote{\cls{njuthesis} 已经于2021年9月12日发布在 CTAN,用于绘制南大图标的 \href{https://ctan.org/pkg/njuvisual}{\pkg{njuvisual}} 也已于同年11月28日发布,两者将进入\hologo{TeX}\,Live 2022。}上提供基本的介绍信息,可以下载说明文档(本文档)和宏包源代码。当然,使用这一来源时并不需要接触后者,请参考 \ref{subsubsec:standard-installation} 的标准安装方法。
%
% \subparagraph{GitHub 仓库} 最新开发进度会提交在本项目的 \href{https://github.com/nju-lug/NJUThesis}{Github仓库}。仓库内仅包含源代码、空白模板及测试文件,不可直接用于写作。这些文件对应的使用方法请参考 \ref{subsubsec:on-the-fly-installation}。如果由于网络原因不便访问主仓库,也可以从\href{https://git.nju.edu.cn/nju-lug/nju-latex-templates/njuthesis}{NJU Git 同步镜像} 获取项目工程文件。
% \subparagraph{GitHub Releases} 本模板不定期将已有的新功能和问题修复打包为新的正式发行版,赋以更改后的版本号,发布在 \href{https://github.com/nju-lug/NJUThesis/releases/latest}{Github Releases 页面}。如果由于网络原因不便访问主仓库,也可以从\href{https://mirror.nju.edu.cn/github-release/nju-lug/NJUThesis/LatestRelease/}{南京大学镜像站下载页面}获取。可供下载的文件包括下列三种:
% \begin{description}
% \item[\file{njuthesis-v*.pdf}] 模板说明文档(本文档)。
% \item[\file{njuthesis-user-v*.zip}] 交付给用户的完整模板包,包括格式文件和范本文档,解压后可用于本地编译,也可直接上传至在线编译网站。
% \item[\file{njuthesis-ctan-v*.zip}] 交付给 CTAN 的源代码包,普通用户请忽略。
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
% \subsubsection{文件构成}
%
% 本模板由数量众多的文件组成,\emph{所有可能遇到的}文件如表 \ref{tab:njuthesisfiles} 所示。
% 其中标注为黄色的内容仅供开发使用,并不会在发行版中出现。
%
% \begin{table}[ht]
% \caption{\cls{njuthesis}文件构成}
% \label{tab:njuthesisfiles}
% \centering
% \begin{tabular}{lp{18em}}
% \toprule
% 名称 & 说明 \\
% \midrule
% \file{.vscode} & Visual Studio Code 配置文件 \\
% \file{latexmkrc} & latexmk 配置文件 \\
% \file{LICENSE} & 许可证 \\
% \file{njuthesis.cls} & 模板文档类 \\
% \color{njuyellow}\file{njuthesis.dtx} & 文档类源代码 \\
% \color{njuyellow}\file{njuthesis.ins} & 文档类安装脚本 \\
% \file{njuthesis.pdf} & 用户手册(本文档) \\
% \file{njuthesis-sample.bib} & 示例参考文献列表 \\
% \file{njuthesis-sample.tex} & 示例文档,不妨以此为基础撰写论文 \\
% \file{README.md} & 自述文件 \\
% \bottomrule
% \end{tabular}
% \end{table}
%
%
% \subsection{本地安装}
%
% \subsubsection{标准安装}
% \label{subsubsec:standard-installation}
%
% 我们\emph{始终建议}使用宏包管理器将 \cls{njuthesis} 安装到您的 \hologo{TeX} 系
% 统。您可以通过 \hologo{TeX}\,Live Manager 或者 \hologo{MiKTeX} Console 等图形
% 化包管理器直接搜索并安装 \cls{njuthesis} (及其依赖的 \pkg{njuvisual})最新的
% 稳定版。同时,您也可以使用终端命令。例如,假设您使用的是 \hologo{TeX}\,Live,
% 键入下述 \pkg{tlmgr} 的命令(很可能需要管理员权限):
% \begin{shellexample}[morekeywords={tlmgr},emph={install}]
% 另一方面,CTAN 依赖开发者手动上传更新,版本更新具有滞后性。如果使用时遇到了问
% 题,不妨使用下一小节的\emph{即时安装方法}优先载入较新的格式文件。
% {\color{red}|[!]|} 如果您具备相关经验\footnote{譬如熟悉命令行操作、使用的是 \hologo{TeX}\,Live 发行版等},可以在下载仓库内全部文件后,于该目录下运行
% \begin{shellexample}[morekeywords={l3build},emph={install}]
% \subsubsection{即时安装}
% \label{subsubsec:on-the-fly-installation}
% 在某些情况下(例如需要上传至在线编译平台、新版本提供了急需的错误修复),您可能
% 需要独立的 \file{.cls} 格式文件。此时请前往前述的 Releases 页面下载
% \emph{完整模板包}。
% 对于希望使用主仓库中版本的用户,本模板也提供了扁平化安装脚本,用于释放供编译的
% 空白模板和格式文件。Windows 用户请直接双击打开 \file{install-win.bat};其他平
% 台(包括 macOS 和 Linux)用户请在此目录下运行
% \begin{shellexample}[morekeywords={bash}]
% bash install-unix.sh
% \end{shellexample}
% {\color{red}|[!]|} 请注意,如果仅仅是希望使用这个模板撰写论文,请无论如何都不
% 要从手动编译 \file{source/} 文件夹下的源代码开始,这样做只会浪费生命中宝贵的数
% 分钟时间。如果遇到了问题,请前往 GitHub 仓库提出 issue。我们只推荐希望参与开发
% 的同学接触 \file{.dtx} 文件。
% 本地编译的安装过程分为两个阶段:安装 \hologo{TeX} 发行版以及配置编辑器。前者提供了可以被命
% 令行终端调用的编译程序,后者则提供了语法高亮、自动编译等人性化功能。
% 首先需要下载并安装 \hologo{TeX} 软件发行版,其中包括引擎、宏包、字体、文档等。各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次编译前请务必通过 MiKTeX Console、TeX Live
% \centering
% \caption{\hologo{TeX} 软件发行版一览}
% \label{tab:texdistribution}
% \begin{tabular}{cccc}
% \toprule
% \hologo{TeX} & Windows & macOS & Linux \\
% \midrule
% \bottomrule
% \end{tabular}
% \end{table}
% \item 可以参照这份\href{https://ctan.org/pkg/install-latex-guide-zh-cn}{手把手的教程}。
% \item 校园网环境中访问\href{https://mirror.nju.edu.cn/download/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F}{南京大学开源软件镜像站}可以获得最佳的下载体验。
% \item 使用最新的发行版,即版本号为2021或者21。
% \item 对于 Windows 和 macOS 用户,更推荐轻量化的 \hologo{MiKTeX} 套件。
% \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查\footnote{譬如遇到 l3 过时问题请运行 |tlmgr update l3packages|。},请确认各宏包已升级至最新版。
% \subsubsection{配置编辑器}
% \changes{v0.11}{2021/11/23}{提供TeXstudio配置文件。}
% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是最好的
% 文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代更美观更多功
% 能}的编辑器,譬如\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 插件的简易配置,在打开文件夹后将自动导入,可以省略初始配置步骤直接使用。
% \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键 |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置为使用 \hologo{XeLaTeX} 编译,然后按照 \ref{subsubsec:compileseq} 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用 \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
% \end{description}
% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎,编辑器提供的
% 快捷按钮实际只是做了包装。为了便于排查运行错误,以下通过具体终端命令简要描述编
% 译过程。
% 要编译三次\footnote{在这里展示的是运用 \pkg{biblatex} 的编译方法,不同于 \hologo{BibTeX}。若设置了 backref 选项,还需第四遍编译以生成后向超链接。}。\emph{假设即将使用的文件名为 \file{njuthesis-sample.tex}},应采用以
% 下命令顺序进行编译,以生成内容正确的 \file{njuthesis-sample.pdf}。输出的 PDF
% 编译命令具体为引擎名称加文件名,在编译 \file{.tex} 文件时,文件扩展名可以省略
% 不写。现阶段 \cls{njuthesis} 仅支持 \hologo{XeLaTeX} 与 \hologo{LuaLaTeX}。请
% 注意,几种命令的输出文件基本相同,可以任取一种;但如果您不清楚这两种编译引擎的
% 区别,或者对多步编译感到困惑,我们建议优先使用 |latexmk -xelatex|。
% xelatex njuthesis-sample
% biber njuthesis-sample
% xelatex njuthesis-sample
% xelatex njuthesis-sample
% lualatex njuthesis-sample
% biber njuthesis-sample
% lualatex njuthesis-sample
% lualatex njuthesis-sample
% \pkg{latexmk}\cite{latexmk} 是一个基于 Perl 脚本的自动编译工具,宗旨是通过单一命令简化上述的多次编译流程。在使用该命令前,请确保安装了以下软件:
% \begin{description}
% \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装 \href{https://strawberryperl.com/}{Strawberry Perl}。
% \item[\pkg{latexmk}] \hologo{MiKTeX}已预装;如果终端找不到|latexmk|命令,\hologo{TeX}\,Live 用户需使用 \pkg{tlmgr} 单独安装。
% \end{description}
%
% 该命令的使用方法为
% 直接运行会调用 \hologo{pdfLaTeX} 引擎导致报错。如需指定编译引擎,可以加入 |-xelatex| 或 |-lualatex| 参数,例如指定 \hologo{XeLaTeX} 的命令为
% \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
% 此外,可以选择使用以下命令清理编译生成的临时文件。
% \begin{shellexample}[morekeywords={latexmk},emph={-c}]
% 相信您在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如\hologo{TeX}编译器安装过程较为漫长\footnote{因此对于 Windows 推荐 \hologo{MiKTeX}。},占用空间过大,而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{同一个模板在 Linux 编译可以相对 Windows 节省一半耗时。}。拒绝接受这些麻烦的同学不妨尝试本节介绍的在线编译方法。
% \href{https://tex.nju.edu.cn}{南大\hologo{TeX}}基于开源的 ShareLaTeX 平台\footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正式上线,是 \href{https://sci.nju.edu.cn/}{eScience 中心}为南大在校师生提供的 \hologo{LaTeX} 在线编译平台,首次使用需凭学校邮箱自助注册账号。
% \item 访问\href{https://tex.nju.edu.cn}{南大\hologo{TeX}},点击界面右上方 Register,使用\emph{南京大学邮箱}注册账号并登录
% \item 在项目页面左上角的Menu中,将编译器改为\hologo{XeLaTeX}或者\hologo{LuaLaTeX}
% \item 仿照 \file{njuthesis-sample.tex} 编写论文
% \item 点击Compile按钮进行编译和预览
% 注意,由于南大 \hologo{TeX} 已预装 \cls{njuthesis},可以直接编写正文,无需 \file{.cls} 等格式文件。如果需要使用新版模板,也可以点击New Project -> Upload Project上传 \ref{subsubsec:on-the-fly-installation} 得到的压缩文件。
%
% \subparagraph{Overleaf}
% \changes{v0.12}{2021/12/07}{更新了对 Overleaf 的支持情况。}
% \pkg{njuthesis} 现已支持 \href{https://www.overleaf.com/}{Overleaf} 平台。
% \href{https://www.texpage.com/}{TeXPage} 是国人研发的 \hologo{LaTeX} 在线编辑器,当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、编辑历史等实用工具,也可以作为一个备选项。
%
%
% \subsection{版本升级}
%
% 考虑到本模板仍在开发中,将不断发布新版本,您可能需要不定期进行更新以得到对于已知问题的修复补丁。考虑到安装和编译方式的差异,不妨直接将论文内容迁移至新版的 \file{njuthesis-sample.tex}\footnote{请赞美 \hologo{TeX} 系统“样式与内容分离”的原则!},然后按照当前工作文件夹内是否有 \file{.cls} 文件分别进行更新操作。
%
% \subparagraph{有}
% 迁移至 \file{njuthesis-user-v*.zip} 提供的新内容。
%
% \subparagraph{没有}
% 如果使用的是南大 \hologo{TeX},更新内置模板时会进行公告,一般为上传 CTAN 后一周。如果是本地安装,请直接使用包管理器进行更新:
% \begin{shellexample}[morekeywords={tlmgr},emph={update}]
% tlmgr update all
% \end{shellexample}
% \begin{latexexample}[moretexcs={\njusetup,\graphicspath,\addbibresource,\maketitle,\tableofcontents,\listoffigures,\listoftables,\mainmatter,\chapter,\printbibliography,\appendix},emph={[1]document}]
% \documentclass{njuthesis}
% \njusetup{}
% \begin{document}
% \maketitle
% \tableofcontents
% \mainmatter
% 选择学位,分别为学士、学术型硕士、专业硕士、博士,默认为学士(即本科生)。
% \end{function}
%
% \begin{function}[added=2021-09-07]{type}
% \begin{syntax}
% type = <(thesis)|design>
% \end{syntax}
% 用于选择文档类型并将相关字段输出在封面和摘要页,可选值分别为毕业论文和毕业设计,默认为毕业论文。
% \begin{function}[added=2021-09-07]{nlcover}
% \begin{syntax}
% 通过此项可用国家图书馆封面替换普通封面。
% 由于本科生院文件中并未提及相关规定,故本选项仅对于研究生有效。
%
% 草稿模式为全局选项,有助于提升编译速度以及检查格式问题,建议在定稿前始终开启。启用这一选项将产生以下整体影响:
% \item 显示页面文字范围边框以及页眉页脚线
% \item 将超出宽度的内容显示为黑色方块
% \item 不再渲染图片,使用含有图片路径的空白盒子占位
% \item 不再渲染超链接及生成 PDF 书签
% \end{itemize}
%
% 该选项也会改变特定宏包的行为,譬如在草稿模式下 \pkg{listings} 宏包的代码环境不会显示内容。具体请参照各个宏包的说明文档。
%
% \begin{function}[added=2021-09-07,updated=2021-12-18]{cjk-font,latin-font}
% cjk-font = <win|mac|fandol|founder|noto|source|none>
% 根据学校论文格式的要求,本模板使用的中文字体主要有{\songti 宋体}、{\heiti 黑体}、{\kaishu 楷体}、{\fangsong 仿宋}四种;
% 西文字体主要有衬线体(\textup{serif})、无衬线体(\textsf{sans-serif})和等宽字体(\texttt{monospace})三种。
% 在生成论文时,需要将每一种字体(宋体、楷体)与一种字库(操作系统中的 ttf 文件)相对应。
% 由于不同操作系统自带的字库不同,在不同的操作系统上使用同一套配置会导致缺字、编译出错等后果。
% 因此,本模板对于中文字体和西文字体都提供了多种字体配置。
% 本模板提供的中文字体配置如表 \ref{tab:cjk-fontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 Fandol 配置)。
% 此外,我们也单独提供了方正和思源两套中文字体配置。
% caption = {中文字体配置列表},
% label = {tab:cjk-fontset},
% note{a} = {请下载简繁扩展(即 GBK 编码)版本},
% note{b} = {使用
% \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}{方正小标宋}
% 作为方正书宋的粗体},
% note{c} = {使用
% \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}{方正黑体}
% 作为方正细黑一的粗体},
% note{d} = {在部分操作系统中可能已经预装 Google Noto 字体。考虑到获取字体的难易程度,单独安装时请采用
% \href{https://mirrors.nju.edu.cn/download/Adobe%20Source%20Han}{Adobe Source Han}
% 字体表示思源字体,请下载 Simplified Chinese(即后缀名为 SC)的版本},
% note{e} = {思源字体并不包含楷书和仿宋,而 Adobe 楷体和仿宋难以直接下载,
% 因此使用方正字体代替},
% ] { cell{2}{2,4} = {white!70!njuyellow}, cell{4}{4} = {white!70!njuyellow}, colspec = {ccccc} }
% \bf 配置名称 & \bf 宋体 & \bf 黑体 & \bf 楷书 & \bf 仿宋 \\
% Windows & 中易宋体 & 中易黑体 & 中易楷体 & 中易仿宋 \\
% macOS & 华文宋体 & 华文黑体 & 华文楷体 & 华文仿宋 \\
% & 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} & 方正仿宋 \\
% 表 \ref{tab:cjk-fontset} 中,黄色底色的字体采用算法加粗。
% 若想要获得与 Word 版本模板最为贴近的体验,
% 可以通过手动安装 Windows 自带的中易宋体、中易黑体、中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 \opt{gyre} 配置)。
% \caption{西文字体清单}
% \label{tab:latinfontset}
% \begin{tabular}{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 \\
% \bottomrule
% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec} 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
% 最后,出于统一格式的需要,本模板还选取了与正文字体相似度最高的数学字体(\href{https://github.com/aliftype/xits}{XITS 字体})用于公式排版。
% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、两种思源字体和四种Fandol字体能够\emph{免费商用};
% 英文字库中只有 Times New Roman、XITS 和三种 \Hologo{TeX} Gyre字体能够\emph{免费商用}。
% 是 \cls{njuthesis} 文档类的通用设置命令,用来设置各项功能。\tn{njusetup} 的参数是一个使用英文半角逗号分隔的键值列表,通常形如 \meta{key}|=|\meta{value}。
% 目前,\tn{njusetup} 仅包含用于设置个人信息的 |info| 类。以下为全部的个人信息参数,其中带有星号的为对应的英文字段。请注意,部分参数已被弃置,列于后方。
%
% \begin{function}[updated=2021-12-12]{info/title,info/title*}
% 题目。由于封面上提供给中文题目的横线长度有限(单行最长为15个汉字),默认会自动对标题进行换行。如果需要手动制定换行位点,请使用英文半角感叹号 |!|,最多两处。
% \begin{function}[updated=2021-10-01]{info/keywords,info/keywords*}
% keywords* = \Arg{英文关键词}
% \end{syntax}
% 关键词列表。关键词之间需要使用英文半角逗号隔开,含有空格的关键字需要使用花括号包裹以避免歧义。可以参照示例模板中的填写方式。
% \end{syntax}
% 年级,推荐格式为“20XX”。
% \end{function}
%
% \end{syntax}
% 学号。南京大学本科生为9位数字学号,研究生为两位大写字母标识加上八位数字组成的学号。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/department,info/department*}
% field = \Arg{方向}
% field* = \Arg{方向}
%
% \begin{function}[updated=2021-12-12]{info/supervisor,info/supervisor*,info/supervisor-title,info/supervisor-title*}
% supervisor = \Arg{导师}
% supervisor* = \Arg{导师}
% supervisor-title = \Arg{导师职称}
% supervisor-title* = \Arg{导师职称}
% \begin{function}[updated=2021-12-12]{info/supervisor-ii,info/supervisor-ii*,info/supervisor-ii-title,info/supervisor-ii-title*}
% \begin{syntax}
% supervisor-ii = \Arg{第二导师}
% supervisor-ii* = \Arg{第二导师}
% supervisor-ii-title = \Arg{第二导师职称}
% supervisor-ii-title* = \Arg{第二导师职称}
% \end{syntax}
% 第二导师。
% \end{function}
% \begin{function}[updated=2021-10-01]{info/submit-date,info/submit-date*}
% \begin{function}[updated=2021-10-01]{info/defend-date,info/chairman,info/reviewer}
% defend-date = \Arg{答辩日期}
% chairman = \Arg{答辩主席}
% reviewer = \Arg{评委姓名职称}
% 答辩相关的内容,只对研究生有效,包括答辩日期,评审委员会主席及四位成员的姓名加职称。其中,四位评审成员是以列表的形式存储的,填写方法同关键词。如果是盲审,填入“盲审”二字即可。
% \begin{function}[updated=2021-10-01]{info/clc,info/secret-level,info/udc,info/supervisor-contact}
% clc = \Arg{中图分类号}
% secret-level = <不涉密|秘密|机密|绝密>
% udc = \Arg{udc}
% supervisor-contact = \Arg{导师联系方式}
% \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*}
% keywords = {我,就是,充数的,关键词},
% keywords* = {Dummy,Keywords,Here,{it is}},
% grade = {2018},
% student-id = {189114514},
% author = {周煜华},
% author* = {Zhou Yuhua},
% department = {拉太赫科学与技术学院},
% department* = {School of \hologo{LaTeX}},
% major = {拉太赫语言学},
% major* = {\hologo{LaTeX} Linguistics},
% supervisor = {李成殿},
% supervisor*= {Li Chengdian},
% supervisor-title = {教授},
% supervisor-title* = {Professor},
% keywords = {我,就是,充数的,关键词},
% keywords* = {Dummy,Keywords,Here,{it is}},
% grade = {2018},
% student-id = {dz18114514},
% author = {周煜华},
% author* = {Zhou Yuhua},
% department = {拉太赫科学与技术学院},
% department* = {School of \hologo{LaTeX}},
% major = {拉太赫语言学},
% major* = {\hologo{LaTeX} Linguistics},
% field = {拉太赫语言在现当代的使用},
% field* = {Contemporary Usage of the \hologo{LaTeX}~Language},
% supervisor = {李成殿},
% supervisor*= {Li Chengdian},
% supervisor-title = {教授},
% supervisor-title* = {Professor},
% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授},
% clc = {0175.2},
% secret-level = {限制},
% udc = {004.72},
% supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514}
% }
% }
% \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}
% \pkg{ctex} 宏集提供了其中用于处理长标题的可选参数。对于过长的标题,目录中会使用其短描述。
% \end{function}
% \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}包中的下划线命令进行了包装。
% \end{function}
% \begin{function}{\footnote}
% \begin{syntax}
% \tn{footnote}\Arg{脚注}
% \end{syntax}
% 添加脚注
% \end{function}
%
%
% \begin{function}{\graphicspath}
% \begin{syntax}
% \tn{graphicspath}\{\marg{路径1}\marg{路径2}\}
% \end{syntax}
% \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}]
% \includegraphics[width=0.5\textwidth]{myfig}
% \caption{我的图}
% \label{fig:myfig}
% \end{figure}
% \paragraph{文字环绕}
%
% 对于较为瘦长,或者仅起到辅助作用的图像,可以使用 \pkg{wrapfig} 宏包提供的 \env{wrapfigure} 实现文字环绕效果。注意这个环境后紧跟的一行不能为空。
% \begin{latexexample}[moretexcs={\includegraphics},emph={[1]wrapfigure}]
% \includegraphics[width=0.15\textwidth]{myfig}
% \caption{我的图}
% \label{fig:myfig}
% \end{wrapfigure}
% <text>
% 使用 \pkg{subcaption} 宏包提供的 \env{subfigure} 环境可以实现多张图片嵌套的效果。
% \begin{latexexample}[moretexcs={\includegraphics},emph={[1]figure,subfigure}]
% \begin{figure}
% \begin{subfigure}{.32\textwidth}
% \centering
% \caption{fig1}
% \end{subfigure}
% \begin{subfigure}{.32\textwidth}
% \centering
% \caption{fig2}
% \end{subfigure}
% \begin{subfigure}{.32\textwidth}
% \centering
% \caption{fig3}
% \end{subfigure}
% \caption{subfigures}
% \end{figure}
% 请尽量避免使用较为老旧的 \pkg{subfig} 宏包,完全不要使用过时的 \pkg{subfigure} 宏包。两者的 CTAN 页面上均建议转移至更新的 \pkg{subcaption} 宏包。
%
% 下面这个例子展示了如何插入一张表格。通过 \pkg{booktabs} 宏包提供的 \tn{toprule}、\tn{midrule} 和 \tn{bottomrule} 命令,我们可以很轻松地绘制出一张漂亮规范的三线表。
% \begin{latexexample}[moretexcs={\toprule,\midrule,\bottomrule},emph={[1]table,tabular}]
% \caption{我的表}
% \label{tab:testtab}
% \begin{tabular}{ccc}
% \toprule
% OS & TeX & 测试情况 \\
% \midrule
% 南大TeX & Overleaf & √ \\
% \bottomrule
% \end{tabular}
% \end{table}
% \begin{function}{\multirow,\multicolumn}
% \begin{syntax}
% \tn{multirow}\Arg{nrows}\oarg{bigstructs}\Arg{width}[\oarg{fixup}\Arg{text}
% \tn{multicolumn}\Arg{nrows}\Arg{width}\Arg{text}
% \end{syntax}
% \url{http://www.ctex.org/documents/packages/table/multirow.htm}
%
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
% \paragraph{更多样式}
%
% TODO:使用 \pkg{tabularray} 的新语法丰富单元格样式
%
%
%
% \subsubsection{数学}
%
% 符号表可以参考\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}是一个更新频繁的包,可能会引发兼容性问题。
%
% 行内公式形如|$\mathrm{e}^{(a+2b)x}$|。
%
% 带有编号的行间公式 \env{equation}。
% \begin{latexexample}[emph={[1]equation}]
% \begin{equation}\label{eq:myeqlabel}
% \pi
% \end{equation}
% \end{latexexample}
%
% 如不需要编号,可以用 \env{equation*} 或者 |\[|\meta{公式}|\]|,请不要使用可能引发问题的 |$$|\meta{公式}|$$|\footnote{\url{https://tex.stackexchange.com/questions/503/why-is-preferable-to}}。
%
%
% \paragraph{定理环境}
%
% 本模板也提供了一系列的数学定理环境。
% 全部预定义的数学定理环境如表~\ref{tab:mathenv} 所示。其中证明环境较为特殊,会在结尾添加证毕符号(\mdwhtsquare)。用户也可以选择使用 \tn{newtheorem} 定义新的定理环境。
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
% \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}
% \begin{proof}
% 证明我是我
% \end{proof}
% \end{latexexample}
% 普通环境。
% \begin{latexexample}
% \begin{definition}[他人]
% 定义他人即地狱
% \end{definition}
% \end{latexexample}
% \changes{v0.13}{2021/12/13}{提供简化的行内代码环境。}
% \changes{v0.13}{2021/12/16}{默认不加载 \pkg{listings} 宏包。}
%
% 如需展示代码,可以使用抄录环境 \tn{verb},格式如 |\verb!<code>!|。其中包裹代码的两个感叹号并不是绝对的,可以替换成任何两个相同的、没有在这段代码中出现过的符号。
%
% 抄录环境仅会用等宽字体如实呈现代码本身,并无任何附加功能。若需格式更为多样的代码环境,可以使用 \pkg{listings} 宏包。v0.14.0 版以后,本模板默认不会调用该宏包,使用代码环境前请在导言区自行导入。
% \begin{latexexample}
% \usepackage{listings}
% \end{latexexample}
% \pkg{listings} 宏包\cite{listings}提供了 \env{lstlisting} 环境,可以生成代码块,提供语法高亮功能,会如实输出缩进空格。且值得注意的是这个环境中的代码不会在草稿模式下显示。
% 如需指定语言,可以使用 |language| 选项。如需自定义关键字,可以使用 |morekeywords| 选项。这一宏包也提供了为某种样式单独一种环境的方法,详见其手册,此处仅展示一个最简化的例子:
% \begin{latexexample}[emph={[1]lstlisting},emph={[2]language},morekeywords={print}]
% 当然,默认提供的代码样式在本模板中并不和谐。可以参照以下代码在导言区设置代码环境通用样式。
% \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 % 右侧边距
% style = njulisting, % 调用上述样式
% flexiblecolumns % 允许调整字符宽度
% \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}!
% 简便起见,不妨单独创建使用简写的行内代码环境,指定某个符号后用其包裹代码即可。这个符号不可以出现在正文及其他命令中,请谨慎设置。
% \begin{latexexample}[moretexcs={\lstMakeShortInline},emph={[2]style,basicstyle,columns}]
% \lstMakeShortInline[
% style = njulisting,
% basicstyle = \normalsize\tt,
% columns = fixed]|
% \end{latexexample}
%
% \begin{function}{\cref}
% \begin{syntax}
% \tn{cref}\Arg{标签}
% \end{syntax}
% 本模板默认载入 \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}。
%
% \begin{function}[added=2021-12-19]{bib/style}
% \begin{syntax}
% \end{syntax}
% 参考文献样式。分为顺序编码制 \opt{numeric} 和著者-出版年制 \opt{author-year},默认为顺序编码制。
% \end{function}
%
% 参考文献样式是一个整体的设置,会对正文中引用的文献的标注方法和参考文献表的输出格式产生影响。根据国家规定\cite{gb-t-7714-2015},可以按照参考文献表的组织方式分为以下两种样式:
%
% \subparagraph{顺序编码制}
% 顺序编码制是按正文中引用的文献出现的先后顺序连续编码,将序号置于方括号中。参考文献表采用顺序编码制组织时,各篇文献应按正文部分标注的序号依次列出。
%
% \subparagraph{著者-出版年制}
% 正文引用的文献采用著者-出版年制时,各篇文献的标注内容由著者姓氏与出版年构成,并置于"()"内。参考文献表采用著者-出版年制组织时,各篇文献首先按文种集中,然后按著者字顺和出版年排列。
%
% 对于本科生而言,学校规定文件表明参考文献表应当“用数字加方括号表示”\cite{nju2021},符合顺序编码制的格式,保持默认设置即可。
%
% \begin{function}[added=2021-12-19]{bib/resource}
% \begin{syntax}
% \end{syntax}
% 参考文献数据源。类似于 \tn{addbibresource} 命令,但可以使用逗号分隔的列表形式。必须使用带扩展名(\file{.bib})的完整文件名。
% \end{function}
% \begin{function}{\addbibresource}
% \begin{syntax}
% \tn{addbibresource}\Arg{文件}
% \end{syntax}
% 添加参考文献源文件。为了与 \pkg{biblatex} 进行兼容,也可使用本命令添加数据源。本命令不支持逗号分隔多个文件的形式,如果希望额外添加参考文献列表,需要在导言区中多次调用。
% 示例参考文献存储于 \file{njuthesis-sample.bib},直接向其中粘贴新的参考文献即可。
%
%
% 可以参考如下范例进行参考文献设置。
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib}]
% \njusetup {
% bib = {
% style = author-year,
% resource = {njuthesis-sample.bib}
% }
% }
% \end{latexexample}
% 显然只有被引用过的条目才会被输出至参考文献表。
%
% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题,这时就要果断假装没有看到。
% 该问题的产生是由于 \hologo{LaTeX} 中只有固定的字母组合中间可以断行。使条目右侧平齐的方法有如下两种:
% \footnote{很不行,\pkg{microtype} 与 \pkg{babel} 没能在我们的模板中解决问题。}
% \begin{itemize}
% \item 自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。缺点是需要逐条手动排查,建议在定稿时进行修改。
% \item 在 |\printbibliography| 前添加 |\emergencystretch=1em| 命令拉伸词间距,缺点是可能降低美观度。
% \end{itemize}
%
% \tn{cite}\marg{文献}
% \tn{cite}\oarg{页码}\marg{文献}
%
% 引用命令 \tn{cite} 含有多个变体,以便使用文献条目中不同的信息域。在两种参考文献样式下,这些命令的行为具体存在一些差异,详见表 \ref{tab:numeric-style} 和表 \ref{tab:author-year-style}。
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
% \begin{table}[ht]
% \caption{顺序编码制下的引用样式}
% \label{tab:numeric-style}
% \centering
% \begin{tblr}{cll}
% \toprule
% \bf 引用方式 & \bf 命令 & \bf 排版效果 \\
% \midrule
% 单篇文献 & \tn{cite} & 上标可设置页码 \\
% 单篇文献 & \tn{parencite} & 非上标可设置页码 \\
% 多篇文献 & \tn{cite} & 上标,逗号隔开或短横线连接 \\
% 标注页码 & \tn{pagescite} & 上标加自动页码 \\
% 标注作者 & \tn{textcite} & 作者为主语加非上标编号 \\
% 标注作者 & \tn{authornumcite} & 作者为主语加上标编号 \\
% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
% \bottomrule
% \end{tblr}
% \end{table}
%
% \begin{table}[ht]
% \centering
% \begin{talltblr}[
% caption = {著者-出版年制下的引用样式},
% label = {tab:author-year-style},
% note{a} = {在此样式下 \tn{parencite} 效果等同于 \tn{cite}} ] {cll}
% \toprule
% \bf 引用方式 & \bf 命令 & \bf 排版效果 \\
% \midrule
% 单篇文献 & \tn{cite}\TblrNote{a} & 作者加年份用括号包围可设置页码 \\
% 多篇文献 & \tn{cite} & 分号隔开 \\
% 标注页码 & \tn{pagescite} & 作者加年份用括号包围自动页码 \\
% 标注年份 & \tn{yearcite} & 用括号包围的年份 \\
% 标注年份、页码 & \tn{yearpagescite} & 提供年份用括号包围自动页码 \\
% 标注作者 & \tn{textcite} & 作者为主语加加括号包围年份 \\
% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
% \bottomrule
% \end{talltblr}
% \end{table}
%
% 南京大学信息化建设管理服务中心已购买 \href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote} 供全校师生免费使用,最新版为 EndNote 20。
%
%
% \subparagraph{使用Zotero}
%
% \href{https://www.zotero.org/}{Zotero}是一款免费的文献管理软件,支持所有桌面平台。
%
% 在保持 Zotero 程序运行的情况下,点击浏览器工具栏的 Zotero Connector 插件即可自动从网页抓取参考文件信息。Zotero 可以通过\href{https://github.com/l0o0/jasminum}{jasminum插件}支持中文参考文献的识别。在选中希望使用的文献后右键导出文献条目即可生成 \file{.bib} 文件。
% 本模板也预定义了一系列用于生成所需的特殊页面的命令与环境。
%
%
% \subsubsection{封面}
%
% \begin{function}{\maketitle}
% 本科生模板仅会生成中文封面;研究生模板会生成中英文封面。
% 如果选择了 \opt{nlcover},仅会生成研究生的国家图书馆封面。
% 如果选择了 \opt{decl-page},会在封面后生成本科生的诚信承诺书或研究生的原创性声明。
% 在启用草稿模式后封面绘制将被禁用。
%
% \paragraph{封面图片}
%
% \begin{function}[added=2021-12-23]{style/emblem-img}
% \begin{syntax}
% emblem-img = \Arg{文件}
% \end{syntax}
% 校徽图片文件。
% \end{function}
%
% \begin{function}[added=2021-12-23]{style/name-img}
% \begin{syntax}
% name-img = \Arg{文件}
% \end{syntax}
% 校名图片文件。
% \end{function}
%
% 通过以上两个选项可以使用外置的校徽和校名图片。本模板封面中校徽及校名的绘制默认依赖 \pkg{njuvisual} 宏包提供的 \pkg{tikz} 矢量曲线,耗时较长,在替换为外置图片后可节省约1秒的编译时长。
%
%
% \subsubsection{摘要页}
% \changes{v0.11}{2021/10/01}{简化了摘要的编写方式。}
% \begin{function}{abstract,abstract*}
% 摘要。带星号的会生成英文摘要。
% \end{function}
%
% \begin{latexexample}[emph={[1]abstract,abstract*}]
% \begin{abstract}
% 我的中文摘要
% \end{abstract}
%
% \begin{abstract*}
% Abstract in English
% \end{abstract*}
% \end{latexexample}
%
%
% \subsubsection{前言页}
% \begin{function}{preface}
% 使用 \env{preface} 环境定义。
% \end{function}
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
% \begin{latexexample}[emph={[1]preface,flushright}]
% \begin{preface}
% 我的前言
% \vspace{1cm}
% \begin{flushright}
% 我的名字\\
% 时间地点
% \end{flushright}
% \end{preface}
% \end{latexexample}
%
%
% \subsubsection{目录页}
%
% \begin{function}{\tableofcontents,\listoffigures,\listoftables}
% 分别生成目录、图片目录和表格目录。
% \end{function}
%
% 目录页的标题名称一般无需修改。用户可以选择使用 \pkg{ctex} 宏集提供的 \tn{ctexset} 命令进行自定义。
% \begin{latexexample}[moretexcs={\ctexset},emph={[1]contentsname,listfigurename,listtablename}]
% \ctexset{
% contentsname = { 目\hspace{2em}次 },
% listtablename = { 表格清单 }
% }
% \end{latexexample}
% 实际上,根据《学位论文编写规则》国家标准\cite{gb-t-7713.1-2006},尽管“目录”这一说法已流传甚广,但学位论文中理应使用“目次”这一名称来指代篇目的列表。
%
%
% \subsubsection{致谢页}
%
% \begin{function}{acknowledgement}
% 同前言,使用 \env{acknowledgement} 环境。
% \end{function}
% \begin{latexexample}[emph={[1]acknowledgement}]
% \begin{acknowledgement}
% 感谢NJU LUG
% \end{acknowledgement}
% \end{latexexample}
%
%
% \subsubsection{附录页}
%
% \begin{function}{\appendix}
% 附录放在本命令后,以英文字母进行编号,编写方式同正文
% \end{function}
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
% \subsubsection{成果列表}
%
% \begin{function}[added=2021-09-29,updated=2021-12-20]{\njupaperlist}
% \begin{syntax}
% \tn{njupaperlist}\oarg{标题}\marg{文献}
% \end{syntax}
% 成果列表,默认标题为发表文章目录。\Arg{文献} 的填写方式同 \tn{cite},多个文献需要使用英文半角逗号隔开。
% \end{function}
%
% 为了便于识别,成果列表中默认对发表年份进行加粗处理。而对作者姓名的处理较为复杂。利用 \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},
% author = {B Nemec and Zhao, Mou Mou},
% author+an = {2=thesisauthor},
% booktitle = {Processings of Symposium on Robot Control},
% shortbooktitle = {(PSRC)},
% pages = {209-214},
% country = {Nantes France},
% year = {1997}
% }
% \end{latexexample}
% 其中 |author+an| 提供了注解的标记,格式为 \meta{序号}|=|\meta{标签},以上条目中即是将第二名作者加入了指定论文作者的注解。\tn{njupaperlist} 会识别 |thesisauthor| 标签,为其指代的作者姓名进行加粗下划线处理。
%
% 除手动进行标记以外,以下也提供一种自动化处理办法。下载 \href{https://github.com/hushidong/biblatex-map}{bibmap} 全部文件后,修改主目录下的 \file{bibmapaddauthoran.py} 中 |fieldsource| 为需要匹配的姓名,将需要进行标记的 \file{.bib} 文件拷贝至本目录(此处使用 \file{test.bib} 进行示范),运行以下命令生成的参考文献数据源即可被成果列表识别加粗。
%
% \begin{shellexample}[morekeywords={python}]
% python bibmap.py test.bib -m bibmapaddauthoran.py
% \end{shellexample}
% \begin{latexexample}[moretexcs={\njuemblem,\njuname,\njuname*}]
% \njuemblem{!}{3cm} % 生成指定大小的紫色南大校徽
% \njuname{4cm}{!} % 生成指定大小的紫色南大中文校名
% \njuname*{4cm}{!} % 生成指定大小的紫色南大英文校名
% \njuemblem[black]{!}{3cm} % 黑色的南大校徽
% \njuemblem[department=dii]{!}{4cm} % 紫色匡院徽标
% \njuemblem[department=cs,color=blue]{!}{3cm} % 纯蓝色计科徽标
% 本宏包的详细使用方法请参考其\href{http://mirrors.ctan.org/macros/latex/contrib/njuvisual/njuvisual.pdf}{说明文档}。
%
% \begin{thebibliography}{99}
%
% \newcommand\urlprefix{\newline\hspace*{\fill}}
% \let\OldUrl=\url
% \renewcommand\url[2][]{{\small\textit{#1}~\OldUrl{#2}}}
% \newcommand\CTANurl[2][]{{^^A
% \small\textit{#1}~\href{http://mirror.ctan.org/#2}{\texttt{CTAN://#2}}}}
%
%
% \bibitem{lshort}
% \textsc{Oetiker T}, \textsc{Partl H}, \textsc{Hyna I}, et al.
% \newblock \textit{The Not So Short Introduction to \hologo{LaTeXe}: Or \hologo{LaTeXe} in 139 minutes} [EB/OL].
% \newblock version 6.4,
% \newblock (2021-03-09)
% \urlprefix\url{https://ctan.org/pkg/lshort-english}
% \urlprefix\CTANurl[文档:]{info/lshort/english/lshort.pdf}
%
% \bibitem{lshort-zh-cn}
% \textsc{Oetiker T}, \textsc{Partl H}, \textsc{Hyna I}, et al.
% \newblock \textit{一份(不太)简短的 \hologo{LaTeXe} 介绍: 或 111 分钟了解 \hologo{LaTeXe}} [EB/OL].
% \newblock \CTeX{} 开发小组, 译.
% \newblock 原版版本 version 6.4, 中文版本 version 6.03,
% \newblock (2021-11-21)
% \urlprefix\url{https://ctan.org/pkg/lshort-zh-cn}
% \urlprefix\CTANurl[文档:]{info/lshort/chinese/lshort-zh-cn.pdf}
%
% \bibitem{gb-t-7713.1-2006}
% 全国信息与文献标准化技术委员会.
% \newblock \textit{学位论文编写规则: GB/T 7713.1--2006} [S].
% \newblock 北京: 中国标准出版社, 2006
%
% \bibitem{gb-t-7714-2015}
% 全国信息与文献标准化技术委员会.
% \newblock \textit{信息与文献\quad 参考文献著录规则: GB/T 7714--2015} [S].
% \newblock 北京: 中国标准出版社, 2015
%
% \bibitem{nju2021}
% 南京大学本科生院.
% \newblock \textit{关于启动南京大学2022届本科毕业论文(设计)工作的通知} [EB/OL].
% \newblock (2021-12-14)
% \urlprefix\url{https://jw.nju.edu.cn/7c/86/c26263a556166/page.htm}
%
%
% \bibitem{biblatex-gb7714-2015}
% 胡振震.
% \newblock \textit{符合 GB/T 7714-2015 标准的 biblatex 参考文献样式} [EB/OL].
% \newblock version 1.1b,
% \newblock (2021-12-11)
% \urlprefix\url{https://ctan.org/pkg/biblatex-gb7714-2015}
% \urlprefix\CTANurl[文档:]{biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf}
%
% \bibitem{latexmk}
% \textsc{Collins J}.
% \newblock \textit{Fully automated \hologo{LaTeX} document generation} [EB/OL].
% \newblock version 4.76,
% \newblock (2021-11-20)
% \urlprefix\url{https://www.ctan.org/pkg/latexmk}
% \urlprefix\CTANurl[文档:]{support/latexmk/latexmk.pdf}
%
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
% \bibitem{listings}
% \textsc{Heinz C}, \textsc{Moses B}, \textsc{Hoffmann J}.
% \newblock \textit{Typeset source code listings using \hologo{LaTeX}} [EB/OL].
% \newblock version 1.8d,
% \newblock (2020-03-24)
% \urlprefix\url{https://www.ctan.org/pkg/listings}
% \urlprefix\CTANurl[文档:]{macros/latex/contrib/listings/listings.pdf}
%
%
% \subsection*{模版}
%
% \bibitem{fduthesis}
% 曾祥东.
% \newblock \textit{fduthesis: 复旦大学论文模板} [EB/OL].
% \newblock version 0.7e,
% \newblock (2020-08-30)
% \urlprefix\url{https://ctan.org/pkg/fduthesis}
% \urlprefix\CTANurl[文档及源代码:]{macros/latex/contrib/fduthesis/fduthesis.pdf}
%
% \bibitem{thuthesis}
% 清华大学 TUNA 协会.
% \newblock \textit{\textsc{ThuThesis}:清华大学学位论文模板} [EB/OL].
% \newblock version 7.2.3,
% \newblock (2021-05-31)
% \urlprefix\url{https://ctan.org/pkg/thuthesis}
% \urlprefix\CTANurl[文档及源代码:]{macros/latex/contrib/thuthesis/thuthesis.pdf}
%
%
% \emph{以下模版现已停止更新。}
%
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
% \bibitem{wenboyang2013}
% 杨文博.
% \newblock \textit{南京大学学位论文 \hologo{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 (2013-04-13)
% \urlprefix\url{https://github.com/fireblue/NJUThesis}
%
% \bibitem{wenhai-zheng2013}
% \textsc{wenhai-zheng}.
% \newblock \textit{南京大学本科毕业论文 \hologo{LaTeX} 模板} [EB/OL].
% \newblock (2013-08-12)
% \urlprefix\url{https://github.com/wenhai-zheng/NJUThesis}
%
% \bibitem{zenglecao2013}
% 曹增乐.
% \newblock \textit{南京大学本科毕业论文(设计) \hologo{LaTeX} 模板} [EB/OL].
% \newblock (2019-06-26)
% \urlprefix\url{https://github.com/ZLCao/NJUBachelor}
%
% \bibitem{haixinghu2013}
% 胡海星.
% \newblock \textit{南京大学学位论文 \hologo{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 (2016-06-01)
% \urlprefix\url{https://github.com/zhangchuheng123/NJUThesis}
%
% \bibitem{yanyanjiang2017}
% 蒋炎岩.
% \newblock \textit{南京大学山寨 \hologo{LyX} 研究生毕业论文模板} [EB/OL].
% \newblock (2019-01-16)
% \urlprefix\url{https://github.com/jiangyy/njuthesis}
%
% \bibitem{njuHan2018}
% \textsc{njuHan}.
% \newblock \textit{南京大学学位论文(本科/硕士/博士),毕业论文 \hologo{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 (2018-06-24)
% \urlprefix\url{https://github.com/AnyiRao/NJUThesis2018}
%
% \bibitem{yichenzhao2021}
% 赵懿晨.
% \newblock \textit{南京大学本科生毕业论文 \hologo{LaTeX} 模板(2021版)} [EB/OL].
% \newblock (2021-09-23)
% \urlprefix\url{https://github.com/FengChendian/NJUThesis2021}
%
%
% 本模板使用 \hologo{LaTeX3} 语法编写,依赖 \pkg{expl3} 环境,
% 并需调用 \pkg{l3packages} 中的相关宏包。
%
% 以下代码中有一些形如 |<*class>|
% 的标记,这是 \pkg{DocStrip} 中的“guard”,用来选择性地提取文件。
% “|*|”和“|/|”分别表示该部分的开始和结束。不含
% “|*|”和“|/|”的 guard 出现在行号右侧,它们用来确定
% 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。
%
% 另有若干包含 |@@| 的guard,用以表示名空间(模块)。
% 在删除注释生成格式文件时,变量名称中的 |@@| 会被等号后的字段替换,
% 譬如在本模板 \cls{njuthesis} 中 |@@=nju|。
% \changes{v0.12}{2021/12/03}{放宽对于 \pkg{l3packages} 的版本要求。}
Package~ "#1"~ is~ too~ old. \\
Please~ update~ an~ up-to-date~ version~ of~
the~ bundles "l3kernel"~ and~ "l3packages"~
{ } { \msg_error:nnn { njuthesis } { l3-too-old } {#1} }
}
% \end{macrocode}
%
% \begin{macrocode}
\msg_new:nnn { njuthesis } { unsupported-engine }
{
}
\sys_if_engine_xetex:F
{
\sys_if_engine_luatex:F
{
\msg_fatal:nnx { njuthesis } { unsupported-engine }
{ \c_sys_engine_str }
}
}
% \end{macrocode}
%
% \begin{variable}{\l_@@_tmp_box,\l_@@_tmp_clist,\l_@@_tmp_dim,
% \l_@@_tmp_int,\l_@@_tmp_seq,\l_@@_tmp_tl}
\int_new:N \l_@@_tmp_int
\seq_new:N \l_@@_tmp_seq
\tl_new:N \l_@@_tmp_tl
% \begin{variable}{\l_@@_info_degree_int,\l_@@_info_degree_tl,
% \l_@@_info_diploma_int,\l_@@_info_diploma_tl,
% \l_@@_info_type_int,\l_@@_info_type_tl}
% \begin{variable}{\l_@@_second_supv_bool}
% 定义用于判断是否有第二导师的变量。
% \begin{macrocode}
\bool_new:N \l_@@_second_supv_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\l_@@_info_supv_full_tl,\l_@@_info_supv_full_en_tl}
% 用于存储导师姓名加职称的变量。
\tl_new:N \l_@@_info_supv_full_tl
\tl_new:N \l_@@_info_supv_full_en_tl
% \begin{variable}{\g_@@_latin_font_tl,\g_@@_cjk_font_tl}
\tl_new:N \g_@@_latin_font_tl
\tl_new:N \g_@@_cjk_font_tl
% \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 \c_@@_name_type_clist
{ 毕业论文, 毕业设计 }
\clist_const:Nn \c_@@_name_type_en_clist
{ THESIS, DESIGN }
\clist_const:Nn \c_@@_name_degree_clist
{ 学士, 硕士, 硕士专业, 博士 }
\clist_const:Nn \c_@@_name_degree_en_clist
{ Bachelor, Master, Master, Doctor~of~Philosophy }
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\@@_quad:,\@@_qquad:}
% 等价于 \LaTeXe{} 中的 \tn{quad} 和 \tn{qquad}。
\cs_new:Nn \@@_quad: { \skip_horizontal:n { 1 em } }
\cs_new:Nn \@@_qquad: { \skip_horizontal:n { 2 em } }
% \begin{macro}{\@@_vskip:,\@@_hskip:}
% 生成一个较小的 skip。
\cs_new:Nn \@@_vskip: { \skip_vertical:n { 1 ex } }
\cs_new:Nn \@@_hskip: { \skip_horizontal:n { 0.3 em } }
% \begin{macro}{\@@_define_name:nn,\@@_define_name:nnn}
% 用来定义默认名称的辅助函数。
% \begin{macrocode}
\cs_new_protected:Npn \@@_define_name:nn #1#2
\cs_new_protected:Npn \@@_define_name:nnn #1#2#3
{
\tl_const:cn { c_@@_name_ #1 _tl } {#2}
\tl_const:cn { c_@@_name_ #1 _en_tl } {#3}
}
% \end{macrocode}
% \end{macro}
%
\cs_new:Npn \@@_name:n #1 { \tl_use:c { c_@@_name_ #1 _tl } }
\cs_new:Npn \@@_info:n #1 { \tl_use:c { l_@@_info_ #1 _tl } }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_ulined_center_box:nn}
% 带有下划线的水平盒子。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 内容,可带有格式
% \end{arguments}
% \begin{macrocode}
\cs_new_protected:Npn \@@_ulined_center_box:nn #1#2
\mode_leave_vertical:
\rule [ -0.5 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
\hbox_to_wd:nn {#1} { \hfil #2 \hfil }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_spread_box:nnn}
% 分散对齐的水平盒子。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 格式
% \item 内容,不可带有格式
% \end{arguments}
% \begin{macrocode}
\cs_generate_variant:Nn \tl_map_inline:nn { xn }
\cs_new_protected:Npn \@@_spread_box:nnn #1#2#3
\mode_leave_vertical:
\hbox_to_wd:nn {#1}
{ #2 \tl_map_inline:xn {#3} { ##1 \hfil } \unskip }
% \begin{macro}{\@@_multiline_box:nnnn}
% 多行固定长度的下划线内容。
% \begin{arguments}
% \item 用于循环的 |int| 型变量
% \item 内容,|clist| 型变量
% \item 行数
% \item 宽度,|dim| 型变量
% \end{arguments}
{ \clist_item:Nn #2 { #1 } } \\
\int_incr:N #1
}
% \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_@@_tmp_tl
{ \tl_range:Nnn { #1 } { #2 } { #2 + #3 - 1 } }
{ \clist_put_right:NV \l_@@_tmp_clist { \l_@@_tmp_tl } }
% \begin{macro}{\@@_uline:n}
% 指定宽度的下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \end{arguments}
% \begin{macrocode}
\cs_new_protected:Npn \@@_uline:n #1
{
\mode_leave_vertical:
\rule [ -0.5 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_uuline:n}
% 指定宽度的双层下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \end{arguments}
\cs_new_protected:Npn \@@_uuline:n #1
{
\mode_leave_vertical:
\rule [ -0.5 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
\rule [ -0.6 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
}
% \begin{macro}{\@@_get_text_width:Nn,\@@_get_text_width:NV}
% 获取文本宽度。
% \begin{arguments}
% \item 存储宽度的 |dim| 型变量
% \item 文本
% \end{arguments}
% 将内容放入 \tn{hbox} 后读取其宽度,存入 |dim| 型变量。
\hbox_set:Nn \l_@@_tmp_box {#2}
\dim_set:Nn #1 { \box_wd:N \l_@@_tmp_box }
}
\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
% \end{macro}
%
% \begin{macro}{\@@_full_uline:Nn,\@@_full_uline:NV}
% 横跨整页的下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
% \end{arguments}
% 先使用 \cs{@@_get_text_width:Nn} 获取文本内容宽度,该宽度存储在调用的 |dim| 型变量中。随后输出文本内容。
% \begin{macrocode}
\cs_new_protected:Npn \@@_full_uline:Nn #1#2
{
\@@_get_text_width:Nn #1 { #2 }
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
}
\cs_generate_variant:Nn \@@_full_uline:Nn { NV }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_uline_entry:nnnn}
% 生成占整页宽度的下划线条目。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
% \item 文本
% \item 分隔符
% \end{arguments}
% \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 } }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_uline_bientry:nnnn}
% 生成占半页宽度的下划线条目。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
% \item 文本
% \item 分隔符
% \end{arguments}
% \begin{macrocode}
\cs_new_protected:Npn \@@_uline_bientry:nnnn #1#2#3#4
{
\@@_full_uline:NV #1 { \@@_name:n { #2 } #4 }
\dim_sub:Nn #1 { \textwidth / 2 }
\@@_ulined_center_box:nn { #1 } { \@@_info:n { #3 } }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\njuchapter}
% 含有目录和 PDF 标签的无编号章。
% \begin{macrocode}
\NewDocumentCommand \njuchapter { m }
\chapter*{#1}
\addcontentsline { toc } { chapter } { \c_@@_sec_format_tl #1 }
\@mkboth{#1}{#1}
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{模板选项}
% \changes{v0.11}{2021/11/15}{进行了效率优化。}
{
\int_set_eq:NN \l_@@_info_degree_int \l_keys_choice_int
\int_compare:nTF { \l_@@_info_degree_int == 1 }
{ \tl_set:Nn \l_@@_info_diploma_tl { ug } }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{type}
\int_set_eq:NN \l_@@_info_type_int \l_keys_choice_int
\tl_set:Nn \l_@@_info_type_tl
{ \clist_item:Nn \c_@@_name_type_clist { \l_@@_info_type_int } }
{ \tl_use:c { c_@@_name_ \l_@@_info_diploma_tl _tl } }
},
nlcover .bool_set:N = \g_@@_nlcover_bool,
nlcover .initial:n = false,
% \footnote{原创性声明的英文翻译为 Declaration of Originality,为了使选项表义更清晰同时缩减名称长度,将其修改为“声明页”这一名称。}
decl-page .bool_set:N = \g_@@_orig_decl_bool,
decl-page .initial:n = false,
% \begin{macro}{draft}
% \changes{v0.13}{2021/12/15}{新增草稿模式选项。}
% 是否开启草稿模式(默认关闭)。
% \begin{macrocode}
draft .bool_set:N = \g_@@_draft_bool,
draft .initial:n = false,
% \changes{v0.14}{2021/12/12}{简化字体选项名称。}
% 定义字体选项。
{ gyre, mac, win, none }
{ \tl_set_eq:NN \g_@@_latin_font_tl \l_keys_choice_tl },
{ fandol, founder, mac, noto, source, win, none }
{ \tl_set_eq:NN \g_@@_cjk_font_tl \l_keys_choice_tl },
% \begin{macrocode}
\ProcessKeysOptions { nju }
% \end{macrocode}
Loading
Loading full blame...