Skip to content
Snippets Groups Projects
njuthesis.dtx 73.1 KiB
Newer Older
% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
% Copyright (C) 2021 
% 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
%    https://www.latex-project.org/lppl.txt
% -----------------------------------------------------------------------
% 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>
%
%<*readme-zh>
Yichen Zhao's avatar
Yichen Zhao committed
# NJU Thesis
Yu Xiong's avatar
Yu Xiong committed

[![njuthesis](https://img.shields.io/badge/njuthesis-latex-blue)](https://git.nju.edu.cn/nju-lug/nju-latex-templates)
[![overleaf](https://img.shields.io/badge/overleaf-supported-brightgreen)](https://tex.nju.edu.cn)
![build status](https://github.com/nju-lug/NJUThesis/actions/workflows/build.yml/badge.svg)

> 此项目是基于[NJU thesis 2021](https://github.com/FengChendian/NJUThesis2021)的重构版本,目前本科生版本**已经基本重构完成**,硕博论文**正在**根据研究生院的文件重构,但研究生院的规定并不完善,因此部分格式可能会参考本科的,**如果院系另有要求,请自行修改或者提交issue**。

原来的[NJU thesis 2021](https://github.com/FengChendian/NJUThesis2021)模板太过古老并且不支持硕士、博士论文,目前难以维护,因此为了模板的可持续发展,现在将对该项目进行重构,项目挂载于[NJU-LUG](https://github.com/nju-lug)组织仓库下,目前已[发布在CTAN](https://ctan.org/pkg/njuthesis)。

相关文档请参见[本项目wiki](https://github.com/nju-lug/NJUThesis/wiki)。

## 快速开始

从0.9.0版以后,本模板以DocStrip(`.dtx`)格式进行维护。常规的`.cls`格式文件可从Releases页面下载或使用以下方法提取。
### 关于DocStrip文件
DocStrip格式合并了LaTeX源代码和说明文档,更有利于宏包的发布。要使用该文件,请在当前工作目录下打开终端:
- 输入`xetex njuthesis.dtx`以提取宏包内容
Yu Xiong's avatar
Yu Xiong committed
- 输入`latexmk njuthesis.dtx`以生成并查看内置的文档

请注意,由于文件重名原因,项目中的示例论文模板已被重命名为`njuthesis-sample.tex`。

### 本地编译

1. [从南大镜像站下载](https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F)并安装TeXLive或者MiKTeX最新版
2. 下载包含[模板全部文件](https://github.com/nju-lug/NJUThesis/releases/latest)的压缩包`njuthesis.zip`
Yu Xiong's avatar
Yu Xiong committed
3. 根据需要更改`njuthesis-sample.tex`文件中的内容
4. 在模板根目录下运行`latexmk`编译文件,得到对应的PDF
Yu Xiong's avatar
Yu Xiong committed

#### **关于本地编译**

- 模板支持`latexmk`、`xelatex`、`lualatex`三种编译方式
- 如果使用`latexmk`,请务必使用完整的命令`latexmk -xelatex`以免产生不必要的问题
- 如果使用`xelatex`或`lualatex`,需要按照`xelatex/lualatex` -> `biber` -> `xelatex/lualatex` -> `xelatex/lualatex`的顺序编译四次
- 仓库中`.vscode`附带一份VScode的LaTeX WorkShop的配置文件,可根据需要使用

### [南大TeX](https://tex.nju.edu.cn)编译

1. 下载包含[模板全部文件](https://github.com/nju-lug/NJUThesis/releases/latest)的压缩包`njuthesis.zip`
2. 登录[南大TeX](https://tex.nju.edu.cn),点击New Project -> Upload Project上传刚刚得到的压缩包,上传后`njuthesis-sample.tex`、`njuthesis.cls`等文件应在根目录,0.9.0以后的目录结构如下所示:
Yu Xiong's avatar
Yu Xiong committed

    ```shell
    NJUThesis-master/

    ├─figure/
    │   njulogo.pdf
    │   njuname.pdf

    │ njuthesis.bib
    │ njuthesis.cls
    │ njuthesis-sample.tex
    ```
Yu Xiong's avatar
Yu Xiong committed
3. 在南大TeX项目内页面左上角的`Menu`中,将编译器改为`XeLaTeX`
4. 编写TeX文档

### 其他

更多内容请参见项目Wiki中的[使用说明](https://github.com/nju-lug/NJUThesis/wiki/%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)。

你也可以下载[Release](https://github.com/nju-lug/NJUThesis/releases/latest)中附带的`njuthesis.pdf`,里面详尽阐述了模板的特性和使用方法。

## 常见问题

请参见[常见问题](https://github.com/nju-lug/NJUThesis/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)。

## 贡献

如果你发现了模板的问题,欢迎在Github中[提交issue](https://github.com/nju-lug/NJUThesis/issues)或者PR。

## 许可

本模板的发布遵守 LaTeX Project Public License(版本 1.3c 或更高)。
%</readme-zh>
Yu Xiong's avatar
Yu Xiong committed
%
%<*readme-en>
# The njuthesis class
This package is intended for typesetting Nanjing University thesis with LaTeX, providing support for bachelor, master, and doctoral thesis. Compilation of this class requires either `xelatex` or `lualatex` engine.

## License

-----
    This work may be distributed and/or modified under the conditions of
    the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
    either version 1.3c of this license or (at your option) any later
    version.
-----

## Contributing

If you run into any problem with the template, please contact us via Github issue or submit Pull Request.

## Wiki

Please see [Chinese wiki](https://github.com/nju-lug/NJUThesis/wiki)。

-----

Copyright © NJU-LUG
Yu Xiong's avatar
Yu Xiong committed
%</readme-en>
%
%<*internal>
\fi
\begingroup
  \def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
%<*install>
\input l3docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

Copyright (C) 2021 
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.3 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}}
%</install>
%<*internal>
  \usedir{source/latex/njuthesis}
    \file{\jobname.ins}        {\from{\jobname.dtx}{install}}
%</internal>
%<*install>
  \usedir{doc/latex/njuthesis}
  \nopreamble\nopostamble
Yu Xiong's avatar
Yu Xiong committed
    \file{README_EN.md}        {\from{\jobname.dtx}{readme-en}}
    \file{README.md}           {\from{\jobname.dtx}{readme-zh}}
}

\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                                         *}
Yu Xiong's avatar
Yu Xiong committed
\Msg{*     README.md                                             *}
\Msg{*     README_EN.md                                          *}
\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>
%
Yu Xiong's avatar
Yu Xiong committed
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\RequirePackage{expl3}
Yu Xiong's avatar
Yu Xiong committed
%<!(readme-zh|readme-en)> \GetIdInfo  $Id: njuthesis.dtx 0.9.2 2021-09-17 22:00:00 +0800  NJU LUG <nju.lug@yaoge123.cn> $
%<class>  {Thesis template for Nanjing University}
Yu Xiong's avatar
Yu Xiong committed
%<class>\ProvidesExplClass{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\ProvidesFile{njuthesis.dtx}
\documentclass{ctxdoc}
\usepackage{listings,xcolor}
\definecolor{njuviolet}{cmyk}{0.5,1,0,0.4}
\definecolor{njumagenta}{cmyk}{0.05,1,0.55,0}
\definecolor{njublue}{cmyk}{0.8,0.5,0,0}
\definecolor{njuyellow}{cmyk}{0,0.3,1,0}
\begin{document}
  \DocInput{njuthesis.dtx}
\end{document}
%</driver>
% \fi
%
Yu Xiong's avatar
Yu Xiong committed
% \title{\color{njuviolet}{The \textsc{NJuThesis} class\\ 南京大学学位论文模板}}
Yu Xiong's avatar
Yu Xiong committed
% 
% \author{^^A
Yu Xiong's avatar
Yu Xiong committed
% Nanjing University Linux User Group
% \thanks{E-mail: \href{mailto:nju.lug@yaoge123.cn}{nju.lug@yaoge123.cn}}}
Yu Xiong's avatar
Yu Xiong committed
% \date{v0.9.2 \\ Released 2021-09-17}
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{abstract}
% 南京大学学位论文\hologo{LaTeX}模板基于本科生院的论文撰写规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书写的方便。
% \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 \textsc{NJuThesis} class is intended for typesetting Nanjing University thesis 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
% \def\abstractname{特别声明}
% \begin{abstract}
% 请注意,本模板仍未完成开发,出现bug或者文档不完善属于正常情况,提issue或Pull Request即可。
%
% \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{NJU LUG}始终欢迎您的加入与贡献!
Yu Xiong's avatar
Yu Xiong committed
% \end{abstract}
%
Yu Xiong's avatar
Yu Xiong committed
% \clearpage
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \setcounter{tocdepth}{4}
Yu Xiong's avatar
Yu Xiong committed
% \tableofcontents
% \EnableDocumentation
%^^A \DisableDocumentation
% 
% \begin{documentation}
Yu Xiong's avatar
Yu Xiong committed
% \section{模板介绍}
Yu Xiong's avatar
Yu Xiong committed
% \textsc{NJuThesis},即南京大学学位论文模板,是一个由南京大学LUG组织维护的,用于处理本校学生毕业论文排版需求的\hologo{LaTeX}模板。
Yu Xiong's avatar
Yu Xiong committed
%
% \subsection{历史沿革}
% 十几年来,多位热心校友发布过自己编写的模板,在GitHub上可考的包括
% \begin{enumerate}
%  \item 杨文博(\href{http://yangwenbo.com/}{@solrex})的\href{https://github.com/solrex/njuthesis}{南京大学学位论文\hologo{LaTeX}模板}(2010) 
%  \item \href{https://github.com/fireblue}{@fireblue}基于solrex模板的的\href{https://github.com/fireblue/NJUThesis}{南京大学学位论文\hologo{LaTeX}模板}(2013)
%  \item \href{https://github.com/wenhai-zheng}{@wenhai-zheng}的\href{https://github.com/wenhai-zheng/NJUThesis}{NJUThesis}(2013)  
%  \item 胡海星(\href{http://haixing-hu.github.io/}{@Haixing-Hu})的\href{https://github.com/Haixing-Hu/nju-thesis}{NJU-Thesis}(2013 - 2018)
%  \item 张楚珩(\href{https://github.com/zhangchuheng123}{@zhangchuheng123})基于胡海星模板的\href{https://github.com/zhangchuheng123/NJUThesis}{NJUThesis}(2016)
%  \item 蒋炎岩(\href{http://ics.nju.edu.cn/~jyy/}{@jiangyy})的\href{https://github.com/jiangyy/njuthesis}{南京大学山寨\hologo{LyX}研究生毕业论文模板}(2017)
Yu Xiong's avatar
Yu Xiong committed
%  \item 饶安逸(\href{https://anyirao.com/}{@AnyiRao})基于胡海星模板的\href{https://github.com/jiangyy/njuthesis}{NJU-Thesis}(2018)
%  \item \href{https://github.com/njuHan}{@njuHan}基于胡海星模板的\href{https://github.com/njuHan/njuthesis-nju-thesis-template/}{NJU-Thesis}(2018 - 2021)
%  \item 赵懿晨(\href{https://fengchendian.github.io/about.html}{@FengChendian})基于AnyiRao模板的\href{https://github.com/FengChendian/NJUThesis2021}{NJU Thesis 2021}(2021)
% \end{enumerate}
% 至于不幸而未进行代码版本管理的,甚至于说以压缩包形式流传于各人硬盘中的,就更不可计数了。
%
% 与其让一千个学生做一千种不同的模板,不如有人牵起头来,集中力量办大事。因此,南京大学 Linux User Group 的有志之士在2021年暑期联合起来,参考以上的现成模板,兼顾友校thuthesis、fduthesis等优秀项目,构建了这一全新模板,力求通过\hologo{LaTeX3}语法和清淅的接口实现良好的易用性和可维护性。
%
% 目前,本模板的主要维护者包括:
%
% \begin{itemize}
%     \item 赵懿晨
%     \item 熊煜
% \end{itemize}
%
% \subsection{君\hologo{LaTeX}本当上手}
Yu Xiong's avatar
Yu Xiong committed
% \hologo{LaTeX}并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听到“\emph{给毕业论文交差也得写代码}”这种事情就头疼,实在是我们不愿意见到而必须要面对的情况。目前,中文互联网上的\hologo{LaTeX}写作教程不能说屈指可数,起码也是汗牛充栋,比较著名的包括刘海洋的《\hologo{LaTeX}入门》等等都是不错的参考资料。然而如何快速准确找到所需要的用法,尤其是\hologo{LaTeX3}的新接口,需要一定的时间或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您的相关知识体系,只能\textbf{尽力做到有求必应},在需要的地方顺带提一嘴,保证您少走点弯路。
%
% \subsection{关于本说明手册}
%
Yu Xiong's avatar
Yu Xiong committed
% 本模板通过\textsc{DocStrip}进行维护,实际上是一种\emph{文学编程}。文学编程的本体是那些用来说明的文字,按写书写文章的方式组织。
% \file{njuthesis.dtx}包含njuthesis模板的所有信息。前半部分为模板说明,即各种常用命令与必要的使用方法;后半部分为代码实现,为带有详细注释的\hologo{TeX}源代码。后者配合附录,为有意了解本模板细节的同学提供简明的指引。
Yu Xiong's avatar
Yu Xiong committed
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,\file{file-example.xxx}为文件名,\pkg{pkg-example}为宏包名,\opt{opt-example}为选项名,\env{env-example}为需要|\begin{}|和|\end{}|的环境名,等。
Yu Xiong's avatar
Yu Xiong committed
%
% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,请通过GitHub issue或者QQ群聊联系LUG。
% \section{安装}
Yu Xiong's avatar
Yu Xiong committed
% \label{sec:setup}
%
% 本节主要介绍本宏包的获取、安装以及编译方式
% \subsection{下载模板}
% 本宏包已经发布在CTAN,将在明年进入\hologo{TeX}\,Live 2022 发行版。然而CTAN版更新不及时,更推荐使用以下方式下载。
%
% 从本模板的Github Releases页面下载最新的发布版
%
Yu Xiong's avatar
Yu Xiong committed
% 从本模板的Github仓库或者NJU Git同步镜像下载最新的dtx文件自行安装
%
% \subsection{本地编译}
%
% \subsubsection{安装\hologo{TeX}发行版}
%
% 首先需要下载\hologo{TeX}软件发行版,校园网环境中使用\href{https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F}{南大镜像站}可以获得最好的体验。\textbf{推荐使用最新的\hologo{TeX}\,Live 2021或者\hologo{MiKTeX} 21以避免潜在的兼容性问题。}
%
% \begin{itemize}
%     \item 为了避免不必要的麻烦,请尽可能下载 full 版本,如 texlive-full。简而言之,下载大的那个。
Yu Xiong's avatar
Yu Xiong committed
%     \item 并且,尽可能使用最新版(截至目前是 2021)。2020 及之前版本使用 PDF 格式的图片可能会出现加粗问题以及l3语法解释错误。
% \end{itemize}
Yu Xiong's avatar
Yu Xiong committed
%
% 下表是目前经过测试的环境。如果有其他可用不可用的环境,欢迎补充。
Yu Xiong's avatar
Yu Xiong committed
% \begin{table}[ht]
%     \centering
Yu Xiong's avatar
Yu Xiong committed
%     \caption{经过测试的环境}
Yu Xiong's avatar
Yu Xiong committed
%     \label{tab:1}
Yu Xiong's avatar
Yu Xiong committed
%     \begin{tabular}{ccc}
Yu Xiong's avatar
Yu Xiong committed
%           \toprule
%           OS & TeX & 测试情况 \\
%           \midrule
%           Windows 10   & \hologo{TeX}\,Live 2020 & cref存在格式问题  \\
%           Windows 10   & \hologo{TeX}\,Live 2021 & 通过 \\
%           Windows 10   & \hologo{MiKTeX}         & 通过 \\
%           macOS 10.15  & mac\hologo{TeX} 2021    & 通过 \\
%           Ubuntu 20.04 & \hologo{TeX}\,Live 2021 & 通过 \\
%           Arch Linux   & \hologo{TeX}\,Live 2021 & 通过 \\
%           \bottomrule
Yu Xiong's avatar
Yu Xiong committed
%     \end{tabular}
% \end{table}
%
% \subsubsection{选择编辑器}
%
% 配置完编译器后,还需要一个\textbf{文本编辑器}作为前端来完成\texttt{.tex}文件内容的写作。
%
% 至今仍有相当一部分人认为Windows自带的\textit{记事本}是最好的文本编辑器,但对于本项目而言,在此诚心诚意地推荐你使用\textbf{更现代更美观更多功能}的编辑器,譬如\emph{安装了 LaTeX Workshop 插件 的 \href{https://code.visualstudio.com/}{Visual Studio Code}},来完成论文编写。你也可以根据个人的喜好随便使用其他编辑器,如 TeXworks、TeX Studio 等,顺手就行。
%
% 若使用 LaTeX Workshop 插件,本项目在|.vscode/|中提供一份简易配置,可以省略初始配置步骤直接使用。
Yu Xiong's avatar
Yu Xiong committed
%
% \subsubsection{编译顺序}
% 假设即将使用的文件名为\file{mynjuthesis.tex}
Yu Xiong's avatar
Yu Xiong committed
% 应采用以下命令顺序进行编译,以生成正确的目录、编号和参考文献条目。
% \begin{ctexexam}
%   xelatex mynjuthesis
%   biber mynjuthesis
%   xelatex mynjuthesis
%   xelatex mynjuthesis
% \end{ctexexam}
% 使用 \pkg{latexmk}
% \begin{ctexexam}
%   latexmk -xelatex mynjuthesis
% \end{ctexexam}
% \begin{ctexexam}
%   lualatex mynjuthesis
%   biber mynjuthesis
%   lualatex mynjuthesis
%   lualatex mynjuthesis
% \end{ctexexam}
% 使用 \pkg{latexmk}
% \begin{ctexexam}
%   latexmk -lualatex mynjuthesis
% \end{ctexexam}
%
% 编译产物为\file{njuthesis.pdf},位于主目录下。此外还会生成一系列中间文件,可以选择使用以下命令进行清理。
%
% \begin{ctexexam}
%   latexmk -c
% \end{ctexexam}
Yu Xiong's avatar
Yu Xiong committed
%
% \subsection{在线编译}
%
% 相信你在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如\hologo{TeX}编译器安装过程较为漫长,占用空间过大,而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{其实这三点都是对广大的Windows用户说的,同一个模板在Linux编译可以节省一半耗时}。拒绝接受这些麻烦的同学不妨尝试本节介绍的在线编译方法。
%
% \subsubsection{南大\hologo{TeX}平台简介}
%
% \href{https://tex.nju.edu.cn}{南大\hologo{TeX}}基于开源的ShareLaTeX平台\footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正式上线,面向南京大学全体师生开放,首次使用需凭学校邮箱自助注册账号。
%
% \subsubsection{操作步骤}
%
% \begin{enumerate}
%     \item 下载\href{https://github.com/nju-lug/NJUThesisUndergraduate/archive/refs/heads/master.zip}{模板全部文件}
%     \item 访问\href{https://tex.nju.edu.cn}{南大\hologo{TeX}},点击界面右上方Register,使用\emph{南京大学邮箱}注册账号并登录
%     \item 点击New Project -> Upload Project上传刚刚得到的zip文件,上传后njuthesis.tex、njuthesis.cls等文件应在根目录,目录结构如{{sec:directory}}所示
%     \item 在项目页面左上角的Menu中,将编译器改为\hologo{XeLaTeX}或者\hologo{LuaLaTeX}
%     \item 编写论文
%     \item 点击Compile按钮进行编译和预览
%     \item 点击编译按钮右侧第三个按钮下载产物
% \end{enumerate}
%
% \subsubsection{关于Overleaf平台}
%
% 由于\href{https://www.overleaf.com/}{Overleaf平台}的\hologo{TeX}\,Live版本停留在2020,\texttt{cleveref}包在引用章节时会生成错误的标签,引发格式错误;而南大\hologo{TeX}通过及时更新规避了这一问题。因此\emph{请务必不要使用Overleaf官网进行编译}。
%
%
%
% \section{使用方法}
Yu Xiong's avatar
Yu Xiong committed
% \subsection{自定义选项}
%
Yu Xiong's avatar
Yu Xiong committed
% 尖括号内列出了若干个允许的选项,其中加粗的为默认选项。
Yu Xiong's avatar
Yu Xiong committed
%
% 封面标题留空即可自动化换行
Yu Xiong's avatar
Yu Xiong committed
%
% 第二导师不填则留空,目前来说拥有两位指导老师并不是一种普遍状况。
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{function}[added=2021-09-07]{nlcover}
%   \begin{syntax}
%     nlcover = <\TTF>
%   \end{syntax}
%
% 通过此项可选择是否添加国家图书馆封面,本选项仅对于研究生有效
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% 
% \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}
%
% 选择学位,可选:
% \opt{ug}(默认本科),\opt{mg}即学术硕士,\opt{mf},\opt{phd}。
% \end{function}
%   
Yu Xiong's avatar
Yu Xiong committed
% \begin{function}[added=2021-09-07]{type}
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     type = <(thesis)|design>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
%
% 用于选择文档类型并将相关字段输出在封面和摘要页。可选值包括thesis(表示毕业论文)和design(表示毕业设计),缺省值为thesis。
% \opt{thesis}(默认),\opt{design}。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%   
%
% \subsubsection{指定字体}
%
%
Yu Xiong's avatar
Yu Xiong committed
% 学校论文格式要求使用的字体一般已经预装在各个操作系统,本模板针对不同平台进行了自动检测适配,可以开箱即用。
%
Yu Xiong's avatar
Yu Xiong committed
% 如果希望更改本模板使用的字体,请填写以下两个选项覆盖检测操作系统得到的设置
Yu Xiong's avatar
Yu Xiong committed
% 
Yu Xiong's avatar
Yu Xiong committed
%
% \begin{function}[added=2021-09-07]{customlatinfont}
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     customlatinfont = <(windows)|macos|gyre|none>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
%
% 手动指定英文字体,可选:
Yu Xiong's avatar
Yu Xiong committed
% \opt{windows}(默认), \opt{macos}, \opt{gyre}, \opt{none}。
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
% 
% \begin{function}[added=2021-09-07]{customchinesefont}
%   \begin{syntax}
Yu Xiong's avatar
Yu Xiong committed
%     customchinesefont = <(windows)|macos|fandol|founder|noto|none>
Yu Xiong's avatar
Yu Xiong committed
%   \end{syntax}
%
% 手动指定中文字体,可选:
Yu Xiong's avatar
Yu Xiong committed
% \opt{windows}(默认), \opt{macos}, \opt{fandol}, \opt{founder},\opt{noto},\opt{none}。
Yu Xiong's avatar
Yu Xiong committed
%
% 方正字体(简繁扩展)系列
% FZSSK \href{http://www.foundertype.com/index.php/FontInfo/index/id/151}{方正书宋} 免费商用
%
% FZXBSK \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}{方正小标宋} 设计师非商免费
%
% FZKTK \href{http://www.foundertype.com/index.php/FontInfo/index/id/137}{方正楷体} 免费商用
%
% FZXH1K \href{http://www.foundertype.com/index.php/FontInfo/index/id/161}{方正细黑一} 设计师非商免费
%
% FZHTK  \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}{方正黑体} 免费商用
%
% FZFSK  \href{http://www.foundertype.com/index.php/FontInfo/index/id/128}{方正仿宋}
Yu Xiong's avatar
Yu Xiong committed
%
% FZYouHK_508R  \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑508R} 设计师非商免费
%
% FZYouHK_511M \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑511M} 设计师非商免费
%
% 思源字体\footnote{思源宋体和思源黑体有两种英文命名,本模板采用Google的noto系列}:
%  \href{https://www.google.com/get/noto/#serif-hans}{思源宋体}、
%  \href{https://www.google.com/get/noto/#sans-hans}{思源黑体}
% 
% 方正楷体、方正仿宋为免费商用字体,且支持CJK字符集
%  \href{http://www.foundertype.com/index.php/FontInfo/index/id/128.html}{方正仿宋}
%  \href{http://www.foundertype.com/index.php/FontInfo/index/id/137.html}{方正楷体}
%
Yu Xiong's avatar
Yu Xiong committed
% 各个系统的默认字体请参考。可以看到,不同系统上使用的字体有所差别,实际输出结果可能存在细微不同, 使用时请注意。例如,在Linux平台或者使用了Ubuntu后端的南大\hologo{TeX}上,宋体加粗效果更明显;另一方面,在Windows平台进行编译的效果更接近Word加粗\footnote{因为SimSun没有原生粗体,通过AutoFakeBold=2.17进行模仿},符合视觉习惯。
% 
Yu Xiong's avatar
Yu Xiong committed
% \end{function}
%
%
% \subsection{封面信息}
%
% \subsection{输入个人信息}
%
% \begin{function}{\njusetup}
% 
%  定义了用于文档封面的诸多属性参数,
Yu Xiong's avatar
Yu Xiong committed
% 写作时修改相应字符串即可。注意不要有空行,否则可能报错
%
% \end{function}
%
Yu Xiong's avatar
Yu Xiong committed
% 本科生可以参考如下列表输入个人信息。注意不能有空行,有空格的内容需要将空格替换为波浪线或者两端加上大括号
%
% \begin{ctexexam}
Yu Xiong's avatar
Yu Xiong committed
%   \njusetup {
%       info = {
%           TitleA = 第一行标题,
%           TitleB = 第二行标题,
%           Title* = {My title in English}, 
%           Grade = 2018,
%           StudentID = 189114514,
%           StudentName = 周煜华,
%           StudentName* = Zhou~Yuhua,
%           Department = 拉太赫科学与技术学院,
%           Department* = School~of~\hologo{LaTeX},
%           Major = 拉太赫语言学,
%           Major* = \hologo{LaTeX}~Linguistics,
%           SupervisorA = 李成殿,
%           SupervisorA*= Li~Chengdian,
%           SupervisorATitle = 教授,
%           SupervisorATitle* = Professor,
%           SupervisorB = 孙赫弥,
%           SupervisorB* = Sun~Hemi,
%           SupervisorBTitle = 副教授,
%           SupervisorBTitle* = Associate professor,
%           SubmitDate = 2021年8月10日,
%       }
%   }
Yu Xiong's avatar
Yu Xiong committed
% \end{ctexexam}
%
% 研究生可以参考如下列表输入个人信息
Yu Xiong's avatar
Yu Xiong committed
%
Yu Xiong's avatar
Yu Xiong committed
% \begin{ctexexam}
Yu Xiong's avatar
Yu Xiong committed
%   \njusetup {
%       info = {
%           TitleA = 第一行标题,
%           TitleB = 第二行标题,
%           TitleC = 第三行标题,
%           Title* = {My title in English}, 
%           Grade = 2018,
%           StudentID = dz18114514,
%           StudentName = 周煜华,
%           StudentName* = Zhou~Yuhua,
%           Department = 拉太赫科学与技术学院,
%           Department* = School~of~\hologo{LaTeX},
%           Major = 拉太赫语言学,
%           Major* = \hologo{LaTeX}~Linguistics,
%           Field = 拉太赫语言在现当代的使用, 
%           Field* = Contemporary~Usage~of~the~\hologo{LaTeX}~Language, 
%           SupervisorA = 李成殿,
%           SupervisorA*= Li~Chengdian,
%           SupervisorATitle = 教授,
%           SupervisorATitle* = Professor,
%           SubmitDate = 2021年8月10日,
%           SubmitDate* = {Aug 10, 2021}, 
%           DefendDate = 2021年9月19日,
%           ReviewerChairman = 张晓山~教授,
%           ReviewerA = 王瑞希~教授,
%           ReviewerB = 郭德纲~副教授,
%           ReviewerC = 华芈库~教授,
%           ReviewerD = 戴菲菲~教授,
%           Classification = 0175.2,
%           SecurityLevel = 限制,
%           UDC = 004.72,
%           SupervisorContact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514},
%       }
%   }
Yu Xiong's avatar
Yu Xiong committed
% \end{ctexexam}
Yu Xiong's avatar
Yu Xiong committed
%
% \subsection{摘要页}
%
Yu Xiong's avatar
Yu Xiong committed
%
% 在使用\hologo{LuaLaTeX}编译时,研究生中文摘要页的标题会出现空格无下划线的问题,目前正在积极寻求解决方法。
%
% {前言页}
Yu Xiong's avatar
Yu Xiong committed
% 使用\env{preface}环境定义
Yu Xiong's avatar
Yu Xiong committed
%
%
% \subsection{正文格式}
%
% 本科生无页眉,页面编号居中位于页脚;研究生无页脚,页眉包括章节名和页面编号。
%
% 
Yu Xiong's avatar
Yu Xiong committed
%
%
% {致谢页}
Yu Xiong's avatar
Yu Xiong committed
% 同前言,使用\env{acknowledgement}环境
Yu Xiong's avatar
Yu Xiong committed
% 
% {附录页}
Yu Xiong's avatar
Yu Xiong committed
% 附录放在|\appendix|命令后,以英文字母进行编号
Yu Xiong's avatar
Yu Xiong committed
% 
% 
% \subsection{页面元素}
%
% \subsubsection{图片}
%
% 所有图片默认存放在主目录下的\texttt{figure/}文件夹内,允许的文件名包括\file{*.jpg}, \file{*.png}, \file{*.pdf}, \file{*.eps}, 
%
% 下面这个例子展示了如何插入一张名称为\file{myfig.jpg},宽度占页面文字宽度一半的图片。注意标签命令|\label|必须放在图注命令|\caption|之后。
%
% \begin{ctexexam}
%   \begin{figure}
%       \includegraphics[width=0.5\textwidth]{myfig}
%       \caption{我的图}
%       \label{fig:myfig}
%   \end{figure}
% \end{ctexexam}
%
% 
% 文字环绕图像,\env{wrapfigure}后面不能有空行
%
% \begin{ctexexam}
%   \begin{wrapfigure}{r}{0cm}
%       \includegraphics[width=0.15\textwidth]{myfig}
%       \caption{我的图}
%       \label{fig:myfig}
%   \end{wrapfigure}
%   <text>
% \end{ctexexam}
% 
%
% \subsubsection{表格}
%
% 下面这个例子展示了如何插入一张表格
% \begin{ctexexam}
%   \begin{table}[htbp]
%       \caption{我的表}
%       \label{tab:testtab}
%       \begin{tabular}{ccc}
%           \toprule
%           OS & TeX & 测试情况 \\
%           \midrule
%           南大TeX & Overleaf & √ \\
%           \bottomrule
%       \end{tabular}
%   \end{table}
% \end{ctexexam}
%
% 
% 
% 
%
% \subsubsection{代码}
%
% \env{lstlisting}环境用来进行代码排版
% 
% \subsubsection{引用标签}
%
% 使用\pkg{cleveref}宏包实现了带图、表等项目名称的智能引用,仅需使用|\cref{<label>}|命令。
%
% \subsection{参考文献}
%
% 符合GB7714-2015规范。使用\hologo{biber}作为\hologo{BibTeX}后端。需要使用|biber|命令手动编译才会显示
%
% 默认参考文献存储于主目录下的\file{njuthesis.bib},直接向其中粘贴新的参考文献即可。
%
% 如果希望额外添加一个名叫\file{mybiblio.bib}的参考文献目录,可以在主文件\file{mynjuthesis.tex}的导言区中添加以下命令:
%
% \begin{ctexexam}
%   \addbibresource{mybiblio.bib}
% \end{ctexexam}
%
% \subsubsection{使用EndNote管理文献}
%
% 南京大学信息化建设管理服务中心已购买\href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote}供全校师生免费试用,最新版为EndNote 20。
%
%
%
% 
%
% \subsubsection{使用Zotero管理文献}
%
% \href{https://www.zotero.org/}{Zotero}是一款免费的文献管理软件,支持所有桌面平台。
%
% 在保持Zotero程序运行的情况下,点击浏览器工具栏的Zotero Connector插件即可自动从网页抓取参考文件信息。Zotero也有知网插件
%
% \subsubsection{文段内引用}
%
% |\cite{myref}|,|\citesuthor{myref}|
%
% 
% \end{documentation}
%
% \begin{implementation}
%
Yu Xiong's avatar
Yu Xiong committed
% \section{代码实现}
Yu Xiong's avatar
Yu Xiong committed
% @@在l3docstrip中表示名空间,在生成cls时会被相应字段替换,譬如在\pkg{njuthesis}中|@@=nju|。
Yu Xiong's avatar
Yu Xiong committed
% 尖括号包裹的|<*class>||</class>|用来指定某段代码属于哪个文件。
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%<*class>
\LoadClass[
  a4paper,
  twoside,
  UTF8,
  scheme=chinese,
%    \end{macrocode}
%
% 关于行距,\hologo{LaTeX}默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故
% \[ 1.5\times\frac{1.3}{1.2} = 1.625\]
%    \begin{macrocode}
Yu Xiong's avatar
Yu Xiong committed
  linespread=1.625,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 默认不载入任何字体,供模板自行设置
%    \begin{macrocode}
  fontset=none,
  zihao=-4
  ]{ctexbook}[2018/04/01]
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 宏包\pkg{l3keys2e}用于配置模板选项。
%    \begin{macrocode}
\RequirePackage{l3keys2e}
%    \end{macrocode}
% 是否需要国家图书馆封面的设置
%    \begin{macrocode}
\keys_define:nn { nju }
{
Yu Xiong's avatar
Yu Xiong committed
  nlcover           .bool_set:N   =   \g_@@_nlcover_bool,
  nlcover           .initial:n    =   false,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
% 
%
% \begin{variable}{\l_@@_info_degree_tl,\l_@@_info_type_tl}
% 用于存储学位名称的变量,注意宏的命名,l代表局部变量,g代表全局变量
%    \begin{macrocode}
\tl_new:N \l_@@_info_degree_tl
\tl_new:N \l_@@_info_type_tl
%    \end{macrocode}
% \end{variable}
Yu Xiong's avatar
Yu Xiong committed
%
% 学位信息的设置
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju }
{
  degree            .choices:nn   =
  { ug, mg, mg, phd }
  { \tl_set_eq:NN \l_@@_info_degree_tl \l_keys_choice_tl },  
  degree            .initial:n    =   ug,
  type              .choices:nn   =
  { thesis, design }
  { \tl_set_eq:NN \l_@@_info_type_tl   \l_keys_choice_tl }, 
  type              .initial:n    =   thesis,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
% \subsection{个人信息}
Yu Xiong's avatar
Yu Xiong committed
% 输入个人信息的区域。
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju }
{
  info.meta:nn = { nju / info } { #1 }
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  TitleA            .tl_set:N     =   \l_@@_info_title_a_tl,
  TitleB            .tl_set:N     =   \l_@@_info_title_b_tl,
  TitleC            .tl_set:N     =   \l_@@_info_title_c_tl,
  Title*            .tl_set:N     =   \l_@@_info_title_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 年级、学号、姓名
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  Grade             .tl_set:N     =   \l_@@_info_grade_tl,
  StudentID         .tl_set:N     =   \l_@@_info_id_tl,
  StudentName       .tl_set:N     =   \l_@@_info_author_tl,
  StudentName*      .tl_set:N     =   \l_@@_info_author_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 院系、专业、方向
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  Department        .tl_set:N     =   \l_@@_info_dept_tl,
  Department*       .tl_set:N     =   \l_@@_info_dept_en_tl,
  Major             .tl_set:N     =   \l_@@_major_tl,
  Major*            .tl_set:N     =   \l_@@_major_en_tl,
  Field             .tl_set:N     =   \l_@@_field_tl,
  Field*            .tl_set:N     =   \l_@@_field_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  SupervisorA       .tl_set:N     =   \l_@@_info_supv_a_tl,
  SupervisorA*      .tl_set:N     =   \l_@@_info_supv_a_en_tl,
  SupervisorATitle  .tl_set:N     =   \l_@@_info_supv_a_title_tl,
  SupervisorATitle* .tl_set:N     =   \l_@@_info_supv_a_title_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  SupervisorB       .tl_set:N     =   \l_@@_info_supv_b_tl,
  SupervisorB*      .tl_set:N     =   \l_@@_info_supv_b_en_tl,
  SupervisorBTitle  .tl_set:N     =   \l_@@_info_supv_b_title_tl,
  SupervisorBTitle* .tl_set:N     =   \l_@@_info_supv_b_title_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  SubmitDate        .tl_set:N     =   \l_@@_submit_date_tl,
  SubmitDate*       .tl_set:N     =   \l_@@_submit_date_en_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  DefendDate        .tl_set:N     =   \l_@@_defend_date_tl,
  ReviewerChairman  .tl_set:N     =   \l_@@_info_chairman_tl,
  ReviewerA         .tl_set:N     =   \l_@@_info_reviewer_a_tl,
  ReviewerB         .tl_set:N     =   \l_@@_info_reviewer_b_tl,
  ReviewerC         .tl_set:N     =   \l_@@_info_reviewer_c_tl,
  ReviewerD         .tl_set:N     =   \l_@@_info_reviewer_d_tl,
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 国家图书馆封面相关
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
  Classification    .tl_set:N     =   \l_@@_info_classif_tl,
  SecurityLevel     .tl_set:N     =   \l_@@_info_seclv_tl,
  UDC               .tl_set:N     =   \l_@@_info_udc_tl,
  SupervisorContact .tl_set:N     =   \l_@@_info_supv_cont_tl,
%    \end{macrocode}
% 定义用于设置个人信息的命令
%    \begin{macrocode}
\NewDocumentCommand \njusetup { m }
{ \keys_set:nn { nju } { #1 } }
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 使用\pkg{geometry}设置页边距。
%    \begin{macrocode}
\RequirePackage[    
    top=2.5cm,
    bottom=2.5cm,
    left=3.2cm,
    right=3.2cm
]{geometry}
%    \begin{macrocode}
\RequirePackage{xparse}
\RequirePackage{titletoc} % 修改目录内标题格式
\RequirePackage[hyphens]{url} % generate better linebreaks in the url
\RequirePackage{dashundergaps}
\RequirePackage{setspace}
\RequirePackage{lastpage}
\RequirePackage{emptypage} % 清除空白页的页码
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\RequirePackage{listings} % 代码环境
\RequirePackage{enumitem} % 用于修改列表环境
\RequirePackage{caption}
\RequirePackage{floatrow} % 用于图表等页面元素的定位
\RequirePackage{booktabs} % 用于绘制三线表
\RequirePackage{multirow} % Cells occupying multiple rows in tables
\RequirePackage{multicol} % Multiple columns in dictionary
\RequirePackage{siunitx} % 用于书写单位符号
%    \end{macrocode}
%
% 用于化学
%    \begin{macrocode}
\RequirePackage[version=4]{mhchem} % 用于绘制分子式
Yu Xiong's avatar
Yu Xiong committed
% 用于生成可以被插入书签的LaTeX logo,TODO: 使用hologo创建|latex{}|命令
%    \begin{macrocode}
\RequirePackage{hologo} 
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
% Required to prevent page break right after a sectioning command
% \RequirePackage{needspace} 

% \RequirePackage{xspace} % Better print trailing whitespace
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 针对编译引擎,使用不同的宏包重构下划线命令
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\sys_if_engine_xetex:T
{
    \RequirePackage{microtype}

    % 加中文下划线,不能用于lualatex
    \RequirePackage{xeCJKfntef} 
    \cs_new:Npn \nju_underline:n #1 {\CJKunderline{#1}}
}
\sys_if_engine_luatex:T{
    % 加中文下划线
    \RequirePackage{lua-ul}
    \cs_new:Npn \nju_underline:n #1 {\underLine{#1}}

    % emoji支持
    % \RequirePackage{emoji}
    % \setemojifont{Segoe~UI~Emoji} % windows
    % \setemojifont{Apple~Color~Emoji} % macos
    % \setemojifont{Noto~Color~Emoji}
    % For windows. 
    % Shipped with the best `grinning-face-with-sweat' support.
}
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 生成用于测试的大段无意义英文文字
%    \begin{macrocode}
\RequirePackage{blindtext} 
\RequirePackage{zhlipsum} 
%    \end{macrocode}
%
% 加载以后展示内容边界
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
% \RequirePackage{showframe} 
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
% 数学
%    \begin{macrocode}
\RequirePackage{amsmath} % Must be loaded before unicode-math
\RequirePackage{amsthm} % Mathematical environments
\RequirePackage{mathtools} % Mathematical tools to use with amsmath
\RequirePackage{thmtools} % Theorem styles
\RequirePackage[
    warnings-off={% 消除与mathtools合用产生的警告
        mathtools-colon,
        mathtools-overbracket}
        ]{unicode-math} % Math fonts in xetex or luatex
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 配置图片路径
Yu Xiong's avatar
Yu Xiong committed
%    \begin{macrocode}
\RequirePackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png}
\graphicspath{{figure/}} % 图片路径
\RequirePackage{wrapfig} % Wrap text around figures
Yu Xiong's avatar
Yu Xiong committed
%    \end{macrocode}
%
Yu Xiong's avatar
Yu Xiong committed
% 必须以该顺序加载以下包
\RequirePackage[hidelinks,bookmarksnumbered=true]{hyperref}
\RequirePackage[capitalise,nameinlink,noabbrev]{cleveref}
%    \end{macrocode}
%
% \subsection{字体设置}