% \iffalse meta-comment % !TeX program = XeLaTeX % !TeX encoding = UTF-8 % % Copyright (C) 2019--2023 by Nan Geng % % This work 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. % % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is Nan Geng. % % This work consists of the files nwafuthesis.dtx, % nwafuthesis-doc.dtx, % and the derived files nwafuthesis.ins, % nwafuthesis.cls, % nwafudoc.cls, % %<*internal> \iffalse % % %<*internal> \fi \begingroup \def\NameOfLaTeXe{LaTeX2e} \expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else \csname fi\endcsname % % %<*install> \input l3docstrip.tex \keepsilent \askforoverwritefalse \preamble Copyright (C) 2019--2023 by Nan Geng This work 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. This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Nan Geng. This work consists of the files nwafuthesis.dtx, nwafuthesis-doc.dtx, and the derived files nwafuthesis.ins, nwafuthesis.cls, nwafudoc.cls, \endpreamble \generate{ \usedir{tex/latex/nwafuthesis} \file{\jobname.cls} {\from{\jobname.dtx}{class}} \file{nwafudoc.cls} {\from{\jobname.dtx}{doc} \from{\jobname-doc.dtx}{doc}} % %<*internal> \usedir{source/latex/nwafuthesis} \file{\jobname.ins} {\from{\jobname.dtx}{install}} % %<*install> \usedir{doc/latex/nwafuthesis} \nopreamble\nopostamble } \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/nwafuthesis *} \Msg{* *} \Msg{* nwafuthesis.cls *} \Msg{* nwafudoc.cls *} \Msg{* *} \Msg{* To produce the documentation, run the file nwafuthesis.dtx*} \Msg{* through XeLaTeX. *} \Msg{* *} \Msg{* Happy TeXing! *} \Msg{* *} \Msg{*************************************************************} \endbatchfile % % %<*internal> \fi % % %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} %<*!(driver|install)> %\GetIdInfo $Id: nwafuthesis.dtx 1.25 2023-04-18 Nan Geng $ % {Thesis template for Northwest A\&F University} %\ProvidesExplClass{\ExplFileName} % {Definition file for nwafuthesis} %\ProvidesExplFile{\ExplFileName.def} % {Documentation class for nwafuthesis} %\ProvidesExplClass{nwafudoc} % {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} % %<*driver> % \PassOptionsToPackage{showframe}{geometry} \documentclass{nwafudoc} \usepackage{multirow,xeCJKfntef,xpinyin,csquotes} \hypersetup{ pdftitle = {nwafuthesis: 西北农林科技大学学位论文模板}, pdfauthor = {耿楠} } % 全角标点放在引号中,需要改成半角式,否则间距过大,不好看 \def\FSID{“{\xeCJKsetup{PunctStyle=banjiao}。}”} % U+3002 \def\FSFW{“{\xeCJKsetup{PunctStyle=banjiao}.}”} % U+FF0E \def\COFW{“{\xeCJKsetup{PunctStyle=banjiao}:}”} % U+FF1A \def\SCFW{“{\xeCJKsetup{PunctStyle=banjiao};}”} % U+FF1B % nwafuthesis的LOGO \newcommand{\nwafuthesis}{% \makebox{\rmfamily% N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex}{\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% \textsc{Thesis}}} \title{\textcolor{MaterialIndigo800}{% \textbf{\nwafuthesis: 西北农林科技大学学位论文 \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{耿楠} \date{\today\quad v1.25% \thanks{\url{https://gitee.com/nwafu_nan/nwafuthesis-l3}.}} \begin{document} % \DisableImplementation \EnableImplementation % \def\nwafuCODEDOC{} \DocInput{nwafuthesis.dtx} \DocInput{nwafuthesis-doc.dtx} \IndexLayout \PrintChanges \PrintIndex \end{document} % % \fi % % \changes{v1.10}{2022/03/17}{更新实现细节。} % \changes{v1.00}{2021/06/06}{开始发布测试。} % \changes{v1.00}{2021/05/12}{开始编写模板。} % % \CheckSum{0} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % %^^A 禁止使用 " 符号作为抄录文本缩略符 % \DeleteShortVerb\" % %^^A 封面与目录的页边距 % \newgeometry{ % left = 1.25 in, % right = 1.25 in, % top = 1.25 in, % bottom = 1.00 in % } % % \maketitle % \vfill % \begin{center} % \includegraphics[width=0.20\textwidth]{logo/nwafu-circle.pdf}\\[3ex] % \includegraphics[width=0.5\textwidth]{logo/motto} % \end{center} % \vfill % \begin{center} % \includegraphics[width=0.6\textwidth]{logo/building} % \end{center} % \vfill % \begin{center} % \bfseries\zihao{1}经国本\qquad{}解民生\qquad{}尚科学 % \end{center} % \vfill % \thispagestyle{empty} % \clearpage % % \pagenumbering{Roman} % \tableofcontents % \clearpage % % \pagenumbering{arabic} % \EnableDocumentation %^^A \DisableDocumentation % % \begin{documentation} % %^^A 用户手册的页边距 % \newgeometry{ % left = 1.65 in, % right = 0.80 in, % top = 1.25 in, % bottom = 1.00 in % } % % \section{简介} % % 目前,西北农林科技大学 \LaTeX{} 学位论文模板是由信息工程学院 % 耿楠老师编写的\cls{nwafuthesis}模板。 % 该模板是基于\LaTeXe{}开发,虽然一直在维护,但由于初期开发代码的不规范, % 其维护成本较高,为此,在借鉴\scite{fduthesis}的基础上, % 用 \LaTeX3 \scite{source3}根据\scite{西北农林科技大学研究生论文写作指南}和 % \scite{西北农林科技大学本科生论文撰写规范} % 重构了\cls{nwafuthesis}模板,以适应 \TeX{} 技术的发展。 % 同时\cls{nwafuthesis}还构建了一套简洁的用户接口,以方便用户使用。 % 新模板更加稳定,普适性更强,运行效率更高。 % % \subsection*{\LaTeX{} 入门} % % 本文档并非一份 \LaTeX{} 零基础教程。如果是完完全全的新手, % 建议先阅读相关入门文档,如刘海洋编著的《\LaTeX{} 入门》 % \scite{刘海洋2013latex入门} ,或大名鼎鼎的“\pkg{lshort}” % \scite{lshort} 及其中文翻译版 \scite{lshort-zh-cn}。当然, % 网络上诸如耿楠录制的\LaTeX{}教学系列视频等入门教程多如牛毛, % 可以自行选取学习。 % % \subsection*{关于本文档} % % 本文采用不同字体表示不同内容。无衬线字体表示宏包名称,如 % \pkg{xeCJK} 宏包、\cls{nwafuthesis} 文档类等;等宽字体表示代码或 % 文件名,如 \cs{nwafuset} 命令、\env{abstract} 环境、\TeX{} 文档 % \file{main.tex} 等;带有尖括号的楷体(或西文斜体)表示命令参数, % 如 \meta{模板选项}、\meta{English title} 等。使用时,不必输入参数两侧 % 的尖括号。示例代码进行了语法高亮处理,以方便阅读。 % % 在用户手册中,带有蓝色侧边线的为 \LaTeX{} 代码,而带有粉色侧边线 % 的则为命令行代码,请注意区分。模板提供的选项、命令、环境等, % 均用横线框起,同时给出语法和相关说明。 % % 手册中代码实现部分主要面向对 \LaTeX{} 模板开发感兴趣的用户。 % 文档的最后还提供了版本历史和代码索引,以供查阅。 % % \section{安装} % % \subsection{模板工作流} % % 使用{\nwafuthesis}模板排版学位论文的工作流如图\ref{fig:workflow}所示。 % % \begin{figure}[!htb] % \centering % \includegraphics[width=0.85\textwidth]{logo/workflow} % \caption{模板工作流} % \label{fig:workflow} % \end{figure} % % 作为普通用户,仅需要通过{\LaTeX}发行版安装和更新模板,完成安装后,即可使用% % \verb|\documentclass{nwafuthesis}|载入该模板进行工作了。作为普通用户, % 强烈建议只关心学位论文内容,通过与导师的反复沟通修改与完善论文内容即可。 % 关于学位论文排版格式问题应该交由开发者根据根据相关学校% % \emph{指南/规范}进行设计和调整。开发者完成模板开发及功能完善后,会上传到 % CTAN(\url{www.ctan.org}),然后模板会被部署于{\LaTeX}发行版,此时普通 % 用户仅需要通过{\LaTeX}发行版的管理工具更新模板即可得到更新后的模板, % 模板更新再次编译学位论文即可按最新的格式要求完成排版。 % % 关于{\nwafuthesis}模板的使用的详细说明,一方面可以通过阅读其使用说明书和 % 写作样例进行学习,另一方面也可以参阅耿楠在B站发布的教学视频% % \url{https://www.bilibili.com/video/BV1tY4y1q7RT#reply107826496032}进行学习。 % % 如果有任何改进意见或者功能需求,欢迎前往 Gitee 仓库提交issue。 % {\nwafuthesis}模板的源代码托管于\url{https://gitee.com/nwafu_nan/nwafuthesis-l3}, % 欢迎大家多提 issue/PR,以便进一步完善和美化我校学位论文\LaTeX{}模板。 % % \subsection{获取 \cls{nwafuthesis}} % % \subsubsection{标准安装} % % 如果没有特殊理由,强烈建议使用宏包管理器安装 \cls{nwafuthesis}。 % 例如在 \TeXLive{} 中,执行(可能需要管理员权限) % \begin{shellexample}[morekeywords={tlmgr,install}] % tlmgr install nwafuthesis % \end{shellexample} % 即可完成安装。 % % 当然,在 \TeXLive{} 和 \MiKTeX{} 中,也可以通过图形界面进行安装, % 此处不再赘述,请参阅软件帮助。 % % \subsubsection{手动安装} % % 可以从\cls{nwafuthesis}源代码直接生成模板(不推荐): % % \begin{itemize} % \item 打开 \href{https://gitee.com/nwafu_nan/nwafuthesis-l3}^^A % {Gitee仓库主页},点击“克隆/下载”,并选择“下载ZIP”, % 下载 \file{nwafuthesis-master.zip};如果的电脑中安装有 git % 程序,也可通过以下命令直接克隆代码仓库: % \begin{shellexample}[gobble=7,alsoletter={.},^^A % morekeywords={git,clone}] % git clone git@gitee.com:nwafu_nan/nwafuthesis-l3.git % \end{shellexample} % \item 在解压后的目录中或进入克隆后的仓库目录,然后执行以下命令以生成 % 模板的各组件: % \begin{shellexample}[gobble=7,morekeywords={xetex}] % xetex nwafuthesis.dtx % \end{shellexample} % \item 将生成的文档类(\file{.cls})复制到 \TeX{} 发行版本地 TDS 树 % 的 \path{texmf-local/tex/latex/nwafuthesis/} 目录下,并执行 % \bashcmd{mktexlsr} 刷新文件名数据库,方可完成安装。 % \end{itemize} % % \subsubsection{扁平化安装} % % 如果您不希望安装本模板,但需要立刻使用,也可以使用模板提供的安装脚本。 % % \begin{itemize} % \item 打开 \href{https://gitee.com/nwafu_nan/nwafuthesis-l3}^^A % {Gitee仓库主页},点击“克隆/下载”,并选择“下载ZIP”, % 下载 \file{nwafuthesis-master.zip};如果的电脑中安装有 git % 程序,也可通过以下命令直接克隆代码仓库: % \begin{shellexample}[gobble=7,alsoletter={.},^^A % morekeywords={git,clone}] % git clone git@gitee.com:nwafu_nan/nwafuthesis-l3.git % \end{shellexample} % \item 在解压后的目录中或进入克隆后的仓库目录,然后执行以下命令以生成 % 模板的各组件: % \begin{itemize} % \item Windows系统: % \begin{shellexample}[gobble=11,morekeywords={build-win}] % build-win % \end{shellexample} % \item Linux系统: % \begin{shellexample}[gobble=11,morekeywords={build.sh}] % ./build.sh % \end{shellexample} % \end{itemize} % \item 将生成的文档类文件(\file{nwafuthesis.cls})复制到 % 论文撰写工作目录,然后开始撰写论文。 % \end{itemize} % % \subsection{模板组成} % % 本模板主要包含核心文档类、示例项目以及用户文档等几个 % 部分,其具体组成见表~\ref{tab:nwafuthesis-components}。 % % \begin{table}[ht] % \caption{\cls{nwafuthesis} 的主要组成部分} % \label{tab:nwafuthesis-components} % \centering % \begin{tabular}{lp{20em}} % \toprule % \textbf{文件} & \textbf{功能说明} \\ % \midrule % \file{nwafuthesis.cls} & 模板文档类 \\ % \file{nwafuthesis.pdf} & 用户手册 \\ % \bottomrule % \end{tabular} % \end{table} % % \section{使用说明} % % \subsection{基本用法} % % 在当前工作目录下创建一个名为logo的文件夹, % 并将学校的\enquote{\texttt{nwafu-bar.pdf}} % logo矢量图保存在该文件夹内,然后建立如下一份 % 简单的 \TeX{} 文档,它演示了 \cls{nwafuthesis} % 的最基本用法: % \begin{latexexample}[deletetexcs={\documentclass},% % moretexcs={\chapter},morekeywords={\documentclass},% % emph={[2]document}] % % main.tex % \documentclass{nwafuthesis} % \begin{document} % \chapter{欢迎} % \section{欢迎使用nwafuthesis!} % 你好,\LaTeX{}! % \end{document} % \end{latexexample} % % 按照 \ref{subsec:编译方式}~小节中的方式编译该文档,应当得到 % 一篇包含封面、独创声明等在内的空白论文(研究生7页,本科生3页)。 % % \subsection{编译方式} \label{subsec:编译方式} % % 本模板不支持 \pdfTeX{} 引擎,请使用 \XeLaTeX{} 或 \LuaLaTeX{} % 编译,推荐使用 \XeLaTeX{}编译。为了生成正确的目录、脚注、参考 % 文献以及交叉引用,至少需要连续编译4次。 % % 假设\TeX{} 源文件名为 \file{main.tex},使用 \XeLaTeX{} 编译论文。 % 则在命令行中可以顺序执行: % \begin{shellexample}[morekeywords={xelatex}] % xelatex main % biber main % xelatex main % xelatex main % \end{shellexample} % 或使用带有参数\meta{-xelatex}的 \pkg{latexmk}命令: % \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}] % latexmk -xelatex main % \end{shellexample} % % 如果使用 \LuaLaTeX{} 编译论文,请在命令行中顺序执行: % \begin{shellexample}[morekeywords={lualatex}] % lualatex main % biber main % lualatex main % lualatex main % \end{shellexample} % 或者执行带有\meta{-lualatex}的latexmk命令 % \begin{shellexample}[morekeywords={latexmk},emph={-lualatex}] % latexmk -lualatex main % \end{shellexample} % % 由于我校参考文献格式的特殊性,本模板基于 % 胡振震编写的符合GB/T7714-2015的biblatex样式文件\scite{biblatex-gb7714-2015} % 实现了参考文献排版,并在后台强制使用biber引擎编译参考文献。 % 因此,在第2次编译时,请务必\textbf{使用biber进行编译}。 % % 关于如何配置TeXStudio等IDE工具,以实现正确编译,请 % 参阅其使用说明书。 % % \subsection{模板选项} % % 所谓\enquote{模板选项}是指在用\tn{documentclass}命令引入文档类时能够指定的选项: % \begin{latexexample}[deletetexcs={\documentclass},% % morekeywords={\documentclass}] % \documentclass(*\oarg{模板选项}*){nwafuthesis} % \end{latexexample} % % 有些模板选项为布尔型,只能取 \opt{true} 或 \opt{false}。 % 对于这些选项,\kvopt{\meta{选项}}{true} 中的“|= true|” % 可以省略。 % % \begin{function}[added=2021-05-12]{type} % \begin{nwafusyntax}[emph={[1]type}] % type = (**) % \end{nwafusyntax} % 选择论文类型。三种选项分别代表博士学位论文、硕士学位论文和本科 % 毕业论文(设计)。 % \end{function} % % \begin{function}[added=2021-05-12]{oneside,twoside} % 指明论文的单双面模式,默认为 \opt{twoside}。 % \end{function} % % 无论是双面模式(\opt{twoside}),还是单面模式(\opt{oneside}), % 第一章都是从奇数页开始,而其后各章都是接上一章另起一页起排。 % 本模板中,目录、摘要、主要符号表对照表、附录、参考文献、致谢、 % 个人简历等均视作章,也按相同方式排版。 % % 对于研究生学位论文,奇数页页眉是章名称,偶数页页眉是 % “西北农林科技大学博士(或硕士)学位论文”。 % 对于本科生生毕业论文(设计),奇数页页眉是章名称,偶数页页眉是 % 论文(设计)题目。 % % \begin{function}[added=2021-05-12]{draft} % \begin{nwafusyntax}[emph={[1]draft}] % draft = (*<\TFF>*) % \end{nwafusyntax} % 选择是否开启草稿模式,默认关闭。 % \end{function} % % 草稿模式为全局选项,会影响到很多宏包的工作方式。 % 开启之后,主要的变化有: % \begin{itemize} % \item 将行溢出的盒子显示为黑色方块; % \item 不插入图片,只输出一个占位方框; % \item 关闭超链接渲染,也不生成 PDF 书签; % \item 显示页面边框。 % \end{itemize} % % \subsection{参数设置} % % \begin{function}[added=2021-05-12]{\nwafuset} % \begin{nwafusyntax}[morekeywords={\nwafuset}] % \nwafuset(*\marg{键值列表}*) % \end{nwafusyntax} % 本模板提供了一系列选项,以实现论文格式和作者、指导教师等 % 基本信息的配置。载入\pkg{nwafuthesis}文档类之后,以下 % 所有选项均可通过统一的\cs{nwafuset}命令进行设置。 % \end{function} % % \cs{nwafuset} 的参数是一组由(英文)逗号分隔的选项列表,列表中的 % 选项通常是 \kvopt{\meta{key}}{\meta{value}} 形式。部分选项的 % \meta{value} 可以省略。对于同一项,后续设置会覆盖以前的设置。 % 在下文的说明中,将用\textbf{粗体}表示默认值。 % % \cs{nwafuset} 采用 \LaTeX3 风格的键值设置,支持不同类型以及多种 % 层次的选项设定。键值列表中,“|=|”左右的空格不影响设置;但需注意, % 参数列表中\textbf{不可以出现空行}。 % % 与模板选项相同,布尔型的参数 \kvopt{\meta{选项}}{true} % 中的“|= true|”可以省略。 % % 另有一些选项包含子选项,如 \opt{style} 、\opt{abstract}和 \opt{info} 等。它们可以 % 按如下两种等价方式来设定: % \begin{latexexample}[morekeywords={\nwafuset},% % emph={[1]style,cjk-font,font-size,info,title,title*,author,author*,department}] % \nwafuset{ % style = {cjk-font = adobe, font-size = -4}, % info = { % title = {说C解C}, % title* = {C Story}, % author = {耿楠}, % author* = {Nan Geng}, % department = {信息工程学院} % } % } % \end{latexexample} % 或者 % \begin{latexexample}[morekeywords={\nwafuset},% % emph={[1]style,cjk-font,font-size,info,title,title*,author,author*,department}] % \nwafuset{ % style/cjk-font = adobe, % style/font-size = -4, % info/title = {说C解C}, % info/title* = {C Story}, % info/author = {耿楠}, % info/author* = {Nan Geng}, % info/department = {信息工程学院} % } % \end{latexexample} % % 注意 “|/|” 的前后均不可以出现空白字符。 % % \subsubsection{论文格式} \label{subsubsec:论文格式} % % \begin{function}[added=2021-05-12]{style} % \begin{nwafusyntax}[emph={[1]style}] % style = (*\marg{键值列表}*) % style/(*\meta{key}*) = (*\meta{value}*) % \end{nwafusyntax} % 该选项包含多个子项目,用于设置字体、字号等论文格式。 % \end{function} % % \begin{function}[added=2021-05-12]{style/font} % \begin{nwafusyntax}[emph={[1]font}] % font = (**) % \end{nwafusyntax} % 设置西文字体(包括数学字体)。具体配置见表~\ref{tab:font}。 % 该选项若未指定,则由根据操作系统进行选择,Windows取times*,MacOS取times*,Linux取times。 % \end{function} % % \begin{table}[ht] % \begin{threeparttable} % \caption{西文字体配置} % \label{tab:font} % \centering % \begin{tabular}{ccccc} % \toprule % & \strong{正文字体} & \strong{无衬线字体} & \strong{等宽字体} & \strong{数学字体} \\ % \midrule % |garamond| & EB Garamond & Libertinus Sans & LM Mono\tnote{a} & Garamond Math \\ % |libertinus| & Libertinus Serif & Libertinus Sans & LM Mono & Libertinus Math \\ % |lm| & LM Roman & LM Sans & LM Mono & LM Math \\ % |palatino| & TG Pagella\tnote{b} & Libertinus Sans & LM Mono & TG Pagella Math \\ % |times| & XITS & TG Heros & TG Cursor & XITS Math \\ % |times*|\tnote{c} & Times New Roman & Arial & Courier New & XITS Math \\ % \bottomrule % \end{tabular} % \begin{tablenotes} % \item[a] “LM”是 Latin Modern 的缩写。 % \item[b] “TG”是 TeX Gyre 的缩写。 % \item[c] 本行中,Times New Roman、Arial 和 Courier New 是商业字体, % 在 Windows 和 macOS 系统上均默认安装。 % \end{tablenotes} % \end{threeparttable} % \end{table} % % \begin{function}[added=2021-05-12]{style/cjk-font} % \begin{nwafusyntax}[emph={[1]cjk-font}] % cjk-font = (**) % \end{nwafusyntax} % 设置中文字体。具体配置见表~\ref{tab:cjk-font}。 % 该选项若未指定,则由根据操作系统进行选择,Windows取windows,MacOS取mac,Linux取fandol。 % \end{function} % % \begin{table}[ht] % \caption{中文字体配置} % \label{tab:cjk-font} % \centering % \begin{tabular}{cccc} % \toprule % & \strong{正文字体(宋体)} & \strong{无衬线字体(黑体)} & \strong{等宽字体(仿宋)} \\ % \midrule % \multirow{2}*{|adobe|} & Adobe 宋体 & Adobe 黑体 & Adobe 仿宋 \\ % & Adobe Song Std & Adobe Heiti Std & Adobe Fangsong Std \\ % \multirow{2}*{|fandol|} & Fandol 宋体 & Fandol 黑体 & Fandol 仿宋 \\ % & FandolSong & FandolHei & FandolFang \\ % \multirow{2}*{|founder|} & 方正书宋 & 方正黑体 & 方正仿宋 \\ % & FZShuSong-Z01 & FZHei-B01 & FZFangSong-Z02 \\ % \multirow{2}*{|mac|} & (华文)宋体-简 & (华文)黑体-简 & 华文仿宋 \\ % & Songti SC & Heiti SC & STFangsong \\ % \multirow{2}*{|sinotype|} & 华文宋体 & 华文黑体 & 华文仿宋 \\ % & STSong & STHeiti & STFangsong \\ % \multirow{2}*{|sourcehan|} & 思源宋体 & 思源黑体 & --- \\ % & Source Han Serif SC & Source Han Sans SC & --- \\ % \multirow{2}*{|windows|} & (中易)宋体 & (中易)黑体 & (中易)仿宋 \\ % & SimSun & SimHei & FangSong \\ % \bottomrule % \end{tabular} % \end{table} % % 启用 \kvopt{font}{none} 或 \kvopt{cjk-font}{none} 之后,模板将关闭 % 默认西文 / 中文字体设置。此时,需要自行使用 \cs{setmainfont}、 % \cs{setCJKmainfont}、\cs{setmathfont} 等命令来配置字体。 % % \emph{关于字体配置,本模板完全采用\cls{fduthesis}模板代码}。 % % \begin{function}[added=2021-05-12]{style/font-size} % \begin{nwafusyntax}[emph={[1]font-size}] % font-size = (*<(-4)|5>*) % \end{nwafusyntax} % 设置论文的基础字号。 % \end{function} % % \begin{function}[added=2021-05-12]{style/fullwidth-stop} % \begin{nwafusyntax}[emph={[1]fullwidth-stop}] % fullwidth-stop = (**) % \end{nwafusyntax} % 选择是否把全角实心句点\FSFW 作为默认的句号形状。 % 这种句号一般用于科技类文章,以避免与下标“$_o$”或“$_0$”混淆。 % \end{function} % % 选择 \kvopt{fullwidth-stop}{catcode} 或 \opt{mapping} 后,都会实现 % 上述效果。有所不同的是,在选择 \opt{catcode} 后,只有 % \emph{显式的}\FSID 会被替换为\FSFW;但在选择 \opt{mapping} 后, % \emph{所有的}\FSID 都会被替换。例如,如果用宏保存了一些含有 % \FSID 的文字,那么在选择 \opt{catcode} 时,其中的\FSID 不会被 % 替换为\FSFW。 % % 选项 \kvopt{fullwidth-stop}{mapping} 只在 \XeTeX{} 下有效。使用 % \LuaTeX{} 编译时,该选项相当于 \kvopt{fullwidth-stop}{catcode}。 % % 如果在选择 \kvopt{fullwidth-stop}{mapping} 后仍需要临时显示 % \FSID,可以按如下方法操作: % \begin{latexexample}[moretexcs={\CJKfontspec},emph={[1]Mapping}] % % 请使用 XeTeX 编译 % % 外侧的花括号表示分组 % 这是一个句号{\CJKfontspec{(*\meta{字体名}*)}[Mapping=full-stop]。} % \end{latexexample} % % \emph{关于标点符号压缩,本模板完全采用\cls{fduthesis}模板代码}。 % % \begin{function}[added=2021-05-12]{style/footnote-style} %^^A 这里奇怪的东西是用来控制对齐的。nwafusyntax 会吃掉开头的几个 %^^A 空格,因此这里用 X 来占位。 % \begin{nwafusyntax}[emph={[1]footnote-style}] % footnote-style = (**) % \end{nwafusyntax} % 设置脚注编号样式。西文字体设置会影响其默认取值(见 % 表~\ref{tab:footnote-font})。因此,要使得该选项生效,需将其 % 放置在 \opt{font} 选项之后。带有 |sans| 的为相应的无衬线字体 % 版本;带有 |*| 的为阴文样式(即黑底白字)。 % \end{function} % % \begin{table}[ht] % \caption{西文字体与脚注编号样式默认值的对应关系} % \label{tab:footnote-font} % \centering % \begin{tabular}{ccccc} % \toprule % \textbf{西文字体设置} & % |libertinus| & |lm| & |palatino| & |times| \\ % \midrule % \textbf{脚注编号样式默认值} & % |libertinus| & |pifont| & |pifont| & |xits| \\ % \bottomrule % \end{tabular} % \end{table} % % \emph{关于脚注字体配置,本模板完全采用\cls{fduthesis}模板代码}。 % % \begin{function}[added=2021-05-12]{style/hyperlink} % \begin{nwafusyntax}[emph={[1]hyperlink}] % hyperlink = (**) % \end{nwafusyntax} % 设置超链接样式。\opt{border} 表示在超链接四周绘制方框; % \opt{color} 表示用彩色显示超链接,可输出用于批阅的电子稿; % \opt{none} 表示没有特殊装饰,可用于生成最终的打印版文稿。 % \end{function} % % \begin{function}[added=2021-05-12,updated=2021-05-12]{style/hyperlink-color} % \begin{nwafusyntax}[emph={[1]hyperlink-color}] % hyperlink-color = (*<(default)|classic|elegant|fantasy|material|\\ % XXXXXX\mbox{}~~~~~~~~~~~~~~~~~~business|science|summer|autumn|graylevel|prl>*) % \end{nwafusyntax} % 设置超链接颜色。该选项在 \kvopt{hyperlink}{none} 时无效。 % 各选项所代表的颜色见表~\ref{tab:hyperlink-color}。 % \end{function} % % \begin{table}[ht] % \centering % \newcommand\linkcolorexam[3]{^^A % {\small 图~\textcolor[HTML]{#1}{1-2}, % (\textcolor[HTML]{#1}{3.4})~式} & % {\small \textcolor[HTML]{#2}{\texttt{http://g.cn}}} & % {\small 文献~[\textcolor[HTML]{#3}{1}], % (\textcolor[HTML]{#3}{Knuth~1986})}} % \begin{threeparttable} % \caption{预定义的超链接颜色方案} % \label{tab:hyperlink-color} % \begin{tabular}{c*{3}{>{\hspace{0.2cm}}c<{\hspace{0.2cm}}}} % \toprule % \textsf{选项} & \textsf{链接} & \textsf{URL} & \textsf{引用} \\ % \midrule % \opt{default} & \linkcolorexam{990000}{0000B2}{007F00} \\ % \opt{classic} & \linkcolorexam{FF0000}{0000FF}{00FF00} \\ % \opt{elegant}\tnote{a} & \linkcolorexam{961212}{C31818}{9B764F} \\ % \opt{fantasy}\tnote{b} & \linkcolorexam{FF4A19}{FF3F94}{934BA1} \\ % \opt{material}\tnote{c} & \linkcolorexam{E91E63}{009688}{4CAF50} \\ % \opt{business}\tnote{d} & \linkcolorexam{D14542}{295497}{1F6E43} \\ % \opt{science}\tnote{e} & \linkcolorexam{CA0619}{389F9D}{FF8920} \\ % \opt{summer}\tnote{f} & \linkcolorexam{00AFAF}{5F5FAF}{5F8700} \\ % \opt{autumn}\tnote{f} & \linkcolorexam{D70000}{D75F00}{AF8700} \\ % \opt{graylevel}\tnote{c} & \linkcolorexam{616161}{616161}{616161} \\ % \opt{prl}\tnote{g} & \linkcolorexam{2D3092}{2D3092}{2D3092} \\ % \bottomrule % \end{tabular} % \begin{tablenotes} % \item[a] 来自 \href{https://tex.stackexchange.com/}^^A % {\TeX{} - \LaTeX{} Stack Exchange 网站}。 % \item[b] Adobe CC 产品配色。 % \item[c] 取自 Material 色彩方案 % (见 \url{https://material.io/guidelines/style/color.html})。 % \item[d] Microsoft Office 2016 产品配色。 % \item[e] 来自 \href{https://www.wolfram.com/}{Wolfram Research 网站}。 % \item[f] 均取自 Solarized 色彩方案 % (见 \url{http://ethanschoonover.com/solarized})。 % \item[g] \textit{Physical Review Letter} 杂志配色。 % \end{tablenotes} % \end{threeparttable} % \end{table} % % \emph{关于超链接配置,本模板完全采用\cls{fduthesis}模板的配置代码}。 % % \begin{function}[added=2021-05-12]{style/bib-resource} % \begin{nwafusyntax}[emph={[1]bib-resource}] % bib-resource = (*\marg{文件}*) % \end{nwafusyntax} % 参考文献数据源。可以是单个文件,也可以是用英文逗号隔开的一组文件。 % 其中,各文献数据源文件必须明确给出 \file{.bib} % 后缀名。 % \end{function} % % \begin{function}[added=2021-05-12]{style/logo} % \begin{nwafusyntax}[emph={[1]logo}] % logo = (*\marg{文件}*) % \end{nwafusyntax} % 封面中校名图片的文件名。默认值为 \file{logo/nwafu-bar.pdf}。 % \end{function} % % \begin{function}[added=2021-05-12]{style/logo-size} % \begin{nwafusyntax}[emph={[1]logo-size}] % logo-size = (*\marg{宽度}*) % logo-size = {(*\meta{宽度}*), (*\meta{高度}*)} % \end{nwafusyntax} % 校名图片的大小。默认仅指定了宽度,为 |0.65\textwidth|\/。 % 如果仅需指定高度,可在 \meta{宽度} 处填入一个空的分组 |{}|。 % \end{function} % % \begin{function}[added=2021-05-12,updated=2021-5-22]{style/auto-make-cover} % \begin{nwafusyntax}[emph={[1]auto-make-cover}] % auto-make-cover = (*<\TTF>*) % \end{nwafusyntax} % 是否自动生成研究生论文的封面(封一)、英文封面(封二)、 % 题名页(封三)、项目资助页(封四)、声明页(封五)和 % 使用授权页(封六)。本科论文(设计)的封面(封一)和 % 声明及使用授权页(封二)。 % 封面中的各项信息,可通过 \cs{nwafuset} 录入, % 具体请参阅 \ref{subsubsec:信息录入}~节。 % \end{function} % % \begin{function}[added=2021-05-18]{style/withchapter} % \begin{nwafusyntax}[emph={[1]withchapter}] % withchapter = (*<\TTF>*) % \end{nwafusyntax} % 选择论文章标题格式为章格式(如:第1章 绪论)还是报告格式(如:1 绪论),默认为章格式。 % \end{function} % % \begin{function}[added=2022-05-29]{style/withsig} % \begin{nwafusyntax}[emph={[1]withsig}] % withsig = (*<\TFF>*) % \end{nwafusyntax} % 题名页是否需要签名,默认为不需要签名。 % \end{function} % % \changes{v1.25}{2023/04/19}{添加盲审样式参数说明。} % % \begin{function}[added=2023-04-19]{style/anonymous} % \begin{nwafusyntax}[emph={[1]anonymous}] % anonymous = (*<\TFF>*) % \end{nwafusyntax} % 选择是否输出盲审格式论文,默认为不输出盲审格式论文。 % \end{function} % % \begin{function}[added=2022-05-24]{style/chapnum} % \begin{nwafusyntax}[emph={[1]chapnum}] % chapnum = (**) % \end{nwafusyntax} % 选择章编号格式,zh表示中文数字,en表示阿拉伯数字,默认为阿拉伯数字。 % \end{function} % % \subsubsection{信息录入} \label{subsubsec:信息录入} % % \begin{function}[added=2021-05-12]{info} % \begin{nwafusyntax}[emph={[1]info}] % info = (*\marg{键值列表}*) % info/(*\meta{key}*) = (*\meta{value}*) % \end{nwafusyntax} % 该选项包含许多子项目,用于录入论文信息。具体内容见下。以下带“|*|” % 的项目表示对应的英文字段。 % \end{function} % % \begin{function}[added=2021-05-12]{info/degree} % \begin{nwafusyntax}[emph={[1]degree}] % degree = (*<(academic)|professional>*) % \end{nwafusyntax} % 学位类型,仅适用于硕士学位论文。\opt{academic} 和 \opt{professional} % 分别表示学术学位和专业学位。 % \end{function} % % \begin{function}[added=2021-05-18]{info/btype} % \begin{nwafusyntax}[emph={[1]btype}] % btype = (*<(paper)|design>*) % \end{nwafusyntax} % 本科生毕业类型,仅适用于本科。\opt{paper} 和 \opt{design} % 分别表示论文和设计。 % \end{function} % % \begin{function}[added=2021-05-12]{info/title,info/title*} % \begin{nwafusyntax}[emph={[1]title,title*}] % title = (*\marg{中文标题}*) % title* = (*\marg{英文标题}*) % \end{nwafusyntax} % 论文标题。默认会在约 20 个汉字字宽处强制断行,但为了语义的 % 连贯以及排版的美观,如果的标题长于一行,建议使用“|\\|” % 进行手动断行。 % \end{function} % % \begin{function}[added=2021-05-12]{info/author,info/author*} % \begin{nwafusyntax}[emph={[1]author,author*}] % author = (*\marg{姓名}*) % author* = (*\marg{英文姓名或拼音}*) % \end{nwafusyntax} % 作者姓名。 % \end{function} % % \begin{function}[added=2021-05-18]{info/supervisor, info/supervisor*} % \begin{nwafusyntax}[emph={[1]supervisor, supervisor*}] % supervisor = (*\marg{姓名}*) % supervisor* = (*\marg{英文姓名或拼音}*) % \end{nwafusyntax} % 导师姓名。 % \end{function} % % \begin{function}[added=2021-05-18]{info/cosupervisor, info/cosupervisor*} % \begin{nwafusyntax}[emph={[1]cosupervisor, cosupervisor*}] % cosupervisor = (*\marg{姓名}*) % cosupervisor* = (*\marg{英文姓名或拼音}*) % \end{nwafusyntax} % 联合(协助)指导教师姓名。 % \end{function} % % \begin{function}[added=2021-05-18]{info/department, info/department*} % \begin{nwafusyntax}[emph={[1]department, department*}] % department = (*\marg{名称}*) % department* = (*\marg{英文名称}*) % \end{nwafusyntax} % 学院名称。 % \end{function} % % \begin{function}[added=2021-05-18]{info/major,info/major*} % \begin{nwafusyntax}[emph={[1]major, major*}] % major = (*\marg{名称}*) % major* = (*\marg{英文名称}*) % \end{nwafusyntax} % 专业名称。 % \end{function} % % \begin{function}[added=2021-05-18]{info/researchfield, info/researchfield*} % \begin{nwafusyntax}[emph={[1]researchfield, researchfield*}] % researchfield = (*\marg{名称}*) % researchfield* = (*\marg{英文名称}*) % \end{nwafusyntax} % 研究方向名称(仅学硕需要)。 % \end{function} % % \begin{function}[added=2021-05-18]{info/professionaltype, info/professionaltype*} % \begin{nwafusyntax}[emph={[1]professionaltype, professionaltype*}] % professionaltype = (*\marg{名称}*) % professionaltype* = (*\marg{英文名称}*) % \end{nwafusyntax} % 专业学位类型名称(仅专硕需要)。 % \end{function} % % \begin{function}[added=2021-05-18]{info/professionalfield, info/professionalfield*} % \begin{nwafusyntax}[emph={[1]professionalfield, professionalfield*}] % professionalfield = (*\marg{名称}*) % professionalfield* = (*\marg{英文名称}*) % \end{nwafusyntax} % 专业学位领域名称(仅专硕需要)。 % \end{function} % % \begin{function}[added=2021-05-23]{info/mastertype} % \begin{nwafusyntax}[emph={[1]mastertype}] % mastertype = (*\marg{研究生学位英文名称}*) % \end{nwafusyntax} % 研究生学位英文名称(用于硕士研究生英文封面)。 % % 对于学术硕士可以取:Philosophy(哲学);Economics(经济学); % Science(理学);Engineering(工学);Agriculture(农学); % Management(管理学)等(注意首字母需要大写)。 % % 对于专业硕士可以取:Engineering(工程硕士); % Agricultural(农业硕士) 等(注意首字母需要大写)。 % \end{function} % % \begin{function}[added=2021-05-12]{info/student-id} % \begin{nwafusyntax}[emph={[1]student-id}] % student-id = (*\marg{数字}*) % \end{nwafusyntax} % 作者学号。 % \end{function} % % 西北农林科技大学学号采用10位4段制编码:X1--X4/X5/X6/X7--X10。 % 其中: % % X1--X4代表入学年份。 % % X5=0表示学生,此时,X6=1-2表示本科生, % X6=3表示成人教育学生,X6=4表示预科生,X6=5-6表示研究生, % X6=7表示国际学院学生,X6=8表示水土保持研究所学生。 % X7-X10为流水号。 % % \begin{function}[added=2021-05-18]{info/class-id} % \begin{nwafusyntax}[emph={[1]class-id}] % class-id = (*\marg{数字}*) % \end{nwafusyntax} % 作者班级号,班号数字。 % \end{function} % % \begin{function}[added=2021-05-18]{info/grade} % \begin{nwafusyntax}[emph={[1]grade}] % grade = (*\marg{数字}*) % \end{nwafusyntax} % 毕业年份(届)。 % \end{function} % % \begin{function}[added=2021-05-18]{info/enroll} % \begin{nwafusyntax}[emph={[1]enroll}] % enroll = (*\marg{数字}*) % \end{nwafusyntax} % 入学年份(年级)。 % \end{function} % % \begin{function}[added=2021-05-12,updated=2021-05-23]{info/school-id} % \begin{nwafusyntax}[emph={[1]school-id}] % school-id = (*\marg{数字}*) % \end{nwafusyntax} % 学校代码。默认值为 10712(西北农林科技大学学校代码)。 % \end{function} % % \begin{function}[added=2021-05-12, updated=2021-05-24]{info/date, info/date*} % \begin{nwafusyntax}[emph={[1]date, date*}] % date = (*\marg{日期}*) % date* = (*\marg{英文日期}*) % \end{nwafusyntax} % 论文完成日期。默认值为文档编译年月(\tn{datezh}和\tn{dateen})。 % \end{function} % % \begin{function}[added=2021-05-18]{info/defensedate} % \begin{nwafusyntax}[emph={[1]defensedate}] % defensedate = (*\marg{日期}*) % \end{nwafusyntax} % 论文答辩日期。默认值为文档编译日期(\tn{today})。 % \end{function} % % \begin{function}[added=2021-05-12, updated=2021-05-18]{info/secret-level} % \begin{nwafusyntax}[emph={[1]secret-level}] % secret-level = (*<(none)|i|ii|iii|iv>*) % \end{nwafusyntax} % 密级。\opt{i}、\opt{ii}、\opt{iii}、\opt{iv} 分别表示限制、 % 秘密、机密、绝密; % \opt{none} 表示论文不涉密,密级为公开。 % \end{function} % % \begin{function}[added=2021-05-12]{info/instructors} % \begin{nwafusyntax}[emph={[1]instructors}] % instructors = (*\marg{成员 1, 成员 2, ...}*) % \end{nwafusyntax} % 指导小组成员。各成员之间需使用英文逗号隔开。为防止歧义, % 可以用分组括号“|{...}|”把各成员字段括起来。 % \end{function} % % \begin{function}[added=2021-05-18]{info/defensecommittees} % \begin{nwafusyntax}[emph={[1]defensecommittees}] % defensecommittees = (*\marg{\{单位, 姓名, 职称\}, \{单位, 姓名, 职称\}, ...}*) % \end{nwafusyntax} % 答辩委员会构成(仅研究生需要),每个成员由单位、姓名和职称三部分构成, % 用英文逗号分隔后置于大括号内,不同成员间用英文逗号隔开。为防止歧义, % 可以用分组括号“|{...}|”把每个成员中的各个字段括起来。 % \end{function} % % \begin{function}[added=2021-05-18]{info/foundation} % \begin{nwafusyntax}[emph={[1]foundation}] % foundation = (*\marg{\{来源, 名称, 编号\}, \{来源, 名称, 编号\}, ...}*) % \end{nwafusyntax} % 论文资助项目(仅研究生需要),每个项目由来源、名称和编号三部分构成, % 用英文逗号分隔后置于大括号内,不同项目间用英文逗号隔开。为防止歧义, % 可以用分组括号“|{...}|”把每个项目中的各个字段括起来。 % \end{function} % % \begin{function}[added=2021-05-12]{info/clc} % \begin{nwafusyntax}[emph={[1]clc}] % clc = (*\marg{分类号}*) % \end{nwafusyntax} % 中图分类号(CLC)。 % \end{function} % % \begin{function}[added=2021-05-12]{info/udc} % \begin{nwafusyntax}[emph={[1]udc}] % udc = (*\marg{UDC码}*) % \end{nwafusyntax} % UDC码(UDC)。 % \end{function} % % \subsubsection{摘要数据录入} \label{subsubsec:摘要数据录入} % % \begin{function}[added=2021-05-31]{nwafu / abstract} % \begin{nwafusyntax}[emph={[1]abstract}] % abstract = (*\marg{键值列表}*) % abstract/(*\meta{key}*) = (*\meta{value}*) % \end{nwafusyntax} % 该选项包含多个子项目,用于录入或指定论文摘要数据文件, % 具体内容见下。以下带“|*|” 的项目表示对应的英文字段。 % \end{function} % % \begin{function}[added=2021-05-31]{abstract/abstractfile,abstract/abstractfile*} % \begin{nwafusyntax}[emph={[1]abstractfile,abstractfile*}] % abstractfile = (*\marg{中文摘要文件名}*) % abstractfile* = (*\marg{英文摘要文件名}*) % \end{nwafusyntax} % 摘要内容\file{.tex}源文件的文件名称。在文件名中可以使用路径信息, % 文件名中需包括\file{.tex}扩展名。 % \end{function} % % \begin{function}[added=2021-05-12,updated=2021-05-31]{abstract/keywords,abstract/keywords*} % \begin{nwafusyntax}[emph={[1]keywords,keywords*}] % keywords = (*\marg{中文关键字}*) % keywords* = (*\marg{英文关键字}*) % \end{nwafusyntax} % 关键字列表。各关键字之间需\textbf{使用英文逗号隔开}。为防止歧义, % 可以用分组括号“|{...}|”把各关键字括起来。 % \end{function} % % \begin{function}[added=2021-05-31]{abstract/notationfile} % \begin{nwafusyntax}[emph={[1]notationfile}] % notationfile = (*\marg{主要符号对照表文件名}*) % \end{nwafusyntax} % 主要符号对照表内容\file{.tex}源文件的文件名称。在文件名中可以使用路径信息。 % 文件名中需包括\file{.tex}扩展名。 % \end{function} % % \subsection{正文编写} % % \begin{quotation} % 喬孟符(吉)博學多能,以樂府稱。嘗云:「作樂府亦有法,曰^^A % \CJKunderdot{鳳頭、豬肚、豹尾}六字是也。」大概起要美麗,中要浩蕩, % 結要響亮。尤貴在首尾貫穿,意思清新。苟能若是,斯可以言樂府矣。 % \end{quotation} % \hfill ——陶宗儀《南村輟耕錄·作今樂府法》 % % \subsubsection{凤头} % % \begin{function}[added=2021-05-29]{\frontmatter,\frontmatter*} % \begin{nwafusyntax}[deletetexcs={\frontmatter,\frontmatter*}, % morekeywords={\frontmatter,\frontmatter*}] % \frontmatter(*\oarg{编号格式|(Roman)}*) % \frontmatter*(*\oarg{编号格式|(Roman)}*) % \end{nwafusyntax} % \cs{frontmatter} 为前言区命令,章标题不编号, % 默认页码为从I开始计数的大写罗马数字,也可以指定你页码格式 % 带有星号的命令 \cs{frontmatter*} 不使用清双页命令 \tn{cleardoublepage}。 % % \end{function} % % 对于研究生学位论文,该部分包含封面(研究生包括封面一$\sim$七, % 本科生包括封面一和封面七)、中英文摘要、主要符号对照表和目录。 % 在前置部分中,中英文摘要开始至主要符号对照表,页码采用大写罗马字母,并且与目录分开计数。 % 目录应该放在奇数页起排,页码采用大写罗马字母,并与正文分开计数 % % 对于本科生毕业论文(设计),该部分包含中英文摘要和目录。其中, % 中英文摘要无页码。目录应该放在奇数页起排,部分页码采用大写罗马字母,并与正文分开计数 % % 建议将中英文摘要内容分别写在不同\file{.tex}源文件中,然后用\cs{nwafuset}设置文件名后, % 自动排版。在摘要的最后,会显示关键字列表,可通过 \cs{nwafuset} 录入关键字列表。 % 关于摘要数据录入,具体请参阅 \ref{subsubsec:摘要数据录入}~节。 % % 建议将主要符号对照表写在\file{.tex}源文件中,然后用\cs{nwafuset}设置文件名后, % 自动排版。关于主要符号对照表数据录入,具体请参阅 \ref{subsubsec:摘要数据录入}~节。 % % 为正确按要求实现排版顺序和页码,不建议手动排版封面、中英文摘要、主要符号对照表和目录, % 在提供基本内容后,由模板自动实现前置部分(凤头)排版 % % \subsubsection{猪肚} % % \begin{function}[added=2021-05-29]{\mainmatter,\mainmatter*} % \begin{nwafusyntax}[deletetexcs={\mainmatter,\mainmatter*}, % morekeywords={\mainmatter,\mainmatter*}] % \mainmatter % \mainmatter* % \end{nwafusyntax} % \cs{mainmatter} 为主文区命令,章标题正常编号, % 且页码为从1开始计数的阿拉伯数字, % 带有星号的命令 \cs{mainmatter*} 不使用清双页命令 \tn{cleardoublepage}。 % % 注意,由于要求第一章从奇数页开始排版, % 因此应该使用不带星号的\cs{mainmatter}开始正文主体区的排版。 % \end{function} % % 主体部分是论文的核心,可以分章节撰写。如有需求,也可以采用 % 多文件方式撰写,然后用\cs{include}命令将各个子文件包含入主文件。 % 主体部分的页码采用阿拉伯数字连续编号。 % % \begin{function}[added=2021-05-12]{\footnote} % \begin{nwafusyntax}[deletetexcs={\footnote},% % morekeywords={\footnote}] % \footnote(*\marg{脚注文字}*) % \end{nwafusyntax} % 插入脚注。脚注编号样式可利用 \opt{style/footnote-style} 选项控制, % 具体见 \ref{subsubsec:论文格式}~小节。 % \end{function} % % \begin{function}[added=2021-05-12]{axiom,corollary,definition,example,lemma, % proof,theorem} % \begin{nwafusyntax}[emph={[2]proof}] % \begin{proof}(*\oarg{小标题}*) % (*\meta{证明过程}*) % \end{proof} % \end{nwafusyntax} % 一系列预定义的数学环境。具体含义见表~\ref{tab:theorem}。 % \end{function} % % \begin{table}[ht] % \caption{预定义的数学环境} \label{tab:theorem} % \centering % \begin{tabular}{cccccccc} % \toprule % \textbf{名称} & % \env{axiom} & \env{corollary} & \env{definition} & % \env{example} & \env{lemma} & \env{proof} & % \env{theorem} \\ % \midrule % \textbf{含义} & % 公理 & 推论 & 定义 & 例 & 引理 & 证明 & 定理 \\ % \bottomrule % \end{tabular} % \end{table} % % 证明环境(\env{proof})的最后会添加证毕符号“$\QED$”。要确保 % 该符号在正确的位置显示,需要按照 \ref{subsec:编译方式}~节 % 中的有关说明至少编译\emph{两次},可不执行biber main参考文献编译操作。 % % \begin{function}[added=2021-05-12]{\newtheorem} % \begin{nwafusyntax}[deletetexcs={\newtheorem}, % morekeywords={\newtheorem,\newtheorem*}] % \newtheorem(*\oarg{选项}\marg{环境名}\marg{标题}*) % \newtheorem*(*\oarg{选项}\marg{环境名}\marg{标题}*) % \begin(*\marg{环境名}\oarg{小标题}*) % (*\meta{内容}*) % \end(*\marg{环境名}*) % \end{nwafusyntax} % 声明新的定理类环境(数学环境)。带星号的版本表示不进行编号, % 并且会默认添加证毕符号“$\QED$”。声明后,即可同预定义的数学环境 % 一样使用。 % \end{function} % % 事实上,表~\ref{tab:theorem} 中预定义的环境正是通过以下方式定义的: % \begin{latexexample}[deletetexcs={\newtheorem}, % morekeywords={\newtheorem,\newtheorem*}] % \newtheorem*{proof}{证明} % \newtheorem{axiom}{公理} % \newtheorem{corollary}{定理} % ... % \end{latexexample} % % 与 \cs{nwafuset} 相同,\cs{newtheorem} 的可选参数 \meta{选项} % 也为一组键值列表。可用的选项见下。注意无需输入“|theorem/|”。 % % \begin{function}[added=2021-05-12]{theorem/style} % \begin{nwafusyntax}[emph={[1]style}] % style = (*<(plain)|margin|change|\\ % XXXXXX\mbox{}~~~~~~~~break|marginbreak|changebreak>*) % \end{nwafusyntax} % 定理类环境的总体样式。 % \end{function} % % \begin{function}[added=2021-05-12]{theorem/header-font} % \begin{nwafusyntax}[emph={[1]header-font}] % header-font = (*\marg{字体}*) % \end{nwafusyntax} % 定理头(即标题)的字体。中文模板默认为 \tn{sffamily},即无衬线体 % (黑体);英文模板默认为 |\bfseries\upshape|,即加粗直立体。 % \end{function} % % \begin{function}[added=2021-05-12]{theorem/body-font} % \begin{nwafusyntax}[emph={[1]body-font}] % body-font = (*\marg{字体}*) % \end{nwafusyntax} % 定理内容的字体。中文模板默认为 \tn{nwafu@kai},即楷体;英文模板 % 默认为 \tn{itshape},即斜体。 % \end{function} % % \begin{function}[added=2021-05-12]{theorem/qed} % \begin{nwafusyntax}[emph={[1]qed}] % qed = (*\marg{符号}*) % \end{nwafusyntax} % 定理结束标记(即证毕符号)。如果用 \cs{newtheorem} 声明定理, % 则默认为空;用 \cs{newtheorem*} 声明,则默认为 % |\ensuremath{\QED}|,即“$\QED$”。 % \end{function} % % \begin{function}[added=2021-05-12]{theorem/counter} % \begin{nwafusyntax}[emph={[1]counter}] % counter = (*\marg{计数器}*) % \end{nwafusyntax} % 定理计数器,表示定理编号在 \meta{计数器} 的下一级,并会随 % \meta{计数器} 的变化而清零。\scite{刘海洋2013latex入门} % 默认为 |chapter|,表示按章编号。使用 \cs{newtheorem*} 时, % 该选项无效。 % \end{function} % % \emph{关于定理部分命令定义和设置,完全采用\cls{fduthesis}的代码实现}。 % % \begin{function}[added=2021-05-12]{\caption} % \begin{nwafusyntax}[deletetexcs={\caption},morekeywords={\caption}] % \caption(*\marg{图表标题}*) % \caption(*\oarg{短标题}\marg{长标题}*) % \end{nwafusyntax} % 插入图表标题。可选参数 \meta{短标题} 用于图表目录。在 % \meta{长标题} 中,可以进行长达多段的叙述;但 \meta{短标题} % 和单独的 \meta{图表标题} 中则不允许分段。 % \scite{刘海洋2013latex入门} % \end{function} % % \begin{function}[added=2021-05-22]{\bicaption} % \begin{nwafusyntax}[deletetexcs={\bicaption},morekeywords={\bicaption}] % \bicaption(*\marg{中文标题}\marg{英文标题}*) % \end{nwafusyntax} % 插入图表双语标题。双语标题基于\cls{bicaption}宏包实现。 % \end{function} % % 按照排版惯例,建议将表格的标题放置在绘制表格的命令之前, % 而将图片的标题放置在绘图或插图的命令之后。另需注意, % \tn{caption} 命令必须放置在浮动体环境(如 \env{table} 或 % \env{figure})中。 % % \subsubsection{豹尾} % % \begin{function}[added=2021-05-26]{\bibmatter} % 参考文献开始开始。 % \end{function} % % 用于为参考文献部分设置正确的页眉,后续页码接正文区连续编码。 % % \begin{function}[added=2021-05-12]{\printbibliography} % \begin{nwafusyntax}[morekeywords={\printbibliography}] % \printbibliography(*\oarg{选项}*) % \end{nwafusyntax} % 打印参考文献列表。 % \meta{文献数据库} 可利用 \opt{style/bib-resource} 选项指定,具体见 % \ref{subsubsec:论文格式}~小节。 % \end{function} % % 注:本模板参考文献是胡振震根据西北农林科技大学的基本要求,通过 % 添加部分样式控制代码实现的\scite{biblatex,biblatex-gb7714-2015}, % 因此,\textbf{无法进行个性化定制}。 % % \begin{function}[added=2021-05-24]{\appdendix} % 声明附录开始。 % \end{function} % % 用于为附录部分设置正确的页眉及按要求实现附录中的图、表和公式编号。 % 后续页码接参考文献区连续编码。 % % \begin{function}[added=2021-05-29]{\backmatter} % \cs{backmatter} 为后置区命令,页码格式与编号保持不变, % 章标题不编号。 % \end{function} % % 用于为后置部分设置正确页眉,后置部分主要包括致谢和个人简历。 % 后续页码接附录区连续编码。 % % \begin{function}[added=2021-06-01]{acknowledgement} % \begin{nwafusyntax}[emph={[2]acknowledgement}] % \begin{acknowledgement} % (*\meta{致谢内容}*) % \end{acknowledgement} % \end{nwafusyntax} % 致谢排版环境。使用该环境的主要作用是设置页眉及产生不编号章标题。 % \end{function} % % \begin{function}[added=2021-06-01]{resume} % \begin{nwafusyntax}[emph={[2]resume}] % \begin{resume} % (*\meta{简历内容}*) % \end{resume} % \end{nwafusyntax} % 简历排版环境。使用该环境的主要作用是设置页眉及产生不编号章标题。 % \end{function} % % \begin{function}[added=2021-06-01]{\researchitem} % \begin{nwafusyntax}[deletetexcs={\researchitem},morekeywords={\researchitem}] % \researchitem(*\oarg{个人简历分类名称}*) % \end{nwafusyntax} % 在简历排版中,指定成果类型,按标题的格式(非标题)居中排版。 % \end{function} % % \begin{function}[added=2021-06-01]{publications} % \begin{nwafusyntax}[emph={[2]publications}] % \begin{publications} % (*\meta{简历中发表的学术论文列表}*) % \end{publications} % \end{nwafusyntax} % 简历中发表的学术论文排版列表环境。 % \end{function} % % \begin{function}[added=2021-06-01]{achievements} % \begin{nwafusyntax}[emph={[2]achievements}] % \begin{achievements} % (*\meta{简历中发表的学术论文列表}*) % \end{achievements} % \end{nwafusyntax} % 简历中专利等研究成果排版列表环境。 % \end{function} % % \section{其他命令接口} % % \begin{function}[added=2021-05-20]{\nwafuthesis} % \cs{nwafuthesis} 命令用于输出\cls{nwafuthesis}模板 % 的LOGO:~\nwafuthesis{}。 % \end{function} % % \begin{function}[added=2021-05-20]{\datezh} % \cs{datezh} 命令用于输出中文格式的当前年、月。 % \end{function} % % \begin{function}[added=2021-05-20]{\dateen} % \cs{dateen} 命令用于输出英文格式的当前月,年。 % \end{function} % % \begin{function}[added=2022-04-04]{\fakebold} % \begin{nwafusyntax}[deletetexcs={\fakebold},morekeywords={\fakebold}] % \fakebold(*\oarg{加粗系数}\marg{文字内容}*) % \end{nwafusyntax} % 使用PDF literal通过缩放笔画实现的伪粗命令。 % \end{function} % % \begin{function}[added=2021-05-12,updated=2021-5-28]{\makecoveri, % \makecoverii,\makecoveriii, \makecoveriv, % \makecoverv,\makecovervi,\makecovervii} % 分别用于生成封面(一)$\sim$(七)。单独使用这几个命令可能 % 会造成页面顺序错误,因此若非必要,应避免直接使用这些命令排版。 % \end{function} % % \begin{function}[added=2021-06-04]{\makecovers} % 生成所有封面。 % \end{function} % % \begin{function}[added=2021-05-12]{\tableofcontents,\listoffigures,\listoftables} % 修改 \cs{tableofcontents}、\cs{listoffigures} 和 \cs{listoftables} 的定义, % 使得页眉正确显示,并出现在目录及 PDF 书签中。来自于 \LaTeXe{} 标准文档类 % \file{book.cls} % \footnote{原代码中只有 \cs{tableofcontents} 的 \cs{@mkboth} 出现在 % \cs{chapter*} 内部,这是出于兼容性的考虑而非 typo。}。 % \end{function} % % \begin{function}[added=2021-05-28]{\makefront} % 用于生成中英文摘要、目录和主要符号对照表。 % % 注意:不建议直接使用该命令排版, % 应该由模板自动调用进行排版。 % \end{function} % % \begin{function}[added=2021-05-12]{abstract} % \begin{nwafusyntax}[emph={[2]abstract}] % \begin{abstract} % (*\meta{中文摘要}*) % \end{abstract} % \end{nwafusyntax} % \end{function} % \begin{function}[added=2021-05-12]{abstract*} % \begin{nwafusyntax}[emph={[2]abstract*}] % \begin{abstract*} % (*\meta{英文摘要}*) % \end{abstract*} % \end{nwafusyntax} % 摘要排版环境。不带星号和带星号的版本分别用来排版中文摘要 % 和英文摘要。 % % 注意:不建议直接排版摘要,应该提供摘要内容\file{.tex}源文件名后,由 % \cs{makefront}命令自动排版。 % \end{function} % % \begin{function}[added=2021-05-12]{notation} % \begin{nwafusyntax}[emph={[2]notation}] % \begin{notation}(*\oarg{列格式说明}*) % (*\meta{符号 1}*) & (*\meta{说明}*) \\ % (*\meta{符号 2}*) & (*\meta{说明}*) \\ % (*\phantom{\meta{符号 $n$}}*) (*$\vdots$*) % (*\meta{符号\ \kern-0.1em$n$}*) & (*\meta{说明}*) % \end{notation} % \end{nwafusyntax} % 主要符号对照表环境。可选参数 \meta{列格式说明}与 \LaTeX{} 中标准表格的列格 % 式说明语法一致,默认值为“|lp{7.5cm}|”,即第一列宽度自动调整, % 第二列限宽 \SI{7.5}{cm},两列均为左对齐。 % % 注意:不建议直接排版主要符号对照表, % 应该提供主要符号对照表内容\file{.tex}源文件名后,由 % \cs{makefront}命令自动排版。 % \end{function} % % \begin{function}[added=2021-05-12]{\cleardoublepage} % \begin{nwafusyntax}[deletetexcs={\cleardoublepage},morekeywords={\cleardoublepage}] % \cleardoublepage(*\oarg{页面风格|(empty)}*) % \end{nwafusyntax} % 在奇数页使用命令 \tn{cleardoublepage} 时可选参数为 % 下一页多出的空白偶数页的页面风格,默认为 \opt{empty} 即空的页眉页脚。 % \end{function} % % \section{宏包依赖情况} % % 使用不同编译方式、指定不同选项,会导致宏包依赖情况有所不同。 % 具体如下: % \begin{itemize} % \item 在任何情况下,本模板都会\emph{显式}调用以下宏包 % (或文档类): % \begin{itemize} % \item \pkg{expl3}、\pkg{xparse}、\pkg{xtemplate} 和 % \pkg{l3keys2e},用于构建 \LaTeX3 编程环境 % \scite{source3}。它们分属 \pkg{l3kernel} 和 % \pkg{l3packages} 宏集。 % \item \cls{ctexbook},提供中文排版的通用框架。属于 \CTeX{} % 宏集 \scite{CTeX}。 % \item \pkg{amsmath},对 \LaTeX{} 的数学排版功能进行了 % 全面扩展。属于 \AmSLaTeX{} 套件。 % \item \pkg{unicode-math},负责处理 Unicode 编码的 % OpenType 数学字体。 % \item \pkg{geometry},用于调整页面尺寸。 % \item \pkg{fancyhdr},处理页眉页脚。 % \item \pkg{footmisc},处理脚注。 % \item \pkg{ntheorem},提供增强版的定理类环境。 % \item \pkg{graphicx},提供图形插入的接口。 % \item \pkg{caption},用于设置标题。 % \item \pkg{bicaption},用于设置标题。 % \item \pkg{xcolor},提供彩色支持。 % \item \pkg{enumitem},提供列表环境的个性化设置。 % \item \pkg{biblatex},提供参考文献排版。 % \item \pkg{hyperref},提供交叉引用、超链接、电子书签等功能。 % \end{itemize} % \item 开启 \kvopt{style/footnote-style}{pifont} 后,会调用 % \pkg{pifont} 宏包。它属于 \pkg{psnfss} 套件。 % \item \pkg{biblatex} 宏包需要依赖 \biber{} 程序。参考文献样式由 % \pkg{biblatex-gb7714-2015} 宏包提供的\texttt{gb7714-NWAFU}样式 % 文件控制,请注意将其升级到最新版\scite{biblatex,biblatex-gb7714-2015}。 % \end{itemize} % % 这里只列出了本模板直接调用的宏包。这些宏包自身的调用情况, % 此处不再具体展开。如有需要,请参阅相关文档。 % % \begin{thebibliography}{99} % % \newcommand\urlprefix{\newline\hspace*{\fill}} % \let\OldUrl=\url % \renewcommand\url[2][]{{\small\textit{#1}~\OldUrl{#2}}} % \newcommand\CTANurl[2][]{{\small\textit{#1}~\href{http://mirror.ctan.org/#2}^^A % {\ttfamily CTAN://#2}}} % % \subsection{图书} % % \bibitem{knuth1986texbook} % \textsc{Knuth D E}. % \newblock \textit{The \TeX book: Computers \& Typesetting, volume A} [M]. % \newblock Boston: Addison--Wesley Publishing Company, 1986 % \urlprefix \CTANurl[源代码^^A % \footnote{此代码只可作为学习之用。未经 Knuth 本人同意,不应当编译此文档。}:]^^A % {systems/knuth/dist/tex/texbook.tex} % % \bibitem{mittelbach2004latexcompanion} % \textsc{Mittelbach F} and \textsc{Goossens M}. % \newblock \textit{The \LaTeX{} Companion} [M]. % \newblock 2nd ed. % \newblock Boston: Addison--Wesley Publishing Company, 2004 % % \bibitem{胡伟2017latex2e} % 胡伟. % \newblock \textit{\LaTeXe{} 文类和宏包学习手册} [M]. % \newblock 北京: 清华大学出版社, 2017 % % \bibitem{刘海洋2013latex入门} % 刘海洋. % \newblock \textit{\LaTeX{} 入门} [M]. % \newblock 北京: 电子工业出版社, 2013 % % \subsection{标准、规范} % % \bibitem{gb-t-7713.1-2006} % 国务院学位委员会办公室, 全国信息与文献标准化技术委员会. % \newblock \textit{学位论文编写规则: GB/T 7713.1--2006} [S]. % \newblock 北京: 中国标准出版社, 2007 % % \bibitem{gb-t-7714-2015} % 全国信息与文献标准化技术委员会. % \newblock \textit{信息与文献\quad 参考文献著录规则: GB/T 7714--2015} [S]. % \newblock 北京: 中国标准出版社, 2015 % % \bibitem{gb-t-15834-2011} % 教育部语言文字信息管理司. % \newblock \textit{标点符号用法: GB/T 15834--2011} [S/OL]. % \newblock 北京: 中国标准出版社, 2012 % \urlprefix\url{http://www.moe.gov.cn/ewebeditor/uploadfile/2015/01/13/20150113091548267.pdf} % % \bibitem{clreq} % W3C. % \newblock \textit{中文排版需求(Requirements for Chinese Text Layout)} [EB/OL]. % \newblock (2020-08-17) % \urlprefix\url{https://w3c.github.io/clreq/} % % \bibitem{西北农林科技大学研究生论文写作指南} % 西北农林科技大学研究生院. % \newblock \textit{研究生学位论文写作指南(试用版)} [EB/OL]. % \newblock 2021 年 3 月修订版. % \newblock (2021-03-17) % \urlprefix\url{https://yjshy.nwafu.edu.cn/docs//2021-03/0d686e7d3f204af9880822db5fd7045c.pdf} % % \bibitem{西北农林科技大学本科生论文撰写规范} % 西北农林科技大学教务处. % \newblock \textit{西北农林科技大学本科生毕业论文(设计)写作规范(试用)} [EB/OL]. % \newblock 2021 年 5 月修订版. % \newblock (2021-05-07) % \urlprefix\url{https://jiaowu.nwafu.edu.cn/docs//2021-05/8aa0ef88fcf94e5ebf0bdcc2a6f42785.pdf} % % \subsection{宏包、模版} % % \bibitem{source2e} % \textsc{Braams J}, \textsc{Carlisle D}, \textsc{Jeffrey A}, et al. % \newblock \textit{The \LaTeXe{} Sources} [CP/OL]. % \newblock (2020-02-02) % \urlprefix\url{https://ctan.org/pkg/latex} % \urlprefix\CTANurl[源代码:]{macros/latex/base/source2e.pdf} % % \bibitem{CTeX} % \textsc{CTEX.ORG}. % \newblock \textit{\CTeX{} 宏集手册} [EB/OL]. % \newblock version 2.5.4, % \newblock (2020-08-23) % \urlprefix\url{https://ctan.org/pkg/ctex} % \urlprefix\CTANurl[文档及源代码:]{language/chinese/ctex/ctex.pdf} % % \bibitem{xeCJK} % \textsc{CTEX.ORG}. % \newblock \textit{\pkg{xeCJK} 宏包} [EB/OL]. % \newblock version 3.8.5, % \newblock (2020-08-23) % \urlprefix\url{https://ctan.org/pkg/xecjk} % \urlprefix\CTANurl[文档及源代码:]{macros/xetex/latex/xecjk/xeCJK.pdf} % % \bibitem{source3} % \textsc{The \LaTeX3 Project}. % \newblock \textit{The \LaTeX3 Sources} [CP/OL]. % \newblock (2020-08-07) % \urlprefix\url{https://ctan.org/pkg/l3kernel} % \urlprefix\CTANurl[源代码:]{macros/latex/contrib/l3kernel/source3.pdf} % % \bibitem{biblatex} % \textsc{Lehman P}, \textsc{Kime P}, \textsc{Boruvka A}, et al. % \newblock \textit{The \pkg{biblatex} Package} [EB/OL]. % \newblock version 3.15a, % \newblock (2020-08-23) % \urlprefix\url{https://ctan.org/pkg/biblatex} % \urlprefix\CTANurl[文档:]{macros/latex/contrib/biblatex/doc/biblatex.pdf} % % \bibitem{lshort} % \textsc{Oetiker T}, \textsc{Partl H}, \textsc{Hyna I}, et al. % \newblock \textit{The Not So Short Introduction to \LaTeXe{}: Or \LaTeXe{} in 139 minutes} [EB/OL]. % \newblock version 6.2, % \newblock (2018-02-28) % \urlprefix\url{https://ctan.org/pkg/lshort-english} % \urlprefix\CTANurl[文档:]{info/lshort/english/lshort.pdf} % % \bibitem{lshort-zh-cn} % \textsc{Oetiker T}, \textsc{Partl H}, \textsc{Hyna I}, et al. % \newblock \textit{一份(不太)简短的 \LaTeXe{} 介绍: 或 112 分钟了解 \LaTeXe{}} [EB/OL]. % \newblock \CTeX{} 开发小组, 译. % \newblock 原版版本 version 6.2, 中文版本 version 6.02, % \newblock (2020-08-03) % \urlprefix\url{https://ctan.org/pkg/lshort-zh-cn} % \urlprefix\CTANurl[文档:]{info/lshort/chinese/lshort-zh-cn.pdf} % % \bibitem{biblatex-gb7714-2015} % 胡振震. % \newblock \textit{符合 GB/T 7714-2015 标准的 biblatex 参考文献样式} [EB/OL]. % \newblock version 1.0v, % \newblock (2020-07-21) % \urlprefix\url{https://ctan.org/pkg/biblatex-gb7714-2015} % \urlprefix\CTANurl[文档:]{biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf} % % \bibitem{fduthesis} % 曾祥东(\textsc{Xiangdong Z}). % \newblock \textit{\textsc{fduThesis}:复旦大学毕业论文 \LaTeX{} 模板} [EB/OL]. % \newblock version 0.7e, % \newblock (2020-08-30) % \urlprefix\url{https://ctan.org/pkg/fduthesis} % \urlprefix\CTANurl[文档及源代码:]{macros/latex/contrib/fduthesis/fduthesis.pdf} % % \subsection{其他} % % \bibitem{wright2009dtxfile} % \textsc{Wright J}. % \newblock \textit{A model dtx file} [EB/OL]. % \newblock (2009-10-06) % \urlprefix\url{https://www.texdev.net/2009/10/06/a-model-dtx-file/} % % \bibitem{孔雀计划} % 刘庆(\textsc{Eric Q L}). % \newblock \textit{孔雀计划:中文字体排印的思路} [EB/OL]. % \urlprefix\url{https://thetype.com/kongque/} % % \end{thebibliography} % % \clearpage % % \end{documentation} % % \begin{implementation} % %^^A 代码部分的页边距 % \newgeometry{ % left = 2.25 in, % right = 1.00 in, % top = 1.25 in, % bottom = 1.00 in, % marginpar = 2.25 in % } % % \changes{v1.11}{2022/04/03}{取消本科黑体加粗。} % % \section{实现细节} % % 本模板使用 \LaTeX3 语法编写,依赖 \pkg{expl3} 环境, % 并需调用 \pkg{l3packages} 中的相关宏包。 % % 按照 \LaTeX3 语法,代码中的空格、换行、回车与制表符完全被忽略, % 而下划线“|_|”和冒号“|:|”则可作为一般字母使用。 % 正常的空格可以使用“|~|”代替;至于 |~| 原来所表示的“带子”, % 则要用 \LaTeXe{} 的原始命令 \tn{nobreakspace} 代替。 % % 以下代码中有一些形如 \textcolor[HTML]{2E3191}{\textsf{<*class>}} % 的标记,这是 \pkg{DocStrip} 中的“guard”,用来选择性地提取文件。 % “\textsf{*}”和“\textsf{/}”分别表示该部分的开始和结束。不含 % “\textsf{*}”和“\textsf{/}”的 guard 出现在行号右侧,它们用来确定 % 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。 % % 另有若干形如 \textcolor{MaterialPink}{\textsf{<@@=nwafu>}} 的 guard, % 它们用来标识名字空间(模块)。 % % \subsection{准备} % % \begin{macrocode} %<@@=nwafu> %<*class> % \end{macrocode} % % 检查 \LaTeX3 编程环境。 % \begin{macrocode} \RequirePackage {xtemplate, l3keys2e } \clist_map_inline:nn { xtemplate, l3keys2e } { \@ifpackagelater {#1} { 2020/07/17 } { } { \msg_error:nnn { nwafuthesis } { l3-too-old } {#1} } } \msg_new:nnn { nwafuthesis } { l3-too-old } { Package~ "#1"~ is~ too~ old. \\\\ Please~ update~ an~ up-to-date~ version~ of~ the~ bundles \\ "l3kernel"~ and~ "l3packages"~ using~ your~ TeX~ package \\ manager~ or~ from~ CTAN. } % \end{macrocode} % % 目前 \cls{nwafuthesis} 仅支持 \XeTeX{} 和 \LuaTeX{}。 % \begin{macrocode} \sys_if_engine_xetex:F { \sys_if_engine_luatex:F { \msg_fatal:nnx { nwafuthesis } { unsupported-engine } { \c_sys_engine_str } } } \msg_new:nnn { nwafuthesis } { unsupported-engine } { The~ nwafuthesis~ class~ requires~ either~ XeTeX~ or~ LuaTeX. \\\\ "#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\ your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex". } % \end{macrocode} % % \subsubsection{内部变量声明} % % \begin{variable}{\l_@@_tmpa_box, % \l_@@_tmpa_clist, % \l_@@_tmpb_clist, % \l_@@_tmpc_clist, % \l_@@_tmpt_clist, % \l_@@_tmpa_dim, % \l_@@_tmpb_dim, % \l_@@_tmpc_dim, % \l_@@_tmpd_dim, % \l_@@_tmpt_dim, % \l_@@_tmpa_skip, % \l_@@_tmpa_tl, % \l_@@_tmpb_tl, % \l_@@_tmpt_tl % } % 临时变量。 % \begin{macrocode} \box_new:N \l_@@_tmpa_box \clist_new:N \l_@@_tmpa_clist \clist_new:N \l_@@_tmpb_clist \clist_new:N \l_@@_tmpc_clist \clist_new:N \l_@@_tmpd_clist \clist_new:N \l_@@_tmpt_clist \dim_new:N \l_@@_tmpa_dim \dim_new:N \l_@@_tmpb_dim \dim_new:N \l_@@_tmpc_dim \dim_new:N \l_@@_tmpd_dim \dim_new:N \l_@@_tmpt_dim \skip_new:N \l_@@_tmpa_skip \tl_new:N \l_@@_tmpa_tl \tl_new:N \l_@@_tmpb_tl \tl_new:N \l_@@_tmpc_tl \tl_new:N \l_@@_tmpd_tl \tl_new:N \l_@@_tmpt_tl % \end{macrocode} % \end{variable} % % \begin{variable}{\g_@@_thesis_type_int} % 论文类型。取值 1、2、3 分别对应博士、硕士、本科(学士)。 % \begin{macrocode} \int_new:N \g_@@_thesis_type_int % \end{macrocode} % \end{variable} % % \begin{variable}{\g_@@_to_ctexbook_clist,\g_@@_to_hyperref_clist} % 分别保存由 \cls{nwafuthesis} 传入 \cls{ctexbook} 文档类和 % \pkg{hyperref} 宏包的选项列表。 % \begin{macrocode} \clist_new:N \g_@@_to_ctexbook_clist \clist_new:N \g_@@_to_hyperref_clist % \end{macrocode} % \end{variable} % % \begin{variable}{\g_@@_twoside_bool} % 是否开启双页模式(默认打开)。 % 本模板中,目前使用双页与单页模式的排版结果是一样的, % 保留该设置的目的是为了后续扩展。 % \begin{macrocode} \bool_new:N \g_@@_twoside_bool \bool_set_true:N \g_@@_twoside_bool % \end{macrocode} % \end{variable} % % \begin{variable}{\g_@@_draft_bool} % 是否开启草稿模式。 % \begin{macrocode} \bool_new:N \g_@@_draft_bool % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_withchap_bool} % 是否按章编写论文(默认按章编写)。 % 该选项是针对部分学院需要按报告形式(类似``1\ 绪论'')的形式 % 撰写本科生毕业论文(设计)而设置的。 % \begin{macrocode} \bool_new:N \l_@@_withchap_bool % \end{macrocode} % \end{variable} % % \changes{v1.15}{2022/05/29}{添加研究生题名页签字判断变量。} % % \begin{variable}{\l_@@_withsignature_bool} % 研究生题名页中的作者、指导教师和答辩委员会姓名是否需要签名。 % \begin{macrocode} \bool_new:N \l_@@_withsignature_bool % \end{macrocode} % \end{variable} % % \changes{v1.25}{2023/04/18}{添加盲审判断变量。} % % \begin{variable}{\l_@@_anonymous_bool} % 是否输出盲审版论文(隐藏作者、导师、页眉等个人及学校信息)。 % \begin{macrocode} \bool_new:N \l_@@_anonymous_bool % \end{macrocode} % \end{variable} % % % \changes{v1.12}{2022/05/24}{添加本科生中文章编号处理。} % % \begin{variable}{\g_@@_chapnum_int} % 章编号编号类型(默认为阿拉伯数字)。 % 该选项是针对部分学院需要中文数字进行章编号(类似``第一章 绪论'')的需求 % 仅为撰写本科生毕业论文(设计)而设置的。 % \begin{macrocode} \int_new:N \g_@@_chapnum_int % \end{macrocode} % \end{variable} % % \subsubsection{内部函数} % % \begin{macro}{\file_input:V, % \int_to_arabic:v, % \keys_define:nx, % \tl_map_inline:xn} % \begin{macro}[TF]{\tl_if_eq:Vn} % \LaTeX3{} 函数的函数变体。 % \begin{macrocode} \cs_generate_variant:Nn \file_input:n { V } \cs_generate_variant:Nn \int_to_arabic:n { v } \cs_generate_variant:Nn \keys_define:nn { nx } \cs_generate_variant:Nn \tl_map_inline:nn { xn } \prg_generate_conditional_variant:Nnn \tl_if_eq:nn { Vn } { T, TF } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@@_quad:,\@@_qquad:} % 等价于 \LaTeXe{} 中的 \tn{quad} 和 \tn{qquad}。 % \begin{macrocode} \cs_new:Npn \@@_quad: { \skip_horizontal:n { 1 em } } \cs_new:Npn \@@_qquad: { \skip_horizontal:n { 2 em } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_vspace:N,\@@_vspace:n,\@@_vspace:c} % 类似 \LaTeXe{} 中的 \tn{vspace*}。 % \begin{macrocode} \cs_new_protected:Npn \@@_vspace:N #1 { \dim_set_eq:NN \l_@@_tmpa_dim \prevdepth \hrule height \c_zero_dim \nobreak \skip_vertical:N #1 \skip_vertical:N \c_zero_skip \dim_set_eq:NN \prevdepth \l_@@_tmpa_dim } \cs_new_protected:Npn \@@_vspace:n #1 { \skip_set:Nn \l_@@_tmpa_skip {#1} \@@_vspace:N \l_@@_tmpa_skip } \cs_generate_variant:Nn \@@_vspace:N { c } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_symbol:n} % 等价于 \LaTeXe{} 中的 \tn{symbol}。 % \begin{macrocode} \cs_new:Npn \@@_symbol:n #1 { \tex_char:D #1 \scan_stop: } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_arabic:n} % 等价于 \LaTeXe{} 中的 \tn{arabic}。 % \begin{macrocode} \cs_new:Npn \@@_arabic:n #1 { \int_to_arabic:v { c@ #1 } } % \end{macrocode} % \end{macro} % % \changes{v1.11}{2022/04/03}{添加PDF literal实现的伪粗命令。} % % \begin{macro}{\@@_fake_bold:nn,\fakebold} % 利用PDF literal实现的伪粗命令。 % 参考\url{https://zhuanlan.zhihu.com/p/60262200}实现。 % \begin{arguments} % \item 加粗系数 % \item 需要加粗的文字 % \end{arguments} % \begin{macrocode} \cs_new:Npn \@@_fake_bold:nn #1#2 { \special{pdf:code~q~2~Tr~0~G~#1~w}% #2% \special{pdf:code~Q}% } \NewDocumentCommand \fakebold {O{0.2} m } { \@@_fake_bold:nn { #1 }{ #2 } } % \end{macrocode} % \end{macro} % % \changes{v1.10}{2022/03/17}{统一使用 \LaTeX{} 2020/10/01 新钩子机制。} % % \begin{macro}{\@@_gadd_ltxhook:nn} % 封装 \LaTeX{} 的钩子管理机制。本模板中的字体加载命令位于 % |begindocument/before| 钩子中,需确保在 \pkg{xeCJK} 之前执行。 % \begin{macrocode} \cs_new_protected:Npn \@@_gadd_ltxhook:nn #1#2 { \hook_gput_code:nnn {#1} { . } {#2} } \hook_gset_rule:nnnn { begindocument/before } { . } { < } { xeCJK } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_patch_cmd:Nnn,\@@_preto_cmd:Nn,\@@_appto_cmd:Nn} % 补丁工具,来自 \pkg{ctexpatch} 宏包。 % \begin{macrocode} \cs_new_protected:Npn \@@_patch_cmd:Nnn #1#2#3 { \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3} { } { \ctex_patch_failure:N #1 } } \cs_new_protected:Npn \@@_preto_cmd:Nn #1#2 { \ctex_preto_cmd:NnnTF #1 { } {#2} { } { \ctex_patch_failure:N #1 } } \cs_new_protected:Npn \@@_appto_cmd:Nn #1#2 { \ctex_appto_cmd:NnnTF #1 { } {#2} { } { \ctex_patch_failure:N #1 } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_at_begin_environment:nn} % 在环境开始添加代码的补丁函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_at_begin_environment:nn #1#2 { \seq_set_from_clist:Nn \l_@@_env_hook_name_seq {#1} \seq_map_inline:Nn \l_@@_env_hook_name_seq { \AtBeginEnvironment{##1}{#2} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_at_end_preamble:n} % 在导言区结束位置添加代码的补丁函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_at_end_preamble:n { \ctex_gadd_ltxhook:nn { env/document/before } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_define_fn_style:nn, % \@@_define_punct:nn, % \@@_define_name:nn, % \@@_define_name:nnn} % 用来定义脚注样式、标点、默认名称的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_fn_style:nn #1#2 { \tl_const:cn { c_@@_fn_style_ #1 _tl } {#2} } \cs_new_protected:Npn \@@_define_punct:nn #1#2 { \tl_const:cn { c_@@_ #1 _tl } { \@@_symbol:n {#2} } } \cs_new_protected:Npn \@@_define_name:nn #1#2 { \tl_const:cn { c_@@_name_ #1 _tl } {#2} } \cs_new_protected:Npn \@@_define_name:nnn #1#2#3 { \tl_const:cn { c_@@_name_ #1 _tl } {#2} \tl_const:cn { c_@@_name_ #1 _en_tl } {#3} } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_msg_new:nn, % \@@_error:n,\@@_error:nn,\@@_error:nx,\@@_error:nnn, % \@@_warning:n,\@@_warning:nn,\@@_warning:nxx, % \@@_info:nx} % 各种信息函数的缩略形式。 % \begin{macrocode} \cs_new:Npn \@@_msg_new:nn { \msg_new:nnn { nwafuthesis } } \cs_new:Npn \@@_error:n { \msg_error:nn { nwafuthesis } } \cs_new:Npn \@@_error:nn { \msg_error:nnn { nwafuthesis } } \cs_new:Npn \@@_error:nx { \msg_error:nnx { nwafuthesis } } \cs_new:Npn \@@_error:nnn { \msg_error:nnnn { nwafuthesis } } \cs_new:Npn \@@_error:nnnn { \msg_error:nnnnn { nwafuthesis } } \cs_new:Npn \@@_warning:n { \msg_warning:nn { nwafuthesis } } \cs_new:Npn \@@_warning:nn { \msg_warning:nnn { nwafuthesis } } \cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx { nwafuthesis } } \cs_new:Npn \@@_info:nx { \msg_info:nnx { nwafuthesis } } % \end{macrocode} % \end{macro} % % \subsection{选项处理} % % 定义 |nwafu/option| 键值类。 % \begin{macrocode} \keys_define:nn { nwafu / option } { % \end{macrocode} % % \begin{macro}{type} % 设置论文类型。设为模板选项主要是为了以后的兼容性。论文类型可能会 % 影响很多设置,默认为本科生毕业论文。 % \begin{macrocode} type .choice:, type .value_required:n = true, type .choices:nn = { doctor, master, bachelor } { \int_set_eq:NN \g_@@_thesis_type_int \l_keys_choice_int }, type .initial:n = bachelor, % \end{macrocode} % \end{macro} % % \begin{macro}{oneside,twoside} % 设置页面类型为单面或双面。 % \begin{macrocode} oneside .value_forbidden:n = true, twoside .value_forbidden:n = true, oneside .code:n = { \clist_gput_right:Nn \g_@@_to_ctexbook_clist { oneside } \bool_set_false:N \g_@@_twoside_bool }, twoside .code:n = { % \end{macrocode} % 将双面设置为openany(我校特例),从结果来讲与单面一样, % 此处是为后续诸如页边距调整为左右不同保留的设置。 % \begin{macrocode} \clist_gput_right:Nn \g_@@_to_ctexbook_clist { twoside, openany } \bool_set_true:N \g_@@_twoside_bool }, % \end{macrocode} % \end{macro} % % \begin{macro}{draft} % 是否开启草稿模式(默认关闭)。 % \begin{macrocode} draft .choice:, draft / true .code:n = { \bool_set_true:N \g_@@_draft_bool \clist_gput_right:Nn \g_@@_to_ctexbook_clist { draft } }, draft / false .code:n = { \bool_set_false:N \g_@@_draft_bool }, draft .default:n = true, draft .initial:n = false, % \end{macrocode} % \end{macro} % % 处理未知选项。 % \begin{macrocode} unknown .code:n = { \@@_error:n { unknown-option } } } \@@_msg_new:nn { unknown-option } { Class~ option~ "\l_keys_key_tl"~ is~ unknown. } % \end{macrocode} % % 将文档类选项传给 |nwafu/option|。 % \begin{macrocode} \ProcessKeysOptions { nwafu / option } % \end{macrocode} % % \subsection{模板参数配置} % % \subsubsection{定义NWAFU LOGO和中英文年月命令} % % \begin{macro}{\nwafuthesis} % nwafuthesis模板的LOGO。 % \begin{macrocode} \NewDocumentCommand \nwafuthesis { } {% \makebox{\rmfamily% N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex} {\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% \textsc{Thesis} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\datezh} % 取得中文年月。 % \begin{macrocode} \NewDocumentCommand \datezh { } { \int_use:N \c_sys_year_int 年 \int_use:N \c_sys_month_int 月 } % \end{macrocode} % \end{macro} % % \begin{macro}{\dateen} % 取得英文月年,详见:\\ % 1 = Jan.(January),\\ % 2 = Feb.(February),\\ % 3 = Mar.(March),\\ % 4 = Apr.(April),\\ % 5 = May.(May),\\ % 6 = Jun.(June),\\ % 7 = Jul.(July),\\ % 8 = Aug.(August),\\ % 9 = Sept.(September),\\ % 10 = Oct.(October),\\ % 11 = Nov.(November),\\ % 12 = Dec.(December), % \begin{macrocode} \prop_new:N \l_@@_dateen_prop \prop_set_from_keyval:Nn \l_@@_dateen_prop { 1 = Jan., 2 = Feb., 3 = Mar., 4 = Apr., 5 = May., 6 = Jun., 7 = Jul., 8 = Aug., 9 = Sept., 10 = Oct., 11 = Nov., 12 = Dec., } \NewDocumentCommand \dateen { } { \prop_get:NVN \l_@@_dateen_prop \c_sys_month_int \l_@@_tmpa_tl \l_@@_tmpa_tl ,~ \int_use:N \c_sys_year_int } % \end{macrocode} % \end{macro} % % \subsubsection{通用常量} % % 这一部分内容在原\cls{fduthesis}中,是通过``*.def''文件实现的, % 由于针对我校而言这些内容极少发生改变,为了减少文件依赖,将其 % 全部写入了\cls{nwafuthesis.cls}文件。 % % \begin{variable}{\c_@@_name_simp_tl,\c_@@_name_trad_tl, % \c_@@_name_en_tl} % 学校名称。 % \begin{macrocode} \tl_const:Nn \c_@@_name_simp_tl { 西北农林科技大学 } \tl_const:Nn \c_@@_name_trad_tl { 西北農林科技大學 } \tl_const:Nn \c_@@_name_en_tl { Northwest~ A\&F~ University } % \end{macrocode} % \end{variable} % % 常用标点符号,见表~\ref{tab:punctuations}。 % \begin{macrocode} \clist_map_inline:nn { { ideo_comma } { "3001 }, { ideo_full_stop } { "3002 }, { fwid_tilde } { "FF5E }, { fwid_comma } { "FF0C }, { fwid_full_stop } { "FF0E }, { fwid_colon } { "FF1A }, { fwid_semicolon } { "FF1B }, { fwid_left_paren } { "FF08 }, { fwid_right_paren } { "FF09 }, { fwid_left_title } { "300A }, { fwid_right_title } { "300B } } { \@@_define_punct:nn #1 } % \end{macrocode} % % \begin{table}[ht] % \caption{常用标点符号} % \label{tab:punctuations} % \centering % \begin{tabular}{cccc} % \toprule % \textbf{中文名称} & \textbf{英文名称} & \textbf{符号} & \textbf{Unicode} \\ % \midrule % 中文顿号 & Ideographic comma & \symbol{"3001} & U+3001 \\ % 中文句号 & Ideographic full stop & \symbol{"3002} & U+3002 \\ % 中文逗号 & Fullwidth comma & \symbol{"FF0C} & U+FF0C \\ % 中文波浪号 & Fullwidth tilde & \symbol{"FF5E} & U+FF5E \\ % 全角西文句点 & Fullwidth full stop & \symbol{"FF0E} & U+FF0E \\ % 中文冒号 & Fullwidth colon & \symbol{"FF1A} & U+FF1A \\ % 中文分号 & Fullwidth semicolon & \symbol{"FF1B} & U+FF1B \\ % 中文左圆括号 & Fullwidth left parenthesis & \symbol{"FF08} & U+FF08 \\ % 中文右圆括号 & Fullwidth right parenthesis & \symbol{"FF09} & U+FF09 \\ % 中文左书名号 & Fullwidth left book title & \symbol{"300A} & U+300A \\ % 中文右书名号 & Fullwidth right book title & \symbol{"300B} & U+300B \\ % \bottomrule % \end{tabular} % \end{table} % % \begin{variable}{\c_@@_line_spread_fp} % 行距倍数。行距倍数 $k$ 由下式确定: % \begin{equation*} % \num{1.2} \times k \times \SI{12}{bp} = \SI{20}{pt}. % \end{equation*} % 式中,\num{1.2} 是基本行距与文字大小之比,\SI{12}{bp} 是小四号字 % 的大小,\SI{20}{pt} 是行距固定值。 % \begin{macrocode} \fp_const:Nn \c_@@_line_spread_fp { \dim_ratio:nn { 20 pt } { 12 bp } / 1.2 } % \end{macrocode} % \end{variable} % % \subsubsection{声明页内容常量} % % \begin{variable}{\c_@@_orig_decl_text_tl} % 论文独创性声明。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_orig_decl_text: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生独创性声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} \tl_const:Nn \c_@@_orig_decl_text_tl { 本人声明{\c_@@_fwid_colon_tl}所呈交的学位论文是我个人在导师指导下% 独立进行的研究工作及取得的研究结果{\c_@@_fwid_semicolon_tl}论文中% 的研究数据及结果的获得完全符合学校{\c_@@_fwid_left_title_tl}% 关于规范西北农林科技大学研究生学术道德的暂行规定{\c_@@_fwid_right_title_tl}% {\c_@@_fwid_comma_tl}如果违反此规定{\c_@@_fwid_comma_tl}一切后果与% 法律责任均由本人承担{\c_@@_ideo_full_stop_tl}\par% 尽我所知{\c_@@_fwid_comma_tl}除了文中特别加以标注和致谢的地方外% {\c_@@_fwid_comma_tl}论文中不包含其他人已经发表或撰写过的研究结果% {\c_@@_fwid_comma_tl}也不包含其他人和自己本人已获得西北农林科技大学% 或其它教育机构的学位或证书而使用过的材料{\c_@@_ideo_full_stop_tl}与% 我一同工作的同事对本研究所做的任何贡献均已在论文的致谢中作了明确的说% 明并表示了谢意{\c_@@_ideo_full_stop_tl}% } } { % \end{macrocode} % 本科生生独创性声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} \tl_const:Nn \c_@@_orig_decl_text_tl { 本人声明{\c_@@_fwid_colon_tl}所呈交的毕业% \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }% 是我个人在导师指导下独立进行的研究工作及取得的研究结果{\c_@@_ideo_full_stop_tl}% 尽我所知{\c_@@_fwid_comma_tl}除了文中特别加以标注和致谢的地% 方外{\c_@@_fwid_comma_tl}论文中不包含其他人已经发表或撰写过% 的研究结果{\c_@@_fwid_comma_tl}也不包含其他人和自己本人已获% 得\c_@@_name_simp_tl{}或其它教育机构的学位或证书而使用过的材% 料{\c_@@_ideo_full_stop_tl}与我一同工作的同事对本研究所做的% 任何贡献均已在论文的致谢中作了明确的说明并表示了谢意{\c_@@_ideo_full_stop_tl}% 如违反此声明{\c_@@_fwid_comma_tl}一切后果与法律责任均由本人% 承担{\c_@@_ideo_full_stop_tl}% } } } \@@_define_orig_decl_text: % \end{macrocode} % \end{variable} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏导师承诺中研究生姓名。} % % \begin{variable}{\c_@@_super_decl_text_tl} % 研究生学位导师承诺。 % \begin{macrocode} \tl_const:Nn \c_@@_super_decl_text_tl { 本人承诺{\c_@@_fwid_colon_tl}我的研究生{% \bool_if:NTF \l_@@_anonymous_bool { \@@_text_uline:V \c_@@_name_anonname_tl }{ \@@_text_uline:V \l_@@_info_author_tl } }% 所呈交的学位论文是在我指导下独立开展研究工作及取得的研究结果% {\c_@@_fwid_comma_tl}属于我现岗职务工作的结果{\c_@@_fwid_comma_tl}% 并严格按照学校{\c_@@_fwid_left_title_tl}关于规范西北农林科技大学研% 究生学术道德的暂行规定{\c_@@_fwid_right_title_tl}而% 获得的研究结果{\c_@@_ideo_full_stop_tl}如果违反学校{\c_@@_fwid_left_title_tl}% 关于规范西北农林科技大学研究生学术道德的暂行规定{\c_@@_fwid_right_title_tl}% {\c_@@_fwid_comma_tl}我愿接受按学校% 有关规定的处罚处理并承担相应导师连带责任{\c_@@_ideo_full_stop_tl}% } % \end{macrocode} % \end{variable} % % \begin{variable}{\c_@@_auth_decl_text_tl} % 论文使用授权声明。 % \begin{macrocode} \cs_new_protected:Npn \@@_auth_orig_decl_text: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生使用授权声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} \tl_const:Nn \c_@@_auth_decl_text_tl { 本学位论文的知识产权归属西北农林科技大学{\c_@@_ideo_full_stop_tl}% 本人同意西北农林科技大学保存或向国家有关部门或机构送交论文的纸% 质版和电子版{\c_@@_fwid_comma_tl}允许论文被查阅和借阅{\c_@@_fwid_semicolon_tl}% 同意西北农林科技大学将本学位论文的全部或部分内容授权汇编录入% {\c_@@_fwid_left_title_tl}中国博士/硕士学位论文全文数据库% {\c_@@_fwid_right_title_tl}和{\c_@@_fwid_left_title_tl}中国学位% 论文全文数据库{\c_@@_fwid_right_title_tl}进行出版% {\c_@@_fwid_comma_tl}并享受相关权益{\c_@@_ideo_full_stop_tl}\par 本人保证{\c_@@_fwid_comma_tl}在毕业离开(或者工作调离)西北农林科技% 大学后{\c_@@_fwid_comma_tl}发表或者使用本学位论文及其相关的工作成% 果时{\c_@@_fwid_comma_tl}将以西北农林科技大学为第一署名单位% {\c_@@_fwid_comma_tl}否则{\c_@@_fwid_comma_tl}愿意按 {\c_@@_fwid_left_title_tl}中华人民共和国著作权法{\c_@@_fwid_right_title_tl}% 等有关规定接受处理并承担法律责任{\c_@@_ideo_full_stop_tl}\par% 任何收存和保管本论文各种版本的其他单位和个人(包括研究生本人)未经本% 论文作者的导师同意{\c_@@_fwid_comma_tl}不得有对本论文进行复制% {\c_@@_ideo_comma_tl}修改{\c_@@_ideo_comma_tl}发行{\c_@@_ideo_comma_tl}% 出租{\c_@@_ideo_comma_tl}改编等侵犯著作权的行为{\c_@@_fwid_comma_tl}% 否则{\c_@@_fwid_comma_tl}按违背{\c_@@_fwid_left_title_tl}中华人民共和国% 著作权法{\c_@@_fwid_right_title_tl}等有关规定处% 理并追究法律责任{\c_@@_ideo_full_stop_tl}\par% {\sffamily (保密的学位论文在保密期限内{\c_@@_fwid_comma_tl}不得以任何% 方式发表{\c_@@_ideo_comma_tl}借阅{\c_@@_ideo_comma_tl}复印% {\c_@@_ideo_comma_tl}缩印或扫描复制手段保存{\c_@@_ideo_comma_tl}汇编论文)% } } } { % \end{macrocode} % 本科生使用授权声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} \tl_const:Nn \c_@@_auth_decl_text_tl { 本毕业\clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }% 的知识产权归属\c_@@_name_simp_tl{}{\c_@@_ideo_full_stop_tl}本% 人同意\c_@@_name_simp_tl{}保存或向国家有关部门或机构送交论文的% 纸质版和电子版{\c_@@_fwid_comma_tl}允许论文被查阅和借阅% {\c_@@_ideo_full_stop_tl}\par 本人保证{\c_@@_fwid_comma_tl}在毕业离开\c_@@_name_simp_tl{}后% {\c_@@_fwid_comma_tl}发表或者使用本毕业% \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }% 及其相关的工作成果时{\c_@@_fwid_comma_tl}将以\c_@@_name_simp_tl{}% 为第一署名单位{\c_@@_fwid_comma_tl}否则{\c_@@_fwid_comma_tl}% 愿意按{\c_@@_fwid_left_title_tl}中华人民共和国著作权法% {\c_@@_fwid_right_title_tl}等有关规定接受处理并承担法律责任% {\c_@@_ideo_full_stop_tl}\par% 任何收存和保管本论文各种版本的其他单位和个人(包括作者本人)未经% 本论文作者的导师同意{\c_@@_fwid_comma_tl}不得有对本论文进行复制% {\c_@@_ideo_comma_tl}修改{\c_@@_ideo_comma_tl}发行{\c_@@_ideo_comma_tl}% 出租{\c_@@_ideo_comma_tl}改编等侵犯著作权的行为{\c_@@_fwid_comma_tl}% 否则{\c_@@_fwid_comma_tl}按违背{\c_@@_fwid_left_title_tl}中华人民% 共和国著作权法{\c_@@_fwid_right_title_tl}% 等有关规定处理并追究法律责任{\c_@@_ideo_full_stop_tl}% } } } \@@_auth_orig_decl_text: % \end{macrocode} % \end{variable} % % \begin{variable}{\c_@@_orig_decl_sign_tl, % \c_@@_super_decl_sign_tl} % 声明页签名项目。 % \begin{macrocode} \cs_new_protected:Npn \@@_orig_decl_sign: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生。 % \begin{macrocode} \tl_const:Nn \c_@@_orig_decl_sign_tl { 研究生签名 } \tl_const:Nn \c_@@_super_decl_sign_tl { 导师签名 } } { % \end{macrocode} % 本科生。 % \begin{macrocode} \tl_const:Nn \c_@@_orig_decl_sign_tl { 本科生签名 } \tl_const:Nn \c_@@_super_decl_sign_tl { 指导教师签名 } } } \@@_orig_decl_sign: \clist_const:Nn \c_@@_auth_decl_sign_clist { 作者签名, 导师签名, 日期 } % \end{macrocode} % \end{variable} % % \subsubsection{杂项常量定义} % % \changes{v1.13}{2022/05/26}{修订本科毕业为本科生毕业。} % % \begin{variable}{\c_@@_thesis_type_clist, % \c_@@_degree_type_clist, % \c_@@_bachelor_type_clist} % 论文类型与学位类型。 % \begin{macrocode} \clist_const:Nn \c_@@_thesis_type_clist { 博士学位论文, 硕士学位论文, 本科生毕业 } \clist_const:Nn \c_@@_degree_type_clist { 学术学位, 专业学位 } \clist_const:Nn \c_@@_bachelor_type_clist { 论文, 设计 } % \end{macrocode} % \end{variable} % % \begin{variable}{\c_@@_secret_clist} % 四种密级,公开无需列入。 % \begin{macrocode} \clist_const:Nn \c_@@_secret_clist { 限制, 秘密, 机密, 绝密 } % \end{macrocode} % \end{variable} % % 各字段默认名称,注意会忽略空格。 % 研究生和本科名称存在不一样现象,例如研究生用“研究生学号”,本科生用“学号”。 % % 研究生和本科生名称相同中文字段。 % \begin{macrocode} % \clist_map_inline:nn { { secret_level } { 密级 }, { udc } { UDC }, { school_id } { 学校代码 }, { department } { 学院 }, { enroll } { 年级 }, { class_id } { 班级 }, { instructors } { 指导小组 }, { author_sign } { 作者签名 }, { supervisor_sign } { 导师签名 }, { sign_date } { 日期 }, { toc } { 目 \quad 录 }, { lof } { 插图目录 }, { lot } { 表格目录 }, { bib_en } { Bibliography }, { ack } { 致 \quad 谢 }, { resume } { 个人简历 }, { pdf_creator } { LaTeX~ with~ nwafuthesis~ class }, } { \@@_define_name:nn #1 } \cs_new_protected:Npn \@@_define_name_const_zh: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % % \end{macrocode} % 研究生的字段。 % \begin{macrocode} % \clist_map_inline:nn { { student_id } { 研究生学号 }, { orig_decl } { 研究生学位论文的独创性声明 }, { super_decl } { 导师指导研究生学位论文的承诺 }, { auth_decl } { 关于研究生学位论文使用授权的说明 } } { \@@_define_name:nn ##1 } }{ % % \end{macrocode} % 本科生的字段。 % \begin{macrocode} % \clist_map_inline:nn { { major } { 专业 }, { student_id } { 学号 }, { author } { 学生姓名 }, { cosupervisor } { 协助指导教师 }, { date } { 完成日期 }, { orig_decl } { 本科生毕业\clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }的独创性声明 }, { auth_decl } { 关于本科生毕业\clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }知识产权的说明 } } { \@@_define_name:nn ##1 } } } \@@_define_name_const_zh: % % \end{macrocode} % 研究生与本科生相同的中英文字段。 % \begin{macrocode} % % \changes{v1.25}{2023/04/19}{添加盲审隐藏信息符号常量。} % \clist_map_inline:nn { { supervisor } { 指导教师 } { Supervisor }, { anonid } { ********** } { ********** }, { anonname } { **** } { **** }, } { \@@_define_name:nnn #1 } % \cs_new_protected:Npn \@@_define_name_const_zh_en: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % % \end{macrocode} % 研究生。 % \begin{macrocode} % \clist_map_inline:nn { { major } { 学科专业 } { Major }, { researchfield } { 研究方向 } { Research~ Field }, { professionaltype } { 专业学位类型 } { Degree~ Type }, { professionalfield } { 领域名称 } { Field }, { author } { 论文作者 } { Candidate }, { cosupervisor } { 联合指导教师 } { Co-Supervisor }, { date } { 论文提交时间 } { Date~ of~ Submission }, { abstract } { 摘 \quad 要 } { ABSTRACT }, { keywords } { 关键词 } { KEY~WORDS }, { clc } { 分类号 } { CLC~ number: }, { notation } { 主要符号对照表 } { List~ of~ Symbols } } { \@@_define_name:nnn ##1 } }{ % % \end{macrocode} % 本科生。 % \begin{macrocode} % \clist_map_inline:nn { { abstract } { 摘要 } { Abstract }, { keywords } { 关键词 } { Keywords }, { clc } { 分类号 } { CLC~ number }, } { \@@_define_name:nnn ##1 } } } \@@_define_name_const_zh_en: % \end{macrocode} % % 定理定理类标题中英文名称常量。 % \begin{macrocode} % \clist_map_inline:nn { { proof } { 证明 } { Proof }, { axiom } { 公理 } { Axiom }, { corollary } { 推论 } { Corollary }, { definition } { 定义 } { Definition }, { example } { 例 } { Example }, { lemma } { 引理 } { Lemma }, { theorem } { 定理 } { Theorem } } { \@@_define_name:nnn #1 } % \end{macrocode} % % \subsection{载入宏包、文档类} % % 将选项传入 \cls{ctexbook} 文档类。 % \begin{macrocode} \PassOptionsToClass { UTF8, heading = true, fontset = none, zihao = -4, linespread = \c_@@_line_spread_fp, \g_@@_to_ctexbook_clist } { ctexbook } % \end{macrocode} % % 传入各宏包选项。 % \begin{macrocode} \clist_map_inline:nn { { shortlabels } { enumitem }, { no-math } { fontspec }, { perpage } { footmisc }, { amsmath, thmmarks } { ntheorem } } { \PassOptionsToPackage #1 } % \end{macrocode} % % 载入 \cls{ctexbook} 文档类。 % 在使用 \XeLaTeX{} 编译时,\cls{ctexbook} 的底层将调用 \pkg{xeCJK} % 宏包;而在使用 \LuaLaTeX{} 编译时,则将调用 \pkg{LuaTeX-ja} 宏包。 % 两种情况下 \cls{ctexbook} 均会调用 \pkg{fontspec} 宏包。 % \begin{macrocode} \LoadClass { ctexbook } % \end{macrocode} % % % 载入各宏包。其中,\pkg{amsmath} 必须在 \pkg{unicode-math} 之前引入。 % \begin{macrocode} \RequirePackage { amsmath, unicode-math, geometry, fancyhdr, titletoc, footmisc, ntheorem, enumitem, graphicx, caption, bicaption, xcolor, } % \end{macrocode} % % \changes{v1.10}{2022/03/17}{只检查 \cls{ctexbook} 和 \pkg{xeCJK} 的版本。} % % \begin{macro}{\@@_check_package:nnn} % 检查过时宏包。 % \begin{macrocode} \cs_new_protected:Npn \@@_check_package:nnn #1#2#3 { \@ifpackagelater {#1} {#2} { } { \@@_error:nnnn { package-too-old } { Package } {#1} {#3} } } \cs_new_protected:Npn \@@_check_class:nnn #1#2#3 { \@ifclasslater {#1} {#2} { } { \@@_error:nnnn { package-too-old } { Class } {#1} {#3} } } \@@_msg_new:nn { package-too-old } { #1~ "#2"~ is~ too~ old. \\ The~ nwafuthesis~ class~ only~ supports~ "#2" \\ with~ a~ version~ higher~ than~ v#3. \\\\ Please~ update~ an~ up-to-date~ version~ of~ it \\ using~ your~ TeX~ package~ manager~ or~ from~ CTAN. } % \end{macrocode} % \end{macro} % % \changes{v1.01}{2021/08/06}{由于无法获取ctex版本信息,暂时关闭对ctex版本检测。} % % \begin{macrocode} \@@_check_class:nnn { ctexbook } { 2021/03/14 } { 2.5.6 } \sys_if_engine_xetex:T { \@@_check_package:nnn { xeCJK } { 2020/05/01 } { 3.8.3 } } % \end{macrocode} % % \subsection{页面布局} % % 利用 \pkg{geometry} 宏包设置纸张大小、页面边距以及页眉高度。这里, % $\SI{2.54}{\centi\meter}=\SI{1}{in}$, % $\SI{3.18}{\centi\meter}=\SI{1.25}{in}$。 % % 研究论文页面尺寸与本科生毕业论文(设计)的 % 页面尺寸不一致,需要分开设置。 % \begin{macrocode} \cs_new_protected:Npn \@@_thesis_geometry: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生论文页边距 % \begin{macrocode} \geometry { paper=a4paper, top=3.1cm, bottom=3.3cm, left=2.6cm, right=2.6cm, headheight=0.8cm, headsep=0.7cm, footskip=1.4cm, %includehead, %includefoot, } }{ % \end{macrocode} % 本科生论文页边距 % \begin{macrocode} \geometry { paper=a4paper, top=3.14cm, bottom=3.8cm, left=2.45cm, right=2.45cm, headheight=0.8cm, headsep=0.63cm, footskip=2.3cm, } } } \@@_thesis_geometry: % \end{macrocode} % % 草稿模式下显示页面边框及页眉、页脚线 。 % \begin{macrocode} \bool_if:NT \g_@@_draft_bool { \geometry { showframe } } % \end{macrocode} % % \subsection{字体} % % \subsubsection{预定义字体配置} % % \begin{variable}{\g_@@_fontset_tl, \g_@@_cjk_fontset_tl} % 存放字体选项值。 % \begin{macrocode} \tl_new:N \g_@@_fontset_tl \tl_new:N \g_@@_cjk_fontset_tl % \end{macrocode} % \end{variable} % % \begin{macro}{style/font} % 预定义西文字体。 % \begin{macrocode} \keys_define:nn { nwafu / style } { font .choices:nn = { garamond, libertinus, lm, palatino, times, times*, none } { \tl_set_eq:NN \g_@@_fontset_tl \l_keys_choice_tl } } % \end{macrocode} % \end{macro} % % \begin{macro}{style/cjk-font} % 预定义中文字体。 % \begin{macrocode} \keys_define:nn { nwafu / style } { cjk-font .choices:nn = { adobe, fandol, founder, mac, sinotype, sourcehan, windows, none } { \tl_set_eq:NN \g_@@_cjk_fontset_tl \l_keys_choice_tl } } % \end{macrocode} % \end{macro} % % \begin{macro}{ % \@@_setmainfont:nn, % \@@_setsansfont:nn, % \@@_setmonofont:nn, % \@@_setmathfont:nn} % 用于设置西文字体的辅助函数,来源于 \pkg{fontspec} 和 \pkg{unicode-math}。 % \begin{arguments} % \item 字体名 % \item 选项 % \end{arguments} % \begin{macrocode} \cs_new_protected:Npn \@@_setmainfont:nn #1#2 { \__fontspec_main_setmainfont:nn {#2} {#1} } \cs_new_protected:Npn \@@_setsansfont:nn #1#2 { \__fontspec_main_setsansfont:nn {#2} {#1} } \cs_new_protected:Npn \@@_setmonofont:nn #1#2 { \__fontspec_main_setmonofont:nn {#2} {#1} } \cs_new_protected:Npn \@@_setmathfont:nn #1#2 { \__um_setmathfont:nn {#2} {#1} } % \end{macrocode} % \end{macro} % % \begin{macro}{ % \@@_setCJKmainfont:nn, % \@@_setCJKsansfont:nn, % \@@_setCJKmonofont:nn} % 用于设置中文字体的辅助函数,来源于 \pkg{xeCJK} 和 \pkg{ctex} 宏包。 % \begin{macrocode} \cs_new_protected:Npn \@@_setCJKmainfont:nn #1#2 { \@@_set_family:xnn { \CJKrmdefault } {#2} {#1} } \cs_new_protected:Npn \@@_setCJKsansfont:nn #1#2 { \@@_set_family:xnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \@@_setCJKmonofont:nn #1#2 { \@@_set_family:xnn { \CJKttdefault } {#2} {#1} } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_set_cjk_font_hei:nn,\nwafu@hei} % 中文黑体需要单独设置。 % \begin{macrocode} \cs_new_protected:Npn \@@_set_cjk_font_hei:nn #1#2 { \@@_set_family:nnn { nwafu@hei } {#2} {#1} } \cs_new_protected:Npn \nwafu@hei { \@@_switch_family:n { nwafu@hei } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_set_cjk_font_kai:nn,\nwafu@kai} % 楷体需要单独设置。 % \begin{macrocode} \cs_new_protected:Npn \@@_set_cjk_font_kai:nn #1#2 { \@@_set_family:nnn { nwafu@kai } {#2} {#1} } \cs_new_protected:Npn \nwafu@kai { \@@_switch_family:n { nwafu@kai } } % \end{macrocode} % \end{macro} % % \begin{macro}{ % \@@_cjk_font_options:, % \@@_cjk_font_hei_options:, % \@@_setCJKmainfont:n, % \@@_setCJKsansfont:n, % \@@_setCJKmonofont:n, % \@@_set_cjk_font_hei:n, % \@@_set_cjk_font_kai:n} % 将 bold、italic 和 bold italic 统一按照 roman 设置。 % \begin{macrocode} \tl_const:Nn \@@_cjk_font_options: { UprightFont = *, ItalicFont = *, AutoFakeBold = true } % \end{macrocode} % 设置为黑体时不启用伪粗体 % \begin{macrocode} \tl_const:Nn \@@_cjk_font_hei_options: { UprightFont = *, ItalicFont = *, AutoFakeBold = false } % \end{macrocode} % 设置正文常规字体 % \begin{macrocode} \cs_new_protected:Npx \@@_setCJKmainfont:n #1 { \@@_setCJKmainfont:nn {#1} { \@@_cjk_font_options: } } % \end{macrocode} % 设置无衬线字体 % \begin{macrocode} \cs_new_protected:Npx \@@_setCJKsansfont:n #1 { \@@_setCJKsansfont:nn {#1} { \@@_cjk_font_hei_options: } } % \end{macrocode} % 设置等宽字体 % \begin{macrocode} \cs_new_protected:Npx \@@_setCJKmonofont:n #1 { \@@_setCJKmonofont:nn {#1} { \@@_cjk_font_options: } } % \end{macrocode} % 设置黑体字体 % \begin{macrocode} \cs_new_protected:Npx \@@_set_cjk_font_hei:n #1 { \@@_set_cjk_font_hei:nn {#1} { \@@_cjk_font_hei_options: } } % \end{macrocode} % 设置楷体字体 % \begin{macrocode} \cs_new_protected:Npx \@@_set_cjk_font_kai:n #1 { \@@_set_cjk_font_kai:nn {#1} { \@@_cjk_font_options: } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_set_family:nnn,\@@_set_family:xnn,\@@_switch_family:n} % 封装 CJK 字体族的设定和切换命令。 % \begin{macrocode} \sys_if_engine_xetex:TF { \cs_new_eq:NN \@@_set_family:nnn \xeCJK_set_family:nnn \cs_new_eq:NN \@@_switch_family:n \xeCJK_switch_family:n } { \cs_new_eq:NN \@@_set_family:nnn \ctex_ltj_set_family:nnn \cs_new_eq:NN \@@_switch_family:n \ctex_ltj_switch_family:n } \cs_generate_variant:Nn \@@_set_family:nnn { x } % \end{macrocode} % \end{macro} % % \begin{macro}{ % \setmainfont, % \setsansfont, % \setmonofont, % \setmathfont, % \setCJKmainfont, % \setCJKsansfont, % \setCJKmonofont, % \@@_set_font:n} % 重新定义以上宏包提供的字体选择命令。把它放在导言区末尾,使得用户配置不被 % 模板配置覆盖。 % \begin{macrocode} \cs_new_protected:Npn \@@_set_font_helper:n #1 { \exp_args:Nc \RenewDocumentCommand { set #1 font } { O { } m O { } } { \ctex_at_end_preamble:n { \use:c { @@_set #1 font:nn } {##2} { ##1, ##3 } } } } \clist_map_inline:nn { main, sans, mono, math } { \@@_set_font_helper:n {#1} } \clist_map_inline:nn { CJKmain, CJKsans, CJKmono } { \@@_set_font_helper:n {#1} } % \end{macrocode} % \end{macro} % % \changes{v1.10}{2022/03/17}{判断 Libertinus Sans Bold Oblique 字体是否存在。} % % \begin{macro}{ % \g_@@_font_family_libertinus_serif_tl, % \g_@@_font_family_libertinus_sans_tl, % \g_@@_font_style_libertinus_rm_tl, % \g_@@_font_style_libertinus_bf_tl, % \g_@@_font_style_libertinus_it_tl, % \g_@@_font_style_libertinus_bfit_tl, % \g_@@_font_style_libertinus_bfsl_tl, % \g_@@_font_family_xits_tl, % \g_@@_font_style_xits_rm_tl, % \g_@@_font_style_xits_bf_tl, % \g_@@_font_style_xits_it_tl, % \g_@@_font_style_xits_bfit_tl, % \g_@@_font_name_libertinus_serif_tl, % \g_@@_font_name_libertinus_sans_tl, % \g_@@_font_name_libertinus_math_tl, % \g_@@_font_name_xits_tl, % \g_@@_font_name_xits_math_rm_tl, % \g_@@_font_name_xits_math_bf_tl} % Libertinus 和 XITS 字体的文件名做过变动,需要特殊处理。 % \begin{macrocode} \tl_new:N \g_@@_font_family_libertinus_serif_tl \tl_new:N \g_@@_font_family_libertinus_sans_tl \tl_new:N \g_@@_font_style_libertinus_rm_tl \tl_new:N \g_@@_font_style_libertinus_bf_tl \tl_new:N \g_@@_font_style_libertinus_it_tl \tl_new:N \g_@@_font_style_libertinus_bfit_tl \tl_new:N \g_@@_font_style_libertinus_bfsl_tl \tl_new:N \g_@@_font_family_xits_tl \tl_new:N \g_@@_font_style_xits_rm_tl \tl_new:N \g_@@_font_style_xits_bf_tl \tl_new:N \g_@@_font_style_xits_it_tl \tl_new:N \g_@@_font_style_xits_bfit_tl \tl_new:N \g_@@_font_name_libertinus_serif_tl \tl_new:N \g_@@_font_name_libertinus_sans_tl \tl_new:N \g_@@_font_name_libertinus_math_tl \tl_new:N \g_@@_font_name_xits_tl \tl_new:N \g_@@_font_name_xits_math_rm_tl \tl_new:N \g_@@_font_name_xits_math_bf_tl \fontspec_font_if_exist:nTF { LibertinusSerif-Regular.otf } { \tl_set:Nn \g_@@_font_family_libertinus_serif_tl { LibertinusSerif } \tl_set:Nn \g_@@_font_family_libertinus_sans_tl { LibertinusSans } \tl_set:Nn \g_@@_font_family_libertinus_math_tl { LibertinusMath } \tl_set:Nn \g_@@_font_style_libertinus_rm_tl { Regular } \tl_set:Nn \g_@@_font_style_libertinus_bf_tl { Bold } \tl_set:Nn \g_@@_font_style_libertinus_it_tl { Italic } \tl_set:Nn \g_@@_font_style_libertinus_bfit_tl { BoldItalic } % \end{macrocode} % 较新版本中 Libertinus Sans Bold Oblique 字体被移除,需进行额外判断。 % \begin{macrocode} \fontspec_font_if_exist:nTF { LibertinusSans-BoldOblique.otf } { \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { BoldOblique } } { \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { Bold } } } { \tl_set:Nn \g_@@_font_family_libertinus_serif_tl { libertinusserif } \tl_set:Nn \g_@@_font_family_libertinus_sans_tl { libertinussans } \tl_set:Nn \g_@@_font_family_libertinus_math_tl { libertinusmath } \tl_set:Nn \g_@@_font_style_libertinus_rm_tl { regular } \tl_set:Nn \g_@@_font_style_libertinus_bf_tl { bold } \tl_set:Nn \g_@@_font_style_libertinus_it_tl { italic } \tl_set:Nn \g_@@_font_style_libertinus_bfit_tl { bolditalic } \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { bolditalic } } \fontspec_font_if_exist:nTF { XITS-Regular.otf } { \tl_set:Nn \g_@@_font_family_xits_tl { XITS } \tl_set:Nn \g_@@_font_style_xits_rm_tl { Regular } \tl_set:Nn \g_@@_font_style_xits_bf_tl { Bold } \tl_set:Nn \g_@@_font_style_xits_it_tl { Italic } \tl_set:Nn \g_@@_font_style_xits_bfit_tl { BoldItalic } \tl_set:Nn \g_@@_font_name_xits_math_rm_tl { XITSMath-Regular } \tl_set:Nn \g_@@_font_name_xits_math_bf_tl { XITSMath-Bold } } { \tl_set:Nn \g_@@_font_family_xits_tl { xits } \tl_set:Nn \g_@@_font_style_xits_rm_tl { regular } \tl_set:Nn \g_@@_font_style_xits_bf_tl { bold } \tl_set:Nn \g_@@_font_style_xits_it_tl { italic } \tl_set:Nn \g_@@_font_style_xits_bfit_tl { bolditalic } \tl_set:Nn \g_@@_font_name_xits_math_rm_tl { xits-math } \tl_set:Nn \g_@@_font_name_xits_math_bf_tl { xits-mathbold } } \tl_set:Nx \g_@@_font_name_libertinus_serif_tl { \g_@@_font_family_libertinus_serif_tl - \g_@@_font_style_libertinus_rm_tl } \tl_set:Nx \g_@@_font_name_libertinus_sans_tl { \g_@@_font_family_libertinus_sans_tl - \g_@@_font_style_libertinus_rm_tl } \tl_set:Nx \g_@@_font_name_libertinus_math_tl { \g_@@_font_family_libertinus_math_tl - \g_@@_font_style_libertinus_rm_tl } \tl_set:Nx \g_@@_font_name_xits_tl { \g_@@_font_family_xits_tl - \g_@@_font_style_xits_rm_tl } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_garamond:} % EB Garamond 系列。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font_garamond: { \@@_setmainfont:nn { EBGaramond } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic } \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl } { Extension = .otf, UprightFont = *-\g_@@_font_style_libertinus_rm_tl, BoldFont = *-\g_@@_font_style_libertinus_bf_tl, ItalicFont = *-\g_@@_font_style_libertinus_it_tl, BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl } \@@_setmonofont:nn { lmmonolt10 } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-oblique, BoldItalicFont = *-boldoblique } \@@_setmathfont:nn { Garamond-Math.otf } { } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_libertinus:} % Libertinus 系列。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font_libertinus: { \@@_setmainfont:nn { \g_@@_font_family_libertinus_serif_tl } { Extension = .otf, UprightFont = *-\g_@@_font_style_libertinus_rm_tl, BoldFont = *-\g_@@_font_style_libertinus_bf_tl, ItalicFont = *-\g_@@_font_style_libertinus_it_tl, BoldItalicFont = *-\g_@@_font_style_libertinus_bfit_tl } \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl } { Extension = .otf, UprightFont = *-\g_@@_font_style_libertinus_rm_tl, BoldFont = *-\g_@@_font_style_libertinus_bf_tl, ItalicFont = *-\g_@@_font_style_libertinus_it_tl, BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl } \@@_setmonofont:nn { lmmonolt10 } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-oblique, BoldItalicFont = *-boldoblique } \@@_setmathfont:nn { \g_@@_font_name_libertinus_math_tl .otf } { } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_lm:} % Latin Modern 系列。在 \XeLaTeX{} 和 \LuaLaTeX{} 中已作为默认字体,所以仅需 % 额外处理数学部分。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font_lm: { \@@_setmathfont:nn { latinmodern-math.otf } { } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_palatino:} % Palatino 系列。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font_palatino: { \@@_setmainfont:nn { texgyrepagella } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic } \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl } { Extension = .otf, UprightFont = *-\g_@@_font_style_libertinus_rm_tl, BoldFont = *-\g_@@_font_style_libertinus_bf_tl, ItalicFont = *-\g_@@_font_style_libertinus_it_tl, BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl, Scale = MatchUppercase } \@@_setmonofont:nn { lmmonolt10 } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-oblique, BoldItalicFont = *-boldoblique } \@@_setmathfont:nn { texgyrepagella-math.otf } { } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_times:} % Times 系列。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font_times: { \@@_setmainfont:nn { \g_@@_font_family_xits_tl } { Extension = .otf, UprightFont = *-\g_@@_font_style_xits_rm_tl, BoldFont = *-\g_@@_font_style_xits_bf_tl, ItalicFont = *-\g_@@_font_style_xits_it_tl, BoldItalicFont = *-\g_@@_font_style_xits_bfit_tl } \@@_setsansfont:nn { texgyreheros } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic } \@@_setmonofont:nn { texgyrecursor } { Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, Ligatures = CommonOff } \@@_setmathfont:nn { \g_@@_font_name_xits_math_rm_tl .otf } { BoldFont = \g_@@_font_name_xits_math_bf_tl .otf } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_font_times*:} % Times* 系列,除数学部分外采用系统字体。 % \begin{macrocode} \cs_new_protected:cpn { @@_load_font_ times* : } { \@@_setmainfont:nn { Times~ New~ Roman } { } \@@_setsansfont:nn { Arial } { } \@@_setmonofont:nn { Courier~ New } { } \@@_setmathfont:nn { \g_@@_font_name_xits_math_rm_tl .otf } { BoldFont = \g_@@_font_name_xits_math_bf_tl .otf } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_adobe:} % Adobe 字库。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_adobe: { \@@_setCJKmainfont:n { AdobeSongStd-Light } \@@_setCJKsansfont:n { AdobeHeitiStd-Regular } \@@_setCJKmonofont:n { AdobeFangsongStd-Regular } \@@_set_cjk_font_hei:n { AdobeHeitiStd-Regular } \@@_set_cjk_font_kai:n { AdobeKaitiStd-Regular } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_fandol:} % Fandol 字库。注意它是安装在 TeX 发行版中的,所以使用文件名调用。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_fandol: { \@@_setCJKmainfont:nn { FandolSong } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } \@@_setCJKsansfont:nn { FandolHei } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } \@@_setCJKmonofont:nn { FandolFang } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Regular, ItalicFont = *-Regular, BoldItalicFont = *-Regular } \@@_set_cjk_font_hei:nn { FandolHei } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } \@@_set_cjk_font_kai:nn { FandolKai } { Extension = .otf, UprightFont = *-Regular, BoldFont = *-Regular, ItalicFont = *-Regular, BoldItalicFont = *-Regular } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_founder:} % 方正字库。虽然有粗体(方正小标宋)等,但并非免费,故这里不做处理。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_founder: { \@@_setCJKmainfont:n { FZShuSong-Z01 } \@@_setCJKsansfont:n { FZHei-B01 } \@@_setCJKmonofont:n { FZFangSong-Z02 } \@@_set_cjk_font_hei:n { FZHei-B01 } \@@_set_cjk_font_kai:n { FZKai-Z03 } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_mac:} % macOS 自带中文字体。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_mac: { \@@_setCJKmainfont:nn { STSongti-SC } { UprightFont = *-Light, BoldFont = *-Bold, ItalicFont = *-Light, BoldItalicFont = *-Bold } \@@_setCJKsansfont:nn { STHeitiSC } { UprightFont = *-Medium, BoldFont = *-Medium, ItalicFont = *-Medium, BoldItalicFont = *-Medium } \@@_setCJKmonofont:n { STFangsong } \@@_set_cjk_font_hei:nn { STHeitiSC } { UprightFont = *-Medium, BoldFont = *-Medium, ItalicFont = *-Medium, BoldItalicFont = *-Medium } \@@_set_cjk_font_kai:nn { STKaitiSC } { UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_sinotype:} % 华文字库。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_sinotype: { \@@_setCJKmainfont:n { STSong } \@@_setCJKsansfont:n { STHeiti } \@@_setCJKmonofont:n { STFangsong } \@@_set_cjk_font_hei:n { STHeiti } \@@_set_cjk_font_kai:n { STKaiti } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_sourcehan:} % 思源宋体、思源黑体。由于没有对应的楷体和仿宋,这里直接给出警告。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_sourcehan: { \@@_setCJKmainfont:nn { SourceHanSerifSC } { UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } \@@_setCJKsansfont:nn { SourceHanSansSC } { UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Regular, BoldItalicFont = *-Bold } \@@_warning:n { source-han } } \@@_msg_new:nn { source-han } { Font~ set~ `sourcehan'~ does~ not~ contain~ kaiti~ and~ fangsong. } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_load_cjk_font_windows:} % Windows 自带中文字体。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_windows: { \@@_setCJKmainfont:n { SimSun } \@@_setCJKsansfont:n { SimHei } \@@_setCJKmonofont:n { FangSong } \@@_set_cjk_font_hei:n { SimHei } \@@_set_cjk_font_kai:n { KaiTi } } % \end{macrocode} % \end{macro} % % 探测操作系统,以设置中英文字体。 % \begin{macrocode} \tl_new:N \l_@@_font_tl \tl_new:N \l_@@_cjkfont_tl \cs_new_protected:Npn \@@_detect_platform: { \sys_if_platform_windows:TF { \tl_set:Nn \l_@@_cjkfont_tl { windows } \tl_set:Nn \l_@@_font_tl { times* } } { \@@_if_platform_macos:TF { \tl_set:Nn \l_@@_cjkfont_tl { mac } \tl_set:Nn \l_@@_font_tl { times* } }{ \tl_set:Nn \l_@@_cjkfont_tl { fandol } \tl_set:Nn \l_@@_font_tl { times } } } } \cs_new_protected:Npn \@@_if_platform_macos:TF { \file_if_exist:nTF { /System/Library/Fonts/Menlo.ttc } } % \end{macrocode} % % \begin{macro}{\@@_load_font:} % 字体加载命令。 % \begin{macrocode} \cs_new_protected:Npn \@@_load_font: { \tl_if_empty:NT \g_@@_fontset_tl { \@@_detect_platform: \tl_gset_eq:NN \g_@@_fontset_tl \l_@@_font_tl } \tl_if_empty:NT \g_@@_cjk_fontset_tl { \@@_detect_platform: \tl_gset_eq:NN \g_@@_cjk_fontset_tl \l_@@_cjkfont_tl } \use:c { @@_load_font_ \g_@@_fontset_tl : } \use:c { @@_load_cjk_font_ \g_@@_cjk_fontset_tl : } } \ctex_at_end_preamble:n { \@@_load_font: } % \end{macrocode} % \end{macro} % % \subsubsection{数学字体设置} % % 根据 GB 3102.11--93 以及 ISO 80000-2:2009 的规定,数学表达式中 % 表示变量的拉丁字母和希腊字母均应当使用斜体。 % 这里的 |\keys_set:nn{unicode-math}| 实际相当于 \cs{unimathsetup}。 % \begin{macrocode} \keys_set:nn { unicode-math } { math-style = ISO, bold-style = ISO, % mathrm = sym } % \end{macrocode} % % \subsubsection{字号} % % \begin{macrocode} \keys_define:nn { nwafu / style } { % \end{macrocode} % % \begin{macro}{style/font-size} % |font-size| 不是文档类选项,不能传给 \cls{ctexbook} 文档类,因此 % 只能手动重定义字号命令。 % \begin{macrocode} font-size .choice:, font-size .value_required:n = true, font-size / -4 .code:n = { }, % \end{macrocode} % \end{macro} % % \begin{macro}{\tiny,\scriptsize,\footnotesize,\small, % \normalsize,\large,\Large,\LARGE,\huge,\Huge} % 默认使用小四号字,所以只有五号字需要重新设置。 % \begin{macrocode} font-size / 5 .code:n = { \RenewDocumentCommand \tiny { } { \zihao { 7 } } \RenewDocumentCommand \scriptsize { } { \zihao { -6 } } \RenewDocumentCommand \footnotesize { } { \zihao { 6 } } \RenewDocumentCommand \small { } { \zihao { -5 } } \RenewDocumentCommand \normalsize { } { \zihao { 5 } } \RenewDocumentCommand \large { } { \zihao { -4 } } \RenewDocumentCommand \Large { } { \zihao { -3 } } \RenewDocumentCommand \LARGE { } { \zihao { -2 } } \RenewDocumentCommand \huge { } { \zihao { 2 } } \RenewDocumentCommand \Huge { } { \zihao { 1 } } }, % \end{macrocode} % \end{macro} % % \subsubsection{其它设置} % % \begin{macro}{style/fullwidth-stop} % 设置句号形状(圆圈或是圆点)。 % \begin{macrocode} fullwidth-stop .choice:, fullwidth-stop .value_required:n = true, % \end{macrocode} % 利用类别码机制切换,只有显式的\FSID 会被替换。 % \begin{macrocode} fullwidth-stop / catcode .code:n = { \@@_set_fullwidth_stop_catcode: }, % \end{macrocode} % 利用 TECKit 映射机制切换,相当于设置了 \tn{defaultCJKfontfeatures} % |{|\kvopt{Map\-ping}{fullwidth-stop}|}|。这种手段会替换所有出现的\FSID, % 并且将影响所有字体。只在 \XeTeX{} 下可用。 % \begin{macrocode} fullwidth-stop / mapping .code:n = { \sys_if_engine_xetex:TF { \clist_gset:Nn \g__xeCJK_default_features_clist { Mapping = fullwidth-stop } } { % \end{macrocode} % \LuaTeX{} 下改用类别码机制代替,并给出警告。 % \begin{macrocode} \sys_if_engine_luatex:T { \@@_warning:n { mapping-not-available } \@@_set_fullwidth_stop_catcode: } } }, fullwidth-stop / false .code:n = { } } % \end{macrocode} % \end{macro} % % 提示信息。 % \begin{macrocode} \@@_msg_new:nn { mapping-not-available } { Option~ "fullwidth-stop = mapping"~ is~ not~ available~ in~ LuaTeX. \\ "fullwidth-stop = catcode"~ will~ be~ set~ instead. } % \end{macrocode} % % \begin{macro}{\@@_set_fullwidth_stop_catcode:} % 将\FSID 设置为活动符,并定义为句点\FSFW。 % \begin{macrocode} \cs_new:Npn \@@_set_fullwidth_stop_catcode: { \char_set_active_eq:NN ^^^^3002 \c_@@_fwid_full_stop_tl \char_set_catcode_active:N ^^^^3002 \clist_map_inline:nn { \c_@@_orig_decl_text_tl, \c_@@_auth_decl_text_tl } { \tl_set_rescan:Nno ##1 { } {##1} } } % \end{macrocode} % \end{macro} % % \changes{v1.10}{2022/03/17}{允许 \tn{emph} 对中文生效。} % % 声明 \tn{emph} 样式序列,使得中文强调以楷体显示。 % \begin{macrocode} \DeclareEmphSequence { \bfseries, \upshape \CJKfamily { \CJKfamilydefault }, } % \end{macrocode} % % \subsection{页眉页脚} % % 清除默认页眉页脚格式。 % \begin{macrocode} \fancyhf { } % \end{macrocode} % % \begin{variable}{\l_@@_header_center_mark_tl} % 用于保存中间页眉文字的变量。正文中将其设置为空,目录、摘要、符号表、 % 参考文献、附录、致谢、个人简历等设置为相应标题文字。 % \begin{macrocode} \tl_new:N \l_@@_header_center_mark_tl % \end{macrocode} % \end{variable} % % 关闭横线显示(未启用)。 % \begin{macrocode} % \RenewDocumentCommand \headrulewidth { } { 0 pt } % \end{macrocode} % % \begin{macro}{\cleardoublepage} % 重定义 \tn{cleardoublepage},使得偶数页面在没有内容时不显示页眉页脚,见 % \url{https://tex.stackexchange.com/a/1683}。最后清空中间页眉,确保正文部分 % 页眉显示正确。 % \begin{macrocode} \RenewDocumentCommand \cleardoublepage { } { \clearpage \bool_if:NT \g_@@_twoside_bool { \int_if_odd:nF \c@page { \hbox:n { } \thispagestyle{ empty } \newpage } } \tl_gset:Nn \l_@@_header_center_mark_tl { } } % \end{macrocode} % \end{macro} % % % \pkg{ctex} 宏包使用 \opt{heading} 选项后,会把页面格式设置为 |headings|。 % 因此必须在 \pkg{ctex} 调用之后重新设置 \cs{pagestyle} 为 |fancy|。 % \begin{macrocode} \pagestyle { fancy } % \end{macrocode} % % \changes{v1.11}{2022/04/02}{删除本科生目录页眉,并修正单面模式目录页眉。} % \changes{v1.13}{2022/05/26}{删除本科页眉题目中的换行符。} % % \begin{macro}{\frontmatter,\mainmatter} % 重定义 \tn{frontmatter}和\tn{mainmatter}, % 根据学校要求定制摘要、目录、主要符号对照表等前置及下文部分的页眉页脚。 % \begin{macrocode} \cs_gset_eq:NN \nwafuhead\fancyhead \cs_gset_eq:NN \nwafufoot\fancyfoot % \end{macrocode} % 重定义 \tn{frontmatter},带星号的命令不启用\cs{cleardoublepage}。 % \begin{macrocode} \RenewDocumentCommand{\frontmatter}{s O{Roman}} { % \end{macrocode} % 判断是否有*号参数 % \begin{macrocode} \IfBooleanTF{#1}{\clearpage}{\cleardoublepage} \@mainmatterfalse % \end{macrocode} % 页码格式 % \begin{macrocode} \pagenumbering{#2} % \end{macrocode} % 双面模式 % \begin{macrocode} \bool_if:NTF \g_@@_twoside_bool { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生奇数页页眉 % \begin{macrocode} \nwafuhead[OC]{\small \nouppercase{ \leftmark } } % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{ \small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } } }{ % \end{macrocode} % 本科生目录无页眉 % \begin{macrocode} \RenewDocumentCommand \headrulewidth { } { 0 pt } } }{ % \end{macrocode} % 单面模式,研究生奇偶页设成一样,本科生无页眉 % \begin{macrocode} \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \nwafuhead [ C ] { \small \nouppercase { \l_@@_header_center_mark_tl } } }{ \RenewDocumentCommand \headrulewidth { } { 0 pt } } } \nwafufoot[C]{\small\thepage} } % \end{macrocode} % 重定义 \tn{mainmatter},带星号的命令不会启用\cs{cleardoublepage}。 % \begin{macrocode} \RenewDocumentCommand{\mainmatter}{s} { % \end{macrocode} % 判断是否有*号参数 % \begin{macrocode} \IfBooleanTF{#1}{\clearpage}{\cleardoublepage} \@mainmattertrue % \end{macrocode} % 页码格式 % \begin{macrocode} \pagenumbering{arabic} % \end{macrocode} % 双面模式 % \begin{macrocode} \bool_if:NTF \g_@@_twoside_bool { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \nwafuhead[OC]{\small \nouppercase{ \leftmark } } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \RenewDocumentCommand \headrulewidth { } { 0.4 pt } \tl_set_eq:NN \l_tmpa_tl \l__@@_info_title_tl \tl_replace_all:Nnn \l_tmpa_tl { \\ } { ~ } \nwafuhead[EC]{\small \nouppercase{ \l_tmpa_tl } } } }{ % \end{macrocode} % 单面模式 % \begin{macrocode} \RenewDocumentCommand \headrulewidth { } { 0.4 pt } \nwafuhead [ C ] { \int_if_odd:nTF \c@page { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \small \nouppercase{ \leftmark } }{ \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \tl_set_eq:NN \l_tmpa_tl \l__@@_info_title_tl \tl_replace_all:Nnn \l_tmpa_tl { \\ } { ~ } \small \nouppercase{ \l_tmpa_tl } } } } } \int_compare:nNnTF{ \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生页脚 % \begin{macrocode} \nwafufoot[C]{\small\thepage} }{ % \end{macrocode} % 本科生页脚 % \begin{macrocode} \nwafufoot[C]{\small-\ \thepage\ -} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\bibmatter} % 新定义 \cs{bibmatter},以根据学校要求定制参考文献页眉页脚。 % \begin{macrocode} \NewDocumentCommand{\bibmatter}{s} { % \end{macrocode} % 判断是否有*号参数 % \begin{macrocode} \IfBooleanTF{#1}{\clearpage}{\cleardoublepage} \@mainmattertrue % \end{macrocode} % 是否为双面排版 % \begin{macrocode} \bool_if:NTF \g_@@_twoside_bool { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \nwafuhead[OC]{\small \nouppercase{ \leftmark } } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \leftmark } } } }{ % \end{macrocode} % 单面排版 % \begin{macrocode} \nwafuhead [ C ] { \int_if_odd:nTF \c@page { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \small \nouppercase{ \leftmark } }{ \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \leftmark } } } } } } % \end{macrocode} % \end{macro} % \begin{macro}{\appendix,\backmatter} % 为 \cs{appendix}和\cs{backmatter}命令追加代码, % 以根据学校要求定制附录及后置(致谢、个人简历等)页眉页脚。 % \begin{macrocode} \@@_appto_cmd:Nn \appendix { \clearpage \bool_if:NTF \g_@@_twoside_bool % \end{macrocode} % 双面 % \begin{macrocode} { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \nwafuhead[OC]{\small \nouppercase{ \@chapapp } } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \@chapapp } } } }{ % \end{macrocode} % 单面 % \begin{macrocode} \nwafuhead [ C ] { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \int_if_odd:nTF \c@page { \small \nouppercase{ \@chapapp } }{ \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \@chapapp } } } } } } \@@_appto_cmd:Nn \backmatter { \clearpage \bool_if:NTF \g_@@_twoside_bool { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \nwafuhead[OC]{\small \nouppercase{ \leftmark } } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ \leftmark } } } }{ % \end{macrocode} % 单面 % \begin{macrocode} \nwafuhead [ C ] { \int_if_odd:nTF \c@page { % \end{macrocode} % 奇数页页眉 % \begin{macrocode} \small \nouppercase{ \leftmark } }{ \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 % \begin{macrocode} \small \nouppercase{ \leftmark } } } } } } % \end{macrocode} % \end{macro} % % \subsection{章节标题设置} % % \begin{macro}{withchapter} % 设置本科论文章标题是否为章格式。 % \begin{macrocode} \keys_define:nn { nwafu / style } { withchapter .bool_set:N = \l_@@_withchap_bool, withchapter .default:n = true, withchapter .initial:n = true, } % \end{macrocode} % \end{macro} % % \subsection{是否预留签名位置} % % \begin{macro}{withsig} % 设置是否预留下签名。 % \begin{macrocode} \keys_define:nn { nwafu / style } { withsig .bool_set:N = \l_@@_withsignature_bool, withsig .default:n = true, withsig .initial:n = false, } % \end{macrocode} % \end{macro} % % \subsection{章编号格式设置} % % \begin{macro}{withchapter} % 设置论文章标题编号格式(中文/阿拉伯数字)。 % \begin{macrocode} \keys_define:nn { nwafu / style } { chapnum .choice:, chapnum .value_required:n = true, chapnum .choices:nn = { zh, en } { \int_set_eq:NN \g_@@_chapnum_int \l_keys_choice_int }, chapnum .initial:n = en, } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审判断变量。} % % \subsection{是否盲审} % % \begin{macro}{anonymous} % 设置是否为盲审论文输出。 % \begin{macrocode} \keys_define:nn { nwafu / style } { anonymous .bool_set:N = \l_@@_anonymous_bool, anonymous .default:n = true, anonymous .initial:n = false, } % \end{macrocode} % \end{macro} % % \changes{v1.11}{2022/04/02}{修订本科生subsubsection编号两端括号为中文全角括号。} % % |\keys_set:nn{ctex}| 实际相当于调用 \cs{ctexset}。 % % 设置章(chapter)、节(section)与小节(sub-section)标题样式。 % 此处使用 \kvopt{fixskip}{true} 选项来抑制前后的多余间距。 % % 设置标题级别 % \begin{macrocode} \cs_new_protected:Npn \@@_ctexset_caption: { \int_compare:nNnTF{ \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \keys_set:nn { ctex } { secnumdepth = 3, chapter = { pagestyle = fancy, aftername = \hspace*{1.0\ccwd}, format = \zihao{3} \normalfont \nwafu@hei \centering, beforeskip = 1.47\baselineskip, afterskip = 1.24\baselineskip, number = \chinese{ chapter }, fixskip = true }, section = { format = \zihao{-3} \normalfont \nwafu@hei \raggedright, beforeskip = 1.09\baselineskip, afterskip = 0.80\baselineskip, fixskip = true }, subsection = { format = \zihao{4} \normalfont \nwafu@hei \raggedright, beforeskip = 0.80\baselineskip, fixskip = true }, subsubsection = { format = \zihao{-4} \normalfont \nwafu@hei \raggedright, beforeskip = 0.40\baselineskip, afterskip = 0.40\baselineskip, fixskip = true } } }{ % \end{macrocode} % 本科生 % \begin{macrocode} \keys_set:nn { ctex } { secnumdepth = 3, chapter = { pagestyle = fancy, name = { \bool_if:NT \l_@@_withchap_bool {第}, \bool_if:NT \l_@@_withchap_bool {章} }, number = {% \int_compare:nNnTF { \g_@@_chapnum_int } = { 1 } { \chinese{ chapter } }{ \@@_arabic:n { chapter } } }, aftername = \hspace*{\ccwd}, format = \zihao{3} \normalfont \nwafu@hei \centering, beforeskip = 0.25\baselineskip, afterskip = 0.65\baselineskip, fixskip = true }, section = { aftername = \hspace*{0.5\ccwd}, format = \zihao{4} \normalfont \nwafu@hei \raggedright, beforeskip = 0.60\baselineskip, afterskip = 0.65\baselineskip, fixskip = true, afterindent = true, }, subsection = { aftername = \hspace*{0.5\ccwd}, format = \zihao{-4} \normalfont \nwafu@hei , beforeskip = 0.60\baselineskip, afterskip = 0.65\baselineskip, fixskip = true, afterindent = true, % indent = 2\ccwd, }, subsubsection = { name = {{\c_@@_fwid_left_paren_tl},{\c_@@_fwid_right_paren_tl}}, aftername = \hspace*{0.0pt}, number = \@@_arabic:n { subsubsection }, format = \zihao{-4} \normalfont, beforeskip = 0.60\baselineskip, afterskip = 0.65\baselineskip, fixskip = true, % afterindent = true, indent = 2\ccwd, } } } } \@@_ctexset_caption: % \end{macrocode} % % \begin{macro}{\@@_chapter:n,\@@_chapter:V} % 手动生成章标题,用于摘要、参考文献等。 % \begin{macrocode} \cs_new_protected:Npn \@@_chapter:n #1 { \group_begin: \ctexset { chapter / numbering = false } \chapter {#1} \@@_chapter_header:n {#1} \group_end: } \cs_generate_variant:Nn \@@_chapter:n { V } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_chapter_no_toc:n,\@@_chapter_no_toc:V} % 目录自身不应出现在目录中,需特别处理。参考 % \url{https://tex.stackexchange.com/a/1821}。 % \begin{macrocode} \cs_new_protected:Npn \@@_chapter_no_toc:n #1 { \chapter * {#1} \@@_chapter_header:n {#1} \pdfbookmark [0] {#1} { toc } } \cs_generate_variant:Nn \@@_chapter_no_toc:n { V } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_chapter_header:n} % 单面排版模式下,目录、摘要、符号表等的页眉中间为相应标题,左右为空。 % \begin{macrocode} \cs_new_protected:Npn \@@_chapter_header:n #1 { \bool_if:NTF \g_@@_twoside_bool { \markboth {#1} {#1} } { \markboth { } { } \tl_gset:Nn \l_@@_header_center_mark_tl {#1} } } % \end{macrocode} % \end{macro} % % \subsection{脚注} % % \emph{脚注部分的代码完全使用\cls{fduthesis}模板的代码}。 % % \subsubsection{编号样式} % % 各种脚注编号样式的名称。 % \begin{macrocode} \clist_map_inline:nn { { plain } { plain }, { libertinus } { libertinus }, { libertinus_neg } { libertinus* }, { libertinus_sans } { libertinus-sans }, { pifont } { pifont }, { pifont_neg } { pifont* }, { pifont_sans } { pifont-sans }, { pifont_sans_neg } { pifont-sans* }, { xits } { xits }, { xits_sans } { xits-sans }, { xits_sans_neg } { xits-sans* } } { \@@_define_fn_style:nn #1 } % \end{macrocode} % % \begin{variable}{\l_@@_fn_style_tl} % 保存当前使用的脚注编号样式。 % \begin{macrocode} \tl_new:N \l_@@_fn_style_tl % \end{macrocode} % \end{variable} % % \begin{macrocode} \keys_define:nn { nwafu / style } { % \end{macrocode} % % \begin{macro}{style/footnote-style} % 脚注类型共分四大类: % \begin{itemize} % \item \opt{plain}:使用当前字体; % \item \opt{libertinus}:取自 Libertinus Serif 和 Libertinus Sans % 字体; % \item \opt{pifont}:使用 \pkg{pifont} 宏包; % \item \opt{xits}:取自 XITS 字体。 % \end{itemize} % 不带任何修饰的为衬线阳文符号,带“|sans|”的为无衬线符号,带“|*|”的 % 为阴文版本。 % \begin{macrocode} footnote-style .choices:nn = { plain, libertinus, libertinus*, libertinus-sans, pifont, pifont*, pifont-sans, pifont-sans*, xits, xits-sans, xits-sans* } % \end{macrocode} % 若使用 \opt{pifont} 类型,则需引入 \pkg{pifont} 宏包。 % \begin{macrocode} { \tl_gset_eq:NN \l_@@_fn_style_tl \l_keys_choice_tl \int_compare:nT { 5 <= \l_keys_choice_int <= 8 } { \RequirePackage { pifont } } }, footnote-style .value_required:n = true } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_libertinus:n} % \opt{libertinus} 普通版。\numrange{1}{20} 为数字,\numrange{21}{46} % 为小写英文字母,\numrange{47}{72} 为大写英文字母。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_libertinus:n #1 { \int_compare:nTF { #1 >= 21 } { \int_compare:nTF { #1 >= 47 } { \@@_symbol:n { \int_eval:n { "24B6 - 47 + #1 } } } { \@@_symbol:n { \int_eval:n { "24D0 - 21 + #1 } } } } { \@@_symbol:n { \int_eval:n { "2460 - 1 + #1 } } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_libertinus_neg:n} % \opt{libertinus} 阴文衬线版。只含 \numrange{1}{20}。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_libertinus_neg:n #1 { \int_compare:nTF { #1 >= 11 } { \@@_symbol:n { \int_eval:n { "24EB - 11 + #1 } } } { \@@_symbol:n { \int_eval:n { "2776 - 1 + #1 } } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_libertinus_sans:n} % \opt{libertinus} 阳文无衬线版。符号排列与普通版相同。 % \begin{macrocode} \cs_new_eq:NN \@@_fn_symbol_libertinus_sans:n \@@_fn_symbol_libertinus:n % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_pifont:n} % \opt{pifont} 普通版。以下四种都只包含 \numrange{1}{10}。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_pifont:n #1 { \ding { \int_eval:n { 171 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_pifont_neg:n} % \opt{pifont} 阴文衬线版。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_pifont_neg:n #1 { \ding { \int_eval:n { 181 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_pifont_sans:n} % \opt{pifont} 阳文无衬线版。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_pifont_sans:n #1 { \ding { \int_eval:n { 191 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_pifont_sans_neg:n} % \opt{pifont} 阴文无衬线版。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_pifont_sans_neg:n #1 { \ding { \int_eval:n { 201 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_xits:n} % \opt{xits} 普通版。\numrange{1}{9} 为数字,\numrange{10}{35} % 为小写英文字母,\numrange{36}{61} 为大写英文字母。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_xits:n #1 { \int_compare:nTF { #1 >= 10 } { \int_compare:nTF { #1 >= 36 } { \@@_symbol:n { \int_eval:n { "24B6 - 36 + #1 } } } { \@@_symbol:n { \int_eval:n { "24D0 - 10 + #1 } } } } { \@@_symbol:n { \int_eval:n { "2460 - 1 + #1 } } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_xits_sans:n} % \opt{xits} 阳文无衬线版。只包含 \numrange{1}{10}。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_xits_sans:n #1 { \@@_symbol:n { \int_eval:n { "2780 - 1 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fn_symbol_xits_sans_neg:n} % \opt{xits} 阴文无衬线版。也只包含 \numrange{1}{10}。 % \begin{macrocode} \cs_new:Npn \@@_fn_symbol_xits_sans_neg:n #1 { \@@_symbol:n { \int_eval:n { "278A - 1 + #1 } } } % \end{macrocode} % \end{macro} % % \begin{macro}{\thefootnote} % 重定义脚注编号。 % \begin{macrocode} \cs_set:Npn \thefootnote { \nwafu_footnote_number:N \c@footnote } % \end{macrocode} % \end{macro} % % \begin{macro}{\nwafu_footnote_number:N} % 脚注编号样式。 % \begin{macrocode} \cs_new:Npn \nwafu_footnote_number:N #1 { \tl_case:NnF \l_@@_fn_style_tl { % \end{macrocode} % \opt{plain} 类型直接使用计数器 |footnote| 的值。 % \begin{macrocode} \c_@@_fn_style_plain_tl { \int_use:N #1 } % \end{macrocode} % \opt{libertinus} 类型需要使用 Libertinus Serif 或 % Libertinus Sans 字体。 % \begin{macrocode} \c_@@_fn_style_libertinus_tl { \fontspec { \g_@@_font_name_libertinus_serif_tl .otf } \@@_fn_symbol_libertinus:n {#1} } \c_@@_fn_style_libertinus_neg_tl { \fontspec { \g_@@_font_name_libertinus_serif_tl .otf } \@@_fn_symbol_libertinus_neg:n {#1} } \c_@@_fn_style_libertinus_sans_tl { \fontspec { \g_@@_font_name_libertinus_sans_tl .otf } \@@_fn_symbol_libertinus_sans:n {#1} } % \end{macrocode} % \opt{pifont} 类型无需进行额外的操作。 % \begin{macrocode} \c_@@_fn_style_pifont_tl { \@@_fn_symbol_pifont:n {#1} } \c_@@_fn_style_pifont_neg_tl { \@@_fn_symbol_pifont_neg:n {#1} } \c_@@_fn_style_pifont_sans_tl { \@@_fn_symbol_pifont_sans:n {#1} } \c_@@_fn_style_pifont_sans_neg_tl { \@@_fn_symbol_pifont_sans_neg:n {#1} } % \end{macrocode} % \opt{xits} 类型需要临时切换数学字体。 % \begin{macrocode} \c_@@_fn_style_xits_tl { \fontspec { \g_@@_font_name_xits_tl .otf } \@@_fn_symbol_xits:n {#1} } \c_@@_fn_style_xits_sans_tl { \fontspec { \g_@@_font_name_xits_tl .otf } \@@_fn_symbol_xits_sans:n {#1} } \c_@@_fn_style_xits_sans_neg_tl { \fontspec { \g_@@_font_name_xits_tl .otf } \@@_fn_symbol_xits_sans_neg:n {#1} } } % \end{macrocode} % 变量 \cs{l_@@_fn_style_tl} 保存的类型未知时,默认使用 \opt{plain} % 类型。 % \begin{macrocode} { \int_use:N #1 } } % \end{macrocode} % \end{macro} % % \subsubsection{整体样式} % % \begin{macro}[int]{\@makefntext} % 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \SI{1.5}{em}。 % 见 \url{http://tex.stackexchange.com/q/19844} 和 % \url{https://www.zhihu.com/question/53030087}。 % \begin{macrocode} \cs_set:Npn \@makefntext #1 { \mode_leave_vertical: \hbox_to_wd:nn { 1.5 em } { \@thefnmark \hfil } #1 } % \end{macrocode} % \end{macro} % % \subsection{定理环境} % % \emph{定理环境部分的代码完全使用\cls{fduthesis}模板的代码}。 % % \begin{variable}{\c_@@_thm_style_plain_clist, % \c_@@_thm_style_break_clist} % 保存 \opt{plain}、\opt{break} 两种类型的定理样式名称。 % \begin{macrocode} \clist_const:Nn \c_@@_thm_style_plain_clist { plain, margin, change } \clist_const:Nn \c_@@_thm_style_break_clist { break, marginbreak, changebreak } % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_thm_style_tl, % \l_@@_thm_header_font_tl, % \l_@@_thm_body_font_tl, % \l_@@_thm_qed_tl, % \l_@@_thm_counter_tl} % 定理所需的一些字段。 % \begin{macrocode} \tl_new:N \l_@@_thm_style_tl \tl_new:N \l_@@_thm_header_font_tl \tl_new:N \l_@@_thm_body_font_tl \tl_new:N \l_@@_thm_qed_tl \tl_new:N \l_@@_thm_counter_tl % \end{macrocode} % \end{variable} % % \begin{macro}{theorem/style, % theorem/header-font, % theorem/body-font, % theorem/qed, % theorem/counter} % 定义 |nwafu/theorem| 键值类。 % \begin{macrocode} \keys_define:nn { nwafu / theorem } { style .tl_set:N = \l_@@_thm_style_tl, header-font .tl_set:N = \l_@@_thm_header_font_tl, body-font .tl_set:N = \l_@@_thm_body_font_tl, qed .tl_set:N = \l_@@_thm_qed_tl, counter .tl_set:N = \l_@@_thm_counter_tl } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_thm_ntheorem_style:n,\@@_thm_ntheorem_new:w} % 拷贝 \pkg{ntheorem} 命令。 % \begin{macrocode} \cs_new_eq:NN \@@_thm_ntheorem_style:n \theoremstyle \cs_new_eq:NN \@@_thm_ntheorem_new:w \newtheorem % \end{macrocode} % \end{macro} % % \begin{macro}{\newtheorem} % 定义新的定理环境。 % \begin{macrocode} \RenewDocumentCommand \newtheorem { s o m m } { % \end{macrocode} % 默认情况下,由 \cs{newtheorem*} 创建的定理其证毕符号为 \cs{QED}, % 而由 \cs{new\-the\-orem} 创建的则不带证毕符号。符号 \cs{QED} 由 % \pkg{unicode-math} 宏包提供。 % \begin{macrocode} \IfBooleanTF {#1} { \tl_set:Nn \l_@@_thm_qed_tl { \ensuremath { \QED } } } { \tl_set:Nn \l_@@_thm_qed_tl { } } % \end{macrocode} % 设置默认样式为 \opt{plain}。 % \begin{macrocode} \tl_set:Nn \l_@@_thm_style_tl { plain } % \end{macrocode} % 处理可选参数。利用 |nwafu/theorem| 键值对设置,并按此修改证毕符号、 % 定理头字体和定理正文字体。 % \begin{macrocode} \IfValueT {#2} { \keys_set:nn { nwafu / theorem } {#2} } \nwafu_thm_set_header_font:V \l_@@_thm_header_font_tl \nwafu_thm_set_body_font:V \l_@@_thm_body_font_tl \nwafu_thm_set_qed:V \l_@@_thm_qed_tl % \end{macrocode} % \cs{newtheorem} 负责创建编号定理,而 \cs{newtheorem*} % 则负责创建无编号定理。以下分这两种情况处理。 % \begin{macrocode} \IfBooleanTF {#1} { % \end{macrocode} % 带 |*| 的版本原则上只接受 \opt{plain} 和 \opt{break} 两种样式, % 其余样式将被转换成这两者其中之一。 % \begin{macrocode} \clist_if_in:nVF { plain, break } \l_@@_thm_style_tl { \clist_if_in:NVTF \c_@@_thm_style_plain_clist \l_@@_thm_style_tl { \@@_thm_redefine_style:n { plain } } { \clist_if_in:NVTF \c_@@_thm_style_break_clist \l_@@_thm_style_tl { \@@_thm_redefine_style:n { break } } { \@@_error:nx { unknown-theorem-style } { \l_@@_thm_style_tl } } } } % \end{macrocode} % \pkg{ntheorem} 宏包提供的无编号定理带有 |nonumber| 前缀, % 这里将其加上。 % \begin{macrocode} \tl_put_left:Nn \l_@@_thm_style_tl { nonumber } \nwafu_thm_new_no_number:Vxx \l_@@_thm_style_tl {#3} {#4} } { % \end{macrocode} % 不带 |*| 的版本支持不含“|nonumber|”的所有定理样式。 % \begin{macrocode} \clist_clear:N \l_@@_tmpa_clist \clist_concat:NNN \l_@@_tmpa_clist \c_@@_thm_style_plain_clist \c_@@_thm_style_break_clist \clist_if_in:NVF \l_@@_tmpa_clist \l_@@_thm_style_tl { \@@_error:nx { unknown-theorem-style } { \l_@@_thm_style_tl } } \nwafu_thm_new:VVxx \l_@@_thm_style_tl \l_@@_thm_counter_tl {#3} {#4} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_thm_redefine_style:n} % 重定义定理样式,并给出警告。 % \begin{macrocode} \cs_new:Npn \@@_thm_redefine_style:n #1 { \@@_warning:nxx { redefine-theorem-style } {#1} { \l_@@_thm_style_tl } \tl_set:Nn \l_@@_thm_style_tl {#1} } % \end{macrocode} % \end{macro} % % 提示信息。 % \begin{macrocode} \@@_msg_new:nn { redefine-theorem-style } { Theorem~ style~ "#2"~ will~ be~ redefined~ as~ "#1". } \@@_msg_new:nn { unknown-theorem-style } { Theorem~ style~ "#1"~ is~ unknown. } % \end{macrocode} % % \begin{macro}{\nwafu_thm_new:nnnn,\nwafu_thm_new:VVxx} % 带编号的定理环境。 % \begin{arguments} % \item 样式 % \item 计数器 % \item 定理环境名称 % \item 定理头文字 % \end{arguments} % \begin{macrocode} \cs_new:Npn \nwafu_thm_new:nnnn #1#2#3#4 { \@@_thm_ntheorem_style:n {#1} \@@_thm_ntheorem_new:w {#3} {#4} [#2] } \cs_generate_variant:Nn \nwafu_thm_new:nnnn { VVxx } % \end{macrocode} % \end{macro} % % \begin{macro}{\nwafu_thm_new_no_number:nnn, % \nwafu_thm_new_no_number:Vxx} % 不带编号的定理环境。 % \begin{arguments} % \item 样式 % \item 定理环境名称 % \item 定理头文字 % \end{arguments} % \begin{macrocode} \cs_new:Npn \nwafu_thm_new_no_number:nnn #1#2#3 { \@@_thm_ntheorem_style:n {#1} \@@_thm_ntheorem_new:w {#2} {#3} } \cs_generate_variant:Nn \nwafu_thm_new_no_number:nnn { Vxx } % \end{macrocode} % \end{macro} % % \begin{macro}{\nwafu_thm_set_qed:n, % \nwafu_thm_set_header_font:n, % \nwafu_thm_set_body_font:n, % \nwafu_thm_set_qed:V, % \nwafu_thm_set_header_font:V, % \nwafu_thm_set_body_font:V} % 封装 \pkg{ntheorem} 宏包提供的若干命令,分别用以设置证毕符号、 % 定理头字体和定理正文字体。 % \begin{macrocode} \cs_new:Npn \nwafu_thm_set_qed:n #1 { \theoremsymbol {#1} } \cs_new:Npn \nwafu_thm_set_header_font:n #1 { \theoremheaderfont {#1} } \cs_new:Npn \nwafu_thm_set_body_font:n #1 { \theorembodyfont {#1} } \cs_generate_variant:Nn \nwafu_thm_set_qed:n { V } \cs_generate_variant:Nn \nwafu_thm_set_header_font:n { V } \cs_generate_variant:Nn \nwafu_thm_set_body_font:n { V } % \end{macrocode} % \end{macro} % % \begin{macro}{\theequation} % 重定义公式编号。 % \begin{macrocode} \cs_set:Npn \theequation { \thechapter - \@@_arabic:n { equation } } % \end{macrocode} % \end{macro} % % \changes{v1.12}{2022/05/24}{修订图表题注西文为加粗。} % % \subsection{图表及其浮动体} % % 分别设置浮动体 \env{figure} 和 \env{table} 的标题样式。 % \begin{macrocode} \DeclareCaptionLabelSeparator{ccwd}{\hspace{0.5\ccwd}} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} \DeclareCaptionFont{nwafu@table@font}{\nwafu@hei\bfseries\small} \DeclareCaptionFont{nwafu@figure@font}{\nwafu@hei\bfseries\small} \DeclareCaptionFont{nwafu@subtable@font}{\small} \DeclareCaptionFont{nwafu@subfigure@font}{\small} % \end{macrocode} % 图表题注设置。 % \begin{macrocode} \captionsetup { format = hang, font = {stretch = 1}, labelsep = ccwd, singlelinecheck = true, skip = 4bp, } % \end{macrocode} % 图表题注字体设置。 % \begin{macrocode} \captionsetup[table]{font += nwafu@table@font} \captionsetup[longtable]{font += nwafu@table@font} \captionsetup[figure]{font += nwafu@figure@font} % \end{macrocode} % 子图题注设置。 % \begin{macrocode} \captionsetup[subfigure] { labelformat = parens, font = nwafu@subfigure@font, belowskip = 2pt, aboveskip = 6pt } % \end{macrocode} % 设置双语标题前缀 % 直接采用类似\cs{captionsetup}[figure][bi-first]{name=图} % 设置会与longtable宏包的caption冲突 % 需要改成如下设置,[]中的可选参数可以根据需要选择 % \begin{macrocode} \DeclareCaptionOption{bi-first}[format=hang,hangindent=-0.5em]{ \def\tablename{表} \def\figurename{图} } \DeclareCaptionOption{bi-second}[format=hang,hangindent=-2em]{ \def\tablename{Tab.} \def\figurename{Fig.} } \captionsetup[bi-first]{bi-first} \captionsetup[bi-second]{bi-second} % \AddToHook { env/figure/end } { \centering } \AddToHook { env/table/end } { \centering } % % \end{macrocode} % 在tabular、tabularx、longtable环境开始处添加代码, % 设置表格行距和字号。 % \begin{macrocode} \@@_at_begin_environment:nn { tabular,longtable } { \exp_args:Nx \linespread { 1.05 } \small\selectfont\ignorespaces } % \end{macrocode} % % \begin{macro}{\thefigure,\thetable} % 重定义图表编号。 % \begin{macrocode} \cs_set:Npn \thefigure { \thechapter - \@@_arabic:n { figure } } \cs_set:Npn \thetable { \thechapter - \@@_arabic:n { table } } % \end{macrocode} % \end{macro} % % \subsection{封面} % % \subsubsection{信息录入} % % \begin{variable}{\l_@@_info_title_tl, % \l_@@_info_date_tl, % \l_@@_info_grade_tl, % \l_@@_info_enroll_tl, % \l_@@_info_author_tl, % \l_@@_info_supervisor_tl, % \l_@@_info_cosupervisor_tl, % \l_@@_info_department_tl, % \l_@@_info_major_tl, % \l_@@_info_researchfield_tl, % \l_@@_info_professionaltype_tl, % \l_@@_info_professionalfield_tl, % \l_@@_info_class_id_tl, % \l_@@_info_student_id_tl, % \l_@@_info_school_id_tl, % \l_@@_info_clc_tl, % \l_@@_info_defensedate_tl, % \l_@@_info_instructors_clist, % \l_@@_info_defensecommittees_clist, % \l_@@_info_foundation_clist} % 封面所需的一些字段。 % \begin{macrocode} \clist_map_inline:nn { title, date, grade, enroll, author, supervisor, cosupervisor department, major, researchfield, professionaltype, professionalfield, class_id, student_id, school_id, clc, defensedate, udc } { \tl_new:c { l_@@_info_ #1 _tl } } \clist_new:N \l_@@_info_instructors_clist \clist_new:N \l_@@_info_defensecommittees_clist \clist_new:N \l_@@_info_foundation_clist % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_info_title_en_tl, % \l_@@_info_author_en_tl, % \l_@@_info_supervisor_en_tl, % \l_@@_info_cosupervisor_en_tl, % \l_@@_info_department_en_tl, % \l_@@_info_major_en_tl, % \l_@@_info_mastertype_en_tl, % \l_@@_info_researchfield_en_tl, % \l_@@_info_professionaltype_en_tl, % \l_@@_info_professionalfield_en_tl, % \l_@@_info_date_en_tl} % 对应的英文字段。 % \begin{macrocode} \clist_map_inline:nn { title, author, supervisor, cosupervisor, department, major, mastertype, researchfield, professionaltype, professionalfield,date } { \tl_new:c { l_@@_info_ #1 _en_tl } } % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_info_degree_type_int} % 学位类型。1 为学术学位,2 为专业学位。仅对研究生有效。 % \begin{macrocode} \int_new:N \l_@@_info_degree_type_int % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_info_bachelor_type_int} % 本科生毕业类型。1 为论文,2 为设计。仅对本科生有效。 % \begin{macrocode} \int_new:N \l_@@_info_bachelor_type_int % \end{macrocode} % \end{variable} % % 定义 |nwafu/info| 键值类。 % \begin{macrocode} \keys_define:nn { nwafu / info } { % \end{macrocode} % % \begin{macro}{info/degree} % 学位类型。只对硕士论文有效。 % \begin{macrocode} degree .choices:nn = { academic, professional } { \int_set_eq:NN \l_@@_info_degree_type_int \l_keys_choice_int }, % \end{macrocode} % \end{macro} % % \begin{macro}{info/btype} % 本科生毕业类型。仅对本科生有效。 % \begin{macrocode} btype .choice:, btype .value_required:n = true, btype .choices:nn = { paper, design } { \int_set_eq:NN \l_@@_info_bachelor_type_int \l_keys_choice_int }, btype .initial:n = paper, % \end{macrocode} % \end{macro} % % \begin{macro}{info/title,info/title*} % 论文题目。以下带星号的项目均表示相应的英文字段。 % \begin{macrocode} title .tl_set:N = \l_@@_info_title_tl, title* .tl_set:N = \l_@@_info_title_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/date, info/date*} % 论文完成日期。 % \begin{macrocode} date .tl_set:N = \l_@@_info_date_tl, date* .tl_set:N = \l_@@_info_date_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/grade} % 毕业年份(届)。 % \begin{macrocode} grade .tl_set:N = \l_@@_info_grade_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/enroll} % 入学年份(级)。 % \begin{macrocode} enroll .tl_set:N = \l_@@_info_enroll_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/author,info/author*} % 作者姓名。 % \begin{macrocode} author .tl_set:N = \l_@@_info_author_tl, author* .tl_set:N = \l_@@_info_author_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/supervisor,info/supervisor*} % 导师姓名。 % \begin{macrocode} supervisor .tl_set:N = \l_@@_info_supervisor_tl, supervisor* .tl_set:N = \l_@@_info_supervisor_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/cosupervisor, info/cosupervisor} % 协助指导教师。 % \begin{macrocode} cosupervisor .tl_set:N = \l_@@_info_cosupervisor_tl, cosupervisor* .tl_set:N = \l_@@_info_cosupervisor_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/instructors} % 指导小组成员。 % \begin{macrocode} instructors .clist_set:N = \l_@@_info_instructors_clist, % \end{macrocode} % \end{macro} % % \begin{macro}{info/defensecommittees} % 答辩委员会成员,每个成员包含单位、姓名、职称。仅研究生需要。 % \begin{macrocode} defensecommittees .clist_set:N = \l_@@_info_defensecommittees_clist, % \end{macrocode} % \end{macro} % % \begin{macro}{info/defensedate} % 论文答辩日期。 % \begin{macrocode} defensedate .tl_set:N = \l_@@_info_defensedate_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/foundation} % 资助项目,每个项目包含项目类型、项目名称、项目编号。仅研究生需要。 % \begin{macrocode} foundation .clist_set:N = \l_@@_info_foundation_clist, % \end{macrocode} % \end{macro} % % \begin{macro}{info/department,info/department*} % 院系。 % \begin{macrocode} department .tl_set:N = \l_@@_info_department_tl, department* .tl_set:N = \l_@@_info_department_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/major,info/major*} % 专业。 % \begin{macrocode} major .tl_set:N = \l_@@_info_major_tl, major* .tl_set:N = \l_@@_info_major_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/mastertype} % 硕士学位类型英文名称,仅硕士需要。 % \begin{macrocode} mastertype .tl_set:N = \l_@@_info_mastertype_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/researchfield,info/researchfield*} % 研究方向,仅博士、学历硕士需要。 % \begin{macrocode} researchfield .tl_set:N = \l_@@_info_researchfield_tl, researchfield* .tl_set:N = \l_@@_info_researchfield_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/professionaltype,info/professionaltype*} % 专业学位类型,仅专业学位硕士需要。 % \begin{macrocode} professionaltype .tl_set:N = \l_@@_info_professionaltype_tl, professionaltype* .tl_set:N = \l_@@_info_professionaltype_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/professionalfield,info/professionalfield*} % 领域名称,仅专业学位硕士需要。 % \begin{macrocode} professionalfield .tl_set:N = \l_@@_info_professionalfield_tl, professionalfield* .tl_set:N = \l_@@_info_professionalfield_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/class-id} % 班级号。仅本科生需要 % \begin{macrocode} class-id .tl_set:N = \l_@@_info_class_id_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/student-id} % 学号。 % \begin{macrocode} student-id .tl_set:N = \l_@@_info_student_id_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/school-id} % 学校代码。 % \begin{macrocode} school-id .tl_set:N = \l_@@_info_school_id_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/clc} % 中图分类号。 % \begin{macrocode} clc .tl_set:N = \l_@@_info_clc_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{info/udc} % UDC码。 % \begin{macrocode} udc .tl_set:N = \l_@@_info_udc_tl, } % \end{macrocode} % \end{macro} % % \begin{variable}{\l_@@_cover_logo_tl,\l_@@_cover_logo_size_clist} % \begin{macrocode} \tl_new:N \l_@@_cover_logo_tl \clist_new:N \l_@@_cover_logo_size_clist % \end{macrocode} % \end{variable} % % \begin{macro}{style/logo,style/logo-size} % 校名图片的文件名和尺寸。 % \begin{macrocode} \keys_define:nn { nwafu / style } { logo .tl_set:N = \l_@@_cover_logo_tl, logo-size .clist_set:N = \l_@@_cover_logo_size_clist } % \end{macrocode} % \end{macro} % % \subsubsection{密级} % % \begin{variable}{\l_@@_secret_bool} % 是否显示密级。 % \begin{macrocode} \bool_new:N \l_@@_secret_bool % \end{macrocode} % \end{variable} % % \begin{variable}{\l_@@_info_secret_level_tl} % 保存当前的密级。 % \begin{macrocode} \tl_new:N \l_@@_info_secret_level_tl % \end{macrocode} % \end{variable} % % \begin{macrocode} \keys_define:nn { nwafu / info } { % \end{macrocode} % % \begin{macro}{info/secret-level} % 密级。\opt{none} 表示公开,\opt{i}、\opt{ii}、\opt{iii}、\opt{iv} 分别为 % 限制、秘密、机密、绝密。 % \begin{macrocode} secret-level .choices:nn = { none, i, ii, iii, iv } { \int_compare:nNnTF { \l_keys_choice_int } > { 1 } { \bool_set_true:N \l_@@_secret_bool \tl_set:Nn \l_@@_info_secret_level_tl { \clist_item:Nn \c_@@_secret_clist { \l_keys_choice_int - 1 } } } { \bool_set_false:N \l_@@_secret_bool \tl_set:Nn \l_@@_info_secret_level_tl { 公开 } } }, secret-level .value_required:n = true, } % \end{macrocode} % \end{macro} % % \subsubsection{内部函数} % % \begin{macro}{\@@_spread_box:nn,\@@_spread_box:Vn,\@@_spread_box:nV} % 分散对齐的水平盒子。 % \begin{arguments} % \item 宽度 % \item 内容 % \end{arguments} % 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip} % 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。 % |#2| 需要完全展开以避免 underfull 警告。 % \begin{macrocode} \cs_new_protected:Npn \@@_spread_box:nn #1#2 { \mode_leave_vertical: \hbox_to_wd:nn {#1} { \tl_map_inline:xn {#2} { ##1 \hfil } \unskip } } \cs_generate_variant:Nn \@@_spread_box:nn { Vn } \cs_generate_variant:Nn \@@_spread_box:nn { nV } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_center_box:nn,\@@_center_box:Vn} % 居中对齐的下划线水平盒子。 % \begin{macrocode} \cs_new_protected:Npn \@@_center_box:nn #1#2 { \mode_leave_vertical: \dim_set:Nn \l_@@_tmpt_dim {#1} \dim_add:Nn \l_@@_tmpt_dim {0.6em} \makebox[0cm][l]{\rule[-0.5ex]{\l_@@_tmpt_dim}{0.4 pt}} \hbox_to_wd:nn {\l_@@_tmpt_dim} { \hfil #2 \hfil } } \cs_generate_variant:Nn \@@_center_box:nn { Vn } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fixed_width_box:nn,\@@_fixed_width_box:Vn} % 限宽盒子(允许换行)。 % \begin{macrocode} \cs_new:Npn \@@_fixed_width_box:nn #1#2 { \parbox {#1} {#2} } \cs_generate_variant:Nn \@@_fixed_width_box:nn { Vn } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_fixed_width_center_box:nn} % 居中对齐的限宽盒子(允许换行)。 % \begin{macrocode} \cs_new:Npn \@@_fixed_width_center_box:nn #1#2 { \parbox {#1} { \centering #2 } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_get_text_width:Nn,\@@_get_text_width:NV} % 获取文本宽度,并存入 |dim| 型变量。 % \begin{arguments} % \item |dim| 型变量 % \item 内容 % \end{arguments} % \begin{macrocode} \cs_new:Npn \@@_get_text_width:Nn #1#2 { \hbox_set:Nn \l_@@_tmpa_box {#2} \dim_set:Nn #1 { \box_wd:N \l_@@_tmpa_box } } \cs_generate_variant:Nn \@@_get_text_width:Nn { NV } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_get_max_text_width:NN} % 获取多个文本中的最大宽度,并存入 |dim| 型变量。 % \begin{arguments} % \item |dim| 型变量 % \item 文本 |clist| % \end{arguments} % 当 \cs{l_@@_tmpa_clist} 非空时,弹出最后一个元素 % 赋给 \cs{l_@@_tmpa_tl},获取其长度后与 |#1| 进行比较, % 二者中较大的那一个将成为 |#1| 的新值。 % 不断循环,直至 \cs{l_@@_tmpa_clist} 为空。 % \begin{macrocode} \cs_new:Npn \@@_get_max_text_width:NN #1#2 { % \end{macrocode} % 这里用 |group| 确保局部变量不会被污染。 % \begin{macrocode} \group_begin: \dim_set:Nn #1 {-999pt} \clist_set_eq:NN \l_@@_tmpt_clist #2 \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpt_clist } { \clist_pop:NN \l_@@_tmpt_clist \l_@@_tmpt_tl \@@_get_text_width:NV \l_@@_tmpt_dim \l_@@_tmpt_tl \dim_gset:Nn #1 { \dim_max:nn {#1} { \l_@@_tmpt_dim } } } \group_end: } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_blank_underline:n} % 下划线占位符。|#1|: 长度。 % \begin{macrocode} \cs_new:Npn \@@_blank_underline:n #1 { \rule [ -0.5 ex ] {#1} { 0.4 pt } } \cs_generate_variant:Nn \@@_blank_underline:n { V } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_text_uline:n,\@@_text_uline:V} % 下划线文字。|#1|: 文字。 % \begin{macrocode} \cs_new:Npn \@@_text_uline:n #1 { \@@_get_text_width:Nn \l_@@_tmpt_dim {#1} \dim_add:Nn \l_@@_tmpt_dim {0.6em} \makebox[0cm][l]{\rule[-0.5ex]{\l_@@_tmpt_dim}{0.4 pt}} \rule{.3em}{0cm}#1\rule{.3em}{0cm} } \cs_generate_variant:Nn \@@_text_uline:n { V } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_line_spread:N,\@@_line_spread:n} % 设置行距。|#1|: 行距倍数 |fp| 变量。 % \begin{macrocode} \cs_new:Npn \@@_line_spread:N #1 { \linespread { \fp_use:N #1 } \selectfont } \cs_new:Npn \@@_line_spread:n #1 { \linespread {#1} \selectfont } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏学号。} % % \subsubsection{封面各部件} % % \begin{macro}{\@@_cover_id:,\@@_cover_id_aux:n} % 封面中的中图分类号、udc码、密级、学校代码和学号。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_id: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \group_begin: % \end{macrocode} % 将中图分类号、udc码和密级名称常量存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_clear:N \l_@@_tmpa_clist \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_clc_tl }, { \c_@@_name_udc_tl }, { \c_@@_name_secret_level_tl } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 将中图分类号、udc码和密级变量值存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_clc_tl }, { \l_@@_info_udc_tl }, { \l_@@_info_secret_level_tl } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist % \end{macrocode} % 将学校代码、研究生学号标记名称存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpc_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpc_clist { { \c_@@_name_school_id_tl }, { }, { \c_@@_name_student_id_tl } } \@@_get_max_text_width:NN \l_@@_tmpc_dim \l_@@_tmpc_clist % \end{macrocode} % 将学校代码、研究生学号变量值存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpd_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpd_clist { { \l_@@_info_school_id_tl }, { }, { \c_@@_name_anonid_tl } } }{ \clist_set:Nx \l_@@_tmpd_clist { { \l_@@_info_school_id_tl }, { }, { \l_@@_info_student_id_tl } } } \@@_get_max_text_width:NN \l_@@_tmpd_dim \l_@@_tmpd_clist % \end{macrocode} % 用minipage环境通过循环输出结果。 % \begin{macrocode} \begin{minipage} [ c ] { \textwidth } \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \clist_pop:NN \l_@@_tmpc_clist \l_@@_tmpc_tl \clist_pop:NN \l_@@_tmpd_clist \l_@@_tmpd_tl % \end{macrocode} % udc码标记需要左对齐。 % \begin{macrocode} \tl_if_eq:NNTF \l_@@_tmpa_tl \c_@@_name_udc_tl { \@@_fixed_width_box:Vn \l_@@_tmpa_dim { \l_@@_tmpa_tl } }{ \@@_spread_box:Vn \l_@@_tmpa_dim { \l_@@_tmpa_tl } } \c_@@_fwid_colon_tl \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } \hfill % \end{macrocode} % 用空值占有一行。 % \begin{macrocode} \tl_if_empty:NTF \l_@@_tmpc_tl { }{ \@@_spread_box:Vn \l_@@_tmpc_dim { \l_@@_tmpc_tl } \c_@@_fwid_colon_tl \@@_center_box:Vn \l_@@_tmpd_dim { \l_@@_tmpd_tl } } \par } \end{minipage} \group_end: } { % \end{macrocode} % 本科生。 % \begin{macrocode} \@@_fixed_width_box:nn { 120 pt } { \@@_cover_id_aux:n { student_id } } } } \cs_new:Npn \@@_cover_id_aux:n #1 { \tl_use:c { c_@@_name_ #1 _tl } \c_@@_fwid_colon_tl \bool_if:NTF \l_@@_anonymous_bool { \@@_text_uline:V \c_@@_name_anonid_tl }{ \@@_text_uline:n {\tl_use:c { l_@@_info_ #1 _tl }} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_cover_logo:} % 插入校名图片。根据参数 \opt{width} 和 \opt{height} 是否为空依次 % 判断。\cs{l_@@_cover_logo_size_clist} 中超过两个的参数将被忽略。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_logo: { \clist_pop:NN \l_@@_cover_logo_size_clist \l_@@_tmpa_tl \clist_pop:NNTF \l_@@_cover_logo_size_clist \l_@@_tmpb_tl { \tl_if_empty:NTF \l_@@_tmpa_tl { \includegraphics [ height = \l_@@_tmpb_tl ] } { \includegraphics [ width = \l_@@_tmpa_tl, height = \l_@@_tmpb_tl ] } } { \includegraphics [ width = \l_@@_tmpa_tl ] } { \l_@@_cover_logo_tl } } % \end{macrocode} % \end{macro} % % \changes{v1.11}{2022/04/03}{利用PDF literal添加本科楷体伪粗。} % % \begin{macro}{\@@_cover_type:} % 论文类型。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_type: { \tl_set:Nx \l_@@_tmpa_tl { % \end{macrocode} % 取出论文类型。 % \begin{macrocode} \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生论文。 % \begin{macrocode} \@@_spread_box:nn { 0.75 \textwidth } { \l_@@_tmpa_tl } }{ % \end{macrocode} % 本科生毕业年份(届)。 % \begin{macrocode} \@@_get_text_width:NV \l__@@_tmpa_dim \l__@@_info_grade_tl \@@_center_box:Vn \l__@@_tmpa_dim { \l__@@_info_grade_tl } % \end{macrocode} % 利用PDF literal伪粗显示楷体。 % \begin{macrocode} \@@_fake_bold:nn {0.20} { \@@_spread_box:nn { 0.50 \textwidth } { 届 \l_@@_tmpa_tl % \end{macrocode} % 本科的论文或设计选择。 % \begin{macrocode} \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int } } } } } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏中文作者与导师。} % % \begin{macro}{\@@_cover_info:} % 作者信息栏。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info: { \begin{minipage} [ c ] { \textwidth } \centering % \end{macrocode} % 根据论文类型(博士、硕士、本科)输出不同信息 % \begin{macrocode} \int_case:nn {\g_@@_thesis_type_int} { % \end{macrocode} % 博士论文 % \begin{macrocode} {1}{ % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_major_tl }, { \c_@@_name_researchfield_tl }, { \c_@@_name_author_tl }, { \c_@@_name_supervisor_tl }, { \c_@@_name_cosupervisor_tl }, { \c_@@_name_date_tl } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_tl }, { \l_@@_info_researchfield_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \l_@@_info_date_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_tl }, { \l_@@_info_researchfield_tl }, { \l_@@_info_author_tl }, { \l_@@_info_supervisor_tl }, { \l_@@_info_cosupervisor_tl }, { \l_@@_info_date_tl } } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist } % \end{macrocode} % 硕士论文 % \begin{macrocode} {2}{ \int_case:nn {\l_@@_info_degree_type_int} { % \end{macrocode} % 学术硕士 % \begin{macrocode} {1}{ % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_major_tl }, { \c_@@_name_researchfield_tl }, { \c_@@_name_author_tl }, { \c_@@_name_supervisor_tl }, { \c_@@_name_cosupervisor_tl }, { \c_@@_name_date_tl } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_tl }, { \l_@@_info_researchfield_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \l_@@_info_date_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_tl }, { \l_@@_info_researchfield_tl }, { \l_@@_info_author_tl }, { \l_@@_info_supervisor_tl }, { \l_@@_info_cosupervisor_tl }, { \l_@@_info_date_tl } } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist } % \end{macrocode} % 专业学位硕士 % \begin{macrocode} {2}{ % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_professionaltype_tl }, { \c_@@_name_professionalfield_tl }, { \c_@@_name_author_tl }, { \c_@@_name_supervisor_tl }, { \c_@@_name_cosupervisor_tl }, { \c_@@_name_date_tl } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_professionaltype_tl }, { \l_@@_info_professionalfield_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \l_@@_info_date_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_professionaltype_tl }, { \l_@@_info_professionalfield_tl }, { \l_@@_info_author_tl }, { \l_@@_info_supervisor_tl }, { \l_@@_info_cosupervisor_tl }, { \l_@@_info_date_tl } } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist } } } % \end{macrocode} % 本科论文 % \begin{macrocode} {3}{ % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_department_tl }, { \c_@@_name_major_tl }, { \c_@@_name_enroll_tl\c_@@_name_class_id_tl }, { \c_@@_name_author_tl }, { \c_@@_name_supervisor_tl }, { \c_@@_name_cosupervisor_tl }, { \c_@@_name_date_tl } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_department_tl }, { \l_@@_info_major_tl }, { \l_@@_info_enroll_tl 级 \l_@@_info_class_id_tl 班 }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \l_@@_info_date_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_department_tl }, { \l_@@_info_major_tl }, { \l_@@_info_enroll_tl 级 \l_@@_info_class_id_tl 班 }, { \l_@@_info_author_tl }, { \l_@@_info_supervisor_tl }, { \l_@@_info_cosupervisor_tl }, { \l_@@_info_date_tl } } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist } } % \end{macrocode} % 用循环输出各字段。 % \begin{macrocode} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \@@_spread_box:Vn \l_@@_tmpa_dim { \l_@@_tmpa_tl } \c_@@_fwid_colon_tl \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } \skip_vertical:n { 1 ex } } \end{minipage} } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏英文作者与导师。} % % \begin{macro}{\@@_cover_info_en:} % 英文作者信息栏,仅对研究生有效。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_en: { \int_case:nn {\g_@@_thesis_type_int} { {1}{ % \end{macrocode} % 计算各标识名称和信息字段的总计宽度,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { {\c_@@_name_major_en_tl{\l_@@_info_major_en_tl} }, {\c_@@_name_researchfield_en_tl{\l_@@_info_researchfield_en_tl} }, {\c_@@_name_author_en_tl{\l_@@_info_author_en_tl} }, {\c_@@_name_supervisor_en_tl{\l_@@_info_supervisor_en_tl} }, {\c_@@_name_cosupervisor_en_tl{\l_@@_info_cosupervisor_en_tl} }, {\c_@@_name_date_en_tl{\l_@@_info_date_en_tl} } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 将宽度值适当放宽。 % \begin{macrocode} \dim_add:Nn \l_@@_tmpa_dim {2.5em} \begin{minipage} [ c ] { \l_@@_tmpa_dim } \flushleft % \end{macrocode} % 读取作者信息标识变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_major_en_tl }, { \c_@@_name_researchfield_en_tl }, { \c_@@_name_author_en_tl }, { \c_@@_name_supervisor_en_tl }, { \c_@@_name_cosupervisor_en_tl }, { \c_@@_name_date_en_tl } } % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_en_tl }, { \l_@@_info_researchfield_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \l_@@_info_date_en_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_en_tl }, { \l_@@_info_researchfield_en_tl }, { \l_@@_info_author_en_tl }, { \l_@@_info_supervisor_en_tl }, { \l_@@_info_cosupervisor_en_tl }, { \l_@@_info_date_en_tl } } } % \end{macrocode} % 用循环输出各字段。 % \begin{macrocode} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \l_@@_tmpa_tl \c_@@_fwid_colon_tl \l_@@_tmpb_tl \skip_vertical:n { 1 ex } } \end{minipage} } {2}{ \int_case:nn {\l_@@_info_degree_type_int} { % \end{macrocode} % 学术硕士 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} {1}{ % \end{macrocode} % 计算各标识名称和信息字段的总计宽度,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { {\c_@@_name_major_en_tl{\l_@@_info_major_en_tl} }, {\c_@@_name_researchfield_en_tl{\l_@@_info_researchfield_en_tl} }, {\c_@@_name_author_en_tl{\l_@@_info_author_en_tl} }, {\c_@@_name_supervisor_en_tl{\l_@@_info_supervisor_en_tl} }, {\c_@@_name_cosupervisor_en_tl{\l_@@_info_cosupervisor_en_tl} }, {\c_@@_name_date_en_tl{\l_@@_info_date_en_tl} } } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 将宽度值适当放宽。 % \begin{macrocode} \dim_add:Nn \l_@@_tmpa_dim {2.5em} \begin{minipage} [ c ] { \l_@@_tmpa_dim } \flushleft % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_major_en_tl }, { \c_@@_name_researchfield_en_tl }, { \c_@@_name_author_en_tl }, { \c_@@_name_supervisor_en_tl }, { \c_@@_name_cosupervisor_en_tl }, { \c_@@_name_date_en_tl } } % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_en_tl }, { \l_@@_info_researchfield_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \l_@@_info_date_en_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { \l_@@_info_major_en_tl }, { \l_@@_info_researchfield_en_tl }, { \l_@@_info_author_en_tl }, { \l_@@_info_supervisor_en_tl }, { \l_@@_info_cosupervisor_en_tl }, { \l_@@_info_date_en_tl } } } % \end{macrocode} % 用循环输出各字段。 % \begin{macrocode} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \l_@@_tmpa_tl \c_@@_fwid_colon_tl \l_@@_tmpb_tl \skip_vertical:n { 1 ex } } \end{minipage} } % \end{macrocode} % 专业学位硕士。 % \begin{macrocode} {2}{ % \end{macrocode} % 计算各标识名称和信息字段的总计宽度,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { {\c_@@_name_professionaltype_en_tl{Master~of~\l_@@_info_professionaltype_en_tl}}, {\c_@@_name_professionalfield_en_tl{\l_@@_info_professionalfield_en_tl}}, {\c_@@_name_author_en_tl{\l_@@_info_author_en_tl}}, {\c_@@_name_supervisor_en_tl{\l_@@_info_supervisor_en_tl}}, {\c_@@_name_cosupervisor_en_tl{\l_@@_info_cosupervisor_en_tl}}, {\c_@@_name_date_en_tl{\l_@@_info_date_en_tl}}, } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 将宽度值适当放宽。 % \begin{macrocode} \dim_add:Nn \l_@@_tmpa_dim {2.5em} \begin{minipage} [ c ] { \l_@@_tmpa_dim } \flushleft % \end{macrocode} % 读取作者信息标识常量,并将最宽者的宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { { \c_@@_name_professionaltype_en_tl }, { \c_@@_name_professionalfield_en_tl }, { \c_@@_name_author_en_tl }, { \c_@@_name_supervisor_en_tl }, { \c_@@_name_cosupervisor_en_tl }, { \c_@@_name_date_en_tl } } % \end{macrocode} % 读取作者信息变量值,并将最宽者的宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { Master ~ of ~ \l_@@_info_professionaltype_en_tl }, { \l_@@_info_professionalfield_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \c_@@_name_anonname_en_tl }, { \l_@@_info_date_en_tl } } }{ \clist_set:Nx \l_@@_tmpb_clist { { Master ~ of ~ \l_@@_info_professionaltype_en_tl }, { \l_@@_info_professionalfield_en_tl }, { \l_@@_info_author_en_tl }, { \l_@@_info_supervisor_en_tl }, { \l_@@_info_cosupervisor_en_tl }, { \l_@@_info_date_en_tl } } } % \end{macrocode} % 用循环输出各字段。 % \begin{macrocode} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \l_@@_tmpa_tl \c_@@_fwid_colon_tl \l_@@_tmpb_tl \skip_vertical:n { 1 ex } } \end{minipage} } } } } } % \end{macrocode} % \end{macro} % % \changes{v1.15}{2022/05/29}{为研究生题名页签字位置留空位。} % \changes{v1.25}{2023/04/18}{添加盲审隐藏作者、导师、指导小组等。} % % \begin{macro}{\@@_cover_instructors:} % 题名页作者、指导教师、指导小组签名,仅对研究生有效。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_instructors: { \int_case:nn {\g_@@_thesis_type_int} { % \end{macrocode} % 博士生,需要指导小组。 % \begin{macrocode} {1}{ % \end{macrocode} % 作者、导师、指导小组标识常量,并取得最宽宽度。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { {\c_@@_name_author_tl }, {\c_@@_name_supervisor_tl }, {\c_@@_name_instructors_tl }, } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 取得指导小组名单。 % \begin{macrocode} \tl_set:Nn \l_@@_tmpa_tl {\clist_use:Nn \l_@@_info_instructors_clist {\@@_quad: }} % \end{macrocode} % 判断是否需要签名。 % \begin{macrocode} \bool_if:NTF \l_@@_withsignature_bool % \end{macrocode} % 不输出姓名,输出下划线,留作签名空间。 % \begin{macrocode} { \begin{minipage} [ c ] { 17em } \flushleft \c_@@_name_author_tl \c_@@_fwid_colon_tl \@@_blank_underline:n{ 12em } \skip_vertical:n { 1.6 ex } \c_@@_name_supervisor_tl \c_@@_fwid_colon_tl \@@_blank_underline:n{ 12em } \skip_vertical:n { 1.6 ex } \c_@@_name_instructors_tl \c_@@_fwid_colon_tl \@@_blank_underline:n{ 12em } \skip_vertical:n { 1 ex } \end{minipage} }{ % \end{macrocode} % 作者、导师、指导小组信息变量值,并取得最宽宽度。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, } }{ \clist_set:Nx \l_@@_tmpb_clist { {\l_@@_info_author_tl }, {\l_@@_info_supervisor_tl }, {\l_@@_tmpa_tl }, } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist % \end{macrocode} % 计算小页宽度。 % \begin{macrocode} \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } \dim_add:Nn \l_@@_tmpt_dim {2.5em} % \end{macrocode} % 循环输出作者、导师、指导小组姓名。 % \begin{macrocode} \begin{minipage} [ c ] { \l_@@_tmpt_dim } \centering \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \l_@@_tmpa_tl \c_@@_fwid_colon_tl \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } \skip_vertical:n { 1.6 ex } } \skip_vertical:n { -0.6 ex } \end{minipage} } } % \end{macrocode} % 硕士生,仅需作者和导师。 % \begin{macrocode} {2}{ % \end{macrocode} % 作者、导师标识,并取得最宽宽度。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { {\c_@@_name_author_tl }, {\c_@@_name_supervisor_tl }, } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} % 判断是否需要签名。 % \begin{macrocode} \bool_if:NTF \l_@@_withsignature_bool % \end{macrocode} % 不输出姓名,输出下划线,留作签名空间(暂未启用)。 % \begin{macrocode} { \begin{minipage} [ c ] { 17em } \flushleft \c_@@_name_author_tl \c_@@_fwid_colon_tl \@@_blank_underline:n{ 12em } \skip_vertical:n { 1.6 ex } \c_@@_name_supervisor_tl \c_@@_fwid_colon_tl \@@_blank_underline:n{ 12em } \skip_vertical:n { 1 ex } \end{minipage} }{ % \end{macrocode} % 作者、导师信息,并取得最宽宽度。 % \begin{macrocode} \bool_if:NTF \l_@@_anonymous_bool { \clist_set:Nx \l_@@_tmpb_clist { { \c_@@_name_anonname_tl }, { \c_@@_name_anonname_tl }, } }{ \clist_set:Nx \l_@@_tmpb_clist { {\l_@@_info_author_tl }, {\l_@@_info_supervisor_tl }, } } \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist \dim_add:Nn \l_@@_tmpb_dim { \l_@@_tmpb_dim } % \end{macrocode} % 计算小页环境宽度后,用循环输出各姓名字段。 % \begin{macrocode} \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } \dim_add:Nn \l_@@_tmpt_dim {2.5em} \begin{minipage} [ c ] { \l_@@_tmpt_dim } \centering \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \l_@@_tmpa_tl \c_@@_fwid_colon_tl \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } \skip_vertical:n { 1.6 ex } } \skip_vertical:n { -0.6 ex } \end{minipage} } } } } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏答辩委员会。} % % \begin{macro}{\@@_cover_defensecommittees:} % 答辩委员会名单,仅对研究生有效。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_defensecommittees: { % \end{macrocode} % 清空临时变量。 % \begin{macrocode} \clist_set:Nn \l_@@_tmpa_clist {} \clist_set:Nn \l_@@_tmpb_clist {} \clist_set:Nn \l_@@_tmpc_clist {} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_info_defensecommittees_clist } { \clist_set:Nn \l_@@_tmpt_clist {} % \end{macrocode} % 取出一个答辩委员的信息。 % \begin{macrocode} \clist_pop:NN \l_@@_info_defensecommittees_clist \l_@@_tmpa_tl \clist_set:NV \l_@@_tmpt_clist \l_@@_tmpa_tl % \end{macrocode} % 构造单位列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpa_clist { \clist_item:Nn \l_@@_tmpt_clist {1} } % \end{macrocode} % 构造姓名列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpb_clist { \clist_item:Nn \l_@@_tmpt_clist {2} } % \end{macrocode} % 构造职称列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpc_clist { \clist_item:Nn \l_@@_tmpt_clist {3} } } % \end{macrocode} % 分别计算单位列表、姓名列表、职称列表的最宽宽度。 % \begin{macrocode} \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist \@@_get_max_text_width:NN \l_@@_tmpc_dim \l_@@_tmpc_clist % \end{macrocode} % 输出答辩委员会信息。 % \begin{macrocode} \bool_if:NF \l_@@_anonymous_bool { \begin{minipage} [ c ] { \textwidth } \centering \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \clist_pop:NN \l_@@_tmpc_clist \l_@@_tmpc_tl \@@_spread_box:Vn \l_@@_tmpa_dim { \l_@@_tmpa_tl } \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } \@@_spread_box:Vn \l_@@_tmpc_dim { \l_@@_tmpc_tl } \skip_vertical:n { 0.5 ex } } \end{minipage} } } % \end{macrocode} % \end{macro} % % \changes{v1.25}{2023/04/18}{添加盲审隐藏项目资助列表。} % % \begin{macro}{\@@_cover_foundation:} % 项目资助列表,仅对研究生有效。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_foundation: { % \end{macrocode} % 清空临时变量。 % \begin{macrocode} \clist_set:Nn \l_@@_tmpa_clist {} \clist_set:Nn \l_@@_tmpb_clist {} \clist_set:Nn \l_@@_tmpc_clist {} \bool_until_do:nn { \clist_if_empty_p:N \l_@@_info_foundation_clist } { \clist_set:Nn \l_@@_tmpt_clist {} % \end{macrocode} % 取出一个资助项目的信息。 % \begin{macrocode} \clist_pop:NN \l_@@_info_foundation_clist \l_@@_tmpa_tl \clist_set:NV \l_@@_tmpt_clist \l_@@_tmpa_tl % \end{macrocode} % 构造项目来源列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpa_clist { \clist_item:Nn \l_@@_tmpt_clist {1} } % \end{macrocode} % 构造项目名称列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpb_clist { \clist_item:Nn \l_@@_tmpt_clist {2} } % \end{macrocode} % 构造项目编号列表。 % \begin{macrocode} \clist_put_right:Nx \l_@@_tmpc_clist { \clist_item:Nn \l_@@_tmpt_clist {3} } } % \end{macrocode} % 输出资助项目信息。 % \begin{macrocode} \begin{minipage} [ c ] { \textwidth } \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } { \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl \clist_pop:NN \l_@@_tmpc_clist \l_@@_tmpc_tl \indent \@@_qquad: 本研究得到 \bool_if:NTF \l_@@_anonymous_bool { \c_@@_name_anonname_tl, }{ \l_@@_tmpa_tl } \c_@@_fwid_colon_tl \bool_if:NTF \l_@@_anonymous_bool { \c_@@_name_anonname_tl, }{ \l_@@_tmpb_tl } (编号\c_@@_fwid_colon_tl \bool_if:NTF \l_@@_anonymous_bool { \c_@@_name_anonname_tl, }{ \l_@@_tmpc_tl } )资助 \par } \end{minipage} } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_cover_signature:N} % 签名行。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_signature:N #1 { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生。 % \begin{macrocode} \@@_qquad: \@@_spread_box:nV { 5 em } #1 \c_@@_fwid_colon_tl \hspace*{\fill} }{ % \end{macrocode} % 本科生。 % \begin{macrocode} \@@_spread_box:nV { 6 em } #1 \c_@@_fwid_colon_tl % \@@_blank_underline:n { 6 em } \hspace*{\fill} } % \end{macrocode} % 签名时间。 % \begin{macrocode} 时间\c_@@_fwid_colon_tl \@@_qquad:\@@_qquad: 年 \@@_qquad: 月 \@@_qquad: 日 \hspace*{\fill} % \@@_qquad: } % \end{macrocode} % \end{macro} % % \changes{v1.12}{2022/04/12}{重新抽象封面\pkg{xtemplate}模板。} % % \subsubsection{封面模板} % % 改自\url{https://github.com/stone-zeng/fduthesis/pull/236} % % 本模板使用 \pkg{xtemplate} 提供的面向对象方法绘制封面。 % % 以下分别从页面元素(element)和页面整体(page)的层次进行了抽象。 % 当把页面部件作为一个对象时,则页面部件只具备有限数量的属性: % 内容、格式、边距、对齐方式等。而具体页面是这些对象的实例的集合, % 附加边距、行距等属性。通过 \pkg{xtemplate} 提供的功能,可以 % 根据这些属性创建模板(template),进而能大量构建具有\emph{相似行为} % 的实例(instance)。 % % 声明对象类型,此类对象均不需要带参数。 % \begin{macrocode} \DeclareObjectType { nwafu } { \c_zero_int } % \end{macrocode} % % 定义元素模板。 % \begin{macrocode} %<@@=nwafu_elem> % \end{macrocode} % % 声明页面元素模板接口。 % % 元素是一个页面的基本组成单位,包括文字段落、插图等等。 % 一个抽象的元素应当具备以下属性: % \begin{description} % \item[\opt{content}] 内容,即剥离了样式的元素本身 % \item[\opt{format}] 格式,例如字号、字体 % \item[\opt{bottom-skip}] 底边距,即与下一个元素的垂直距离 % \item[\opt{align}] 对齐方式,包括左对齐、右对齐、居中、正常段落 % \end{description} % \begin{macrocode} \DeclareTemplateInterface { nwafu } { element } { \c_zero_int } { content : tokenlist = \c_empty_tl, format : tokenlist = \c_empty_tl, bottom-skip : skip = \c_zero_skip, align : choice { left, right, center, normal } = normal } % \end{macrocode} % % 声明页面元素模板代码。^^A 涉及的变量将被自动创建。 % \begin{macrocode} \DeclareTemplateCode { nwafu } { element } { \c_zero_int } { content = \l_@@_content_tl, format = \l_@@_format_tl, bottom-skip = \l_@@_bottom_skip, align = { left = { \tl_set_eq:NN \l_@@_begin_align_tl \flushleft \tl_set_eq:NN \l_@@_end_align_tl \endflushleft }, right = { \tl_set_eq:NN \l_@@_begin_align_tl \flushright \tl_set_eq:NN \l_@@_end_align_tl \endflushright }, center = { \tl_set_eq:NN \l_@@_begin_align_tl \center \tl_set_eq:NN \l_@@_end_align_tl \endcenter }, normal = { \tl_clear:N \l_@@_begin_align_tl \tl_clear:N \l_@@_end_align_tl } } } { \AssignTemplateKeys \group_begin: \l_@@_begin_align_tl \l_@@_format_tl \l_@@_content_tl \par \l_@@_end_align_tl \group_end: \__nwafu_vspace:N \l_@@_bottom_skip } % \end{macrocode} % % 定义页面模板。 % \begin{macrocode} %<@@=nwafu_page> % \end{macrocode} % % 声明页面模板接口。 % % 页面是元素的集合。一个抽象的页面应当具备以下属性: % \begin{description} % \item[\opt{content}] 内容,包含页面元素模板实例名称的列表 % \item[\opt{prefix}] 元素模板实例名称前缀(表示封一、封二等) % \item[\opt{format}] 格式,例如行距 % \item[\opt{top-skip}] 上间距,即与页面顶部的距离 % \item[\opt{bottom-skip}] 下间距,即与页面底部的距离 % \end{description} % \begin{macrocode} \DeclareTemplateInterface { nwafu } { page } { \c_zero_int } { content : commalist = \c_empty_clist, prefix : tokenlist = \c_empty_tl, format : tokenlist = \c_empty_tl, top-skip : skip = \c_zero_skip, bottom-skip : skip = \c_zero_skip } % \end{macrocode} % % 声明页面模板代码。 % \begin{macrocode} \DeclareTemplateCode { nwafu } { page } { \c_zero_int } { content = \l_@@_content_clist, prefix = \l_@@_prefix_tl, format = \l_@@_format_tl, top-skip = \l_@@_top_skip, bottom-skip = \l_@@_bottom_skip } { \AssignTemplateKeys \__nwafu_vspace:N \l_@@_top_skip \group_begin: \l_@@_format_tl \clist_map_inline:Nn \l_@@_content_clist { \UseInstance { nwafu } { \l_@@_prefix_tl ##1 } } \group_end: \__nwafu_vspace:N \l_@@_bottom_skip } % %<@@=nwafu> % \end{macrocode} % % \begin{macro}{\@@_declare_element:nn,\@@_declare_page:nn} % 封装 \pkg{xtemplate} 提供的函数,简化创建实例的过程。 % \begin{arguments} % \item 实例名称 % \item 参数列表 % \end{arguments} % \begin{macrocode} \cs_new_protected:Npn \@@_declare_element:nn #1#2 { \DeclareInstance { nwafu } {#1} { element } {#2} } \cs_generate_variant:Nn \@@_declare_element:nn { nx } \cs_new_protected:Npn \@@_declare_page:nn #1#2 { \DeclareInstance { nwafu } {#1} { page } {#2} } \cs_generate_variant:Nn \@@_declare_page:nn { nx } % \end{macrocode} % \end{macro} % % \subsubsection{定义封面页面元素} % % \changes{v1.13}{2022/05/26}{修订ID为四号字。} % % \begin{macro}{cover/i/id} % 封一学校代码和学号。仅本科生需要 % \begin{macrocode} \@@_declare_element:nn { cover / i / id } { content = \@@_cover_id:, format = \bfseries\zihao { 4 }, bottom-skip = 0 pt plus 0.3 fill, align = right, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/i/logo} % 封一学校视觉识别图片(Logo)。 % \begin{macrocode} \@@_declare_element:nn { cover / i / logo } { content = \@@_cover_logo:, bottom-skip = \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} -45 pt plus 0.3 fill }{ % \end{macrocode} % 本科生 % \begin{macrocode} -30 pt plus 0.3 fill }, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/i/type} % 封一论文类型。 % \begin{macrocode} \@@_declare_element:nn { cover / i / type } { content = \@@_cover_type:, format = \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \sffamily \zihao { 0 } }{ % \end{macrocode} % 本科生 % \begin{macrocode} \nwafu@kai\zihao{ 1 } }, bottom-skip = -20 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/i/title} % 封一论文题目。 % \begin{macrocode} \@@_declare_element:nn { cover / i / title } { content = \@@_fixed_width_center_box:nn { 0.9 \textwidth } { \l_@@_info_title_tl }, format = \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \sffamily \zihao { 2 } }{ % \end{macrocode} % 本科生 % \begin{macrocode} \nwafu@hei\zihao{ 2 } }, bottom-skip = 80 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/i/info} % 封一论文专业、单位、作者、导师等信息栏。 % \begin{macrocode} \@@_declare_element:nn { cover / i / info } { content = \@@_cover_info:, format = \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \@@_line_spread:n {1.05}\nwafu@hei \zihao { -3 } }{ % \end{macrocode} % 本科生 % \begin{macrocode} \rmfamily \zihao { 3 } }, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/ii/type} % 封二论文类型(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / ii / type } { content = \int_case:nn { \g_@@_thesis_type_int } { {1}{ % \end{macrocode} % 博士研究生 % \begin{macrocode} \@@_fixed_width_center_box:nn { 0.7\textwidth } { Thesis~Submitted~to~\c_@@_name_en_tl\\ in~Partial~Fulfillment~of~the~Requirements\\ for~Degree~of\\ Doctor~of~Philosophy } } {2}{ % \end{macrocode} % 硕士研究生 % \begin{macrocode} \@@_fixed_width_center_box:nn { 0.7\textwidth } { Thesis~Submitted~to~\c_@@_name_en_tl\\ in~Partial~Fulfillment~of~the~Requirements\\ for~Degree~of\\ Master~of \int_case:nn {\l_@@_info_degree_type_int} { {1}{ \@@_text_uline:V \l_@@_info_mastertype_en_tl } {2}{ \@@_text_uline:V \l_@@_info_professionaltype_en_tl } } } } }, format = \@@_line_spread:n {1.22} \zihao { -3 }, bottom-skip = 42 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/ii/title} % 封二论文英文(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / ii / title } { content = \l_@@_info_title_en_tl, format = \@@_line_spread:n {0.90} \zihao { 1 } \bfseries, bottom-skip = 35 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/ii/info} % 封二论文专业、作者、导师等英文信息栏(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / ii / info } { content = \@@_cover_info_en:, format = \@@_line_spread:n {1.12} \zihao { -3 }, bottom-skip = 72 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/ii/department} % 封二论文单位英文(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / ii / department } { content = \l_@@_info_department_en_tl, format = \zihao { -3 }, bottom-skip = -32 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/ii/nwafu} % 封二学校名称英文(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / ii / nwafu } { content = \c_@@_name_en_tl, format = \zihao { -3 }, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/id} % 封三题名页ID(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / id } { content = \@@_cover_id:, format = \@@_line_spread:n {1.12}\zihao { -4 }, bottom-skip = 35 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/type} % 封三题名页论文类型(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / type } { content = \c_@@_name_simp_tl \clist_item:Nn \c_@@_thesis_type_clist { \g_@@_thesis_type_int }, format = \zihao { -2 }\bfseries, bottom-skip = 0 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/title} % 封三题名页论文题目(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / title } { content = \l_@@_info_title_tl, format = \zihao { 2 }\sffamily, bottom-skip = 65 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/instructors} % 封三题名页作者、导师(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / instructors } { content = \@@_cover_instructors:, format = \@@_line_spread:n {0.88}\zihao { 3 }\bfseries, bottom-skip = 75 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/ctitle} % 封三题名页答辩委员会标题(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / ctitle } { content = 答辩委员会\c_@@_fwid_colon_tl, format = \zihao { -3 }\bfseries, bottom-skip = -20 pt plus 0.3 fill, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/committees} % 封三题名页答辩委员会成员(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / committees } { content = \@@_cover_defensecommittees:, format = \@@_line_spread:n {1.12}\zihao { -3 }, bottom-skip = 60 pt plus 0.3 fill, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iii/date} % 封三题名页答辩日期(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iii / date } { content = {\bfseries{}答辩日期}\c_@@_fwid_colon_tl\l_@@_info_defensedate_tl, format = \zihao { -3 }, bottom-skip = 0 pt plus 0.3 fill, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/iv/foundation} % 封四资助页(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / iv / foundation } { content = \@@_cover_foundation:, format = \sffamily\zihao{3}, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/originality-decl-name} % 封五独创声明标题(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / originality-decl-name } { content = \c_@@_name_orig_decl_tl, format = \@@_line_spread:n { 1.2 } \zihao { 3 } \sffamily, bottom-skip = 0.25 cm, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/originality-decl-text} % 封五独创声明内容(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / originality-decl-text } { content = \c_@@_orig_decl_text_tl, format = \zihao { -4 }, bottom-skip = 0.4 cm, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/originality-decl-sig} % 封五独创声明签字(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / originality-decl-sig } { content = \@@_cover_signature:N \c_@@_orig_decl_sign_tl, format = \zihao { -4 }, bottom-skip = 0.4 cm, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/supervisor-decl-name} % 封五导师承诺标题(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / supervisor-decl-name } { content = \c_@@_name_super_decl_tl, format = \@@_line_spread:n { 1.2 } \zihao { 3 } \sffamily, bottom-skip = 0.25 cm, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/supervisor-decl-text} % 封五导师承诺内容(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / supervisor-decl-text } { content = \c_@@_super_decl_text_tl, format = \zihao { -4 }, bottom-skip = 0.4 cm, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/v/supervisor-decl-sig} % 封五导师承诺签字(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / v / supervisor-decl-sig } { content = \@@_cover_signature:N \c_@@_super_decl_sign_tl, format = \zihao { -4 }, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vi/authorization-decl-name} % 封六使用授权标题(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vi / authorization-decl-name } { content = \c_@@_name_auth_decl_tl, format = \@@_line_spread:n { 1.2 } \zihao { 3 } \sffamily, bottom-skip = 0.25 cm, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vi/authorization-decl-text} % 封六使用授权内容(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vi / authorization-decl-text } { content = \c_@@_auth_decl_text_tl, format = \zihao { -4 }, bottom-skip = 0.8 cm, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vi/authorization-decl-sig} % 封六使用授权签字(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vi / authorization-decl-sig } { content = \@@_cover_signature:N \c_@@_orig_decl_sign_tl, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vi/supervisor-decl-sig} % 封六使用授权签字(仅研究生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vi / supervisor-decl-sig } { content = \@@_cover_signature:N \c_@@_super_decl_sign_tl, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/originality-decl-name} % 封七独创声明标题(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / originality-decl-name } { content = \c_@@_name_orig_decl_tl, format = \@@_line_spread:n { 1.2 } \zihao { 3 } \sffamily, bottom-skip = 0.25 cm, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/originality-decl-text} % 封七独创声明内容(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / originality-decl-text } { content = \c_@@_orig_decl_text_tl, format = \indent \zihao { -4 } \nwafu@kai, bottom-skip = 0.4 cm, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/originality-decl-sig} % 封七独创声明学生签字(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / originality-decl-sig } { content = \@@_cover_signature:N \c_@@_orig_decl_sign_tl, format = \zihao { -4 } \nwafu@kai, bottom-skip = 0.4 cm, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/authorization-decl-name} % 封七使用授权标题(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / authorization-decl-name } { content = \c_@@_name_auth_decl_tl, format = \@@_line_spread:n { 1.2 } \zihao { 3 } \sffamily, bottom-skip = 0.25 cm, align = center, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/authorization-decl-text} % 封七使用授权内容(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / authorization-decl-text } { content = \c_@@_auth_decl_text_tl, format = \zihao { -4 } \nwafu@kai, bottom-skip = 0.4 cm, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/authorization-decl-sig} % 封七使用授权学生签字(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / authorization-decl-sig } { content = \@@_cover_signature:N \c_@@_orig_decl_sign_tl, format = \zihao { -4 } \nwafu@kai, bottom-skip = -0.5 cm, align = left, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover/vii/supervisor-decl-sig} % 封七使用授权教师签字(仅本科生用)。 % \begin{macrocode} \@@_declare_element:nn { cover / vii / supervisor-decl-sig } { content = \@@_cover_signature:N \c_@@_super_decl_sign_tl, format = \zihao { -4 } \nwafu@kai, align = left, } % \end{macrocode} % \end{macro} % % \subsubsection{定义封面页面参数} % % \begin{macro}{cover-i-default} % 封一。 % \begin{macrocode} \@@_declare_page:nx { cover-i-default } { content = \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生封面一 % \begin{macrocode} { logo, type, title, info } }{ % \end{macrocode} % 本科生封面一 % \begin{macrocode} { id, logo, type, title, info } }, prefix = cover / i /, bottom-skip = 0 pt plus 1.5 fill } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-ii-default} % 封二(仅研究生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-ii-default } { content = { type, title, info, department, nwafu }, prefix = cover / ii /, bottom-skip = 0 pt plus 1.5 fill } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-iii-default} % 封三(仅研究生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-iii-default } { content = { id, type, title, instructors, ctitle, committees, date }, prefix = cover / iii /, top-skip = -55 pt plus 0.1 fill, bottom-skip = 0 pt plus 0.5 fill } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-iv-default} % 封四(仅研究生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-iv-default } { content = { foundation }, prefix = cover / iv /, } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-v-default} % 封五(仅研究生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-v-default } { content = { originality-decl-name, originality-decl-text, originality-decl-sig, supervisor-decl-name, supervisor-decl-text, supervisor-decl-sig }, prefix = cover / v /, format = \@@_line_spread:n { 1.25 }, top-skip = 0 pt plus 0.2 fill, bottom-skip = 0 pt plus 2.5 fill } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-vi-default} % 封六(仅研究生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-vi-default } { content = { authorization-decl-name, authorization-decl-text, authorization-decl-sig, supervisor-decl-sig }, prefix = cover / vi /, format = \@@_line_spread:n { 1.25 }, top-skip = 0 pt plus 0.2 fill, bottom-skip = 0 pt plus 2.5 fill } % \end{macrocode} % \end{macro} % % \begin{macro}{cover-vii-default} % 封七(仅本科生用)。 % \begin{macrocode} \@@_declare_page:nn { cover-vii-default } { content = { originality-decl-name, originality-decl-text, originality-decl-sig, authorization-decl-name, authorization-decl-text, authorization-decl-sig, supervisor-decl-sig }, prefix = cover / vii /, format = \@@_line_spread:n { 1.25 }, top-skip = 0 pt plus 0.2 fill, bottom-skip = 0 pt plus 2.5 fill } % \end{macrocode} % \end{macro} % % \subsubsection{排版封面} % % \begin{macro}{\makecoveri,\makecoverii,\makecoveriii, % \makecoveriv,\makecoverv,\makecovervi,\makecovervii} % 封面一$\sim$七,其中一$\sim$六为研究生使用,一和七为本科生使用。 % \begin{macrocode} % 封面一,研究生、本科生中文封面 \NewDocumentCommand \makecoveri { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-i-default } \restoregeometry } % \end{macrocode} % 封面二,研究生英文封面 % \begin{macrocode} \NewDocumentCommand \makecoverii { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-ii-default } \restoregeometry } % \end{macrocode} % 封面三,研究生封面内页(ID、答辩委员会等) % \begin{macrocode} \NewDocumentCommand \makecoveriii { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-iii-default } \restoregeometry } % \end{macrocode} % 封面四,研究生项目资助页 % \begin{macrocode} \NewDocumentCommand \makecoveriv { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-iv-default } \restoregeometry } % \end{macrocode} % 封面五,研究生独创性声明与导师承诺 % \begin{macrocode} \NewDocumentCommand \makecoverv { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-v-default } \restoregeometry } % \end{macrocode} % 封面六,研究生论文使用授权说明 % \begin{macrocode} \NewDocumentCommand \makecovervi { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-vi-default } \restoregeometry } % \end{macrocode} % 封面七,本科生独创性声明及论文使用授权说明 % \begin{macrocode} \NewDocumentCommand \makecovervii { } { \thispagestyle { empty } \newgeometry{top=1.0in, bottom=1.0in, left=1.25in, right=1.25in} \UseInstance { nwafu } { cover-vii-default } \restoregeometry } % \end{macrocode} % \end{macro} % % \subsubsection{自动生成封面} % % \begin{macro}{style/auto-make-cover} % \begin{variable}{\l_@@_auto_make_cover_bool} % 是否自动生成封面。 % \begin{macrocode} \bool_new:N \l_@@_auto_make_cover_bool \keys_define:nn { nwafu / style } { auto-make-cover .bool_set:N = \l_@@_auto_make_cover_bool, auto-make-cover .default:n = true } % \end{macrocode} % \end{variable} % \end{macro} % % \begin{macro}{\makecovers} % 在排版所有封面。 % \begin{macrocode} \NewDocumentCommand \makecovers { } { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生 % \begin{macrocode} \begin{titlepage} \makecoveri \newpage \makecoverii \newpage \makecoveriii \newpage \makecoveriv \newpage \makecoverv \newpage \makecovervi \end{titlepage} }{ % \end{macrocode} % 本科生 % \begin{macrocode} \begin{titlepage} \makecoveri \cleardoublepage \makecovervii \end{titlepage} } } % \end{macrocode} % \end{macro} % % \subsection{摘要及符号表} % % \begin{variable}{\l_@@_abstract_file_tl, % \l_@@_abstract_file_en_tl, % \l_@@_abstract_keywords_clist, % \l_@@_abstract_keywords_en_clist, % \l_@@_notation_file_tl} % 摘要数据所需字段。 % \begin{macrocode} \tl_new:c { l_@@_abstract_file_tl } \tl_new:c { l_@@_abstract_file_en_tl } \clist_new:N \l_@@_abstract_keywords_clist \clist_new:N \l_@@_abstract_keywords_en_clist \tl_new:c { l_@@_notation_file_tl } % \end{macrocode} % \end{variable} % % \begin{macrocode} \keys_define:nn { nwafu / abstract } { % \end{macrocode} % % \begin{macro}{abstract/abstractfile, abstract/abstractfile*} % 摘要文件的文件名 % \begin{macrocode} abstractfile .tl_set:N = \l_@@_abstract_file_tl, abstractfile* .tl_set:N = \l_@@_abstract_file_en_tl, % \end{macrocode} % \end{macro} % % \begin{macro}{abstract/keywords, abstract/keywords*} % 论文关键字列表。 % \begin{macrocode} keywords .clist_set:N = \l_@@_abstract_keywords_clist, keywords* .clist_set:N = \l_@@_abstract_keywords_en_clist, % \end{macrocode} % \end{macro} % % \begin{macro}{abstract/notation} % 论文符号表文件的文件名。 % \begin{macrocode} notationfile .tl_set:N = \l_@@_notation_file_tl, notationfile .default:n = {}, } % \end{macrocode} % \end{macro} % % \changes{v1.11}{2022/04/02}{修复摘要后的所有页面尺寸。} % % \begin{macro}{\makefront} % 排版摘要、目录等前料。 % \begin{macrocode} \NewDocumentCommand \makefront { } { % \end{macrocode} % 恢复页面尺寸 % \begin{macrocode} \restoregeometry \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { % \end{macrocode} % 研究生,\cs{frontmatter}命令用于设置页眉页脚,页码格式 % 并于奇数页起排。 % \begin{macrocode} \frontmatter \tl_if_empty:NF \l_@@_abstract_file_tl { % \end{macrocode} % 根据提供的文件,排版中文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract} \file_input:V \l_@@_abstract_file_tl \end{abstract} } \tl_if_empty:NF \l_@@_abstract_file_en_tl { % \end{macrocode} % 根据提供的文件,排版英文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract*} \file_input:V \l_@@_abstract_file_en_tl \end{abstract*} } % \end{macrocode} % 排版目录,需要在奇数页起排。 % \begin{macrocode} \cleardoublepage \pagenumbering{Roman} \tableofcontents % \end{macrocode} % 排版主要符号对照表,需要在奇数页起排。 % \begin{macrocode} \tl_if_empty:NF \l_@@_notation_file_tl { % \end{macrocode} % 根据提供的文件,排版主要符号对照表,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \cleardoublepage \pagenumbering{Roman} \file_input:V \l_@@_notation_file_tl } }{ % \end{macrocode} % 本科生,无页眉页脚 % \begin{macrocode} \cleardoublepage \thispagestyle { empty } \tl_if_empty:NF \l_@@_abstract_file_tl { % \end{macrocode} % 根据提供的文件,排版中文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract} \@@_get_text_width:Nn \l_@@_tmpa_dim {\c_@@_name_keywords_tl} \group_begin: \par \indent {\nwafu@hei\zihao{-4} \@@_spread_box:Vn \l_@@_tmpa_dim {\c_@@_name_abstract_tl} \c_@@_fwid_colon_tl} \normalfont \file_input:V \l_@@_abstract_file_tl \group_end: \end{abstract} } \cleardoublepage \thispagestyle { empty } \tl_if_empty:NF \l_@@_abstract_file_en_tl { % \end{macrocode} % 根据提供的文件,排版英文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract*} \group_begin: \par \indent {\bfseries\zihao{-4} \c_@@_name_abstract_en_tl : ~} \normalfont \file_input:V \l_@@_abstract_file_en_tl \group_end: \end{abstract*} } \frontmatter \tableofcontents } } % \end{macrocode} % \end{macro} % % 在 \env{document} 开始位置添加封面以及指导小组成员名单。 % % \begin{macrocode} \ctex_after_end_preamble:n { \bool_if:NT \l_@@_auto_make_cover_bool { \makecovers \makefront } } % \end{macrocode} % % \subsection{目录} % % 设置目录标题。 % \begin{macrocode} \keys_set:nn { ctex } { contentsname = \c_@@_name_toc_tl, listfigurename = \c_@@_name_lof_tl, listtablename = \c_@@_name_lot_tl, } % \end{macrocode} % % \begin{variable}{\@@_toc_chapter_format_tl, % \@@_toc_chapter_indent_tl, % \@@_toc_chapter_rule_tl, % \@@_toc_chapter_numsep_tl, % \@@_toc_chapter_offset_dim, % \@@_toc_section_format_tl, % \@@_toc_section_indent_tl, % \@@_toc_section_rule_tl, % \@@_toc_section_numsep_tl, % \@@_toc_section_offset_dim, % \@@_toc_subsection_format_tl, % \@@_toc_subsection_indent_tl, % \@@_toc_subsection_rule_tl, % \@@_toc_subsection_numsep_tl, % \@@_toc_subsection_offset_dim, % \@@_toc_list_format_tl, % \@@_toc_list_indent_tl, % \@@_toc_list_rule_tl, % \@@_toc_list_numsep_tl, % \@@_toc_list_offset_dim, % \@@_toc_line_align_bool, % \@@_titletoc_hang_fix_bool} % 目录设置中需要的字段。 % \begin{macrocode} \clist_map_inline:nn { chapter, section, subsection, figure, table } { \clist_map_inline:nn { format, indent, rule, numsep } { \tl_new:c {@@_toc_ #1 _ ##1 _ tl} } } \clist_map_inline:nn { chapter, section, subsection, figure, table } { \dim_new:c { @@_toc_ #1 _offset_dim } } \bool_new:N \@@_toc_line_align_bool \bool_new:N \@@_titletoc_hang_fix_bool % \end{macrocode} % \end{variable} % % 目录格式设置,研究生与本科生需设置不同参数 % \begin{macrocode} \tl_set:Nn \@@_toc_chapter_format_tl { \addvspace{1pt}\nwafu@hei } \tl_set:Nn \@@_toc_chapter_indent_tl {0pc} \tl_set:Nn \@@_toc_chapter_rule_tl {\tocrule{$\cdot$}} \tl_set:Nn \@@_toc_chapter_numsep_tl {0.5\ccwd} \dim_set:Nn \@@_toc_chapter_offset_dim { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { 0pc }{ 1pt } } \tl_set:Nn \@@_toc_section_format_tl { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \addvspace{0pt} }{ \addvspace{1pt}\small } } \tl_set:Nn \@@_toc_section_indent_tl { \ccwd } \tl_set:Nn \@@_toc_section_rule_tl {\tocrule{$\cdot$}} \tl_set:Nn \@@_toc_section_numsep_tl {0.5\ccwd} \dim_set:Nn \@@_toc_section_offset_dim { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { 0pc }{ 1pt } } \tl_set:Nn \@@_toc_subsection_format_tl { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \addvspace{0pt} }{ \addvspace{1pt}\small } } \tl_set:Nn \@@_toc_subsection_indent_tl {2.0\ccwd} \tl_set:Nn \@@_toc_subsection_rule_tl {\tocrule{$\cdot$}} \tl_set:Nn \@@_toc_subsection_numsep_tl {0.5\ccwd} \dim_set:Nn \@@_toc_subsection_offset_dim { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { 0pc }{ 1pt } } \tl_set:Nn \@@_toc_figure_format_tl { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \addvspace{0pt} }{ \addvspace{1pt} } } \tl_set:Nn \@@_toc_figure_indent_tl {0pc} \tl_set:Nn \@@_toc_figure_rule_tl {\tocrule{$\cdot$}} \tl_set:Nn \@@_toc_figure_numsep_tl {0.5\ccwd} \dim_set:Nn \@@_toc_figure_offset_dim { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { 0pc }{ 1pt } } \tl_set:Nn \@@_toc_table_format_tl { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \addvspace{0pt} }{ \addvspace{1pt} } } \tl_set:Nn \@@_toc_table_indent_tl {0pc} \tl_set:Nn \@@_toc_table_rule_tl {\tocrule{$\cdot$}} \tl_set:Nn \@@_toc_table_numsep_tl {0.5\ccwd} \dim_set:Nn \@@_toc_table_offset_dim { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { 0pc }{ 1pt } } \bool_set_false:N \@@_toc_line_align_bool \bool_set_false:N \@@_titletoc_hang_fix_bool % % \end{macrocode} % 循环设置各级别目录格式。 % 代码借鉴于easybook(\url{https://gitee.com/texl3/easybook})。 % \begin{macrocode} % \clist_map_inline:nn { chapter, section, subsection, figure, table } { \titlecontents{#1} % \end{macrocode} % 左侧缩进距离。 % \begin{macrocode} [ \use:c { @@_toc_#1_indent_tl } ] % \end{macrocode} % 标题格式,可以设置字体、加入垂直间距等, % 垂直间距最好使用无间距重合的\textbackslash addvspace命令。 % \begin{macrocode} { \use:c { @@_toc_#1_format_tl } } % \end{macrocode} % 标题标志格式,如序号格式、序号宽度、序号与标题内容之间的间距等。 % 该参数若为空,则无标题标志。 % \begin{macrocode} { \bool_if:NT \@@_titletoc_hang_fix_bool { \contentspush { \thecontentslabel % \end{macrocode} % 有编号的标题在目录中编号与标题的间距。 % \begin{macrocode} \hspace{\use:c { @@_toc_#1_numsep_tl }} } } } % \end{macrocode} % 无序号标题格式。 % \begin{macrocode} {} % \end{macrocode} % 标题与页码之间的导引线。 % \begin{macrocode} {\use:c { @@_toc_#1_rule_tl }} % \end{macrocode} % 下间距,可选参数, 用于设置标题排版后还需要执行的命令, % 例如与下个标题的垂直间距等。 % \begin{macrocode} [\addvspace{\use:c{ @@_toc_ #1 _offset_dim }}] } % \end{macrocode} % 自定义导引线命令。 % 代码借鉴于easybook(\url{https://gitee.com/texl3/easybook})。 % \begin{macrocode} \cs_new:Npn \NWAFUNumberLine #1 { \CTEXifname { \use:c { CTEXthe#1 } \hspace{\use:c { @@_toc_#1_numsep_tl }} }{} } % \end{macrocode} % 导引线。 % \begin{macrocode} \bool_if:NTF \@@_titletoc_hang_fix_bool { % \end{macrocode} % CTeX格式导引线。 % \begin{macrocode} \keys_set:nn { ctex } { chapter/tocline = \CTEXnumberline{#1}#2, section/tocline = \CTEXnumberline{#1}#2, subsection/tocline = \CTEXnumberline{#1}#2 } }{ % \end{macrocode} % 自定义导引线。 % \begin{macrocode} \keys_set:nn { ctex } { chapter/tocline = \NWAFUNumberLine{#1}#2, section/tocline = \NWAFUNumberLine{#1}#2, subsection/tocline = \NWAFUNumberLine{#1}#2 } } % % \end{macrocode} % 定义tocrule目录导引线命令。 % *星号命令能够使右侧与页码连接与不是对齐。 % 代码借鉴于easybook(\url{https://gitee.com/texl3/easybook})。 % \begin{macrocode} % \NewDocumentCommand{\tocrule}{sO{0.3pc}D(){1.2}mO{}} { \small\normalfont \titlerule*[#2]{\scalebox{#3}{#4}}#5 \IfBooleanTF{#1} {\thecontentspage} { \bool_if:NTF \@@_toc_line_align_bool {\contentspage}{\thecontentspage} } } % \end{macrocode} % % \begin{macro}{\tableofcontents,\listoffigures,\listoftables} % 修改 \cs{tableofcontents}、\cs{listoffigures} 和 \cs{listoftables} 的定义, % 使得页眉正确显示,并出现在目录及 PDF 书签中。来自于 \LaTeXe{} 标准文档类 % \file{book.cls} % \footnote{原代码中只有 \cs{tableofcontents} 的 \cs{@mkboth} 出现在 % \cs{chapter*} 内部,这是出于兼容性的考虑而非 typo。}。 % \begin{macrocode} \@@_patch_cmd:Nnn \tableofcontents { \chapter*{\contentsname \@mkboth{\MakeUppercase\contentsname} {\MakeUppercase\contentsname}} } { \@@_chapter_no_toc:V \contentsname } \@@_patch_cmd:Nnn \listoffigures { \chapter*{\listfigurename} \@mkboth{\MakeUppercase\listfigurename} {\MakeUppercase\listfigurename} } { \@@_chapter:V \listfigurename } \@@_patch_cmd:Nnn \listoftables { \chapter*{\listtablename} \@mkboth{\MakeUppercase\listtablename} {\MakeUppercase\listtablename} } { \@@_chapter:V \listtablename } % \end{macrocode} % \end{macro} % % \subsection{摘要} % % \begin{environment}{abstract} % \begin{environment}{abstract*} % 摘要环境,定义中英文双语摘要。 % \begin{macrocode} \NewDocumentEnvironment { abstract } { } { \@@_abstract_begin: } { \@@_abstract_end: } \NewDocumentEnvironment { abstract* } { } { \@@_abstract_en_begin: } { \@@_abstract_en_end: } % \end{macrocode} % \end{environment} % \end{environment} % % \begin{macro}{\@@_abstract_begin:,\@@_abstract_en_begin:} % 摘要页标题。 % \begin{macrocode} \cs_new_protected:Npn \@@_abstract_begin: { % \tl_set_eq:NN \l_tmpa_tl \l_@@_info_title_tl % \tl_replace_all:Nnn \l_tmpa_tl { \\ } { ~ } \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \@@_chapter:V \c_@@_name_abstract_tl }{ \par \mode_leave_vertical: \par \begin{center}\nwafu@hei\zihao{3}\l_@@_info_title_tl\end{center} % \begin{center}\nwafu@hei\zihao{3}\l_tmpa_tl\end{center} } } \cs_set_eq:NN \my_uppercase:n \uppercase \cs_new_protected:Npn \@@_abstract_en_begin: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \@@_chapter:n \c_@@_name_abstract_en_tl }{ \par \mode_leave_vertical: \par \begin{center}\bfseries\zihao{3} % \exp_args:Nx \my_uppercase:n {\l_@@_info_title_en_tl} \l_@@_info_title_en_tl \end{center} } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_abstract_end:,\@@_abstract_en_end:} % 摘要正文完成后,输出关键字列表。 % \begin{macrocode} \cs_new_protected:Npn \@@_abstract_end: { \@@_keywords:nNn { \nwafu@hei \zihao{-4} \c_@@_name_keywords_tl \c_@@_fwid_colon_tl } \l_@@_abstract_keywords_clist { ; ~} } \cs_new_protected:Npn \@@_abstract_en_end: { \@@_keywords:nNn { \bfseries \c_@@_name_keywords_en_tl : ~ } \l_@@_abstract_keywords_en_clist { ; ~ } } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_keywords:nNn,\@@_keywords_prevdepth:} % 关键字列表前要空一行,使用悬挂缩进。|\parbox| 之后的间距 % 需要调整,见 \url{https://tex.stackexchange.com/a/34982}。 % \begin{macrocode} \cs_new_protected:Npn \@@_keywords:nNn #1#2#3 { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } { \par \mode_leave_vertical: \par \noindent \@@_get_text_width:Nn \l_@@_tmpa_dim {#1} \group_begin: \MakeUppercase{#1} \group_end: \parbox [t] { \dim_eval:n { \textwidth - \l_@@_tmpa_dim } } { \clist_use:Nn #2 {#3} \par \cs_gset:Npx \@@_keywords_prevdepth: { \dim_use:N \tex_prevdepth:D } } }{ \par \mode_leave_vertical: \par \@@_get_text_width:Nn \l_@@_tmpa_dim {#1} \group_begin: #1 \group_end: \clist_use:Nn #2 {#3} \par \cs_gset:Npx \@@_keywords_prevdepth: { \dim_use:N \tex_prevdepth:D } } } % \end{macrocode} % \end{macro} % % \subsection{符号表} % % \begin{environment}{notation} % 符号表环境,利用 \env{longtable} 封装。可选参数为表格列格式说明符。 % \begin{macrocode} \NewDocumentEnvironment { notation } { O { l p { 7.5 cm } } } { \@@_notation_begin: \group_begin: \@@_notation_long_table_setup: \longtable {#1} } { \endlongtable \group_end: } % \end{macrocode} % \end{environment} % % \begin{macro}{\@@_notation_begin:} % 符号表页标题。 % \begin{macrocode} \cs_new_protected:Npn \@@_notation_begin: { \@@_chapter_no_toc:V \c_@@_name_notation_tl } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_notation_long_table_setup:} % 调整 \cs{LTpre} 和 \cs{LTpost},以删去 \env{longtable} 前后的空白。 % 英文模板中还需要调整表格的行距。注意 \tn{arraystretch} 只是一个简单 % 宏,不能使用 \cs{fp_set:Nn}。 % \begin{macrocode} \cs_new_protected:Npn \@@_notation_long_table_setup: { \dim_set_eq:NN \LTpre \c_zero_dim \dim_set_eq:NN \LTpost \c_zero_dim } % \end{macrocode} % \end{macro} % % \subsection{致谢} % % \begin{environment}{acknowledgement} % 致谢环境,只是简单地设置章节不编号标题。 % \begin{macrocode} \NewDocumentEnvironment { acknowledgement } { } { \group_begin: \@@_chapter:V \c_@@_name_ack_tl } { \group_end: } % \end{macrocode} % \end{environment} % % \subsection{个人简历} % % \begin{environment}{resume} % 个人简历环境,只是简单地设置章节不编号标题。 % \begin{macrocode} \NewDocumentEnvironment { resume } { } { \group_begin: \@@_chapter:V \c_@@_name_resume_tl } { \group_end: } % \end{macrocode} % \end{environment} % % \begin{macro}{\resumeitem,\researchitem} % 学习经历。 % \begin{macrocode} \NewDocumentCommand{ \resumitem }{ O{ 学习经历 } } {% \vspace{24bp}{\zihao{-4}\nwafu@hei\bfseries\centerline{#1}}\par\vspace{6bp} } % \end{macrocode} % 学术成果。 % \begin{macrocode} \NewDocumentCommand{ \researchitem }{ O{ 发表的学术论文 } } {% \vspace{32bp}{\zihao{-4}\nwafu@hei\bfseries\centerline{#1}}\par\vspace{14bp} } % \end{macrocode} % \end{macro} % % \begin{environment}{publications} % \begin{environment}{achievements} % 个人简历中发论文和研究成果列表环境。 % \begin{macrocode} \newlist{publications}{enumerate}{1} \setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=3bp, leftmargin=10mm,before=\zihao{5},resume} \newlist{achievements}{enumerate}{1} \setlist[achievements]{label=[\arabic*],align=left,nosep,itemsep=3bp, leftmargin=10mm,before=\zihao{5}} \def\publicationskip{\bigskip\bigskip} % \end{macrocode} % \end{environment} % \end{environment} % % \changes{v1.10}{2022/03/17}{直接使用胡振震制定的gb7714-NWAFU实现参考文献样式控制。} % \changes{v1.14}{2022/05/26}{调整作者姓在前名在后,缩写不加点。} % \changes{v1.15}{2022/05/28}{调整姓在前名在后缩写标点符号。} % % \subsection{参考文献著录与引用} % % \begin{variable}{\l_@@_bib_resource_clist} % 保存参考文献数据库列表。 % \begin{macrocode} \clist_new:N \l_@@_bib_resource_clist % \end{macrocode} % \end{variable} % % \begin{macrocode} \keys_define:nn { nwafu / style } { % \end{macrocode} % \begin{macro}{style/bib-resource} % 参考文献数据源。 % \begin{macrocode} bib-resource .clist_set:N = \l_@@_bib_resource_clist } % \end{macrocode} % \end{macro} % % 为了保证导言区中的设置能起作用,\pkg{biblatex} 宏包均需要在 % 导言区末尾载入(仍在 \pkg{hyperref} 之前),并做相关设置。 % \begin{macrocode} \@@_at_end_preamble:n { \@@_biblatex_pre_setup: \RequirePackage { biblatex } \@@_biblatex_post_setup: } % \end{macrocode} % % \begin{macro}{ % \@@_biblatex_pre_setup:, % \@@_biblatex_post_setup:, % \@@_pass_options_to_biblatex:n} % \pkg{biblatex} 相关设置。 % \begin{macrocode} \cs_new_protected:Npn \@@_biblatex_pre_setup: { % \end{macrocode} % 参考文献引用与著录样式。 % \begin{macrocode} \@@_pass_options_to_biblatex:n { style = gb7714-NWAFU } % \end{macrocode} % 其它参数。 % \begin{macrocode} % \@@_pass_options_to_biblatex:n % { % backend = biber, % sortlocale=zh__pinyin, gbtype=false, % maxbibnames=99, maxcitenames=2, mincitenames=1, % gbpub=false, uniquename=false, uniquelist=false, % gbnamefmt=lowercase, % doi=false, isbn=false, % gbfieldtype=true, gbpunctin=false, % } } \cs_new_protected:Npn \@@_biblatex_post_setup: { % \end{macrocode} % 载入参考文献数据源文件。 % \begin{macrocode} \clist_map_function:NN \l_@@_bib_resource_clist \addbibresource % \end{macrocode} % 修改参考文献标题。 % \begin{macrocode} \defbibheading { bibliography } [ \bibname ] { \@@_chapter:n {##1} } % \end{macrocode} % 修订著录列表中字号为5号字。 % \begin{macrocode} \renewcommand{\bibfont}{\zihao{5}} % \end{macrocode} % 修订著录列表中英文页码范围连接符号。 % \begin{macrocode} \DefineBibliographyExtras{english}{% \renewcommand*{\bibrangedash}{% \iffieldequalstr{userd}{chinese}% {% \c_@@_fwid_tilde_tl%$\sim$ }{% \textendash\penalty\hyphenpenalty } } } % \end{macrocode} % 修订姓名之间及名缩写后的标点符号。 % \begin{macrocode} \def\gbcaselocalset{% \renewrobustcmd*{\bibinitperiod}{}% \renewcommand*{\revsdnamepunct}{}% %\renewrobustcmd*{\bibinitdelim}{}% } \renewbibmacro*{name:family-given}[4]{% \gbcaselocalset% \ifuseprefix{% \usebibmacro{name:delim}{##3##1}% \usebibmacro{name:hook}{##3##1}% \mkbibcompletenamefamilygiven{% \ifdefvoid{##3}{} {% \ifcapital {\mkbibnameprefix{\MakeCapital{##3}}\isdot} {\mkbibnameprefix{##3}\isdot}% \ifprefchar{}{\bibnamedelimc} }% \mkbibnamefamily{##1}\isdot \ifdefvoid{##4}{} {\bibnamedelimd\mkbibnamesuffix{##4}\isdot}% \ifdefvoid{##2}{} {\revsdnamepunct\bibnamedelimd\mkbibnamegiven{##2}\isdot} } }{% \usebibmacro{name:delim}{##1}% \usebibmacro{name:hook}{##1}% \mkbibcompletenamefamilygiven{% \mkbibnamefamily{##1}\isdot \ifdefvoid{##4}{} {\bibnamedelimd\mkbibnamesuffix{##4}\isdot}% \ifboolexpe{% test {\ifdefvoid{##2}} and test {\ifdefvoid{##3}} }{} {\revsdnamepunct}% \ifdefvoid{##2}{} {\bibnamedelimd\mkbibnamegiven{##2}\isdot}% \ifdefvoid{##3}{} {\bibnamedelimd\mkbibnameprefix{##3}\isdot} } } } } \cs_new_protected:Npn \@@_pass_options_to_biblatex:n #1 { \PassOptionsToPackage {#1} { biblatex } } % \end{macrocode} % \end{macro} % % \subsection{间距设置} % % 段落间距 % \begin{macrocode} \skip_set:Nn \parskip { 0pt plus 2pt minus 1pt } % \end{macrocode} % 浮动体顶端与底端所留距离 % \begin{macrocode} \skip_set:Nn \intextsep { 14pt plus 2pt minus 2pt } % \end{macrocode} % 最后一个浮动对象顶端或第一个浮动对象底端与正文之间的距离 % \begin{macrocode} \skip_set:Nn \textfloatsep { 16pt plus 2pt minus 4pt } \allowdisplaybreaks[4] \ctex_after_end_preamble:n { % \end{macrocode} % 公式前的距离 % \begin{macrocode} \skip_set:Nn \abovedisplayskip { 5pt plus 1pt minus 1pt } % \end{macrocode} % 公式后的距离 % \begin{macrocode} \skip_set:Nn \belowdisplayskip { 5pt plus 1pt minus 1pt } % \end{macrocode} % 公式前与文本的距离 % \begin{macrocode} \skip_set:Nn \abovedisplayshortskip { 0pt } % \end{macrocode} % 公式后与文本的距离 % \begin{macrocode} \skip_set:Nn \belowdisplayshortskip { 5pt plus 1pt minus 1pt } } % \end{macrocode} % % \changes{v1.11}{2022/04/02}{修订本科生enumerate编号两端括号为中文全角括号。} % % \subsection{\env{enumerate}列表环境设置} % % \begin{macrocode} \cs_new_protected:Npn \@@_enumitem_label_set:nn #1#2 { \SetEnumitemValue{label}{#1}{#2} } \clist_map_inline:nn { { bullet } { \textbullet }, { endash } { \normalfont\bfseries\textendash }, { asterisk } { \textasteriskcentered }, { arabic } { \c_@@_fwid_left_paren_tl\arabic*\c_@@_fwid_right_paren_tl }, { alph } { \c_@@_fwid_left_paren_tl\alph*\c_@@_fwid_right_paren_tl }, { roman } { \c_@@_fwid_left_paren_tl\roman*\c_@@_fwid_right_paren_tl }, { alph } { \c_@@_fwid_left_paren_tl\alph*\c_@@_fwid_right_paren_tl }, { roman } { \roman*. }, { outline } { \upshape\ding{111} } } { \@@_enumitem_label_set:nn #1 } \SetEnumitemValue{font}{sf}{\normalfont\sffamily} \SetEnumitemValue{ref}{enumii}{\arabic{enumi}.\alph*} \SetEnumitemValue{ref}{enumiii}{\arabic{enumi}.\alph{enumii}.\roman*} \setlist { nosep, leftmargin = *, labelindent = \dimexpr\parindent+0pt\relax, labelsep = 0pt, wide = \parindent, } \setlist[itemize,1]{label = bullet} \setlist[itemize,2]{label = endash} \setlist[itemize,3]{label = asterisk} \setlist[enumerate,1]{label = arabic,ref = \arabic*} \setlist[enumerate,2]{label = alph,ref = enumii} \setlist[enumerate,3]{label = roman,ref = enumiii,labelwidth = *} \setlist[description]{font = sf,labelwidth = *,leftmargin = 2\ccwd} % \end{macrocode} % % \subsection{\pkg{hyperref} 相关配置} % % \emph{\pkg{hyperref}相关配置完成使用\cls{fduthesis}模板的代码}。 % % \begin{macro}{\hypersetup,\nwafu_hyperref_setup:n} % \pkg{hyperref} 宏包是在导言区之后才引入的。若要在导言区中使用 % \tn{hypersetup} 命令,必须另行定义。 % \begin{macrocode} \NewDocumentCommand \hypersetup { m } { \nwafu_hyperref_setup:n {#1} } \cs_new_protected:Npn \nwafu_hyperref_setup:n #1 { \clist_gput_right:Nn \g_@@_to_hyperref_clist {#1} } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_set_hyperlink_color_key:n} % 设置超链接颜色选项。最后的逗号用于确保 \pkg{l3keys} 可以正确解析,不能省去。 % \begin{macrocode} \cs_new:Npn \@@_set_hyperlink_color_key:n #1 { hyperlink-color / \clist_item:nn {#1} {1} .code:n = { \@@_define_hyperlink_color:nnn { \clist_item:nn {#1} {2} } { \clist_item:nn {#1} {3} } { \clist_item:nn {#1} {4} } \nwafu_hyperref_setup:n { linkcolor = nwafu@link, linkbordercolor = nwafu@link, urlcolor = nwafu@url, urlbordercolor = nwafu@url, citecolor = nwafu@cite, citebordercolor = nwafu@cite } }, } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_define_hyperlink_color:nnn} % 定义超链接颜色。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_hyperlink_color:nnn #1#2#3 { \definecolorset { HTML } { nwafu@ } { } { link, #1; url, #2; cite, #3 } } % \end{macrocode} % \end{macro} % % \begin{macrocode} \keys_define:nx { nwafu / style } { % \end{macrocode} % % \begin{macro}{style/hyperlink} % 超链接样式。 % \begin{macrocode} hyperlink .choice:, hyperlink .value_required:n = true, hyperlink / border .code:n = { }, hyperlink / color .code:n = { \nwafu_hyperref_setup:n { colorlinks = true } }, hyperlink / none .code:n = { \nwafu_hyperref_setup:n { hidelinks = true } }, % \end{macrocode} % \end{macro} % % \begin{macro}{style/hyperlink-color} % 超链接颜色。 % \begin{macrocode} hyperlink-color .choice:, hyperlink-color .value_required:n = true, \clist_map_function:nN { { autumn, D70000, D75F00, AF8700 }, { business, D14542, 295497, 1F6E43 }, { classic, FF0000, 0000FF, 00FF00 }, { default, 990000, 0000B2, 007F00 }, { elegant, 961212, C31818, 9B764F }, { fantasy, FF4A19, FF3F94, 934BA1 }, { material, E91E63, 009688, 4CAF50 }, { science, CA0619, 389F9D, FF8920 }, { summer, 00AFAF, 5F5FAF, 5F8700 }, { graylevel, 616161, 616161, 616161 }, { prl, 2D3092, 2D3092, 2D3092 } } \@@_set_hyperlink_color_key:n } % \end{macrocode} % \end{macro} % % \begin{macro}{\nwafu_allow_url_break:,\@@_add_url_break_points:} % 允许 URL 在字母、数字和一些特殊符号处断行。见 % \url{https://bit.ly/2hhIjLW}。 % \begin{macrocode} \cs_new:Npn \nwafu_allow_url_break: { \cs_new:Npn \@@_add_url_break_points: { \tl_map_function:NN \c_@@_url_break_points_tl \do } \@@_appto_cmd:Nn \UrlBreaks { \UrlOrds \@@_add_url_break_points: } } % \end{macrocode} % \end{macro} % % \begin{variable}{\c_@@_url_break_points_tl} % 额外的断行位置是 26 个英文字母(大小写)以及 10 个阿拉伯数字。 % \pkg{url} 提供的宏 \tn{UrlBreaks} 还包含了特殊符号 |*|、|-|、 % |~|、|'|、|"|、|-|,也被设置为允许断行。 % \begin{macrocode} \tl_const:Nn \c_@@_url_break_points_tl { abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 } % \end{macrocode} % \end{variable} % % 在导言区末尾引入 \pkg{hyperref} 宏包。 % \begin{macrocode} \ctex_at_end_preamble:n { \RequirePackage { hyperref } % \end{macrocode} % 此后 \tn{hypersetup} 命令由 \pkg{hyperref} 宏包接管。 % \begin{macrocode} \tl_set_eq:NN \l_tmpa_tl \l_@@_info_title_tl \tl_replace_all:Nnn \l_tmpa_tl { \\ } { ~ } \hypersetup { bookmarksnumbered = true, psdextra = true, unicode = true, % \end{macrocode} % 填写 PDF 元信息。 % \begin{macrocode} %<*class> pdftitle = \l_tmpa_tl, pdfauthor = \l_@@_info_author_tl, pdfkeywords = \l_@@_abstract_keywords_clist, % % pdfsubject = , pdfcreator = \c_@@_name_pdf_creator_tl } % \end{macrocode} % 将导言区中通过 \cs{nwafu_hyperref_setup:n} 进行的设置传入 % \tn{hypersetup}。 % \begin{macrocode} \exp_args:NV \hypersetup \g_@@_to_hyperref_clist % \end{macrocode} % URL 断行处理。 % \begin{macrocode} \nwafu_allow_url_break: % \end{macrocode} % 手动开启 \pkg{biblatex} 的 \pkg{hyperref} 支持。 % \begin{macrocode} \BiblatexManualHyperrefOn } % \end{macrocode} % % 在 PDF 字符串中设置 \tn{nwafu@kai} 命令为空,以抑制 \pkg{hyperref} % 的警告信息。 % \begin{macrocode} \ctex_at_end_package:nn { hyperref } { \pdfstringdefDisableCommands { \cs_set_eq:NN \nwafu@kai \prg_do_nothing: \cs_set_eq:NN \quad \c_space_tl \cs_set_eq:NN \qquad \c_space_tl } } % \end{macrocode} % % 引用标题配置。 % \begin{macrocode} \labelformat{part}{\CTEXthepart} \labelformat{chapter}{\CTEXthechapter} \labelformat{figure}{\figurename~#1} \labelformat{table}{\tablename~#1} \def\figureautorefname{图} \def\tableautorefname{表} \keys_set_known:nn { ctex } { figurename = 图, tablename = 表, } \labelformat{equation}{式(#1)} \labelformat{section}{第 #1 节} \labelformat{subsection}{第 #1 小节} % \end{macrocode} % % \subsection{用户接口} % % \begin{macro}{abstract,info,style} % 定义元(meta)键值对。 % \begin{macrocode} \keys_define:nn { nwafu } { abstract .meta:nn = { nwafu / abstract } {#1}, info .meta:nn = { nwafu / info } {#1}, style .meta:nn = { nwafu / style } {#1} } % \end{macrocode} % \end{macro} % % 文档类初始设置。 % \begin{macrocode} \keys_set:nn { nwafu } { style / font-size = -4, style / fullwidth-stop = false, style / auto-make-cover = true, style / logo = { logo/nwafu-bar.pdf }, style / logo-size = { 0.65 \textwidth }, style / hyperlink = none, style / hyperlink-color = default, info / degree = academic, info / secret-level = none, info / school-id = { 10712 }, info / date = { \zhtoday }, theorem / header-font = { \sffamily }, theorem / body-font = { \nwafu@kai }, theorem / counter = { chapter } } % \end{macrocode} % % \begin{macro}{\nwafuset} % 用户设置接口。 % \begin{macrocode} \NewDocumentCommand \nwafuset { m } { \keys_set:nn { nwafu } {#1} } % \end{macrocode} % \end{macro} % % \begin{environment}{proof} % \begin{environment}{axiom} % \begin{environment}{corollary} % \begin{environment}{definition} % \begin{environment}{example} % \begin{environment}{lemma} % \begin{environment}{theorem} % 模板预定义的常用数学环境。 % 其中的“证明”比较特殊,它不编号,但会添加证毕符号。 % \begin{macrocode} \newtheorem* { proof } { \c_@@_name_proof_tl } \newtheorem { axiom } { \c_@@_name_axiom_tl } \newtheorem { corollary } { \c_@@_name_corollary_tl } \newtheorem { definition } { \c_@@_name_definition_tl } \newtheorem { example } { \c_@@_name_example_tl } \newtheorem { lemma } { \c_@@_name_lemma_tl } \newtheorem { theorem } { \c_@@_name_theorem_tl } % % \end{macrocode} % \end{environment} % \end{environment} % \end{environment} % \end{environment} % \end{environment} % \end{environment} % \end{environment} % % \begin{macrocode} %<@@=> % \end{macrocode} % % \clearpage % % \end{implementation} %