Newer
Older
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8
% 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
% 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-undergraduate.def,
% njuthesis-graduate.def,
% -----------------------------------------------------------------------
% 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
<git+nju-lug-email-3104-issue-@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-undergraduate.def} {\from{\jobname.dtx}{def-u}}
\file{\jobname-graduate.def} {\from{\jobname.dtx}{def-g}}
\file{\jobname-postdoctoral.def} {\from{\jobname.dtx}{def-p}}
%<*internal>
\usedir{source/latex/njuthesis}
%</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>
%
%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.0.1 2022-08-20 00:00:00
%<+!driver> +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
%<def-u> {Undergraduate definition file for njuthesis}
%<def-u>\ProvidesExplFile{njuthesis-undergraduate.def}
%<def-g> {Graduate definition file for njuthesis}
%<def-g>\ProvidesExplFile{njuthesis-graduate.def}
%<def-p> {Postdoctoral definition file for njuthesis}
%<def-p>\ProvidesExplFile{njuthesis-postdoctoral.def}
%<!driver> {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%</!(driver|install)>
\usepackage{listings,njuvisual,tabularray,unicode-math,xeCJKfntef,zhlineskip}
\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}
\def\TA{\TblrNote{a}}
\def\TB{\TblrNote{b}}
\def\TC{\TblrNote{c}}
\def\TD{\TblrNote{d}}
\def\TE{\TblrNote{e}}
\def\TL{\TeX~Live}
\def\MacTeX{Mac\TeX}
\def\biber{\hologo{biber}}
\def\LaTeXe{\hologo{LaTeX2e}}
\SetTextEnvironmentSinglespace{1.112}
\SetMathEnvironmentSinglespace{1.112}
\setsansfont{LexendDeca}
\setmonofont{Iosevka}[
UprightFont = Iosevka Light,
ItalicFont = Iosevka Light Italic,
BoldFont = Iosevka Semibold
]
\setCJKmainfont{Source Han Serif SC}[
UprightFont = Source Han Serif SC SemiBold,
ItalicFont = Source Han Serif SC Bold,
BoldFont = Source Han Serif SC Heavy,
Language = Chinese Simplified
]
\setmathfont{XITSMath-Regular}[
BoldFont = XITSMath-Bold,
Extension = .otf]
{
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,
texcsstyle = *\color{njuviolet},
emphstyle = [1]\color{nju-ai-orange},
emphstyle = [2]\color{nju-cs-green},
emphstyle = [3]\bfseries\color{njuyellow}
}
\lstnewenvironment{shellexample}[1][]{%
\lstset{style=style@shell, #1}}{}
\lstnewenvironment{latexexample}[1][]{%
\lstset{style=style@latex, #1}}{}
\clist_const:Nn \c__njudoc_module_color_clist
{
{ def-u } { u@guard },
{ def-g } { g@guard },
{ def-p } { p@guard },
{ class } { c@guard }
}
\cs_new_protected:Npn \__njudoc_compare_module:nnn #1#2#3
{ \str_if_eq:nnT {#1} {#2} { \color {#3} #1 } }
\cs_new_protected:Npn \__njudoc_set_module_color:n #1
{
\clist_map_inline:Nn \c__njudoc_module_color_clist
{ \__njudoc_compare_module:nnn {#1} ##1 }
}
\cs_new_protected:Npn \__njudoc_module_angle:Nn #1#2
{
\group_begin: \color { angle@guard } \ttfamily \textlangle \group_end:
\group_begin: \sffamily #2 \group_end:
\group_begin: \color { angle@guard } #1 \ttfamily \textrangle \group_end:
}
\cs_set_protected:Npn \__ctxdoc_module_angle:n #1
{ \__njudoc_module_angle:Nn \c_empty_tl {#1} }
\cs_new_protected:Npn \__njudoc_colored_module_angle:NN #1#2
{
\seq_clear:N #2
\seq_map_inline:Nn #1
{
\seq_gput_right:Nn #2
{ \__njudoc_set_module_color:n {##1} }
}
}
\cs_new_protected:Npn \__njudoc_print_module:n #1
{
\__njudoc_colored_module_angle:NN \l_tmpa_seq \l_tmpb_seq
\bool_lazy_or:nnTF
{ \str_if_empty_p:n { #1 } }
{ \int_compare_p:n { \seq_count:N \l_tmpb_seq = 1 } }
{
\str_clear:N \l_tmpa_str
\str_clear:N \l_tmpb_str
}
{
\str_set:Nn \l_tmpa_str { ( }
\str_set:Nn \l_tmpb_str { ) }
}
\__njudoc_module_angle:Nn \l_tmpb_str
{
\color { star@guard } #1
\color { angle@guard } \l_tmpa_str
\seq_use:Nn \l_tmpb_seq
{ \color { angle@guard } \orbar }
}
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
}
\cs_new_protected_nopar:Npn \__njudoc_split_pm:n #1
{ \seq_set_split:Nnn \l_tmpa_seq { | } {#1} }
\cs_new_protected_nopar:Npn \__njudoc_split_m:n #1
{
\tl_set:Nn \l_tmpa_str {#1}
\clist_map_inline:nn { *, /, (, ) }
{ \str_remove_all:Nn \l_tmpa_str {##1} }
\seq_set_split:NnV \l_tmpa_seq { | } \l_tmpa_str
}
\group_begin:
\char_set_catcode_active:N \>
\cs_gset_protected:Npn \__ctxdoc_module_star:w #1 > #2 \q_stop
{
\__ctxdoc_output_module:nn
{ \__njudoc_split_m:n {#1} }
{ \__ctxdoc_module_push:n { \__njudoc_print_module:n { * } } }
\__ctxdoc_output_line:n {#2}
\__ctxdoc_star_format:
}
\cs_gset_protected:Npn \__ctxdoc_module_slash:w #1 > #2 \q_stop
{
\__ctxdoc_output_module:nn
{ \__njudoc_split_m:n {#1} }
{ \__ctxdoc_module_pop:n { \__njudoc_print_module:n { / } } }
\__ctxdoc_output_line:n {#2}
\__ctxdoc_slash_format:
}
\cs_gset_protected:Npn \__ctxdoc_module_pm:w #1 > #2 \q_stop
{
\tex_noindent:D
\hbox_overlap_left:n
{
\__ctxdoc_output_module:nn
{ \__njudoc_split_pm:n {#1} }
{ \__njudoc_print_module:n { } }
\skip_horizontal:n { \leftskip + \smallskipamount }
}
\group_begin:
\__ctxdoc_pm_format:
\__ctxdoc_output_line:n {#2}
\group_end:
}
\group_end:
\NewDocumentCommand \grd { m }
{ \__ctxdoc_module_angle:n { \color { njuviolet } #1 } }
\NewDocumentCommand \sgrd { m }
{ \__ctxdoc_module_angle:n { \color { star@guard } * \color{ c@guard } #1 } }
\NewDocumentCommand \pgrd { m }
{ \__ctxdoc_module_angle:n { \color { #1 @guard } def- #1 } }
% \title{\color{njuviolet}{The \cls{njuthesis} class\\
% \textbf{南京大学学位论文模板}}}
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}
% {git+nju-lug-email-3104-issue-@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.13}{2021/12/16}{默认不加载 \pkg{listings} 宏包。}
% \changes{v0.16}{2022/03/01}{分离本科生和研究生模板配置。}
% \changes{v0.19}{2022/05/23}{对研究生普通封面进行若干细节修改。}
% \changes{v0.19}{2022/05/23}{对国家图书馆封面进行若干细节修改。}
% \cls{njuthesis} 是制作南京大学本科生毕业论文、研究生学位论文、博士后出站报告的
% \LaTeX 文档类。本模板基于本科生院的论文撰写规范制作,同时参考研究生院提供的硕士、
% 博士学位材料包,用于生成符合南京大学排版要求和相应的国家规范、行业标准的学位论
% 文,力求通过 \LaTeX3 语法实现清晰的实现逻辑、较高的可定制性以及友好的用户接口。
% The \cls{njuthesis} class is intended for typesetting Nanjing University
% dissertations with \LaTeX, providing support for bachelor, master,
% 在使用本模板时,我们默认您同意以下内容:
% \begin{enumerate}
% \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件。
% \item 遇到本文档没有覆盖的问题属于正常情况,欢迎提交反馈意见。
% \end{enumerate}
% 我们的 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}
% {Linux 用户组}始终欢迎您的加入!
% 《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju-bachelor-2022},
% 研究生学位论文格式依据研究生院提供的材料包\cite{nju-master-2022,nju-doctor-2022}。
% 博士后出站报告格式要求与博士学位论文一致\cite{nju-postdoc-2022},
% 封面、摘要的设计参考了部分既有报告。
% \fcolorbox{olgreen}{gray!5}{\parbox{\textwidth-5em}{%
% \hspace{2em}\begin{minipage}[c]{10cm}
% \item 访问 \url{https://tex.nju.edu.cn}
% \item 点击右上角~\olbutton{注册}~按钮,
% 用\href{https://itsc.nju.edu.cn/1b/ce/c21586a334798/page.htm}
% {南大邮箱}注册账号
% \item 登录您的账号
% \item 点击左上角~\olbutton{创建新项目}~按钮,选择~\olbutton{论文模板}
% \item 随意取名,点击~\olbutton{创建}~按钮
% 是,但也不一定。有人坚持认为应该做一些\emph{直观、清晰、有手就行、一
% 条路走到底}的教程,而不是\emph{长篇累牍的精细介绍},其核心论据在于:
% 现代人类总体上需要快速取得成就感,而且大部分可能用到本模板的同学不
% 会具备必要的基础知识。反驳的观点在于过分简单的实验总是浪费时间的,
% 尤其是在您可能早已掌握基本用法的情况下。但,不论如何,这番操作总会
% 使您预览到 \cls{njuthesis} 论文模板的实际样式。
% 具体是哪里不满意?如果是\emph{样式存在偏差},请联系模板的作者;如果
% \emph{不能访问前文提到的在线编译网站},请考虑检查网络连接,依次咨询
% 本校\href{https://itsc.nju.edu.cn}{信息化管理建设服务中心}和该网站
% 的维护者\href{mailto:my@yaoge123.cn}{姚舸老师};如果\emph{报错},请
% 点击左上角的菜单按钮,查看编译器是否显示为 |XeLaTeX|;
% 这意味着您真的得花些时间在\emph{长篇累牍的精细介绍}上。
% 如果您已经下定决心,请接着向后阅读,有需要时善用搜索引擎。
% \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} 等
% 要面对的情况。目前,中文互联网上的 \LaTeX 写作教程可谓汗牛充栋,然而
% 如何快速准确找到所需要的用法,尤其是 \LaTeX3 的新接口,需要一定的时间
% 或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您
% 的相关知识体系,只能\emph{尽力做到有求必应},在需要的地方顺带提一嘴,以期使您
% 少走点弯路。
% \item[\textit{lshort}] 著名的介绍文档,已被译为多种语言,可以参考英文版
% \cite{lshort}及其中文翻译版\cite{lshort-zh-cn}。
% 本模板通过 \textsc{DocStrip} 进行维护,实际上是一种\emph{文学编程}。文学编程的
% 本体是那些用来说明的文字,按写书写文章的方式组织。\file{njuthesis.dtx} 包含
% \cls{njuthesis} 文档类的所有信息。前半部分为模板说明,即各种常用命令与必要的使
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,无衬线字体的
% \pkg{pkg-example} 为宏包名,等宽字体的 \file{file-example.xxx} 为文件名,等宽
% |\begin{}|和|\end{}|的环境名,等。本手册提供的代码示例中,左侧边线呈现南大标
% 准洋红色 {\color{njumagenta}$\blacksquare$} 的属于终端命令,呈南大标准蓝色
% \file{njuthesis.dtx} 文件以及由其直接产生的所有文件被称为
% \cls{njuthesis} 文档类,或者在本文中简称为本模板。
% 本模板的发布和(或)修改遵守 LaTeX Project Public License(版本 1.3c 或更高)
% 的条款。该许可证的最新版本位于 \url{http://www.latex-project.org/lppl.txt},
% 1.3c 及更新的版本随附于 2003/12/01 版本以后的所有 \LaTeX 发行版。
% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,
% 请通过 \href{https://github.com/nju-lug/NJUThesis/issues}{GitHub Issue}
% 或者 QQ 群聊\footnote{群号是 991559926。}联系 NJU LUG。
% \href{https://ctan.org/}{CTAN}\footnote{The Comprehensive \TeX{}
% Archive Network} 是所有 \TeX{} 相关材料的中枢。
% 本模板的 CTAN 页面
% \footnote{\href{https://ctan.org/pkg/njuthesis}{\cls{njuthesis}} 已经于2021年9
% 月12日发布在 CTAN,用于绘制南大图标的
% \href{https://ctan.org/pkg/njuvisual}{\pkg{njuvisual}} 也已于同年11月28日发
% 布,两者已被 \TeX{} Live 和 \MiKTeX 收录。}上提供基本的介绍信息,可以下载
% 说明文档(本文档)和宏包源代码。当然,使用这一来源时并不需要接触后者,请参考
% \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 同步镜像}获取项目工程文件。
% 本模板不定期将已有的新功能和问题修复打包为新的正式发行版,赋以更改后的版本号,
% 发布在 \href{https://github.com/nju-lug/NJUThesis/releases/latest}{Github
% Releases 页面}。如果由于网络原因不便访问主仓库,也可以从\ignorespaces
% \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 的源代码包,
% 普通用户请忽略。
% 本模板由数量众多的文件组成,\emph{所有可能遇到的}文件如表
% \ref{tab:njuthesis-files} 所示。
% caption = {\cls{njuthesis}文件构成},
% label = {tab:njuthesis-files},
% note{a} = {仅供开发使用,并不会在发布版本中出现。}
% ] { row{1} = {font=\bfseries}, colspec = {ll} }
% \file{.vscode} & Visual Studio Code 配置文件 \\
% \file{CHANGELOG.md} & 修订记录 \\
% \file{latexmkrc} & \pkg{latexmk} 配置文件 \\
% \file{LICENSE} & 许可证 \\
% \file{njuthesis.cls} & 模板文档类 \\
% \file{njuthesis.dtx}\TblrNote{a} & 文档类源代码 \\
% \file{njuthesis.ins}\TblrNote{a} & 文档类安装脚本 \\
% \file{njuthesis.pdf} & 用户手册(本文档) \\
% \file{njuthesis-sample.bib} & 示例参考文献列表 \\
% \file{njuthesis-sample.tex} & 示例文档,不妨以此为基础撰写论文 \\
% \file{njuthesis-graduate.def} & 研究生参数配置文件 \\
% \file{njuthesis-undergraduate.def} & 本科生参数配置文件 \\
% \file{README.md} & 自述文件 \\
% \subsection{本地安装}
%
% \subsubsection{标准安装}
% \label{subsubsec:standard-installation}
%
% 我们\emph{始终建议}使用宏包管理器将 \cls{njuthesis} 安装到您的 \TeX 系
% 统。您可以通过 \TL~Manager 或者 \MiKTeX~Console 等图形化包管理器直接搜
% 索并安装 \cls{njuthesis} (及其依赖的 \pkg{njuvisual})最新的
% 稳定版。同时,您也可以使用终端命令。例如,假设您使用的是 \TL,
% \begin{shellexample}[morekeywords={tlmgr},emph={install}]
% 另一方面,CTAN 依赖开发者手动上传更新,版本更新具有滞后性。如果使用时遇到了问
% 题,不妨使用下一小节的\emph{即时安装方法}优先载入较新的格式文件。
% {\color{red}|[!]|} 如果您具备相关经验\footnote{譬如熟悉命令行操作、使用的是 \TL
% 发行版等},可以在下载仓库内全部文件后,于该目录下运行
% \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}
% 分钟时间。如果遇到了问题,请前往 GitHub 仓库提出 issue。我们只推荐希望参与开发
% 的同学接触 \file{.dtx} 文件。
% 编辑器。前者提供了可以被命令行终端调用的编译程序,
% 后者则提供了语法高亮、自动编译等人性化功能。
% 首先需要下载并安装 \TeX{} 软件发行版,其中包括引擎、宏包、字体、文档等。
% 各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次
% 编译前请务必通过 \MiKTeX~Console、\TL~Manager 等图形化程序或
% \label{tab:texdistribution}
% \begin{tabular}{cccc}
% \toprule
% \TL & $\bullet$ & & $\bullet$ \\
% \MacTeX & & $\bullet$ & \\
% \MiKTeX & $\bullet$ & $\bullet$ & $\bullet$ \\
% \bottomrule
% \end{tabular}
% \end{table}
% \item 校园网环境中访问\ignorespaces
% \href{https://mirror.nju.edu.cn/download/TeX%20排版系统}
% {南京大学开源软件镜像站}可以获得最佳的下载体验。
% ^^A \item Linux 用户请尽可能下载 full 版本,如 |texlive-full|。
% ^^A 换言之,下载最大的软件包。
% \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查
% \footnote{譬如遇到 l3 过时问题请运行 |tlmgr update l3packages|。}
% ,请确认各宏包已升级至最新版。
% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是
% 最好的文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代
% \href{https://code.visualstudio.com/}{Visual Studio Code}}。您也可以根据
% 个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
% \cls{njuthesis} 为一些常见编辑器提供了配置文件,如
% \begin{description}
% 可以省略初始配置步骤直接使用。
% \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键
% |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置
% 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用
% \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
% 编译本模板的过程可以概括为下述步骤:
% \begin{enumerate}
% \item 生成初始文档
% \item 生成参考文献信息
% \item 生成页码、编号、目录
% \item 将参考文献列表页插入目录
% \end{enumerate}
% 总计需要编译四次。\emph{假设即将使用的主文件名为
% \file{njuthesis-sample.tex}},应采用以下命令顺序进行编译,
% 以生成内容正确的 \file{njuthesis-sample.pdf}。输出的 PDF
% 文件扩展名可以省略不写。现阶段 \cls{njuthesis} 仅支持 \XeTeX
% 与 \LuaTeX 引擎,以及 \biber 文献工具。请注意,几种命令的输出文件
% 基本相同,可以任取一种;但如果您不清楚这两种编译引擎的区别,
% 或者对多步编译感到困惑,我们建议优先使用 |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 脚本的自动编译工具,
% 宗旨是通过单一命令简化上述的多次编译流程。
% 在使用该命令前,请确保安装了以下软件:
% \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装
% \href{https://strawberryperl.com/}{Strawberry Perl}。
% \item[\normalfont\pkg{latexmk}] 如果终端找不到 |latexmk| 命令,需使用包管理器单独安装。
% \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
% 此外,可以选择使用以下命令清理编译生成的临时文件。
% \begin{shellexample}[morekeywords={latexmk},emph={-c}]
% 相信您在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如 \TeX 编译器
% 安装过程较为漫长\footnote{因此对于 Windows 推荐 \MiKTeX。},占用空间过大
% \footnote{事实上,可以通过 |scheme-infraonly| 模式安装 \TL,随后利用 \pkg{tlmgr}
% 安装依赖宏包,这份宏包列表可以在 Git 仓库的 \file{.github/workflows/build.yml}
% 找到。},而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{出于文件 IO
% 速度的差异,同一个模板在 Linux 编译可以相对 Windows 节省约一半耗时。}。
% 拒绝接受这些麻烦的同学可以尝试本节介绍的在线编译方法。
%
% {\color{red}|[!]|} 请注意,在线编辑器不一定提供良好的文件恢复和版本管理机制。
% 请谨慎备份您的心血结晶。
% \subsubsection{南大 \TeX 平台简介}
% \changes{v0.2}{2021/09/07}{添加对南大 \TeX 的支持。}
% \href{https://tex.nju.edu.cn}{南大 \TeX} 基于开源的 Overleaf 社区版平台构建
% \footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到
% 一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正
% 式上线,是 \href{https://sci.nju.edu.cn/}{eScience 中心}为南大在校师生提供的
% \LaTeX 在线编辑器,首次使用需凭学校邮箱自助注册账号。
% {\color{red}|[!]|} 在 2022 年 5 月的运行中,该网站出现了多次崩溃事件,
% 初步判断原因是由社区版并没有为高并发数做优化引发的。
% 高峰时期,仍然建议在本地部署 \TeX 发行版。
% 本说明手册开头的 \ref{subsec:first-things-first} 即呈现了网站内嵌的
% \cls{njuthesis} 模板的使用方法。由于南大 \TeX 网站已预装 \cls{njuthesis},
% 可以直接编写正文,无需 \file{.cls} 等格式文件。
% 如果有其他要求,也可以按如下步骤手动上传包含模板的压缩包。
% \item 访问\href{https://tex.nju.edu.cn}{南大 \TeX 网站},
% 点击界面右上方“注册”按钮,使用\emph{南京大学邮箱}注册账号并登录
% \item 新建空白项目,或者上传 \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} 是国人研发的 \LaTeX 在线编辑器,
% 当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、
% 编辑历史等实用工具,也可以作为一个备选项。
% 本模板仍在开发中,将不断发布新版本,您可能需要不定期进行更新以得到
% 对于已知问题的修复补丁。每个版本的更新内容记录于 Git 仓库中的
% \file{CHANGELOG.md}。除非特别提到选项变化,升级时一般无需更改 \file{.tex}
% 文件内容\footnote{在确实发生了接口变动,例如选项名称发生了更改,
% 一种稳妥做法是将论文内容迁移至新版的 \file{njuthesis-sample.tex}}。
% 基于安装和编译方式的差异,可以按照当前工作文件夹内是否有 \file{.cls}
% 文件分别进行更新操作。
% 下载 \file{njuthesis-user-v*.zip},使用其中新版的 \file{.cls}、\file{.def}
% 文件覆盖旧版本。
% \begin{shellexample}[morekeywords={tlmgr},emph={update}]
% \begin{latexexample}[moretexcs={\njusetup,\tableofcontents,
% \maketitle,\mainmatter,\chapter,\printbibliography},emph={[1]document}]
% \begin{document}
% \maketitle
% \tableofcontents
% \mainmatter
% 如果您尝试编译上面的代码,会发现自己得到了一个5页的 PDF 文档,
% 是一份空白的本科生论文。当然,这个文档实际上没有任何内容,
% 接下来的部分会介绍具体填写内容的方法。
% \begin{function}[added=2021-09-07,updated=2022-07-23]{type}
% 选择毕业论文模板类型,这将决定模板整体的外观。可选值分别为
% 学士(本科生)、硕士研究生、博士研究生和博士后,默认为学士。
% \begin{function}[added=2021-09-07,updated=2022-07-01]{degree}
% \begin{function}[added=2021-09-07,updated=2022-07-05]{nl-cover}
% 通过此项,对于本科生模板可在封面后添加的诚信承诺书,对于研究生模板可在
% 封面后添加原创性声明\footnote{其中的打勾符号依赖 \pkg{unicode-math}。},