Skip to content
Snippets Groups Projects
njuthesis.dtx 183 KiB
Newer Older
% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
Yu Xiong's avatar
Yu Xiong committed
% Copyright (C) 2021 - 2022
% by Nanjing University Linux User Group
% <git+nju-lug-email-3104-issue-@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
Yu Xiong's avatar
Yu Xiong committed
% license or (at your option) any later version. The latest version
% of this license is in the file
%    https://www.latex-project.org/lppl.txt
% 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>
%
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

Yu Xiong's avatar
Yu Xiong committed
Copyright (C) 2021 - 2022
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.

Yu Xiong's avatar
Yu Xiong committed
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}
    \file{\jobname.ins}        {\from{\jobname.dtx}{install}}
%</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
%</install>
%
%<*internal>
\fi
%</internal>
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\RequirePackage{expl3}
Yu Xiong's avatar
Yu Xiong committed
%<class>\GetIdInfo $Id: njuthesis.dtx 0.15.0 2022-02-20 10:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class>  {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
%<class>  {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\ProvidesFile{njuthesis.dtx}
\documentclass{ctxdoc}
\usepackage{listings,njuvisual,tabularray}
\usepackage[firstpage=true]{background}
\backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm}
Yu Xiong's avatar
Yu Xiong committed
\colorlet{at@guard}{njuviolet}
Yu Xiong's avatar
Yu Xiong committed
\definecolor{olgreen}{HTML}{138a07}
\newcommand\olbutton[1]{\textcolor{olgreen}{\bfseries #1}}
\newcommand\grd[1]{\textcolor{at@guard}{\sffamily #1}}
\hypersetup{%
  pdftitle  = {The njuthesis class - LaTeX thesis template for Nanjing University},
  citecolor = njublue,
  linkcolor = njuviolet,
  urlcolor  = njumagenta}
\UseTblrLibrary{booktabs,diagbox,siunitx}
\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 = {-},
    emphstyle  = \color{nju-cs-green}
  }
\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}}{}
\begin{document}
  \DocInput{njuthesis.dtx}
Yu Xiong's avatar
Yu Xiong committed
  \PrintChanges
\end{document}
%</driver>
% \fi
%
Yu Xiong's avatar
Yu Xiong committed
% \title{\color{njuviolet}{The \cls{njuthesis} class\\ \textbf{南京大学学位论文模板}}}
Yu Xiong's avatar
Yu Xiong committed
% \author{^^A
Yu Xiong's avatar
Yu Xiong committed
% 南京大学 Linux 用户组
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}{git+nju-lug-email-3104-issue-@yaoge123.cn}}}
Yu Xiong's avatar
Yu Xiong committed
% \date{v0.15.0 \quad 2022-02-20}
Yu Xiong's avatar
Yu Xiong committed
% \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}{实现自动打包发布。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.7}{2021/09/11}{增加对研究生模板的支持}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.7}{2021/09/12}{将 \cls{njuthesis} 发布在 CTAN。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.8}{2021/09/12}{修复已知问题,进行公开宣传。}
% \changes{v0.9}{2021/09/15}{使用 DocStrip 合并模板文件。}
% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合 \hologo{LaTeX3} 规范。}
% \changes{v0.9}{2021/09/15}{进一步完善文档。}
Yu Xiong's avatar
Yu Xiong committed
% \changes{v0.10}{2021/09/24}{删除了生成自述文件的代码。}
% \changes{v0.12}{2021/11/28}{删除内置的 \pkg{njuvisual} 代码。}
% \changes{v0.12}{2021/11/29}{更新了说明文档封面设计。}
% \changes{v0.12}{2021/11/30}{区分测试文件和空白模板。}
% \changes{v0.12}{2021/12/06}{修改了说明文档的代码呈现样式。}
% \changes{v0.13}{2021/12/12}{优化了编译速度。}
% \changes{v0.13}{2021/12/15}{适配2022届本科生毕业毕业论文(设计)规范。}
% \changes{v0.14}{2022/01/13}{将本模板内嵌入南大 \hologo{TeX} 网站。}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{abstract}
Yu Xiong's avatar
Yu Xiong committed
% 南京大学学位论文 \hologo{LaTeX} 模板 \cls{njuthesis} 基于本科生院的论文撰写
% 规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学
% 位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书
% 写的方便。
Yu Xiong's avatar
Yu Xiong committed
% \end{abstract}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \def\abstractname{Abstract}
% \begin{abstract}
Yu Xiong's avatar
Yu Xiong committed
% The \cls{njuthesis} class is intended for typesetting Nanjing University
% dissertations with \hologo{LaTeX}, providing support for bachelor, master,
% and doctoral thesis.
Yu Xiong's avatar
Yu Xiong committed
% \end{abstract}
%
Yu Xiong's avatar
Yu Xiong committed
% \vspace{2cm}
Yu Xiong's avatar
Yu Xiong committed
% \def\abstractname{特别声明}
% \begin{abstract}
% 在使用本模板时,我们默认您同意以下内容:
% \begin{enumerate}
%   \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件。
%   \item 本模板与学校官方部门并不存在合作关系,作者不对使用本模板产生的格式审查问题负责。
%   \item 遇到本文档没有覆盖的问题属于正常情况,欢迎提交反馈意见。
% \end{enumerate}
% 我们的 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{Linux 用户组}始终欢迎
Yu Xiong's avatar
Yu Xiong committed
% 您的加入!
Yu Xiong's avatar
Yu Xiong committed
% \end{abstract}
%
Yu Xiong's avatar
Yu Xiong committed
% \clearpage
Yu Xiong's avatar
Yu Xiong committed
%
% \setcounter{tocdepth}{4}
Yu Xiong's avatar
Yu Xiong committed
% \tableofcontents
% \begin{documentation}
Yu Xiong's avatar
Yu Xiong committed
% \section{模板介绍}
Yu Xiong's avatar
Yu Xiong committed
%
% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 Linux 用户组维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
Yu Xiong's avatar
Yu Xiong committed
%
% 本模板使用的本科生毕业论文模板格式依据《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju2021},研究生学位论文格式依据研究生院提供的材料包。
Yu Xiong's avatar
Yu Xiong committed
%
% \subsection{开始之前}
% \label{subsec:first-things-first}
% 在本文正式介绍 \cls{njuthesis} 论文模板前,您也许并不熟悉 \hologo{TeX} 排版系统。话不多说,请先完整体验一遍下述的工作流程:
% \fcolorbox{olgreen}{gray!5}{\parbox{\textwidth-5em}{%
% \hspace{2em}\begin{minipage}[c]{10cm}
% \begin{enumerate}
%  \item 访问 \url{https://tex.nju.edu.cn}
%  \item 点击右上角~\olbutton{注册}~按钮,用\href{https://itsc.nju.edu.cn/1b/ce/c21586a334798/page.htm}{南大邮箱}注册账号
%  \item 登录您的账号
%  \item 点击左上角~\olbutton{创建新项目}~按钮,选择~\olbutton{论文模板}
Yu Xiong's avatar
Yu Xiong committed
%  \item 随意取名,点击~\olbutton{创建}~按钮
% \end{enumerate}
% \end{minipage}}}
% 稍等片刻,您会在浏览器右侧发现一份新生成的空白论文。如果它的效果令您满意,不妨以此为基础开始写作。
%
% \subparagraph{我一定要体验上述流程吗?}
% 是,但也不一定。有人坚持认为应该做一些\emph{直观、清晰、有手就行、一条路走到底}的教程,而不是
% \emph{长篇累牍的精细介绍},其核心论据在于:现代人类总体上需要快速取得成就感,而且大部分可能用
% 到本模板的同学不会具备必要的基础知识。反驳的观点在于过分简单的实验总是浪费时间的,尤其是在您
% 可能早已掌握基本用法的情况下。但,不论如何,这番操作总会使您预览到 \cls{njuthesis} 论文模板的
% 实际样式。
%
% \subparagraph{我并没有见到理想的结果。}
% 具体是哪里不满意?如果是\emph{样式存在偏差},请联系模板的作者;如果\emph{不能访问前文提到的在
% 线编译网站},请考虑检查网络连接,依次咨询本校
% \href{https://itsc.nju.edu.cn}{信息化管理建设服务中心} 和该网站的维护者
% \href{mailto:my@yaoge123.cn}{姚舸老师};如果\emph{报错},请点击左上角的菜单按钮,查看编译器是
% 否显示为 |XeLaTeX|;再如果\emph{还有其他原因},通过这几分钟的实验我们也可以得到一个相当有益的
Yu Xiong's avatar
Yu Xiong committed
% 结论:\emph{也许 Word 模板更加适合您}。这可以节省下熟悉 \hologo{TeX} 排版软件使用方法所需的可
%
% \subparagraph{但我依然对 \hologo{LaTeX} 一无所知!}
% 这意味着您也许得花些时间在\emph{长篇累牍的精细介绍}上。请接着向后阅读,有需要时善用搜索。
% \subsection{历史沿革}
% 十几年来,多位热心校友发布过自己编写的模板,在 GitHub 网站上可考的包括:
% \begin{enumerate}
%  \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}
% 至于不幸而未进行代码版本管理的,甚至于说以压缩包形式流传于各人硬盘中的,就更不可计数了。
%
Yu Xiong's avatar
Yu Xiong committed
% 与其让一千个学生做一千种不同的模板,不如有人牵起头来,集中力量办大事。因此,南
% 京大学 Linux User Group 的有志之士在2021年暑期联合起来,参考以上的现成模板,兼
% 顾友校 \cls{fduthesis}\cite{fduthesis}、\textsc{THuThesis}\cite{thuthesis} 等
% 优秀项目,构建了这一全新模板,力求通过 \hologo{LaTeX3} 语法和清晰的接口实现良
% 好的易用性和可维护性。
% 目前,本模板的主要维护者包括:
% \begin{itemize}
Yu Xiong's avatar
Yu Xiong committed
%   \item 赵懿晨
%   \item 熊煜
%   \item 马畅
Yu Xiong's avatar
Yu Xiong committed
%
% \subsection{君 \hologo{LaTeX} 本当上手}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \hologo{LaTeX} 并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听
% 到“\emph{给毕业论文交差也得写代码}”这种事情就头疼,实在是我们不愿意见到而必须
% 要面对的情况。目前,中文互联网上的 \hologo{LaTeX} 写作教程可谓汗牛充栋,然而
% 如何快速准确找到所需要的用法,尤其是 \hologo{LaTeX3} 的新接口,需要一定的时间
% 或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您
% 的相关知识体系,只能\emph{尽力做到有求必应},在需要的地方顺带提一嘴,以期使您
% 少走点弯路。
Yu Xiong's avatar
Yu Xiong committed
%
% 如果您希望在使用本模板前了解一些关于这个排版软件的基础知识,在此尝试列举一些有
% 所帮助的资料:
Yu Xiong's avatar
Yu Xiong committed
% \begin{description}
%   \item[\textit{lshort}] 著名的介绍文档,已被译为多种语言,可以参考英文版\cite{lshort}及其中文翻译版\cite{lshort-zh-cn}。
Yu Xiong's avatar
Yu Xiong committed
%   \item[《\hologo{LaTeX} 入门》] 刘海洋著\cite{刘海洋2013latex入门}。
Yu Xiong's avatar
Yu Xiong committed
% \end{description}
%
%
% \subsection{关于本说明手册}
%
Yu Xiong's avatar
Yu Xiong committed
% 本模板通过 \textsc{DocStrip} 进行维护,实际上是一种\emph{文学编程}。文学编程的
% 本体是那些用来说明的文字,按写书写文章的方式组织。\file{njuthesis.dtx} 包含
% \cls{njuthesis} 文档类的所有信息。前半部分为模板说明,即各种常用命令与必要的使
% 用方法;后半部分为代码实现,为带有详细注释的 \hologo{TeX} 源代码。后者配合附
% 录,为有意了解本模板实现细节的同学提供必要指引。
Yu Xiong's avatar
Yu Xiong committed
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,无衬线字体的
% \pkg{pkg-example} 为宏包名,等宽字体的 \file{file-example.xxx} 为文件名,等宽
Yu Xiong's avatar
Yu Xiong committed
% 字体的 \opt{opt-example} 为选项名,等宽字体的 \env{env-example} 为需要
Yu Xiong's avatar
Yu Xiong committed
%  |\begin{}|和|\end{}|的环境名,等。本手册提供的代码示例中,左侧边线呈现南大标
% 准洋红色 {\color{njumagenta}$\blacksquare$} 的属于终端命令,呈南大标准蓝色
% {\color{njublue}$\blacksquare$} 的属于 \hologo{LaTeX} 源代码。
Yu Xiong's avatar
Yu Xiong committed
%
%
% \subsection{许可说明}
%
% \file{njuthesis.dtx} 文件以及由其直接产生的所有文件被称为 \cls{njuthesis} 文档类,或者在本文中简称为本模板。
%
% \subparagraph{版权信息}
Yu Xiong's avatar
Yu Xiong committed
%   本模板之版权隶属于 © 2021 - 2022 南京大学 Linux 用户组。
%
% \subparagraph{发布和修改}
%   本模板的发布和(或)修改遵守 LaTeX Project Public License(版本 1.3c 或更高)的条款。该许可证的最新版本位于 \url{http://www.latex-project.org/lppl.txt},1.3c 及更新的版本随附于 2003/12/01 版本以后的所有 \hologo{LaTeX} 发行版。
%
% \subparagraph{联系作者}
%   如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,请通过 \href{https://github.com/nju-lug/NJUThesis/issues}{GitHub Issue} 或者 QQ 群聊\footnote{群号是 991559926。}联系 NJU LUG。
% \section{安装}
Yu Xiong's avatar
Yu Xiong committed
% \label{sec:setup}
Yu Xiong's avatar
Yu Xiong committed
% 本节主要介绍本宏包的获取、安装以及编译方式。
Yu Xiong's avatar
Yu Xiong committed
% \subsection{获取模板}
% \cls{njuthesis} 目前处于积极的维护中,主要可通过以下三种途径获取模板文件:
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subparagraph{CTAN}
% \href{https://ctan.org/}{CTAN}\footnote{The Comprehensive \hologo{TeX}
% Archive Network} 是所有 \hologo{TeX} 相关材料的中枢。
% 本模板的 CTAN 页面
% \footnote{\href{https://ctan.org/pkg/njuthesis}{\cls{njuthesis}} 已经于2021年9
% 月12日发布在 CTAN,用于绘制南大图标的
% \href{https://ctan.org/pkg/njuvisual}{\pkg{njuvisual}} 也已于同年11月28日发
% 布,两者已被 \hologo{TeX}\,Live 和 \hologo{MiKTeX} 收录,将进入 \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/}{南京大学镜像站下载页面}获取。可供下载的文件包括下列三种:
Yu Xiong's avatar
Yu Xiong committed
%   \begin{description}
%     \item[\file{njuthesis-v*.pdf}] 模板说明文档(本文档)。
Yu Xiong's avatar
Yu Xiong committed
%     \item[\file{njuthesis-user-v*.zip}] 交付给用户的完整模板包,包括格式文件和范本文档,可在解压后用于本地编译,也可直接上传至在线编译网站。
%     \item[\file{njuthesis-ctan-v*.zip}] 交付给 CTAN 的源代码包,普通用户请忽略。
Yu Xiong's avatar
Yu Xiong committed
%   \end{description}
%
%
% \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}
%
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{本地安装}
%
% \subsubsection{标准安装}
% \label{subsubsec:standard-installation}
%
Yu Xiong's avatar
Yu Xiong committed
% 我们\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}]
Yu Xiong's avatar
Yu Xiong committed
%   tlmgr install njuthesis njuvisual
% \end{shellexample}
Yu Xiong's avatar
Yu Xiong committed
% 即可完成安装,无需额外准备 \file{.cls} 文件。
Yu Xiong's avatar
Yu Xiong committed
% 另一方面,CTAN 依赖开发者手动上传更新,版本更新具有滞后性。如果使用时遇到了问
% 题,不妨使用下一小节的\emph{即时安装方法}优先载入较新的格式文件。
% {\color{red}|[!]|} 如果您具备相关经验\footnote{譬如熟悉命令行操作、使用的是 \hologo{TeX}\,Live 发行版等},可以在下载仓库内全部文件后,于该目录下运行
% \begin{shellexample}[morekeywords={l3build},emph={install}]
Yu Xiong's avatar
Yu Xiong committed
%   l3build install
% \end{shellexample}
% 来安装本模板的最新版。
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{即时安装}
% \label{subsubsec:on-the-fly-installation}
Yu Xiong's avatar
Yu Xiong committed
% 在某些情况下(例如需要上传至在线编译平台、新版本提供了急需的错误修复),您可能
% 需要独立的 \file{.cls} 格式文件。此时请前往前述的 Releases 页面下载
% \emph{完整模板包}。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% 对于希望使用主仓库中版本的用户,本模板也提供了扁平化安装脚本,用于释放供编译的
% 空白模板和格式文件。Windows 用户请直接双击打开 \file{install-win.bat};其他平
% 台(包括 macOS 和 Linux)用户请在此目录下运行
Yu Xiong's avatar
Yu Xiong committed
% \begin{shellexample}[morekeywords={bash}]
%   bash install-unix.sh
% \end{shellexample}
Yu Xiong's avatar
Yu Xiong committed
% 该脚本会生成一个 \file{mythesis/} 目录以便从头写作,仓库内除此文件夹以外的内容
% 都可以尽情删除。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% {\color{red}|[!]|} 请注意,如果仅仅是希望使用这个模板撰写论文,请无论如何都不
% 要从手动编译 \file{source} 文件夹下的源代码开始,这样做只会浪费生命中宝贵的数
Yu Xiong's avatar
Yu Xiong committed
% 分钟时间。如果遇到了问题,请前往 GitHub 仓库提出 issue。我们只推荐希望参与开发
% 的同学接触 \file{.dtx} 文件。
% \subsection{本地编译}
Yu Xiong's avatar
Yu Xiong committed
% \label{subsec:localcompile}
Yu Xiong's avatar
Yu Xiong committed
% 本地编译的安装过程分为两个阶段:安装 \hologo{TeX} 发行版以及配置编辑器。前者提供了可以被命
% 令行终端调用的编译程序,后者则提供了语法高亮、自动编译等人性化功能。
% \subsubsection{安装\hologo{TeX}发行版}
%
% 首先需要下载并安装 \hologo{TeX} 软件发行版,其中包括引擎、宏包、字体、文档等。各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次编译前请务必通过 MiKTeX Console、TeX Live
Yu Xiong's avatar
Yu Xiong committed
% Manager 等图形化程序或 \pkg{tlmgr} \emph{手动更新全部宏包}以避免潜在的兼容性问题。
% \begin{table}[ht]
%   \centering
%   \caption{\hologo{TeX} 软件发行版一览}
%   \label{tab:texdistribution}
%   \begin{tabular}{cccc}
%     \toprule
%     \hologo{TeX}        & Windows   & macOS     & Linux     \\
%     \midrule
Yu Xiong's avatar
Yu Xiong committed
%     \hologo{TeX}\,Live  & $\bullet$ &           & $\bullet$ \\
%     mac\hologo{TeX}     &           & $\bullet$ &           \\
Yu Xiong's avatar
Yu Xiong committed
%     \hologo{MiKTeX}     & $\bullet$ & $\bullet$ & $\bullet$ \\
%     \bottomrule
%   \end{tabular}
% \end{table}
% 以下是一些值得注意的要点:
% \begin{itemize}
Yu Xiong's avatar
Yu Xiong committed
%   \item 可以参照这份\emph{手把手的教程}\cite{install-latex-guide-zh-cn}。
Yu Xiong's avatar
Yu Xiong committed
%   \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} 套件。
Yu Xiong's avatar
Yu Xiong committed
%   \item Linux 用户请尽可能下载 full 版本,如 |texlive-full|。换言之,下载最大的软件包。
Yu Xiong's avatar
Yu Xiong committed
%   \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查\footnote{譬如遇到 l3 过时问题请运行 |tlmgr update l3packages|。},请确认各宏包已升级至最新版。
% \end{itemize}
Yu Xiong's avatar
Yu Xiong committed
%
% \subsubsection{配置编辑器}
% \changes{v0.11}{2021/11/23}{提供 TeXstudio 配置文件。}
Yu Xiong's avatar
Yu Xiong committed
%
% 配置完编译器后,还需要一个\emph{文本编辑器}来完成 \file{.tex} 文件内容的写作。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是最好的
% 文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代更美观更多功
% 能}的编辑器,譬如\emph{安装了 LaTeX Workshop 插件的 \href{https://code.visualstudio.com/}{Visual Studio Code}}。您也可以根据个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
Yu Xiong's avatar
Yu Xiong committed
%
% \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}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{编译顺序}
% \label{subsubsec:compileseq}
Yu Xiong's avatar
Yu Xiong committed
% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎,编辑器提供的
% 快捷按钮实际只是做了包装。为了便于排查运行错误,以下通过具体终端命令简要描述编
% 译过程。
% 编译本模板的过程可以概括为下述步骤:
% \begin{enumerate}
%   \item 生成初始文档
%   \item 生成参考文献信息
%   \item 生成页码、编号、目录
%   \item 将参考文献列表页插入目录
% \end{enumerate}
% 总计需要编译四次。\emph{假设即将使用的主文件名为 \file{njuthesis-sample.tex}},应采用以
% 下命令顺序进行编译,以生成内容正确的 \file{njuthesis-sample.pdf}。输出的 PDF
Yu Xiong's avatar
Yu Xiong committed
% 文档位于同一目录下。该目录下同时会生成若干中间文件。
% 编译命令具体为引擎名称加主文件名,在编译 \file{.tex} 文件时,文件扩展名可以省略
Yu Xiong's avatar
Yu Xiong committed
% 不写。现阶段 \cls{njuthesis} 仅支持 \hologo{XeLaTeX} 与 \hologo{LuaLaTeX}。请
% 注意,几种命令的输出文件基本相同,可以任取一种;但如果您不清楚这两种编译引擎的
% 区别,或者对多步编译感到困惑,我们建议优先使用 |latexmk -xelatex|。
% \subparagraph{使用 \hologo{XeLaTeX}}
% 标准的 \hologo{XeLaTeX} 引擎四步编译方法。
% \begin{shellexample}[morekeywords={xelatex,biber}]
Yu Xiong's avatar
Yu Xiong committed
%   xelatex njuthesis-sample
%   biber njuthesis-sample
%   xelatex njuthesis-sample
%   xelatex njuthesis-sample
% \end{shellexample}
% \subparagraph{使用 \hologo{LuaLaTeX}}
% 标准的 \hologo{LuaLaTeX} 引擎四步编译方法。
%
% \begin{shellexample}[morekeywords={lualatex,biber}]
Yu Xiong's avatar
Yu Xiong committed
%   lualatex njuthesis-sample
%   biber njuthesis-sample
%   lualatex njuthesis-sample
%   lualatex njuthesis-sample
% \end{shellexample}
% \subparagraph{使用 \pkg{latexmk}}
% \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}
%
% 该命令的使用方法为
% \begin{shellexample}[morekeywords={latexmk}]
Yu Xiong's avatar
Yu Xiong committed
%   latexmk njuthesis-sample
% \end{shellexample}
% 直接运行会调用 \hologo{pdfLaTeX} 引擎导致报错。如需指定编译引擎,可以加入 |-xelatex| 或 |-lualatex| 参数,例如指定 \hologo{XeLaTeX} 的命令为
% \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
Yu Xiong's avatar
Yu Xiong committed
%   latexmk -xelatex njuthesis-sample
% \end{shellexample}
% 此外,可以选择使用以下命令清理编译生成的临时文件。
% \begin{shellexample}[morekeywords={latexmk},emph={-c}]
%   latexmk -c
% \end{shellexample}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{在线编译}
Yu Xiong's avatar
Yu Xiong committed
% \label{subsec:onlinecompile}
Yu Xiong's avatar
Yu Xiong committed
%
% 相信您在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如 \hologo{TeX} 编译器安装过程较为漫长\footnote{因此对于 Windows 推荐 \hologo{MiKTeX}。},占用空间过大\footnote{事实上,可以通过 |scheme-infraonly| 模式安装 \hologo{TeX}\,Live,随后利用 \pkg{tlmgr} 安装依赖宏包,这份宏包列表可以在 Git 仓库的 \file{.github/workflows/build.yml} 找到。},而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{出于文件 IO 速度的差异,同一个模板在 Linux 编译可以相对 Windows 节省约一半耗时。}。拒绝接受这些麻烦的同学不妨尝试本节介绍的在线编译方法。
Yu Xiong's avatar
Yu Xiong committed
%
% \subsubsection{南大\hologo{TeX}平台简介}
% \changes{v0.2}{2021/09/07}{添加对南大 \hologo{TeX} 的支持。}
Yu Xiong's avatar
Yu Xiong committed
%
% \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} 在线编辑器,首次使用需凭学校邮箱自助注册账号。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{操作步骤}
%
% 本说明手册开头的 \ref{subsec:first-things-first} 即呈现了网站内嵌的 \cls{njuthesis} 模板的使用方法。由于南大 \hologo{TeX} 网站已预装 \cls{njuthesis},可以直接编写正文,无需 \file{.cls} 等格式文件。如果有其他要求,也可以按如下步骤手动上传包含模板的压缩包。
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{enumerate}
%   \item 访问\href{https://tex.nju.edu.cn}{南大 \hologo{TeX} 网站},点击界面右上方“注册”按钮,使用\emph{南京大学邮箱}注册账号并登录
%   \item 新建空白项目,或者上传 \ref{subsubsec:on-the-fly-installation} 得到的压缩文件。
%   \item 在项目页面左上角的“菜单”中,确认编译器为 |XeLaTeX| 或者 |LuaLaTeX|
%   \item 仿照 \file{njuthesis-sample.tex} 编写论文
%   \item 点击“重新编译”按钮进行编译和预览
Yu Xiong's avatar
Yu Xiong committed
% \end{enumerate}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{其他平台}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subparagraph{Overleaf}
% \changes{v0.12}{2021/12/07}{更新了对 Overleaf 的支持情况。}
% \pkg{njuthesis} 现已支持 \href{https://www.overleaf.com/}{Overleaf} 平台。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subparagraph{TeXPage}
% \href{https://www.texpage.com/}{TeXPage} 是国人研发的 \hologo{LaTeX} 在线编辑器,当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、编辑历史等实用工具,也可以作为一个备选项。
%
%
% \subsection{版本升级}
%
% 考虑到本模板仍在开发中,将不断发布新版本,您可能需要不定期进行更新以得到对于已知问题的修复补丁。每个版本的更新内容记录于 Git 仓库中的 \file{CHANGELOG.md}。考虑到安装和编译方式的差异,不妨直接将论文内容迁移至新版的 \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}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
%
% \section{使用方法}
Yu Xiong's avatar
Yu Xiong committed
% \subsection{标准结构}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% 典型的 \cls{njuthesis} 主文件结构应该如下所示:
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{latexexample}[moretexcs={\njusetup,\graphicspath,\tableofcontents,\maketitle,\mainmatter,\chapter,\printbibliography},emph={[1]document}]
%   \documentclass{njuthesis}
%   \njusetup{}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{document}
%   \maketitle
%   \tableofcontents
%   \mainmatter
%   \chapter{欢迎}
%   使用 \LaTeX{}!
%   \printbibliography
Yu Xiong's avatar
Yu Xiong committed
%   \end{document}
% \end{latexexample}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% 如果您尝试编译上面的代码,会发现自己得到了一个5页的 PDF 文档,是一份空白的本科生论文。
% 当然,这个文档实际上没有任何内容,接下来将会介绍具体填写内容的方法。
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{模板选项}
Yu Xiong's avatar
Yu Xiong committed
%
% 模板选项位于 \tn{documentclass} 后的方括号内,用于指定模板的行为。
Yu Xiong's avatar
Yu Xiong committed
% 下文中尖括号内列出了若干个允许的选项,其中加粗的为默认选项。
% \subsubsection{学位信息}
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[added=2021-09-07]{degree}
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     degree = <(ug)|mg|mf|phd>
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 选择学位,分别为学士、学术型硕士、专业硕士、博士,默认为学士(即本科生)。
% \end{function}
%
% \begin{function}[added=2021-09-07]{type}
%   \begin{syntax}
%     type = <(thesis)|design>
%   \end{syntax}
% 用于选择文档类型并将相关字段输出在封面和摘要页,可选值分别为毕业论文和毕业设计,默认为毕业论文。
% \end{function}
%
% \subsubsection{特殊页面}
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[added=2021-09-07]{nlcover}
%   \begin{syntax}
%     nlcover = <\TFF>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 是否使用国家图书馆封面,默认关闭。
% 通过此项可用国家图书馆封面\emph{替换}普通封面。
Yu Xiong's avatar
Yu Xiong committed
% 由于本科生院文件中并未提及相关规定,故本选项仅对于研究生有效。
%
% \begin{function}[updated=2022-01-06]{decl-page}
%   \begin{syntax}
%     decl-page = <\TFF>
%   \end{syntax}
% 是否需要诚信承诺书或原创性声明页面,默认关闭。
%
% 通过此项可在封面后添加本科生的诚信承诺书或研究生的原创性声明。
%
Yu Xiong's avatar
Yu Xiong committed
%
% \subsubsection{单双面模式}
%
% \begin{function}[added=2022-01-14]{oneside,twoside}
%   \begin{syntax}
%     <oneside|(twoside)>
%   \end{syntax}
% 开启单面或双面模式,默认为双面模式。
% \end{function}
%
% 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。单双面选项为全局选项,开启后会改变页码编号,以及部分宏包的行为。在单面模式下,页面是连续的,不会产生空白页;在双面模式下,封面、摘要、参考文献列表等特殊页面以及新的章节都会从奇数页开始,更适合印刷输出。
%
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{草稿模式}
% \begin{function}[added=2021-12-15]{draft}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     draft = <\TFF>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 选择是否开启草稿模式,默认关闭。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。草稿模式为全局选项,启用这一选项将产生以下整体影响:
Yu Xiong's avatar
Yu Xiong committed
% \begin{itemize}
%   \item 禁用封面的绘制(包括承诺和声明)
Yu Xiong's avatar
Yu Xiong committed
%   \item 显示页面文字范围边框以及页眉页脚线
%   \item 在超出宽度的内容右侧添加黑色方块标记
Yu Xiong's avatar
Yu Xiong committed
%   \item 不再渲染图片,使用含有图片路径的空白盒子占位
%   \item 不再渲染超链接及生成 PDF 书签
% \end{itemize}
% 草稿模式有助于提升编译速度以及检查格式问题,建议在定稿前始终开启。
Yu Xiong's avatar
Yu Xiong committed
%
% 启用这一选项也会改变特定宏包的行为,譬如在草稿模式下 \pkg{listings} 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。
% \subsubsection{指定字体}
Yu Xiong's avatar
Yu Xiong committed
% 学校论文格式要求使用的字体一般已经预装在各个操作系统,本模板针对不同平台进行了自动检测适配,可以开箱即用。
%
% 如果希望更改本模板使用的字体,请填写以下两个选项以覆盖操作系统检测得到的设置。
% \begin{function}[added=2021-09-07,updated=2021-12-18]{cjk-font,latin-font}
%   \begin{syntax}
%     cjk-font = <win|mac|fandol|founder|noto|source|none>
%     latin-font = <win|mac|gyre|none>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 手动指定字体。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% 根据学校论文格式的要求,本模板使用的中文字体主要有{\songti 宋体}、{\heiti 黑体}、{\kaishu 楷体}、{\fangsong 仿宋}四种;
% 西文字体主要有衬线体(\textup{serif})、无衬线体(\textsf{sans-serif})和等宽字体(\texttt{monospace})三种。
% 在生成论文时,需要将每一种字体(宋体、楷体)与一种字库(操作系统中的 ttf 文件)相对应。
% 由于不同操作系统自带的字库不同,在不同的操作系统上使用同一套配置会导致缺字、编译出错等后果。
% 因此,本模板对于中文字体和西文字体都提供了多种字体配置。
% 本模板提供的中文字体配置如表 \ref{tab:cjk-fontset} 所示。
Yu Xiong's avatar
Yu Xiong committed
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 Fandol 配置)。
% 此外,我们也单独提供了方正和思源两套中文字体配置。
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{table}[htbp]
%   \centering
%   \begin{talltblr}[
%     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} }
Yu Xiong's avatar
Yu Xiong committed
%   \toprule
%     \bf 配置名称 & \bf 宋体    & \bf 黑体    & \bf 楷书    & \bf 仿宋                 \\
Yu Xiong's avatar
Yu Xiong committed
%   \midrule
%     Windows      & 中易宋体    & 中易黑体    & 中易楷体    & 中易仿宋                 \\
%     macOS        & 华文宋体    & 华文黑体    & 华文楷体    & 华文仿宋                 \\
%     \href{https://www.ctan.org/pkg/fandol} {Fandol}
%                  & Fandol宋体  & Fandol黑体  & Fandol楷体  & Fandol仿宋               \\
%     \href{https://www.foundertype.com}{方正}\TblrNote{a}
%       & \href{http://www.foundertype.com/index.php/FontInfo/index/id/151}{方正书宋}\TblrNote{b}
%       & \href{http://www.foundertype.com/index.php/FontInfo/index/id/161}{方正细黑一}\TblrNote{c}
%       & \href{http://www.foundertype.com/index.php/FontInfo/index/id/137}{方正楷体}
%       & \href{http://www.foundertype.com/index.php/FontInfo/index/id/128}{方正仿宋}   \\
%     \href{https://github.com/adobe-fonts}{思源}\TblrNote{d}
%       & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-serif/OTF/SimplifiedChinese/}{思源宋体}
%       & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-sans/OTF/SimplifiedChinese/}{思源黑体}
%                                              & 方正楷体\TblrNote{e}  & 方正仿宋       \\
Yu Xiong's avatar
Yu Xiong committed
%   \bottomrule
%   \end{talltblr}
% \end{table}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% 由于各操作系统对自带字体的支持程度不同,本模板对不同字体加粗的方式有所差别,
% 表 \ref{tab:cjk-fontset} 中,黄色底色的字体采用算法加粗。
mc's avatar
mc committed
% 除此以外,各种字体在设计上也存在差异,因此本模板在不同操作系统下编译的结果可能存在细微不同,使用时请注意。
Yu Xiong's avatar
Yu Xiong committed
% 若想要获得与 Word 版本模板最为贴近的体验,
% 可以通过手动安装 Windows 自带的中易宋体、中易黑体、中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
% 本模板提供的西文字体配置如表 \ref{tab:latinfontset} 所示。
Yu Xiong's avatar
Yu Xiong committed
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 \opt{gyre} 配置)。
%
% \begin{table}[htbp]
%   \centering
%   \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
%   \end{tabular}
% \end{table}
Yu Xiong's avatar
Yu Xiong committed
%
% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec} 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
Yu Xiong's avatar
Yu Xiong committed
% 最后,出于统一格式的需要,本模板还选取了与正文字体相似度最高的数学字体(\href{https://github.com/aliftype/xits}{XITS 字体})用于公式排版。
Yu Xiong's avatar
Yu Xiong committed
%
% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、两种思源字体和四种Fandol字体能够\emph{免费商用};
Yu Xiong's avatar
Yu Xiong committed
% 英文字库中只有 Times New Roman、XITS 和三种 \Hologo{TeX} Gyre字体能够\emph{免费商用}。
% 因此,若需要将本模板用于商业相关的活动,请咨询专业人士。
%
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \subsection{个人信息}
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[added=2021-09-10]{\njusetup}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     \tn{njusetup} \Arg{键值列表}
Yu Xiong's avatar
Yu Xiong committed
% 是 \cls{njuthesis} 文档类的通用设置命令,用来设置各项功能。\tn{njusetup} 的参数是一个使用英文半角逗号分隔的键值列表,通常形如 \meta{key}|=|\meta{value}。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% 目前,\tn{njusetup} 仅包含用于设置个人信息的 |info| 类。以下为全部的个人信息参数,其中带有星号的为对应的英文字段。请注意,部分参数已被弃置,列于后方。
%
% \begin{function}[updated=2022-01-14]{info/title,info/title*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     title  = \Arg{标题}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 题目。由于封面上提供给中文题目的横线长度有限\footnote{单行最长为15个汉字,建议总长度不超过45字},本模板默认会自动对标题进行换行。如果需要手动制定换行位点,请使用换行控制符( |\\| ),最多两处。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/keywords,info/keywords*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     keywords  = \Arg{关键词}
%     keywords* = \Arg{英文关键词}
%   \end{syntax}
% 关键词列表。关键词之间需要使用英文半角逗号隔开,含有空格的关键字需要使用花括号包裹以避免歧义。可以参照下方的填写示例。
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/grade}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 年级,推荐格式为“20XX”。
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/student-id}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 学号。南京大学本科生为9位数字学号,研究生为两位大写字母标识加上八位数字组成的学号。
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/author,info/author*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     author  = \Arg{你的名字}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 姓名。
% \end{function}
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/department,info/department*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     department  = \Arg{院系}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 院系。
% \end{function}
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/major,info/major*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     major  = \Arg{专业}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 专业。
% \end{function}
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/field,info/field*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 研究领域。只有研究生存在研究领域的说法,本科生无需填写。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{function}[updated=2022-01-12]{info/supervisor,info/supervisor*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
%     supervisor = \Arg{导师姓名,职称}
%     supervisor* = \Arg{导师英文全称}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 导师全称。请使用逗号( |,| )分隔导师的中文姓名与职称,英文名则不需添加逗号。
% \end{function}
%
% \begin{function}[updated=2021-01-12]{info/supervisor-ii,info/supervisor-ii*}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
%     supervisor-ii = \Arg{第二导师姓名,职称}
%     supervisor-ii* = \Arg{第二导师英文全称}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 第二导师全称。无第二导师时不填即可。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
% \begin{function}[updated=2022-01-14]{info/submit-date}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
%     submit-date = \Arg{yyyy-mm-dd}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 提交日期。中英文日期现在可以由 ISO 日期格式\cite{gb-t-7408-2005}的字符串统一生成。如果留空,则自动使用编译当天日期。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% \begin{function}[updated=2021-01-14]{info/defend-date}
%   \begin{syntax}
%     defend-date = \Arg{yyyy-mm-dd}
%   \end{syntax}
% 答辩日期,只对研究生有效,要求同提交日期。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/chairman,info/reviewer}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
%     chairman = \Arg{答辩主席}
%     reviewer = \Arg{评委姓名职称}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
% 答辩委员会信息,分别为评审委员会主席及四位成员的姓名加职称,只对研究生有效。四位评审成员是以列表的形式存储的,填写方法同关键词。如果是盲审,填入“盲审”二字即可。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[updated=2021-10-01]{info/clc,info/secret-level,info/udc,info/supervisor-contact}
Yu Xiong's avatar
Yu Xiong committed
%   \begin{syntax}
%     clc = \Arg{中图分类号}
%     secret-level = <不涉密|秘密|机密|绝密>
%     udc = \Arg{udc}
%     supervisor-contact = \Arg{导师联系方式}
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
Yu Xiong's avatar
Yu Xiong committed
% 国家图书馆封面相关,包括中图分类号、密级、UDC 分类号和导师联系方式。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% \begin{function}{info/titlea,info/titleb,info/titlec,info/supervisora,info/supervisora*,info/supervisora-title,info/supervisora-title*,info/supervisorb,info/supervisorb*,info/supervisorb-title,info/supervisorb-title*}
Yu Xiong's avatar
Yu Xiong committed
% 这些选项已在 v0.13 弃置,请不要使用。
% \end{function}
%
% \begin{function}{info/supervisor-title,info/supervisor-title*,info/supervisor-ii-title,info/supervisor-ii-title*,info/submit-date*}
% 这些选项已在 v0.14 弃置,请不要使用。
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% \subsubsection{输入示范}
Yu Xiong's avatar
Yu Xiong committed
% 本科生可以参考如下范例输入个人信息。注意不能有空行。
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
Yu Xiong's avatar
Yu Xiong committed
%   \njusetup {
%       info = {
%           title = {第一行标题\\第二行标题},
%           title* = {My title in English},
%           keywords = {我,就是,充数的,关键词},
%           keywords* = {Dummy,Keywords,Here,{it is}},
Yu Xiong's avatar
Yu Xiong committed
%           grade = {2018},
%           student-id = {189114514},
%           author = {周煜华},
%           author* = {Zhou Yuhua},
Yu Xiong's avatar
Yu Xiong committed
%           department = {化学化工学院},
%           department* = {School of Chemistry and Chemical Engineering},