From 096b4351da025f1c63714aa2a004fdd74f09bc71 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 21 Mar 2022 20:35:25 +0000 Subject: nwafuthesis (21mar22) git-svn-id: svn://tug.org/texlive/trunk@62872 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/nwafuthesis/README.md | 14 +- .../doc/latex/nwafuthesis/logo/nwafu-bar.pdf | Bin 0 -> 694569 bytes .../texmf-dist/doc/latex/nwafuthesis/nwafudoc.cls | 2 +- .../doc/latex/nwafuthesis/nwafuthesis.pdf | Bin 2337649 -> 2276200 bytes .../source/latex/nwafuthesis/nwafuthesis.dtx | 1702 ++++++++------------ .../texmf-dist/tex/latex/nwafuthesis/nwafu-bar.pdf | Bin 694569 -> 0 bytes .../tex/latex/nwafuthesis/nwafuthesis.cls | 1339 ++++++--------- 7 files changed, 1187 insertions(+), 1870 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/nwafuthesis/logo/nwafu-bar.pdf delete mode 100644 Master/texmf-dist/tex/latex/nwafuthesis/nwafu-bar.pdf diff --git a/Master/texmf-dist/doc/latex/nwafuthesis/README.md b/Master/texmf-dist/doc/latex/nwafuthesis/README.md index d37c15fee06..0d1d0d0a36d 100644 --- a/Master/texmf-dist/doc/latex/nwafuthesis/README.md +++ b/Master/texmf-dist/doc/latex/nwafuthesis/README.md @@ -1,7 +1,7 @@ -The nwafuthesis Class -LaTeX thesis template for Northwest A&F University, China, v1.01 +## The nwafuthesis Class +LaTeX thesis template for Northwest A&F University, China, v1.10 -Overview +## Overview This template supports doctoral or master dissertion and undergraduate thesis in Chinese. With the help of modern LaTeX3 technology, nwafuthesis aims to create a simple interface, a normative format, as well as a hackable class for the users. At present, nwafuthesis only supports XeTeX and LuaTEX engines. nwafuthesis only allows UTF-8 encoding. @@ -10,7 +10,7 @@ The documentation can be found in nwafuthesis.pdf (in Chinese). Gitee re­pos­i­tory: https://gitee.com/nwafu_nan/nwafuthesis-l3. -Installation +## Installation To install nwafuthesis, you can use one of the following methods: If you are running TeX Live or MikTeX, the simplest way is to use that distribution's package manager. @@ -24,10 +24,10 @@ For permanent installation, you may move the following files into a directory wh nwafuthesis.cls Do not forget to update the filename database afterwards. -Contributing +## Contributing Issues and pull requests are always welcome. -License +## License 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. -Copyright (C) 2017–2021 by Nan Geng . +Copyright (C) 2017–2022 by Nan Geng . diff --git a/Master/texmf-dist/doc/latex/nwafuthesis/logo/nwafu-bar.pdf b/Master/texmf-dist/doc/latex/nwafuthesis/logo/nwafu-bar.pdf new file mode 100644 index 00000000000..13837d2d693 Binary files /dev/null and b/Master/texmf-dist/doc/latex/nwafuthesis/logo/nwafu-bar.pdf differ diff --git a/Master/texmf-dist/doc/latex/nwafuthesis/nwafudoc.cls b/Master/texmf-dist/doc/latex/nwafuthesis/nwafudoc.cls index 6999a67767f..749d8bd7061 100644 --- a/Master/texmf-dist/doc/latex/nwafuthesis/nwafudoc.cls +++ b/Master/texmf-dist/doc/latex/nwafuthesis/nwafudoc.cls @@ -31,7 +31,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: nwafuthesis.dtx 1.01 2021-08-07 Nan Geng $ +\GetIdInfo $Id: nwafuthesis.dtx 1.10 2022-03-17 Nan Geng $ {Documentation class for nwafuthesis} \ProvidesExplClass{nwafudoc} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/doc/latex/nwafuthesis/nwafuthesis.pdf b/Master/texmf-dist/doc/latex/nwafuthesis/nwafuthesis.pdf index 1d605186a89..17858a00995 100644 Binary files a/Master/texmf-dist/doc/latex/nwafuthesis/nwafuthesis.pdf and b/Master/texmf-dist/doc/latex/nwafuthesis/nwafuthesis.pdf differ diff --git a/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx b/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx index 8acbeab6cef..37bb5960744 100644 --- a/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx +++ b/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx @@ -110,7 +110,7 @@ %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} %<*!(driver|install)> -%\GetIdInfo $Id: nwafuthesis.dtx 1.01 2021-08-07 Nan Geng $ +%\GetIdInfo $Id: nwafuthesis.dtx 1.10 2022-03-17 Nan Geng $ % {Thesis template for Northwest A\&F University} %\ProvidesExplClass{\ExplFileName} % {Definition file for nwafuthesis} @@ -143,12 +143,12 @@ \textbf{\nwafuthesis: 西北农林科技大学学位论文 \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{耿楠} -\date{\today\quad v1.01% +\date{\today\quad v1.10% \thanks{\url{https://gitee.com/nwafu_nan/nwafuthesis-l3}.}} \begin{document} % \DisableImplementation - \EnableImplementation + \EnableImplementation % \def\nwafuCODEDOC{} \DocInput{nwafuthesis.dtx} \DocInput{nwafuthesis-doc.dtx} @@ -159,6 +159,7 @@ % % \fi % +% \changes{v1.10}{2022/03/17}{更新实现细节。} % \changes{v1.00}{2021/06/06}{开始发布测试。} % \changes{v1.00}{2021/05/12}{开始编写模板。} % @@ -245,7 +246,8 @@ % 建议先阅读相关入门文档,如刘海洋编著的《\LaTeX{} 入门》 % \scite{刘海洋2013latex入门} 第一章,或大名鼎鼎的“\pkg{lshort}” % \scite{lshort} 及其中文翻译版 \scite{lshort-zh-cn}。当然, -% 网络上诸如耿楠录制的\LaTeX{}教学系列视频等入门教程多如牛毛,可以自行选取学习。 +% 网络上诸如耿楠录制的\LaTeX{}教学系列视频等入门教程多如牛毛, +% 可以自行选取学习。 % % \subsection*{关于本文档} % @@ -350,7 +352,6 @@ % \file{nwafuthesis.cls} & 模板文档类 \\ % \file{nwafudoc.cls} & 编译该用户手册时需要的文档类 \\ % \file{nwafuthesis.pdf} & 用户手册 \\ -% \file{main.tex} & 空白模板,可以此为基础撰写论文 \\ % \bottomrule % \end{tabular} % \end{table} @@ -359,8 +360,10 @@ % % \subsection{基本用法} % -% 在当前工作目录下创建一个名为logo的文件夹,并将学校的\enquote{\texttt{nwafu-bar.pdf}} -% logo矢量图保存在该文件夹内,然后建立如下一份简单的 \TeX{} 文档,它演示了 \cls{nwafuthesis} +% 在当前工作目录下创建一个名为logo的文件夹, +% 并将学校的\enquote{\texttt{nwafu-bar.pdf}} +% logo矢量图保存在该文件夹内,然后建立如下一份 +% 简单的 \TeX{} 文档,它演示了 \cls{nwafuthesis} % 的最基本用法: % \begin{latexexample}[deletetexcs={\documentclass},% % moretexcs={\chapter},morekeywords={\documentclass},% @@ -377,12 +380,11 @@ % 按照 \ref{subsec:编译方式}~小节中的方式编译该文档,应当得到 % 一篇包含封面、独创声明等在内的空白论文(研究生7页,本科生3页)。 % -% % \subsection{编译方式} \label{subsec:编译方式} % % 本模板不支持 \pdfTeX{} 引擎,请使用 \XeLaTeX{} 或 \LuaLaTeX{} -% 编译,推荐使用 \XeLaTeX{}编译。为了生成正确的目录、脚注、参考文献以及交叉引用, -% 至少需要连续编译四次。 +% 编译,推荐使用 \XeLaTeX{}编译。为了生成正确的目录、脚注、参考 +% 文献以及交叉引用,至少需要连续编译4次。 % % 假设\TeX{} 源文件名为 \file{main.tex},使用 \XeLaTeX{} 编译论文。 % 则在命令行中可以顺序执行: @@ -434,7 +436,7 @@ % type = (**) % \end{nwafusyntax} % 选择论文类型。三种选项分别代表博士学位论文、硕士学位论文和本科 -% 毕业论文。 +% 毕业论文(设计)。 % \end{function} % % \begin{function}[added=2021-05-12]{oneside,twoside} @@ -478,7 +480,7 @@ % 所有选项均可通过统一的\cs{nwafuset}命令进行设置。 % \end{function} % -% \cs{nwafuset} 的参数是一组由(英文)逗号隔开的选项列表,列表中的 +% \cs{nwafuset} 的参数是一组由(英文)逗号分隔的选项列表,列表中的 % 选项通常是 \kvopt{\meta{key}}{\meta{value}} 形式。部分选项的 % \meta{value} 可以省略。对于同一项,后续设置会覆盖以前的设置。 % 在下文的说明中,将用\textbf{粗体}表示默认值。 @@ -528,7 +530,7 @@ % style = (*\marg{键值列表}*) % style/(*\meta{key}*) = (*\meta{value}*) % \end{nwafusyntax} -% 该选项包含多个子项目,用于设置字体、字号等论文格式,具体内容见下。 +% 该选项包含多个子项目,用于设置字体、字号等论文格式。 % \end{function} % % \begin{function}[added=2021-05-12]{style/font} @@ -781,9 +783,6 @@ % % \subsubsection{信息录入} \label{subsubsec:信息录入} % -% \emph{这一部分代码基于\cls{fduthesis},并针对西北农林科技大学的要求, -% 进行了必要的删除和添加}。 -% % \begin{function}[added=2021-05-12]{info} % \begin{nwafusyntax}[emph={[1]info}] % info = (*\marg{键值列表}*) @@ -1054,6 +1053,18 @@ % % \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$七, % 本科生包括封面一和封面七)、中英文摘要、主要符号对照表和目录。 % 在前置部分中,中英文摘要开始至主要符号对照表,页码采用大写罗马字母,并且与目录分开计数。 @@ -1077,8 +1088,8 @@ % \begin{function}[added=2021-05-29]{\mainmatter,\mainmatter*} % \begin{nwafusyntax}[deletetexcs={\mainmatter,\mainmatter*}, % morekeywords={\mainmatter,\mainmatter*}] -% \mainmatter(*\oarg{编号格式|(Roman)}*) -% \mainmatter*(*\oarg{编号格式|(Roman)}*) +% \mainmatter +% \mainmatter* % \end{nwafusyntax} % \cs{mainmatter} 为主文区命令,章标题正常编号, % 且页码为从1开始计数的阿拉伯数字, @@ -1425,8 +1436,6 @@ % \item \pkg{footmisc},处理脚注。 % \item \pkg{ntheorem},提供增强版的定理类环境。 % \item \pkg{graphicx},提供图形插入的接口。 -% \item \pkg{longtable},长表格(允许跨页)支持。 -% \item \pkg{booktabs},三线表支持。 % \item \pkg{caption},用于设置标题。 % \item \pkg{bicaption},用于设置标题。 % \item \pkg{xcolor},提供彩色支持。 @@ -1437,7 +1446,8 @@ % \item 开启 \kvopt{style/footnote-style}{pifont} 后,会调用 % \pkg{pifont} 宏包。它属于 \pkg{psnfss} 套件。 % \item \pkg{biblatex} 宏包需要依赖 \biber{} 程序。参考文献样式由 -% \pkg{biblatex-gb7714-2015} 宏包提供\scite{biblatex,biblatex-gb7714-2015}。 +% \pkg{biblatex-gb7714-2015} 宏包提供的\texttt{gb7714-NWAFU}样式 +% 文件控制,请注意将其升级到最新版\scite{biblatex,biblatex-gb7714-2015}。 % \end{itemize} % % 这里只列出了本模板直接调用的宏包。这些宏包自身的调用情况, @@ -1635,7 +1645,7 @@ % 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。 % % 另有若干形如 \textcolor{MaterialPink}{\textsf{<@@=nwafu>}} 的 guard, -% 它们由 \pkg{l3docstrip} 定义,用来标识名字空间(模块)。 +% 它们用来标识名字空间(模块)。 % % \subsection{准备} % @@ -1646,10 +1656,10 @@ % % 检查 \LaTeX3 编程环境。 % \begin{macrocode} -\RequirePackage { xparse, xtemplate, l3keys2e } -\clist_map_inline:nn { expl3, xparse, xtemplate, l3keys2e } +\RequirePackage {xtemplate, l3keys2e } +\clist_map_inline:nn { xtemplate, l3keys2e } { - \@ifpackagelater {#1} { 2018/05/12 } + \@ifpackagelater {#1} { 2020/07/17 } { } { \msg_error:nnn { nwafuthesis } { l3-too-old } {#1} } } \msg_new:nnn { nwafuthesis } { l3-too-old } @@ -1677,7 +1687,6 @@ "#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\ your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex". } -\hook_gset_rule:nnnn { begindocument/before } { nwafuthesis } { < } { xeCJK } % \end{macrocode} % % \subsubsection{内部变量声明} @@ -1735,15 +1744,6 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\l_@@_withchap_bool} -% 是否按章编写论文(默认按章编写)。 -% 该选项是针对部分学院需要按报告形式(类似"1 绪论")撰写本科毕业论文(设计) -% 而设置的。 -% \begin{macrocode} -\bool_new:N \l_@@_withchap_bool -% \end{macrocode} -% \end{variable} -% % \begin{variable}{\g_@@_twoside_bool} % 是否开启双页模式(默认打开)。 % 本模板中,目前使用双页与单页模式的排版结果是一样的, @@ -1761,17 +1761,24 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\l_@@_withchap_bool} +% 是否按章编写论文(默认按章编写)。 +% 该选项是针对部分学院需要按报告形式(类似``1\ 绪论'')的形式 +% 撰写本科毕业论文(设计)而设置的。 +% \begin{macrocode} +\bool_new:N \l_@@_withchap_bool +% \end{macrocode} +% \end{variable} +% % \subsubsection{内部函数} % -% \begin{macro}{\cs_generate_variant:cn, -% \file_input:V, +% \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 \cs_generate_variant:Nn { cn } \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 } @@ -1825,6 +1832,18 @@ % \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} @@ -1899,6 +1918,7 @@ \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 } } @@ -1940,7 +1960,7 @@ twoside .code:n = { % \end{macrocode} -% 将双面设置为openany,从结果来讲与单面一样, +% 将双面设置为openany(我校特例),从结果来讲与单面一样, % 此处是为后续诸如页边距调整为左右不同保留的设置。 % \begin{macrocode} \clist_gput_right:Nn \g_@@_to_ctexbook_clist { twoside, openany } @@ -1980,7 +2000,7 @@ % % \subsection{模板参数配置} % -% \subsubsection{定义模板LOGO和中英文年月命令} +% \subsubsection{定义NWAFU LOGO和中英文年月命令} % % \begin{macro}{\nwafuthesis} % nwafuthesis模板的LOGO。 @@ -1988,7 +2008,8 @@ \NewDocumentCommand \nwafuthesis { } {% \makebox{\rmfamily% - N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex}{\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% + N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex} + {\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% \textsc{Thesis} } } @@ -2007,18 +2028,18 @@ % \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), +% 取得英文月年,详见:\\ +% 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 @@ -2048,7 +2069,7 @@ % \subsubsection{通用常量} % % 这一部分内容在原\cls{fduthesis}中,是通过``*.def''文件实现的, -% 由于针对本校而言这些内容极少发生改变,为了减少文件依赖,将其 +% 由于针对我校而言这些内容极少发生改变,为了减少文件依赖,将其 % 全部写入了\cls{nwafuthesis.cls}文件。 % % \begin{variable}{\c_@@_name_simp_tl,\c_@@_name_trad_tl, @@ -2115,40 +2136,46 @@ % \begin{variable}{\c_@@_orig_decl_text_tl} % 论文独创性声明。 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\cs_new_protected:Npn \@@_define_orig_decl_text: { + \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } + { % \end{macrocode} -% 研究生独创性声明,注意测试后,此处分段只能用\tn{par}实现。 +% 研究生独创性声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} - \tl_const:Nn \c_@@_orig_decl_text_tl - { - 本人声明:所呈交的学位论文是我个人在导师指导下独立进行的研究工作及取 - 得的研究结果;论文中的研究数据及结果的获得完全符合学校《关于规范西北 - 农林科技大学研究生学术道德的暂行规定》,如果违反此规定,一切后果与法 - 律责任均由本人承担。\par - 尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经 - 发表或撰写过的研究结果,也不包含其他人和自己本人已获得西北农林科技大 - 学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同事对本 - 研究所做的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + \tl_const:Nn \c_@@_orig_decl_text_tl + { + 本人声明:所呈交的学位论文是我个人在导师指导下独立进行的研究工作及取 + 得的研究结果;论文中的研究数据及结果的获得完全符合学校《关于规范西北 + 农林科技大学研究生学术道德的暂行规定》,如果违反此规定,一切后果与法 + 律责任均由本人承担。\par + + 尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经 + 发表或撰写过的研究结果,也不包含其他人和自己本人已获得西北农林科技大 + 学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同事对本 + 研究所做的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + } } - } - { + { % \end{macrocode} -% 本科生生独创性声明,注意测试后,此处分段只能用\tn{par}实现。 +% 本科生生独创性声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} - \tl_const:Nn \c_@@_orig_decl_text_tl - { - 本人声明:所呈交的毕业 - \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int } - 是我个人在导师指导下 - 独立进行的研究工作及取得的研究结果。尽我所知,除了文中特别加 - 以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究结果, - 也不包含其他人和自己本人已获得\c_@@_name_simp_tl{}或其它教育 - 机构的学位或证书而使用过的材料。与我一同工作的同事对本研究所做 - 的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 - 如违反此声明,一切后果与法律责任均由本人承担。 + \tl_const:Nn \c_@@_orig_decl_text_tl + { + 本人声明:所呈交的毕业 + \clist_item:Nn \c__@@_bachelor_type_clist + { \l__@@_info_bachelor_type_int } + 是我个人在导师指导下 + 独立进行的研究工作及取得的研究结果。尽我所知,除了文中特别加 + 以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究结果, + 也不包含其他人和自己本人已获得\c_@@_name_simp_tl{}或其它教育 + 机构的学位或证书而使用过的材料。与我一同工作的同事对本研究所做 + 的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + 如违反此声明,一切后果与法律责任均由本人承担。 + } } } +\@@_define_orig_decl_text: % \end{macrocode} % \end{variable} % @@ -2170,56 +2197,62 @@ % \begin{variable}{\c_@@_auth_decl_text_tl} % 论文使用授权声明。 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\cs_new_protected:Npn \@@_auth_orig_decl_text: { + \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } + { % \end{macrocode} -% 研究生使用授权声明,注意测试后,此处分段只能用\tn{par}实现。 +% 研究生使用授权声明,注意此处分段只能用\tn{par}实现。 % \begin{macrocode} - \tl_const:Nn \c_@@_auth_decl_text_tl - { - 本学位论文的知识产权归属西北农林科技大学。本人同意西北农林科技大学 - 保存或向国家有关部门或机构送交论文的纸质版和电子版,允许论文被查阅和 - 借阅;同意西北农林科技大学将本学位论文的全部或部分内容授权汇编录入 - 中国博士/硕士学位论文全文数据库》和《中国学位论文全文数据库》进行 - 出版,并享受相关权益。\par + \tl_const:Nn \c_@@_auth_decl_text_tl + { + 本学位论文的知识产权归属西北农林科技大学。本人同意西北农林科技大学 + 保存或向国家有关部门或机构送交论文的纸质版和电子版,允许论文被查阅和 + 借阅;同意西北农林科技大学将本学位论文的全部或部分内容授权汇编录入 + 中国博士/硕士学位论文全文数据库》和《中国学位论文全文数据库》进行 + 出版,并享受相关权益。\par - 本人保证,在毕业离开(或者工作调离)西北农林科技大学后,发表或者使用本 - 学位论文及其相关的工作成果时,将以西北农林科技大学为第一署名单位,否 - 则,愿意按《中华人民共和国著作权法》等有关规定接受处理并承担法律责任。\par + 本人保证,在毕业离开(或者工作调离)西北农林科技大学后,发表或者使用本 + 学位论文及其相关的工作成果时,将以西北农林科技大学为第一署名单位,否 + 则,愿意按《中华人民共和国著作权法》等有关规定接受处理并承担法律责任。\par - 任何收存和保管本论文各种版本的其他单位和个人(包括研究生本人)未经本 - 论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、改编等 - 侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》等有关规定处 - 理并追究法律责任。\par + 任何收存和保管本论文各种版本的其他单位和个人(包括研究生本人)未经本 + 论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、改编等 + 侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》等有关规定处 + 理并追究法律责任。\par - {\sffamily (保密的学位论文在保密期限内,不得以任何方式发表、借阅、复印、 - 缩印或扫描复制手段保存、汇编论文)} + {\sffamily (保密的学位论文在保密期限内,不得以任何方式发表、借阅、复印、 + 缩印或扫描复制手段保存、汇编论文)} + } } - } - { + { % \end{macrocode} -% 本科生使用授权声明,注意测试后,此处分段只能用\tn{par}实现。 +% 本科生使用授权声明,注意此处分段只能用\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_@@_name_simp_tl{}保存或向国家有关部门或机构 - 送交论文的纸质版和电子版,允许论文被查阅和借阅。\par + \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_@@_name_simp_tl{}保存或向国家有关部门或机构 + 送交论文的纸质版和电子版,允许论文被查阅和借阅。\par - 本人保证,在毕业离开\c_@@_name_simp_tl{}后,发表或者使用本毕业 - \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int } - 及其相关的工作成果时,将以\c_@@_name_simp_tl{} - 为第一署名单位,否则,愿意按《中华人民共和国著作权法》等 - 有关规定接受处理并承担法律责任。\par + 本人保证,在毕业离开\c_@@_name_simp_tl{}后,发表或者使用本毕业 + \clist_item:Nn \c__@@_bachelor_type_clist + { \l__@@_info_bachelor_type_int } + 及其相关的工作成果时,将以\c_@@_name_simp_tl{} + 为第一署名单位,否则,愿意按《中华人民共和国著作权法》等 + 有关规定接受处理并承担法律责任。\par - 任何收存和保管本论文各种版本的其他单位和个人(包括作者本人)未经 - 本论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、 - 改编等侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》 - 等有关规定处理并追究法律责任。 + 任何收存和保管本论文各种版本的其他单位和个人(包括作者本人)未经 + 本论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、 + 改编等侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》 + 等有关规定处理并追究法律责任。 + } } } +\@@_auth_orig_decl_text: % \end{macrocode} % \end{variable} % @@ -2227,25 +2260,29 @@ % \c_@@_super_decl_sign_tl} % 声明页签名项目。 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\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 - { 导师签名 } - } - { + \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 - { 指导教师签名 } + \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} @@ -2268,7 +2305,7 @@ % \end{variable} % % \begin{variable}{\c_@@_secret_clist} -% 四种密级,公开直接用,未列入。 +% 四种密级,公开无需列入。 % \begin{macrocode} \clist_const:Nn \c_@@_secret_clist { 限制, 秘密, 机密, 绝密 } % \end{macrocode} @@ -2301,45 +2338,50 @@ { pdf_creator } { LaTeX~ with~ nwafuthesis~ class }, } { \@@_define_name:nn #1 } -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } + +\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 } - }{ + \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 - }知识产权的说明 } + \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:nn #1 } } +\@@_define_name_const_zh: % % \end{macrocode} % 研究生与本科生相同的中英文字段。 @@ -2351,45 +2393,49 @@ } { \@@_define_name:nnn #1 } % -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\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 } { 关键字 } { KEYWORDS }, - { clc } { 分类号 } { CLC~ number: }, - { notation } { 主要符号对照表 } { List~ of~ Symbols } - } - { \@@_define_name:nnn #1 } - }{ + \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 } { 关键字 } { KEYWORDS }, + { 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 }, + \clist_map_inline:nn + { + { abstract } { 摘要 } { Abstract }, + { keywords } { 关键字 } { Keywords }, + { clc } { 分类号 } { CLC~ number }, + } + { \@@_define_name:nnn ##1 } } - { \@@_define_name:nnn #1 } } +\@@_define_name_const_zh_en: % \end{macrocode} % -% 定理标题中英文名称常量。 +% 定理定理类标题中英文名称常量。 % \begin{macrocode} % \clist_map_inline:nn @@ -2433,17 +2479,6 @@ { \PassOptionsToPackage #1 } % \end{macrocode} % -% 本模板会在 \pkg{ctexhook} 提供的钩子 \cs{ctex_at_end_preamble:n} -% 中调用 \pkg{biblatex},而 \pkg{biblatex} 自身又会使用 \pkg{etoolbox} -% 的钩子 \tn{AtEndPreamble},因此需要在载入 \cls{ctexbook} 之前调用 -% \pkg{etoolbox}。钩子的顺序为: -% \[ \text{\tn{CTEX@document@left@hook}} -% \prec \text{\tn{@endpreamblehook}} -% \prec \text{\texttt{\textbackslash begin\{document\}}}. \] -% \begin{macrocode} -\RequirePackage { etoolbox } -% \end{macrocode} -% % 载入 \cls{ctexbook} 文档类。 % 在使用 \XeLaTeX{} 编译时,\cls{ctexbook} 的底层将调用 \pkg{xeCJK} % 宏包;而在使用 \LuaLaTeX{} 编译时,则将调用 \pkg{LuaTeX-ja} 宏包。 @@ -2466,28 +2501,34 @@ ntheorem, enumitem, graphicx, - longtable, - booktabs, 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:nnn { package-too-old } {#1} {#3} } + { } { \@@_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 } { - Package~ "#1"~ is~ too~ old. \\ - The~ nwafuthesis~ class~ only~ supports~ "#1"~ with~ a~ version \\ - higher~ than~ v#2. \\\\ - Please~ update~ an~ up-to-date~ version~ of~ it~ using~ your \\ - TeX~ package~ manager~ or~ from~ CTAN. + #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} @@ -2495,13 +2536,9 @@ % \changes{v1.01}{2021/08/06}{由于无法获取ctex版本信息,暂时关闭对ctex版本检测。} % % \begin{macrocode} -%\@@_check_package:nnn { ctex } { 2020/04/30 } { 2.5 } -\@@_check_package:nnn { fontspec } { 2017/09/22 } { 2.6e } -\@@_check_package:nnn { unicode-math } { 2017/11/18 } { 0.8i } +\@@_check_class:nnn { ctexbook } { 2021/03/14 } { 2.5.6 } \sys_if_engine_xetex:T - { \@@_check_package:nnn { xeCJK } { 2017/08/07 } { 3.5.0 } } -\sys_if_engine_luatex:T - { \@@_check_package:nnn { xunicode-addon } { 2018/04/30 } { 3.7.1 } } + { \@@_check_package:nnn { xeCJK } { 2020/05/01 } { 3.8.3 } } % \end{macrocode} % % \subsection{页面布局} @@ -2513,40 +2550,44 @@ % 研究论文页面尺寸与本科生毕业论文(设计)的 % 页面尺寸不一致,需要分开设置。 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\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, - } - }{ + \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, + \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} % % 草稿模式下显示页面边框及页眉、页脚线 。 @@ -2581,7 +2622,6 @@ % \begin{macro}{style/cjk-font} % 预定义中文字体。 % \begin{macrocode} -%<*class> \keys_define:nn { nwafu / style } { cjk-font .choices:nn = @@ -2589,7 +2629,6 @@ { \tl_set_eq:NN \g_@@_cjk_fontset_tl \l_keys_choice_tl } } % \end{macrocode} -% % \end{macro} % % \begin{macro}{withchapter} @@ -2632,13 +2671,12 @@ % \@@_setCJKmonofont:nn} % 用于设置中文字体的辅助函数,来源于 \pkg{xeCJK} 和 \pkg{ctex} 宏包。 % \begin{macrocode} -%<*class> \cs_new_protected:Npn \@@_setCJKmainfont:nn #1#2 - { \@@_set_family:nnn { \CJKrmdefault } {#2} {#1} } + { \@@_set_family:xnn { \CJKrmdefault } {#2} {#1} } \cs_new_protected:Npn \@@_setCJKsansfont:nn #1#2 - { \@@_set_family:nnn { \CJKsfdefault } {#2} {#1} } + { \@@_set_family:xnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \@@_setCJKmonofont:nn #1#2 - { \@@_set_family:nnn { \CJKttdefault } {#2} {#1} } + { \@@_set_family:xnn { \CJKttdefault } {#2} {#1} } % \end{macrocode} % \end{macro} % @@ -2707,7 +2745,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_set_family:nnn,\@@_switch_family:n} +% \begin{macro}{\@@_set_family:nnn,\@@_set_family:xnn,\@@_switch_family:n} % 封装 CJK 字体族的设定和切换命令。 % \begin{macrocode} \sys_if_engine_xetex:TF @@ -2719,7 +2757,7 @@ \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} % @@ -2748,6 +2786,8 @@ % \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, @@ -2796,7 +2836,12 @@ \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 { BoldOblique } +% \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 } @@ -3068,12 +3113,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_load_cjk_font_founder: { - \@@_setCJKmainfont:nn { FZShuSong-Z01 } - { - UprightFont = *, - BoldFont = FZHei-B01, - ItalicFont = FZKai-Z03, - } + \@@_setCJKmainfont:n { FZShuSong-Z01 } \@@_setCJKsansfont:n { FZHei-B01 } \@@_setCJKmonofont:n { FZFangSong-Z02 } \@@_set_cjk_font_hei:n { FZHei-B01 } @@ -3176,8 +3216,8 @@ % % 探测操作系统,以设置中英文字体。 % \begin{macrocode} -\tl_new:N \l_@@_cjkfont_tl \tl_new:N \l_@@_font_tl +\tl_new:N \l_@@_cjkfont_tl \cs_new_protected:Npn \@@_detect_platform: { \sys_if_platform_windows:TF @@ -3205,17 +3245,15 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_load_font: { - \tl_if_empty:NTF \g_@@_fontset_tl + \tl_if_empty:NT \g_@@_fontset_tl { \@@_detect_platform: \tl_gset_eq:NN \g_@@_fontset_tl \l_@@_font_tl - }{ } - \tl_if_empty:NTF \g_@@_cjk_fontset_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 : } @@ -3271,12 +3309,11 @@ \RenewDocumentCommand \LARGE { } { \zihao { -2 } } \RenewDocumentCommand \huge { } { \zihao { 2 } } \RenewDocumentCommand \Huge { } { \zihao { 1 } } -%<*class> }, % \end{macrocode} % \end{macro} % -% \subsubsection{句号} +% \subsubsection{其它设置} % % \begin{macro}{style/fullwidth-stop} % 设置句号形状(圆圈或是圆点)。 @@ -3330,13 +3367,25 @@ % \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 } + \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{页眉页脚} % @@ -3359,7 +3408,7 @@ % \end{macrocode} % % \begin{macro}{\cleardoublepage} -% 重定义 \tn{cleardoublepage},使得偶数页面在没有内容时也不显示页眉页脚,见 +% 重定义 \tn{cleardoublepage},使得偶数页面在没有内容时不显示页眉页脚,见 % \url{https://tex.stackexchange.com/a/1683}。最后清空中间页眉,确保正文部分 % 页眉显示正确。 % \begin{macrocode} @@ -3390,9 +3439,9 @@ \cs_gset_eq:NN \nwafuhead\fancyhead \cs_gset_eq:NN \nwafufoot\fancyfoot % \end{macrocode} -% 重定义 \tn{frontmatter},带星号的命令不会启用\cs{cleardoublepage}。 +% 重定义 \tn{frontmatter},带星号的命令不启用\cs{cleardoublepage}。 % \begin{macrocode} -\RenewDocumentCommand{\frontmatter}{sO{Roman}} +\RenewDocumentCommand{\frontmatter}{s O{Roman}} { % \end{macrocode} % 判断是否有*号参数 @@ -3418,8 +3467,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } } }{ % \end{macrocode} @@ -3467,8 +3517,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } } }{ % \end{macrocode} @@ -3478,7 +3529,7 @@ } }{ % \end{macrocode} -% 单面模式,奇偶页设成一样 +% 单面模式 % \begin{macrocode} \nwafuhead [ C ] { @@ -3495,8 +3546,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 @@ -3547,8 +3599,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } } }{ % \end{macrocode} @@ -3575,8 +3628,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 @@ -3612,8 +3666,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } } }{ % \end{macrocode} @@ -3640,8 +3695,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } }{ % \end{macrocode} % 本科生偶数页页眉 @@ -3668,8 +3724,9 @@ % 研究生偶数页页眉 % \begin{macrocode} \nwafuhead[EC]{\small \nouppercase{ - \c_@@_name_simp_tl \clist_item:Nn - \c_@@_thesis_type_clist { \g_@@_thesis_type_int } } + \c_@@_name_simp_tl + \clist_item:Nn \c_@@_thesis_type_clist + { \g_@@_thesis_type_int } } } }{ % \end{macrocode} @@ -3713,109 +3770,112 @@ % % \subsection{章节标题设置} % -% |\keys_set:nn{ctex}| 实际相当于 \cs{ctexset}。 +% |\keys_set:nn{ctex}| 实际相当于调用 \cs{ctexset}。 % % 设置章(chapter)、节(section)与小节(sub-section)标题样式。 % 此处使用 \kvopt{fixskip}{true} 选项来抑制前后的多余间距。 % % 设置标题级别 % \begin{macrocode} -\int_compare:nNnTF{ \g_@@_thesis_type_int } < { 3 } +\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 \bfseries \centering, - beforeskip = 1.47\baselineskip, - afterskip = 1.24\baselineskip, - number = \@@_arabic:n { chapter }, - fixskip = true - }, - section = - { - format = \zihao{-3} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 1.09\baselineskip, - afterskip = 0.80\baselineskip, - fixskip = true - }, - subsection = + \keys_set:nn { ctex } { - format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 0.80\baselineskip, - fixskip = true - }, - subsubsection = - { - format = \zihao{-4} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 0.40\baselineskip, - afterskip = 0.40\baselineskip, - fixskip = true + secnumdepth = 3, + chapter = + { + pagestyle = fancy, + aftername = \hspace*{1.0\ccwd}, + format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, + beforeskip = 1.47\baselineskip, + afterskip = 1.24\baselineskip, + number = \@@_arabic:n { chapter }, + fixskip = true + }, + section = + { + format = \zihao{-3} \normalfont \nwafu@hei \bfseries \raggedright, + beforeskip = 1.09\baselineskip, + afterskip = 0.80\baselineskip, + fixskip = true + }, + subsection = + { + format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright, + beforeskip = 0.80\baselineskip, + fixskip = true + }, + subsubsection = + { + format = \zihao{-4} \normalfont \nwafu@hei \bfseries \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 = \@@_arabic:n { chapter }, - aftername = \hspace*{\ccwd}, - format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, - beforeskip = 0.25\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true - }, - section = - { - aftername = \hspace*{0.5\ccwd}, - format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 0.60\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true, - afterindent = true, - }, - subsection = + \keys_set:nn { ctex } { - aftername = \hspace*{0.5\ccwd}, - format = \zihao{-4} \normalfont \nwafu@hei \bfseries, - beforeskip = 0.60\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true, - afterindent = true, - % indent = 2\ccwd, - }, - subsubsection = - { - name = {(,)}, - aftername = \hspace*{0.5\ccwd}, - number = \@@_arabic:n { subsubsection }, - format = \zihao{-4} \normalfont, - beforeskip = 0.60\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true, - % afterindent = true, - indent = 2\ccwd, + secnumdepth = 3, + chapter = + { + pagestyle = fancy, + name = { \bool_if:NT \l_@@_withchap_bool {第}, + \bool_if:NT \l_@@_withchap_bool {章} }, + number = \@@_arabic:n { chapter }, + aftername = \hspace*{\ccwd}, + format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, + beforeskip = 0.25\baselineskip, + afterskip = 0.65\baselineskip, + fixskip = true + }, + section = + { + aftername = \hspace*{0.5\ccwd}, + format = \zihao{4} \normalfont \nwafu@hei \bfseries \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 \bfseries, + beforeskip = 0.60\baselineskip, + afterskip = 0.65\baselineskip, + fixskip = true, + afterindent = true, + % indent = 2\ccwd, + }, + subsubsection = + { + name = {(,)}, + aftername = \hspace*{0.5\ccwd}, + 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 { @@ -3830,7 +3890,7 @@ % \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 @@ -3844,7 +3904,7 @@ % \end{macro} % % \begin{macro}{\@@_chapter_header:n} -% 单页模式下,目录、摘要、符号表等的页眉中间为相应标题,左右为空。 +% 单面排版模式下,目录、摘要、符号表等的页眉中间为相应标题,左右为空。 % \begin{macrocode} \cs_new_protected:Npn \@@_chapter_header:n #1 { @@ -4177,7 +4237,6 @@ % \end{macrocode} % \end{macro} % -% % \begin{macro}{\newtheorem} % 定义新的定理环境。 % \begin{macrocode} @@ -4194,7 +4253,6 @@ % \end{macrocode} % 设置默认样式为 \opt{plain}。 % \begin{macrocode} -% TODO: (2017-12-07) Move to interface \tl_set:Nn \l_@@_thm_style_tl { plain } % \end{macrocode} % 处理可选参数。利用 |nwafu/theorem| 键值对设置,并按此修改证毕符号、 @@ -4778,8 +4836,7 @@ \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 }} - % \fbox[b]{\parbox {#1} { \centering #2 }} + \hbox_to_wd:nn {\l_@@_tmpt_dim} { \hfil #2 \hfil } } \cs_generate_variant:Nn \@@_center_box:nn { Vn } % \end{macrocode} @@ -4894,7 +4951,7 @@ % \begin{macrocode} \group_begin: % \end{macrocode} -% 将中图分类号、udc码和密级标记名称存入逗号分隔列表,并计算最宽宽度赋给 +% 将中图分类号、udc码和密级名称常量存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpa_dim}。 % \begin{macrocode} \clist_clear:N \l_@@_tmpa_clist @@ -4906,7 +4963,7 @@ } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} -% 将中图分类号、udc码和密级信息值存入逗号分隔列表,并计算最宽宽度赋给 +% 将中图分类号、udc码和密级变量值存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpb_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpb_clist @@ -4928,7 +4985,7 @@ } \@@_get_max_text_width:NN \l_@@_tmpc_dim \l_@@_tmpc_clist % \end{macrocode} -% 将学校代码、研究生学号信息值存入逗号分隔列表,并计算最宽宽度赋给 +% 将学校代码、研究生学号变量值存入逗号分隔列表,并计算最宽宽度赋给 % \cs{l_@@_tmpd_dim}。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpd_clist @@ -5061,7 +5118,7 @@ \begin{minipage} [ c ] { \textwidth } \centering % \end{macrocode} -% 根据论文类型(博士、硕士、本科)分支输出不同信息 +% 根据论文类型(博士、硕士、本科)输出不同信息 % \begin{macrocode} \int_case:nn {\g_@@_thesis_type_int} { @@ -5070,21 +5127,21 @@ % \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5109,21 +5166,21 @@ % \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5142,21 +5199,21 @@ % \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5177,22 +5234,22 @@ % \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5240,12 +5297,12 @@ % \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}}, + {\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} @@ -5255,20 +5312,20 @@ \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5309,12 +5366,12 @@ % \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}}, + {\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} @@ -5324,20 +5381,20 @@ \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5389,20 +5446,20 @@ \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, + { \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} \clist_set:Nx \l_@@_tmpb_clist @@ -5449,7 +5506,7 @@ % \begin{macrocode} {1}{ % \end{macrocode} -% 作者、导师、指导小组标识,并取得最宽宽度。 +% 作者、导师、指导小组标识常量,并取得最宽宽度。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpa_clist { @@ -5463,7 +5520,7 @@ % \begin{macrocode} \tl_set:Nn \l_@@_tmpa_tl {\clist_use:Nn \l_@@_info_instructors_clist {\@@_quad: }} % \end{macrocode} -% 作者、导师、指导小组信息,并取得最宽宽度。 +% 作者、导师、指导小组信息变量值,并取得最宽宽度。 % \begin{macrocode} \clist_set:Nx \l_@@_tmpb_clist { @@ -5909,7 +5966,7 @@ % % \begin{macro}{\makecoveri,\makecoverii,\makecoveriii, % \makecoveriv,\makecoverv,\makecovervi,\makecovervii} -% 封面一~七,其中一~六为研究生使用,一和七为本科生使用。 +% 封面一$\sim$七,其中一$\sim$六为研究生使用,一和七为本科生使用。 % \begin{macrocode} % 封面一,研究生、本科生中文封面 \NewDocumentCommand \makecoveri { } @@ -5989,20 +6046,24 @@ % % 声明各封面模板组成部分。 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\cs_new_protected:Npn \@@_declare_cover_i_template: { + \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } + { % \end{macrocode} % 研究生封面一 % \begin{macrocode} - \DeclareCoverTemplate { cover-i } - { logo, type, title, info } - }{ + \DeclareCoverTemplate { cover-i } + { logo, type, title, info } + }{ % \end{macrocode} % 本科生封面一 % \begin{macrocode} - \DeclareCoverTemplate { cover-i } - { id, logo, type, title, info } + \DeclareCoverTemplate { cover-i } + { id, logo, type, title, info } + } } +\@@_declare_cover_i_template: % \end{macrocode} % 研究生封面二 % \begin{macrocode} @@ -6059,144 +6120,152 @@ % 定义封面的具体配置参数。 % 封面一 % \begin{macrocode} -\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } +\cs_new_protected:Npn \@@_define_cover_i_entities: { + \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } + { % \end{macrocode} % 研究生 % \begin{macrocode} - \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } - { - bottom-skip = 0 pt plus 1.5 fill, - logo / content = \@@_cover_logo:, - logo / bottom-skip = -45 pt plus 0.3 fill, - logo / align = center, - type / content = \@@_cover_type:, - type / format = \sffamily \zihao { 0 },% \bfseries, - type / bottom-skip = -20 pt plus 0.3 fill, - type / align = center, - title / content = - \@@_fixed_width_center_box:nn - { 0.9 \textwidth } { \l_@@_info_title_tl }, - title / format = \nwafu@hei \bfseries \zihao { 2 }, - title / bottom-skip = 80 pt plus 0.3 fill, - title / align = center, - info / content = \@@_cover_info:, - info / format = \@@_line_spread:n {1.05}\nwafu@hei \zihao { -3 }, - info / align = center, - } - }{ + \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } + { + bottom-skip = 0 pt plus 1.5 fill, + logo / content = \@@_cover_logo:, + logo / bottom-skip = -45 pt plus 0.3 fill, + logo / align = center, + type / content = \@@_cover_type:, + type / format = \sffamily \zihao { 0 },% \bfseries, + type / bottom-skip = -20 pt plus 0.3 fill, + type / align = center, + title / content = + \@@_fixed_width_center_box:nn + { 0.9 \textwidth } { \l_@@_info_title_tl }, + title / format = \nwafu@hei \bfseries \zihao { 2 }, + title / bottom-skip = 80 pt plus 0.3 fill, + title / align = center, + info / content = \@@_cover_info:, + info / format = \@@_line_spread:n {1.05}\nwafu@hei \zihao { -3 }, + info / align = center, + } + }{ % \end{macrocode} % 本科生 % \begin{macrocode} - \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } - { - bottom-skip = 0 pt plus 0.5 fill, - id / content = \@@_cover_id:, - id / format = \bfseries\zihao { 4 }, - id / bottom-skip = 0 pt plus 0.3 fill, - id / align = right, - logo / content = \@@_cover_logo:, - logo / bottom-skip = -30 pt,% plus 0.3 fill, - logo / align = center, - type / content = \@@_cover_type:, - type / format = \bfseries\nwafu@kai\zihao { 1 }, - type / bottom-skip = -20 pt plus 0.3 fill, - type / align = center, - title / content = - \@@_fixed_width_center_box:nn - { 0.9 \textwidth } { \l_@@_info_title_tl }, - title / format = \nwafu@hei \bfseries\zihao { 2 }, - title / bottom-skip = 80 pt plus 0.3 fill, - title / align = center, - info / content = \@@_cover_info:, - info / format = \rmfamily\zihao { 3 }, - info / align = center, + \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } + { + bottom-skip = 0 pt plus 0.5 fill, + id / content = \@@_cover_id:, + id / format = \bfseries\zihao { 4 }, + id / bottom-skip = 0 pt plus 0.3 fill, + id / align = right, + logo / content = \@@_cover_logo:, + logo / bottom-skip = -30 pt,% plus 0.3 fill, + logo / align = center, + type / content = \@@_cover_type:, + type / format = \bfseries\nwafu@kai\zihao { 1 }, + type / bottom-skip = -20 pt plus 0.3 fill, + type / align = center, + title / content = + \@@_fixed_width_center_box:nn + { 0.9 \textwidth } { \l_@@_info_title_tl }, + title / format = \nwafu@hei \bfseries\zihao { 2 }, + title / bottom-skip = 80 pt plus 0.3 fill, + title / align = center, + info / content = \@@_cover_info:, + info / format = \rmfamily\zihao { 3 }, + info / align = center, + } } } +\@@_define_cover_i_entities: % \end{macrocode} % 封面二 % \begin{macrocode} -\int_case:nn {\g_@@_thesis_type_int} +\cs_new_protected:Npn \@@_define_cover_ii_entities: { - {1}{ + \int_case:nn {\g_@@_thesis_type_int} + { + {1}{ % \end{macrocode} % 博士研究生 % \begin{macrocode} - \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } - { - bottom-skip = 0 pt plus 0.5 fill, - type / content = - \@@_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 - }, - type / format = \@@_line_spread:n {1.22} \zihao { -3 }, - type / bottom-skip = 42 pt,% plus 0.3 fill, - type / align = center, - title / content = \l_@@_info_title_en_tl, - title / format = \@@_line_spread:n {0.90} - \zihao { 1 } \bfseries, - title / bottom-skip = 35 pt,% plus 0.3 fill, - title / align = center, - info / content = \@@_cover_info_en:, - info / format = \@@_line_spread:n {1.12} \zihao { -3 }, - info / bottom-skip = 72 pt,% plus 0.3 fill, - info / align = center, - department / content = \l_@@_info_department_en_tl, - department / format = \zihao { -3 }, - department / bottom-skip = -32 pt,% plus 0.3 fill, - department / align = center, - nwafu / content = \c_@@_name_en_tl, - nwafu / format = \zihao { -3 }, - nwafu / align = center, - } - } - {2}{ + \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } + { + bottom-skip = 0 pt plus 0.5 fill, + type / content = + \@@_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 + }, + type / format = \@@_line_spread:n {1.22} \zihao { -3 }, + type / bottom-skip = 42 pt,% plus 0.3 fill, + type / align = center, + title / content = \l_@@_info_title_en_tl, + title / format = \@@_line_spread:n {0.90} + \zihao { 1 } \bfseries, + title / bottom-skip = 35 pt,% plus 0.3 fill, + title / align = center, + info / content = \@@_cover_info_en:, + info / format = \@@_line_spread:n {1.12} \zihao { -3 }, + info / bottom-skip = 72 pt,% plus 0.3 fill, + info / align = center, + department / content = \l_@@_info_department_en_tl, + department / format = \zihao { -3 }, + department / bottom-skip = -32 pt,% plus 0.3 fill, + department / align = center, + nwafu / content = \c_@@_name_en_tl, + nwafu / format = \zihao { -3 }, + nwafu / align = center, + } + } + {2}{ % \end{macrocode} % 硕士研究生 % \begin{macrocode} - \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } - { - bottom-skip = 0 pt plus 0.5 fill, - type / content = - \@@_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 - } - } - }, - type / format = \@@_line_spread:n {1.22} \zihao { -3 }, - type / bottom-skip = 42 pt,% plus 0.3 fill, - type / align = center, - title / content = \l_@@_info_title_en_tl, - title / format = \@@_line_spread:n {0.90} \zihao { 1 } \bfseries, - title / bottom-skip = 35 pt,% plus 0.3 fill, - title / align = center, - info / content = \@@_cover_info_en:, - info / format = \@@_line_spread:n {1.12} \zihao { -3 }, - info / bottom-skip = 72 pt,% plus 0.3 fill, - info / align = center, - department / content = \l_@@_info_department_en_tl, - department / format = \zihao { -3 }, - department / bottom-skip = -32 pt,% plus 0.3 fill, - department / align = center, - nwafu / content = \c_@@_name_en_tl, - nwafu / format = \zihao { -3 }, - nwafu / align = center, - } - } + \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } + { + bottom-skip = 0 pt plus 0.5 fill, + type / content = + \@@_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 + } + } + }, + type / format = \@@_line_spread:n {1.22} \zihao { -3 }, + type / bottom-skip = 42 pt,% plus 0.3 fill, + type / align = center, + title / content = \l_@@_info_title_en_tl, + title / format = \@@_line_spread:n {0.90} \zihao { 1 } \bfseries, + title / bottom-skip = 35 pt,% plus 0.3 fill, + title / align = center, + info / content = \@@_cover_info_en:, + info / format = \@@_line_spread:n {1.12} \zihao { -3 }, + info / bottom-skip = 72 pt,% plus 0.3 fill, + info / align = center, + department / content = \l_@@_info_department_en_tl, + department / format = \zihao { -3 }, + department / bottom-skip = -32 pt,% plus 0.3 fill, + department / align = center, + nwafu / content = \c_@@_name_en_tl, + nwafu / format = \zihao { -3 }, + nwafu / align = center, + } + } + } } +\@@_define_cover_ii_entities: % \end{macrocode} % 封面三 % \begin{macrocode} @@ -6456,7 +6525,7 @@ \tl_if_empty:NF \l_@@_abstract_file_tl { % \end{macrocode} -% 根据提供的文件,排版中文摘要,否则什么都不做。 +% 根据提供的文件,排版中文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract} \file_input:V \l_@@_abstract_file_tl @@ -6465,7 +6534,7 @@ \tl_if_empty:NF \l_@@_abstract_file_en_tl { % \end{macrocode} -% 根据提供的文件,排版英文摘要,否则什么都不做。 +% 根据提供的文件,排版英文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract*} \file_input:V \l_@@_abstract_file_en_tl @@ -6484,7 +6553,7 @@ \tl_if_empty:NF \l_@@_notation_file_tl { % \end{macrocode} -% 根据提供的文件,排版主要符号对照表,否则什么都不做。 +% 根据提供的文件,排版主要符号对照表,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \cleardoublepage \pagenumbering{Roman} @@ -6499,7 +6568,7 @@ \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} @@ -6518,7 +6587,7 @@ \tl_if_empty:NF \l_@@_abstract_file_en_tl { % \end{macrocode} -% 根据提供的文件,排版英文摘要,否则什么都不做。 +% 根据提供的文件,排版英文摘要,如果提供的文件为空,则什么都不做。 % \begin{macrocode} \begin{abstract*} \group_begin: @@ -6537,8 +6606,10 @@ % \end{macrocode} % \end{macro} % +% 在 \env{document} 开始位置添加封面以及指导小组成员名单。 +% % \begin{macrocode} -\AfterEndPreamble +\ctex_after_end_preamble:n { \bool_if:NT \l_@@_auto_make_cover_bool { @@ -6858,10 +6929,8 @@ % \begin{macrocode} \NewDocumentEnvironment { abstract } { } { \@@_abstract_begin: } { \@@_abstract_end: } -%<*class> \NewDocumentEnvironment { abstract* } { } { \@@_abstract_en_begin: } { \@@_abstract_en_end: } -% % \end{macrocode} % \end{environment} % \end{environment} @@ -6869,7 +6938,6 @@ % \begin{macro}{\@@_abstract_begin:,\@@_abstract_en_begin:} % 摘要页标题。 % \begin{macrocode} -%<*class> \cs_new_protected:Npn \@@_abstract_begin: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } @@ -6880,7 +6948,6 @@ \begin{center}\nwafu@hei\bfseries\zihao{3}\l_@@_info_title_tl\end{center} } } -% \cs_new_protected:Npn \@@_abstract_en_begin: { \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 } @@ -6897,14 +6964,12 @@ % \begin{macro}{\@@_abstract_end:,\@@_abstract_en_end:} % 摘要正文完成后,输出关键字列表。 % \begin{macrocode} -%<*class> \cs_new_protected:Npn \@@_abstract_end: { \@@_keywords:nNn { \sffamily \zihao{-4} \c_@@_name_keywords_tl \c_@@_fwid_colon_tl } \l_@@_abstract_keywords_clist { ; ~} } -% \cs_new_protected:Npn \@@_abstract_en_end: { \@@_keywords:nNn @@ -7002,7 +7067,7 @@ % \subsection{个人简历} % % \begin{environment}{resume} -% 致谢环境,只是简单地设置章节不编号标题。 +% 个人简历环境,只是简单地设置章节不编号标题。 % \begin{macrocode} \NewDocumentEnvironment { resume } { } { @@ -7016,12 +7081,15 @@ % \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} @@ -7034,16 +7102,18 @@ % 个人简历中发论文和研究成果列表环境。 % \begin{macrocode} \newlist{publications}{enumerate}{1} -\setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=6bp, - leftmargin=10mm,before=\zihao{-4},resume} +\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=6bp, - leftmargin=10mm,before=\zihao{-4}} +\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实现参考文献样式控制。} +% % \subsection{参考文献著录与引用} % % \begin{variable}{\l_@@_bib_resource_clist} @@ -7068,8 +7138,6 @@ % 为了保证导言区中的设置能起作用,\pkg{biblatex} 宏包均需要在 % 导言区末尾载入(仍在 \pkg{hyperref} 之前),并做相关设置。 % \begin{macrocode} -% \AddToHook -% { env/document/begin } \@@_at_end_preamble:n { \@@_biblatex_pre_setup: @@ -7089,24 +7157,18 @@ % \end{macrocode} % 参考文献引用与著录样式。 % \begin{macrocode} - \@@_pass_options_to_biblatex:n { style = gb7714-2015ay } + \@@_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, - } + \@@_pass_options_to_biblatex:n { backend = biber, } } \cs_new_protected:Npn \@@_biblatex_post_setup: { % \end{macrocode} % 载入参考文献数据源文件。 % \begin{macrocode} - \@@_biblatex_misc: \clist_map_function:NN \l_@@_bib_resource_clist \addbibresource - \@@_biblatex_allow_url_break: % \end{macrocode} % 修改参考文献标题。 % \begin{macrocode} @@ -7117,462 +7179,13 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_biblatex_misc:} -% \pkg{biblatex} 中需要针对西北农林科技大学参考文献规范的特殊设置。 -% 由符合 GB/T 7714-2015 标准的 biblatex 参考文献样式 -% (\url{https://github.com/hushidong/biblatex-gb7714-2015}) -% 作者胡振震协助实现。 -% \begin{macrocode} -\cs_new:Npn \@@_biblatex_misc: - { -% \end{macrocode} -% 表示范围的波浪线符号 -% \begin{macrocode} - \DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{$\sim$}} -% \end{macrocode} -% 设置全局字体字号(5号字,行间距为1.3) -% \begin{macrocode} - \newcommand\nwafu@font@bib{\@@_line_spread:n {1.3}\zihao{5}} - \renewcommand{\bibfont}{\nwafu@font@bib} -% \end{macrocode} -% 英文期刊名称用斜休(Italic体) -% \begin{macrocode} - \DeclareFieldFormat[article]{journaltitle}{\iffieldequalstr{userd}{chinese}{##1}{\textit{##1}}\isdot} -% \end{macrocode} -% \tn{parencite}命令引用标注后导分割符 -% \begin{macrocode} - \renewcommand{\postnotedelim}{\addcolon\space} -% \end{macrocode} -% 删除\tn{parencite}命令引用标注中有页码选项时的p. pp.字符 -% \begin{macrocode} - \DeclareFieldFormat{postnote}{##1} -% \end{macrocode} -% 引用标注作者年制中作者和年份之间的标点(人名与年之间用空格分隔) -% \begin{macrocode} - \DeclareDelimFormat[cite,parencite,pagescite]{nameyeardelim}{\space} - \DeclareDelimFormat[textcite]{nameyeardelim}{\space} -% \end{macrocode} -% 文献著录列表中作者与年之间的分割符(最后一个作者后用点) -% \begin{macrocode} - \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addperiod\space} -% \end{macrocode} -% 删除文献著录列表中最后的点 -% \begin{macrocode} - \renewcommand*{\finentrypunct}{} -% \end{macrocode} -% 修改部分中文化字符串 -% \begin{macrocode} - \DefineBibliographyStrings{english}{ - andincitecn = {和}, - andincite = {and}, - mathesiscn={[硕士学位论文]}, - phdthesiscn={[博士学位论文]}, - in={In:\addspace}, - incn={见:\addspace}, - } -% \end{macrocode} -% 修改最后一个作者前的字符串,比如“and”、“和”。 -% -% 原理方法:默认情况下判断作者或译者是否中文,若中文用字符andcn=“和”,否则用and=“and”。 -% 非默认情况,根据选项信息,选择选择强制中文或英文 -% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了 -% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置 -% \begin{macrocode} - \DeclareDelimFormat{finalnamedelim}{% - \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% - \edef\userfieldabcde{userd}% - \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% - \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% - \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% - \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% - \ifcase\value{gbcitelocalcase}% - \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andincitecn}}{}% - \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% - \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andjp}}{}% - \iffieldequalstr{\userfieldabcde}{english}{\addspace\bibstring{andincite}\addspace}{}% - \iffieldequalstr{\userfieldabcde}{french}{\addspace\bibstring{and}\addspace}{}% - \iffieldequalstr{\userfieldabcde}{russian}{\addspace\bibstring{and}\addspace}{}% - \or% - \bibstring{andincitecn}% - \or% - \addspace\bibstring{andincite}\addspace% - \fi - } -% \end{macrocode} -% 20190215, 胡振震邮件指导代码 -% 去掉超过3个著者时汉字“等”前的空格(GB/T 7714-2015规定需要有空格) -% \begin{macrocode} - \DeclareDelimFormat{strandothersdelim}{% - \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% - %\addspace% - \edef\userfieldabcde{userd}% - \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% - \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% - \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% - \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% - \ifcase\value{gbcitelocalcase}% - \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andothersincitecn}}{}% - \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% - \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andothersjp}}{}% - \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothersincite}}{}% - \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% - \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% - \or% - \bibstring{andothersincitecn}% - \or% - \bibstring{andothersincite}% - \fi - } -% \end{macrocode} -% 设置andothersdelim -% \begin{macrocode} - \AtEveryCitekey{% - \iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{}}%\addthinspace - {\renewcommand*{\andothersdelim}{\addspace}}% - } -% \end{macrocode} -% 标注压缩时,直接用date+extradate代替extradate实现2006a,2006b的效果 -% \begin{macrocode} - \renewbibmacro*{cite:extradate}{% - \iffieldundef{extradate} {} - {\printtext[bibhyperref]{\printlabeldateextra}}%\printfield{extradate} - } -% \end{macrocode} -% 文献表中的日期格式 -% \begin{macrocode} - \renewbibmacro*{date+extradate}{% - \iffieldundef{labelyear}{}% - {\ifboolexpr{% - test {\ifentrytype{patent}} - or - (test {\ifentrytype{newspaper}} )% - }% - {\printtext{\blx@isodate{}{}}}% - {\printtext{% - \iflabeldateisdate - {\printdateextra} - {\printlabeldateextra} - } - }% - }% - } - \newbibmacro*{origdate+extradate}{% - \printtext{\printorigdate}% - } -% \end{macrocode} -% 修改译者位置格式 -% \begin{macrocode} - \renewbibmacro*{bytranslator+others}{% - \ifnameundef{translator} - {} - {\printnames[bytranslator]{translator}% - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 - \newunit - }% - \usebibmacro{withothers}% - \ifboolexpr{% - test {\iffieldundef{origyear}} or test {\ifnameundef{translator}}%% - }{}{\printtext{\printdate}}% - } -% \end{macrocode} -% url和url日期格式 -% \begin{macrocode} - \renewbibmacro*{url+urldate}{% - \usebibmacro{url}% - \iffieldundef{urlyear}% - {} - {\usebibmacro{urldate} - } - } - \DeclareFieldFormat{addnumflag}{% - \ifentrytype{newspaper} - {\setunit{\addcomma\addspace}\printtext{##1}} - {\nobreak\printtext{(}\nobreak ##1\nobreak\printtext{)}} - } -% \end{macrocode} -% 重设专利title的输出,输出文献类型标识符 -% \begin{macrocode} - \renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - { - \printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {} - { - \setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - \setunit{\adddot\addspace}\printfield{number}%写专利号 - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - }% - }% - } -% \end{macrocode} -% 修改作者数量超过限定值,省略时的处理格式 -% 20190103,hzz,修改利用新定义的一个分隔符strandothersdelim -% -% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 -% \begin{macrocode} - \renewbibmacro*{name:andothers}{% - \ifboolexpr{ - test {\ifnumequal{\value{listcount}}{\value{liststop}}} - and - test \ifmorenames - }{\ifnumgreater{\value{liststop}}{1}% - {\finalandcomma}% - {}% - \printdelim{andothersdelim}\printdelim{strandothersdelim}% - }{%当是译者的时候需要特殊处理 - \ifcurrentname{translator}{\addcomma}{}% - } - } -% \end{macrocode} -% 修改对edition版本信息格式 -% \begin{macrocode} - \DeclareFieldFormat{edition}{% - \testCJKfirst{userd}% - \iftoggle{ifCJKforgbt}% - {\ifinteger{##1}% - {\printtext{\bibstring{serialcn}\zhnumber{##1}\str@edition}}% - {##1\isdot} - }% - {\ifinteger{##1}% - {\mkbibordedition{##1}~\bibstring{edition}}% - {##1\isdot} - } - } -% \end{macrocode} -% 注意这里当没有作者只有标题时在年份之前的标点是否需要 -% 标准并未涉及,所以未做处理。 -% \begin{macrocode} - \renewbibmacro*{author}{% - \ifboolexpr{ - test \ifuseauthor - and - not test {\ifnameundef{author}} - }{\usebibmacro{bbx:dashcheck} - {\printnames{author}\setunit{\printdelim{nameyeardelim}}%把标点也带上 - }{\usebibmacro{bbx:savehash}% - \printnames{author}% - \iffieldundef{authortype} - {\setunit{\printdelim{nameyeardelim}}} - {\setunit{\printdelim{authortypedelim}}} - }% - \iffieldundef{authortype} - {} - {\usebibmacro{authorstrg}% - \setunit{\printdelim{nameyeardelim}} - } - }% - {\global\undef\bbx@lasthash - \usebibmacro{labeltitle}% - \setunit*{\printdelim{nonameyeardelim}} - }% - \ifboolexpr{% - test {\iffieldundef{origyear}} or test {\ifnameundef{translator}}% - }{\usebibmacro{date+extradate}}% - {\usebibmacro{origdate+extradate}}% - } -% \end{macrocode} -% book条目类的驱动 -% \begin{macrocode} - \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/editor+others/translator+others}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{maintitle+title}% - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock% - \usebibmacro{byauthor}% - \newunit\newblock% - }% - \newunit% - \printfield{edition}% - \newunit% - \usebibmacro{byeditor+others}% - \newunit\newblock% - \iftoggle{bbx:gbstrict}{}{% - \iffieldundef{maintitle}% - {% - \printfield{volume}% - \printfield{part}% - }% - {}% - \newunit% - \printfield{volumes}% - \newunit\newblock% - \usebibmacro{series+number}% - }% - \newunit\newblock% - \usebibmacro{publisher+location+date}% - \usebibmacro{chapter+pages}% - \iffieldundef{url}{}{%当没有网址时也不输出 - \usebibmacro{modifydate}%带括号的修改或更新日期, - }% - \usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 - \newunit\newblock% - \printfield{pagetotal}% - \newunit\newblock% - \iftoggle{bbx:isbn}% - {\printfield{isbn}} - {}% - \newunit\newblock% - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock% - \iftoggle{bbx:related}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - }{}% - \usebibmacro{finentry} - } -% \end{macrocode} -% 在线文献驱动 -% \begin{macrocode} - \DeclareBibliographyDriver{online}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/editor+others/translator+others}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{title}% - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor}% - \newunit\newblock - \usebibmacro{byeditor+others}% - \newunit\newblock - \printfield{note} - }% - \newunit - \printfield{version}% - \newunit\newblock - \printlist{institution}% - \newunit\newblock - \ifboolexpr{% - test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% - }{\usebibmacro{date}}% - \usebibmacro{url+urldate}%从下面移上来 - \newunit\newblock - \iftoggle{bbx:eprint} - {\usebibmacro{eprint}} - {}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{finentry} - } -% \end{macrocode} -% 专利文献驱动 -% \begin{macrocode} - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \iflistundef{location} - {} - {\setunit*{\addspace}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}} - }% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related} - } - {}% - \usebibmacro{finentry} - } -% \end{macrocode} -% 间距的控制 -% \begin{macrocode} - \setlength{\bibitemsep}{2pt} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} -% \end{macrocode} -% 文献著录条目缩进控制(悬挂缩进4英文字符) -% \begin{macrocode} - \setlength{\bibitemindent}{-2\ccwd}% bibitemindent表示一条文献中第一行相对后面各行的缩进 - \setlength{\bibhang}{2\ccwd} % 表示的各行起始位置到页边的距离 - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_biblatex_allow_url_break:} -% \pkg{biblatex} 下允许 URL 在字母、数字和一些特殊符号处断行。 -% \begin{macrocode} -\cs_new:Npn \@@_biblatex_allow_url_break: - { - \int_set_eq:NN \c@biburlucpenalty \c_one_int - \int_set_eq:NN \c@biburlnumpenalty \c_one_int - \int_set_eq:NN \c@biburllcpenalty \c_one_int - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_set_cite_style_author_year:} -% 著者—出版年制下的引用样式。 -% \begin{macrocode} -\cs_new:Npn \@@_set_cite_style_author_year: - { - \NAT@numbersfalse -%<*class> - \cs_set_eq:NN \NAT@open \c_@@_fwid_left_paren_tl - \cs_set_eq:NN \NAT@close \c_@@_fwid_right_paren_tl - \cs_set_eq:NN \NAT@sep \c_@@_fwid_semicolon_tl - \cs_set_eq:NN \NAT@aysep \c_@@_fwid_comma_tl - \cs_set_eq:NN \NAT@yrsep \c_@@_ideo_comma_tl -% - } -% \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} @@ -7611,12 +7224,9 @@ { bullet } { \textbullet }, { endash } { \normalfont\bfseries\textendash }, { asterisk } { \textasteriskcentered }, - { arabic } { \bool_if:NTF \l_@@_withchap_bool - { \arabic*. }{ (\arabic*) } }, - { alph } { \bool_if:NTF \l_@@_withchap_bool - { \alph*. }{ (\alph*) } }, - { roman } { \bool_if:NTF \l_@@_withchap_bool - { \roman*. }{ (\roman*) } }, + { arabic } { (\arabic*) }, + { alph } { (\alph*) }, + { roman } { (\roman*) }, { alph } { (\alph*) }, { roman } { \roman*. }, { outline } { \upshape\ding{111} } @@ -7884,7 +7494,6 @@ % 模板预定义的常用数学环境。 % 其中的“证明”比较特殊,它不编号,但会添加证毕符号。 % \begin{macrocode} -%<*class> \newtheorem* { proof } { \c_@@_name_proof_tl } \newtheorem { axiom } { \c_@@_name_axiom_tl } \newtheorem { corollary } { \c_@@_name_corollary_tl } @@ -7893,7 +7502,6 @@ \newtheorem { lemma } { \c_@@_name_lemma_tl } \newtheorem { theorem } { \c_@@_name_theorem_tl } % -% % \end{macrocode} % \end{environment} % \end{environment} diff --git a/Master/texmf-dist/tex/latex/nwafuthesis/nwafu-bar.pdf b/Master/texmf-dist/tex/latex/nwafuthesis/nwafu-bar.pdf deleted file mode 100644 index 13837d2d693..00000000000 Binary files a/Master/texmf-dist/tex/latex/nwafuthesis/nwafu-bar.pdf and /dev/null differ diff --git a/Master/texmf-dist/tex/latex/nwafuthesis/nwafuthesis.cls b/Master/texmf-dist/tex/latex/nwafuthesis/nwafuthesis.cls index 350ccff8aa8..cade365ee93 100644 --- a/Master/texmf-dist/tex/latex/nwafuthesis/nwafuthesis.cls +++ b/Master/texmf-dist/tex/latex/nwafuthesis/nwafuthesis.cls @@ -30,14 +30,14 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: nwafuthesis.dtx 1.01 2021-08-07 Nan Geng $ +\GetIdInfo $Id: nwafuthesis.dtx 1.10 2022-03-17 Nan Geng $ {Thesis template for Northwest A\&F University} \ProvidesExplClass{\ExplFileName} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\RequirePackage { xparse, xtemplate, l3keys2e } -\clist_map_inline:nn { expl3, xparse, xtemplate, l3keys2e } +\RequirePackage {xtemplate, l3keys2e } +\clist_map_inline:nn { xtemplate, l3keys2e } { - \@ifpackagelater {#1} { 2018/05/12 } + \@ifpackagelater {#1} { 2020/07/17 } { } { \msg_error:nnn { nwafuthesis } { l3-too-old } {#1} } } \msg_new:nnn { nwafuthesis } { l3-too-old } @@ -61,7 +61,6 @@ "#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\ your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex". } -\hook_gset_rule:nnnn { begindocument/before } { nwafuthesis } { < } { xeCJK } \box_new:N \l__nwafu_tmpa_box \clist_new:N \l__nwafu_tmpa_clist \clist_new:N \l__nwafu_tmpb_clist @@ -82,11 +81,10 @@ \int_new:N \g__nwafu_thesis_type_int \clist_new:N \g__nwafu_to_ctexbook_clist \clist_new:N \g__nwafu_to_hyperref_clist -\bool_new:N \l__nwafu_withchap_bool \bool_new:N \g__nwafu_twoside_bool \bool_set_true:N \g__nwafu_twoside_bool \bool_new:N \g__nwafu_draft_bool -\cs_generate_variant:Nn \cs_generate_variant:Nn { cn } +\bool_new:N \l__nwafu_withchap_bool \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 } @@ -112,6 +110,9 @@ \cs_new:Npn \__nwafu_symbol:n #1 { \tex_char:D #1 \scan_stop: } \cs_new:Npn \__nwafu_arabic:n #1 { \int_to_arabic:v { c@ #1 } } +\cs_new_protected:Npn \__nwafu_gadd_ltxhook:nn #1#2 + { \hook_gput_code:nnn {#1} { . } {#2} } +\hook_gset_rule:nnnn { begindocument/before } { . } { < } { xeCJK } \cs_new_protected:Npn \__nwafu_patch_cmd:Nnn #1#2#3 { \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3} @@ -153,6 +154,7 @@ \cs_new:Npn \__nwafu_error:nn { \msg_error:nnn { nwafuthesis } } \cs_new:Npn \__nwafu_error:nx { \msg_error:nnx { nwafuthesis } } \cs_new:Npn \__nwafu_error:nnn { \msg_error:nnnn { nwafuthesis } } +\cs_new:Npn \__nwafu_error:nnnn { \msg_error:nnnnn { nwafuthesis } } \cs_new:Npn \__nwafu_warning:n { \msg_warning:nn { nwafuthesis } } \cs_new:Npn \__nwafu_warning:nn { \msg_warning:nnn { nwafuthesis } } \cs_new:Npn \__nwafu_warning:nxx { \msg_warning:nnxx { nwafuthesis } } @@ -195,7 +197,8 @@ \NewDocumentCommand \nwafuthesis { } {% \makebox{\rmfamily% - N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex}{\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% + N\hspace{-0.2ex}\raisebox{-0.5ex}{W}\raisebox{0.5ex} + {\hspace{-0.2ex}\textsc{AFU}}\hspace{0.3ex}% \textsc{Thesis} } } @@ -242,34 +245,40 @@ { \__nwafu_define_punct:nn #1 } \fp_const:Nn \c__nwafu_line_spread_fp { \dim_ratio:nn { 20 pt } { 12 bp } / 1.2 } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } +\cs_new_protected:Npn \__nwafu_define_orig_decl_text: { - \tl_const:Nn \c__nwafu_orig_decl_text_tl + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { - 本人声明:所呈交的学位论文是我个人在导师指导下独立进行的研究工作及取 - 得的研究结果;论文中的研究数据及结果的获得完全符合学校《关于规范西北 - 农林科技大学研究生学术道德的暂行规定》,如果违反此规定,一切后果与法 - 律责任均由本人承担。\par - 尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经 - 发表或撰写过的研究结果,也不包含其他人和自己本人已获得西北农林科技大 - 学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同事对本 - 研究所做的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + \tl_const:Nn \c__nwafu_orig_decl_text_tl + { + 本人声明:所呈交的学位论文是我个人在导师指导下独立进行的研究工作及取 + 得的研究结果;论文中的研究数据及结果的获得完全符合学校《关于规范西北 + 农林科技大学研究生学术道德的暂行规定》,如果违反此规定,一切后果与法 + 律责任均由本人承担。\par + + 尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经 + 发表或撰写过的研究结果,也不包含其他人和自己本人已获得西北农林科技大 + 学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同事对本 + 研究所做的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + } } - } - { - \tl_const:Nn \c__nwafu_orig_decl_text_tl { - 本人声明:所呈交的毕业 - \clist_item:Nn \c__nwafu_bachelor_type_clist { \l__nwafu_info_bachelor_type_int } - 是我个人在导师指导下 - 独立进行的研究工作及取得的研究结果。尽我所知,除了文中特别加 - 以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究结果, - 也不包含其他人和自己本人已获得\c__nwafu_name_simp_tl{}或其它教育 - 机构的学位或证书而使用过的材料。与我一同工作的同事对本研究所做 - 的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 - 如违反此声明,一切后果与法律责任均由本人承担。 + \tl_const:Nn \c__nwafu_orig_decl_text_tl + { + 本人声明:所呈交的毕业 + \clist_item:Nn \c__nwafu_bachelor_type_clist + { \l__nwafu_info_bachelor_type_int } + 是我个人在导师指导下 + 独立进行的研究工作及取得的研究结果。尽我所知,除了文中特别加 + 以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究结果, + 也不包含其他人和自己本人已获得\c__nwafu_name_simp_tl{}或其它教育 + 机构的学位或证书而使用过的材料。与我一同工作的同事对本研究所做 + 的任何贡献均已在论文的致谢中作了明确的说明并表示了谢意。 + 如违反此声明,一切后果与法律责任均由本人承担。 + } } } +\__nwafu_define_orig_decl_text: \tl_const:Nn \c__nwafu_super_decl_text_tl { 本人承诺:我的研究生{\__nwafu_text_uline:V \l__nwafu_info_author_tl}所呈交的 @@ -279,63 +288,73 @@ 技大学研究生学术道德的暂行规定》,我愿接受按学校有关规定的处罚处理并 承担相应导师连带责任。 } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } +\cs_new_protected:Npn \__nwafu_auth_orig_decl_text: { - \tl_const:Nn \c__nwafu_auth_decl_text_tl + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { - 本学位论文的知识产权归属西北农林科技大学。本人同意西北农林科技大学 - 保存或向国家有关部门或机构送交论文的纸质版和电子版,允许论文被查阅和 - 借阅;同意西北农林科技大学将本学位论文的全部或部分内容授权汇编录入 - 中国博士/硕士学位论文全文数据库》和《中国学位论文全文数据库》进行 - 出版,并享受相关权益。\par + \tl_const:Nn \c__nwafu_auth_decl_text_tl + { + 本学位论文的知识产权归属西北农林科技大学。本人同意西北农林科技大学 + 保存或向国家有关部门或机构送交论文的纸质版和电子版,允许论文被查阅和 + 借阅;同意西北农林科技大学将本学位论文的全部或部分内容授权汇编录入 + 中国博士/硕士学位论文全文数据库》和《中国学位论文全文数据库》进行 + 出版,并享受相关权益。\par - 本人保证,在毕业离开(或者工作调离)西北农林科技大学后,发表或者使用本 - 学位论文及其相关的工作成果时,将以西北农林科技大学为第一署名单位,否 - 则,愿意按《中华人民共和国著作权法》等有关规定接受处理并承担法律责任。\par + 本人保证,在毕业离开(或者工作调离)西北农林科技大学后,发表或者使用本 + 学位论文及其相关的工作成果时,将以西北农林科技大学为第一署名单位,否 + 则,愿意按《中华人民共和国著作权法》等有关规定接受处理并承担法律责任。\par - 任何收存和保管本论文各种版本的其他单位和个人(包括研究生本人)未经本 - 论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、改编等 - 侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》等有关规定处 - 理并追究法律责任。\par + 任何收存和保管本论文各种版本的其他单位和个人(包括研究生本人)未经本 + 论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、改编等 + 侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》等有关规定处 + 理并追究法律责任。\par - {\sffamily (保密的学位论文在保密期限内,不得以任何方式发表、借阅、复印、 - 缩印或扫描复制手段保存、汇编论文)} + {\sffamily (保密的学位论文在保密期限内,不得以任何方式发表、借阅、复印、 + 缩印或扫描复制手段保存、汇编论文)} + } } - } - { - \tl_const:Nn \c__nwafu_auth_decl_text_tl { - 本毕业 - \clist_item:Nn \c__nwafu_bachelor_type_clist { \l__nwafu_info_bachelor_type_int } - 的知识产权归属\c__nwafu_name_simp_tl{}。 - 本人同意\c__nwafu_name_simp_tl{}保存或向国家有关部门或机构 - 送交论文的纸质版和电子版,允许论文被查阅和借阅。\par + \tl_const:Nn \c__nwafu_auth_decl_text_tl + { + 本毕业 + \clist_item:Nn \c__nwafu_bachelor_type_clist + { \l__nwafu_info_bachelor_type_int } + 的知识产权归属\c__nwafu_name_simp_tl{}。 + 本人同意\c__nwafu_name_simp_tl{}保存或向国家有关部门或机构 + 送交论文的纸质版和电子版,允许论文被查阅和借阅。\par - 本人保证,在毕业离开\c__nwafu_name_simp_tl{}后,发表或者使用本毕业 - \clist_item:Nn \c__nwafu_bachelor_type_clist { \l__nwafu_info_bachelor_type_int } - 及其相关的工作成果时,将以\c__nwafu_name_simp_tl{} - 为第一署名单位,否则,愿意按《中华人民共和国著作权法》等 - 有关规定接受处理并承担法律责任。\par + 本人保证,在毕业离开\c__nwafu_name_simp_tl{}后,发表或者使用本毕业 + \clist_item:Nn \c__nwafu_bachelor_type_clist + { \l__nwafu_info_bachelor_type_int } + 及其相关的工作成果时,将以\c__nwafu_name_simp_tl{} + 为第一署名单位,否则,愿意按《中华人民共和国著作权法》等 + 有关规定接受处理并承担法律责任。\par - 任何收存和保管本论文各种版本的其他单位和个人(包括作者本人)未经 - 本论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、 - 改编等侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》 - 等有关规定处理并追究法律责任。 + 任何收存和保管本论文各种版本的其他单位和个人(包括作者本人)未经 + 本论文作者的导师同意,不得有对本论文进行复制、修改、发行、出租、 + 改编等侵犯著作权的行为,否则,按违背《中华人民共和国著作权法》 + 等有关规定处理并追究法律责任。 + } } } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } - { - \tl_const:Nn \c__nwafu_orig_decl_sign_tl - { 研究生签名 } - \tl_const:Nn \c__nwafu_super_decl_sign_tl - { 导师签名 } - } +\__nwafu_auth_orig_decl_text: +\cs_new_protected:Npn \__nwafu_orig_decl_sign: { - \tl_const:Nn \c__nwafu_orig_decl_sign_tl - { 本科生签名 } - \tl_const:Nn \c__nwafu_super_decl_sign_tl - { 指导教师签名 } + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } + { + \tl_const:Nn \c__nwafu_orig_decl_sign_tl + { 研究生签名 } + \tl_const:Nn \c__nwafu_super_decl_sign_tl + { 导师签名 } + } + { + \tl_const:Nn \c__nwafu_orig_decl_sign_tl + { 本科生签名 } + \tl_const:Nn \c__nwafu_super_decl_sign_tl + { 指导教师签名 } + } } +\__nwafu_orig_decl_sign: \clist_const:Nn \c__nwafu_auth_decl_sign_clist { 作者签名, 导师签名, 日期 } \clist_const:Nn \c__nwafu_thesis_type_clist @@ -366,66 +385,75 @@ { pdf_creator } { LaTeX~ with~ nwafuthesis~ class }, } { \__nwafu_define_name:nn #1 } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } + +\cs_new_protected:Npn \__nwafu_define_name_const_zh: { - \clist_map_inline:nn + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { - { student_id } { 研究生学号 }, - { orig_decl } { 研究生学位论文的独创性声明 }, - { super_decl } { 导师指导研究生学位论文的承诺 }, - { auth_decl } { 关于研究生学位论文使用授权的说明 } + \clist_map_inline:nn + { + { student_id } { 研究生学号 }, + { orig_decl } { 研究生学位论文的独创性声明 }, + { super_decl } { 导师指导研究生学位论文的承诺 }, + { auth_decl } { 关于研究生学位论文使用授权的说明 } + } + { \__nwafu_define_name:nn ##1 } + }{ + \clist_map_inline:nn + { + { major } { 专业 }, + { student_id } { 学号 }, + { author } { 学生姓名 }, + { cosupervisor } { 协助指导教师 }, + { date } { 完成日期 }, + { orig_decl } { 本科生毕业\clist_item:Nn + \c__nwafu_bachelor_type_clist { + \l__nwafu_info_bachelor_type_int + }的独创性声明 }, + { auth_decl } { 关于本科生毕业\clist_item:Nn + \c__nwafu_bachelor_type_clist { + \l__nwafu_info_bachelor_type_int + }知识产权的说明 } + } + { \__nwafu_define_name:nn ##1 } } - { \__nwafu_define_name:nn #1 } - }{ - \clist_map_inline:nn - { - { major } { 专业 }, - { student_id } { 学号 }, - { author } { 学生姓名 }, - { cosupervisor } { 协助指导教师 }, - { date } { 完成日期 }, - { orig_decl } { 本科生毕业\clist_item:Nn - \c__nwafu_bachelor_type_clist { - \l__nwafu_info_bachelor_type_int - }的独创性声明 }, - { auth_decl } { 关于本科生毕业\clist_item:Nn - \c__nwafu_bachelor_type_clist { - \l__nwafu_info_bachelor_type_int - }知识产权的说明 } - } - { \__nwafu_define_name:nn #1 } } +\__nwafu_define_name_const_zh: \clist_map_inline:nn { { supervisor } { 指导教师 } { Supervisor }, } { \__nwafu_define_name:nnn #1 } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } +\cs_new_protected:Npn \__nwafu_define_name_const_zh_en: { - \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 } { 关键字 } { KEYWORDS }, - { clc } { 分类号 } { CLC~ number: }, - { notation } { 主要符号对照表 } { List~ of~ Symbols } - } - { \__nwafu_define_name:nnn #1 } - }{ - \clist_map_inline:nn + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { - { abstract } { 摘要 } { Abstract }, - { keywords } { 关键字 } { Keywords }, - { clc } { 分类号 } { CLC~ number }, + \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 } { 关键字 } { KEYWORDS }, + { clc } { 分类号 } { CLC~ number: }, + { notation } { 主要符号对照表 } { List~ of~ Symbols } + } + { \__nwafu_define_name:nnn ##1 } + }{ + \clist_map_inline:nn + { + { abstract } { 摘要 } { Abstract }, + { keywords } { 关键字 } { Keywords }, + { clc } { 分类号 } { CLC~ number }, + } + { \__nwafu_define_name:nnn ##1 } } - { \__nwafu_define_name:nnn #1 } } +\__nwafu_define_name_const_zh_en: \clist_map_inline:nn { { proof } { 证明 } { Proof }, @@ -455,7 +483,6 @@ { amsmath, thmmarks } { ntheorem } } { \PassOptionsToPackage #1 } -\RequirePackage { etoolbox } \LoadClass { ctexbook } \RequirePackage { @@ -468,58 +495,63 @@ ntheorem, enumitem, graphicx, - longtable, - booktabs, caption, + bicaption, xcolor, } \cs_new_protected:Npn \__nwafu_check_package:nnn #1#2#3 { \@ifpackagelater {#1} {#2} - { } { \__nwafu_error:nnn { package-too-old } {#1} {#3} } + { } { \__nwafu_error:nnnn { package-too-old } { Package } {#1} {#3} } + } +\cs_new_protected:Npn \__nwafu_check_class:nnn #1#2#3 + { + \@ifclasslater {#1} {#2} + { } { \__nwafu_error:nnnn { package-too-old } { Class } {#1} {#3} } } \__nwafu_msg_new:nn { package-too-old } { - Package~ "#1"~ is~ too~ old. \\ - The~ nwafuthesis~ class~ only~ supports~ "#1"~ with~ a~ version \\ - higher~ than~ v#2. \\\\ - Please~ update~ an~ up-to-date~ version~ of~ it~ using~ your \\ - TeX~ package~ manager~ or~ from~ CTAN. + #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. } -\__nwafu_check_package:nnn { fontspec } { 2017/09/22 } { 2.6e } -\__nwafu_check_package:nnn { unicode-math } { 2017/11/18 } { 0.8i } +\__nwafu_check_class:nnn { ctexbook } { 2021/03/14 } { 2.5.6 } \sys_if_engine_xetex:T - { \__nwafu_check_package:nnn { xeCJK } { 2017/08/07 } { 3.5.0 } } -\sys_if_engine_luatex:T - { \__nwafu_check_package:nnn { xunicode-addon } { 2018/04/30 } { 3.7.1 } } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } - { - \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, - } - }{ - \geometry + { \__nwafu_check_package:nnn { xeCJK } { 2020/05/01 } { 3.8.3 } } +\cs_new_protected:Npn \__nwafu_thesis_geometry: + { + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { - paper=a4paper, - top=3.14cm, - bottom=3.8cm, - left=2.45cm, - right=2.45cm, - headheight=0.8cm, - headsep=0.63cm, - footskip=2.3cm, + \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, + } + }{ + \geometry + { + paper=a4paper, + top=3.14cm, + bottom=3.8cm, + left=2.45cm, + right=2.45cm, + headheight=0.8cm, + headsep=0.63cm, + footskip=2.3cm, + } } } +\__nwafu_thesis_geometry: \bool_if:NT \g__nwafu_draft_bool { \geometry { showframe } } \tl_new:N \g__nwafu_fontset_tl \tl_new:N \g__nwafu_cjk_fontset_tl @@ -550,11 +582,11 @@ \cs_new_protected:Npn \__nwafu_setmathfont:nn #1#2 { \__um_setmathfont:nn {#2} {#1} } \cs_new_protected:Npn \__nwafu_setCJKmainfont:nn #1#2 - { \__nwafu_set_family:nnn { \CJKrmdefault } {#2} {#1} } + { \__nwafu_set_family:xnn { \CJKrmdefault } {#2} {#1} } \cs_new_protected:Npn \__nwafu_setCJKsansfont:nn #1#2 - { \__nwafu_set_family:nnn { \CJKsfdefault } {#2} {#1} } + { \__nwafu_set_family:xnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \__nwafu_setCJKmonofont:nn #1#2 - { \__nwafu_set_family:nnn { \CJKttdefault } {#2} {#1} } + { \__nwafu_set_family:xnn { \CJKttdefault } {#2} {#1} } \cs_new_protected:Npn \__nwafu_set_cjk_font_hei:nn #1#2 { \__nwafu_set_family:nnn { nwafu@hei } {#2} {#1} } \cs_new_protected:Npn \nwafu@hei @@ -586,6 +618,7 @@ \cs_new_eq:NN \__nwafu_set_family:nnn \ctex_ltj_set_family:nnn \cs_new_eq:NN \__nwafu_switch_family:n \ctex_ltj_switch_family:n } +\cs_generate_variant:Nn \__nwafu_set_family:nnn { x } \cs_new_protected:Npn \__nwafu_set_font_helper:n #1 { \exp_args:Nc \RenewDocumentCommand { set #1 font } { O { } m O { } } @@ -623,7 +656,9 @@ \tl_set:Nn \g__nwafu_font_style_libertinus_bf_tl { Bold } \tl_set:Nn \g__nwafu_font_style_libertinus_it_tl { Italic } \tl_set:Nn \g__nwafu_font_style_libertinus_bfit_tl { BoldItalic } - \tl_set:Nn \g__nwafu_font_style_libertinus_bfsl_tl { BoldOblique } + \fontspec_font_if_exist:nTF { LibertinusSans-BoldOblique.otf } + { \tl_set:Nn \g__nwafu_font_style_libertinus_bfsl_tl { BoldOblique } } + { \tl_set:Nn \g__nwafu_font_style_libertinus_bfsl_tl { Bold } } } { \tl_set:Nn \g__nwafu_font_family_libertinus_serif_tl { libertinusserif } @@ -840,12 +875,7 @@ } \cs_new_protected:Npn \__nwafu_load_cjk_font_founder: { - \__nwafu_setCJKmainfont:nn { FZShuSong-Z01 } - { - UprightFont = *, - BoldFont = FZHei-B01, - ItalicFont = FZKai-Z03, - } + \__nwafu_setCJKmainfont:n { FZShuSong-Z01 } \__nwafu_setCJKsansfont:n { FZHei-B01 } \__nwafu_setCJKmonofont:n { FZFangSong-Z02 } \__nwafu_set_cjk_font_hei:n { FZHei-B01 } @@ -919,8 +949,8 @@ \__nwafu_set_cjk_font_hei:n { SimHei } \__nwafu_set_cjk_font_kai:n { KaiTi } } -\tl_new:N \l__nwafu_cjkfont_tl \tl_new:N \l__nwafu_font_tl +\tl_new:N \l__nwafu_cjkfont_tl \cs_new_protected:Npn \__nwafu_detect_platform: { \sys_if_platform_windows:TF @@ -943,17 +973,15 @@ { \file_if_exist:nTF { /System/Library/Fonts/Menlo.ttc } } \cs_new_protected:Npn \__nwafu_load_font: { - \tl_if_empty:NTF \g__nwafu_fontset_tl + \tl_if_empty:NT \g__nwafu_fontset_tl { \__nwafu_detect_platform: \tl_gset_eq:NN \g__nwafu_fontset_tl \l__nwafu_font_tl - }{ } - \tl_if_empty:NTF \g__nwafu_cjk_fontset_tl + \tl_if_empty:NT \g__nwafu_cjk_fontset_tl { \__nwafu_detect_platform: \tl_gset_eq:NN \g__nwafu_cjk_fontset_tl \l__nwafu_cjkfont_tl - }{ } \use:c { __nwafu_load_font_ \g__nwafu_fontset_tl : } \use:c { __nwafu_load_cjk_font_ \g__nwafu_cjk_fontset_tl : } @@ -1010,8 +1038,16 @@ } \cs_new:Npn \__nwafu_set_fullwidth_stop_catcode: { - \char_set_active_eq:nN { "3002 } \c__nwafu_fwid_full_stop_tl - \char_set_catcode_active:n { "3002 } + \char_set_active_eq:NN ^^^^3002 \c__nwafu_fwid_full_stop_tl + \char_set_catcode_active:N ^^^^3002 + \clist_map_inline:nn + { \c__nwafu_orig_decl_text_tl, \c__nwafu_auth_decl_text_tl } + { \tl_set_rescan:Nno ##1 { } {##1} } + } +\DeclareEmphSequence + { + \bfseries, + \upshape \CJKfamily { \CJKfamilydefault }, } \fancyhf { } \tl_new:N \l__nwafu_header_center_mark_tl @@ -1028,7 +1064,7 @@ \pagestyle { fancy } \cs_gset_eq:NN \nwafuhead\fancyhead \cs_gset_eq:NN \nwafufoot\fancyfoot -\RenewDocumentCommand{\frontmatter}{sO{Roman}} +\RenewDocumentCommand{\frontmatter}{s O{Roman}} { \IfBooleanTF{#1}{\clearpage}{\cleardoublepage} \@mainmatterfalse @@ -1039,8 +1075,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \nwafuhead[EC]{\small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } } }{ \nwafuhead[EC]{\small \nouppercase{ \leftmark } } @@ -1064,8 +1101,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \nwafuhead[EC]{\small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } } }{ \nwafuhead[EC]{\small \nouppercase{ \l__nwafu_info_title_tl } } @@ -1080,8 +1118,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } }{ \small \nouppercase{ \l__nwafu_info_title_tl } } @@ -1105,8 +1144,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \nwafuhead[EC]{\small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } } }{ \nwafuhead[EC]{\small \nouppercase{ \leftmark } } @@ -1121,8 +1161,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } }{ \small \nouppercase{ \leftmark } } @@ -1140,8 +1181,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \nwafuhead[EC]{\small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } } }{ \nwafuhead[EC]{\small \nouppercase{ \@chapapp } } @@ -1156,8 +1198,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } }{ \small \nouppercase{ \@chapapp } } @@ -1175,8 +1218,9 @@ \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } { \nwafuhead[EC]{\small \nouppercase{ - \c__nwafu_name_simp_tl \clist_item:Nn - \c__nwafu_thesis_type_clist { \g__nwafu_thesis_type_int } } + \c__nwafu_name_simp_tl + \clist_item:Nn \c__nwafu_thesis_type_clist + { \g__nwafu_thesis_type_int } } } }{ \nwafuhead[EC]{\small \nouppercase{ \leftmark } } @@ -1200,91 +1244,95 @@ } } } -\int_compare:nNnTF{ \g__nwafu_thesis_type_int } < { 3 } +\cs_new_protected:Npn \__nwafu_ctexset_caption: { - \keys_set:nn { ctex } + \int_compare:nNnTF{ \g__nwafu_thesis_type_int } < { 3 } { - secnumdepth = 3, - chapter = - { - pagestyle = fancy, - aftername = \hspace*{1.0\ccwd}, - format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, - beforeskip = 1.47\baselineskip, - afterskip = 1.24\baselineskip, - number = \__nwafu_arabic:n { chapter }, - fixskip = true - }, - section = + \keys_set:nn { ctex } { - format = \zihao{-3} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 1.09\baselineskip, - afterskip = 0.80\baselineskip, - fixskip = true - }, - subsection = - { - format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 0.80\baselineskip, - fixskip = true - }, - subsubsection = - { - format = \zihao{-4} \normalfont \nwafu@hei \bfseries \raggedright, - beforeskip = 0.40\baselineskip, - afterskip = 0.40\baselineskip, - fixskip = true + secnumdepth = 3, + chapter = + { + pagestyle = fancy, + aftername = \hspace*{1.0\ccwd}, + format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, + beforeskip = 1.47\baselineskip, + afterskip = 1.24\baselineskip, + number = \__nwafu_arabic:n { chapter }, + fixskip = true + }, + section = + { + format = \zihao{-3} \normalfont \nwafu@hei \bfseries \raggedright, + beforeskip = 1.09\baselineskip, + afterskip = 0.80\baselineskip, + fixskip = true + }, + subsection = + { + format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright, + beforeskip = 0.80\baselineskip, + fixskip = true + }, + subsubsection = + { + format = \zihao{-4} \normalfont \nwafu@hei \bfseries \raggedright, + beforeskip = 0.40\baselineskip, + afterskip = 0.40\baselineskip, + fixskip = true + } } - } - }{ - \keys_set:nn { ctex } - { - secnumdepth = 3, - chapter = - { - pagestyle = fancy, - name = { \bool_if:NT \l__nwafu_withchap_bool {第}, - \bool_if:NT \l__nwafu_withchap_bool {章} }, - number = \__nwafu_arabic:n { chapter }, - aftername = \hspace*{\ccwd}, - format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, - beforeskip = 0.25\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true - }, - section = - { - aftername = \hspace*{0.5\ccwd}, - format = \zihao{4} \normalfont \nwafu@hei \bfseries \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 \bfseries, - beforeskip = 0.60\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true, - afterindent = true, - % indent = 2\ccwd, - }, - subsubsection = + }{ + \keys_set:nn { ctex } { - name = {(,)}, - aftername = \hspace*{0.5\ccwd}, - number = \__nwafu_arabic:n { subsubsection }, - format = \zihao{-4} \normalfont, - beforeskip = 0.60\baselineskip, - afterskip = 0.65\baselineskip, - fixskip = true, - % afterindent = true, - indent = 2\ccwd, + secnumdepth = 3, + chapter = + { + pagestyle = fancy, + name = { \bool_if:NT \l__nwafu_withchap_bool {第}, + \bool_if:NT \l__nwafu_withchap_bool {章} }, + number = \__nwafu_arabic:n { chapter }, + aftername = \hspace*{\ccwd}, + format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering, + beforeskip = 0.25\baselineskip, + afterskip = 0.65\baselineskip, + fixskip = true + }, + section = + { + aftername = \hspace*{0.5\ccwd}, + format = \zihao{4} \normalfont \nwafu@hei \bfseries \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 \bfseries, + beforeskip = 0.60\baselineskip, + afterskip = 0.65\baselineskip, + fixskip = true, + afterindent = true, + % indent = 2\ccwd, + }, + subsubsection = + { + name = {(,)}, + aftername = \hspace*{0.5\ccwd}, + number = \__nwafu_arabic:n { subsubsection }, + format = \zihao{-4} \normalfont, + beforeskip = 0.60\baselineskip, + afterskip = 0.65\baselineskip, + fixskip = true, + % afterindent = true, + indent = 2\ccwd, + } } } } +\__nwafu_ctexset_caption: \cs_new_protected:Npn \__nwafu_chapter:n #1 { \group_begin: @@ -1683,8 +1731,7 @@ \dim_set:Nn \l__nwafu_tmpt_dim {#1} \dim_add:Nn \l__nwafu_tmpt_dim {0.6em} \makebox[0cm][l]{\rule[-0.5ex]{\l__nwafu_tmpt_dim}{0.4 pt}} - {\hbox_to_wd:nn {\l__nwafu_tmpt_dim} { \hfil #2 \hfil }} - % \fbox[b]{\parbox {#1} { \centering #2 }} + \hbox_to_wd:nn {\l__nwafu_tmpt_dim} { \hfil #2 \hfil } } \cs_generate_variant:Nn \__nwafu_center_box:nn { Vn } \cs_new:Npn \__nwafu_fixed_width_box:nn #1#2 @@ -1843,12 +1890,12 @@ {1}{ \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_major_tl, - \c__nwafu_name_researchfield_tl, - \c__nwafu_name_author_tl, - \c__nwafu_name_supervisor_tl, - \c__nwafu_name_cosupervisor_tl, - \c__nwafu_name_date_tl, + { \c__nwafu_name_major_tl }, + { \c__nwafu_name_researchfield_tl }, + { \c__nwafu_name_author_tl }, + { \c__nwafu_name_supervisor_tl }, + { \c__nwafu_name_cosupervisor_tl }, + { \c__nwafu_name_date_tl } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \clist_set:Nx \l__nwafu_tmpb_clist @@ -1868,12 +1915,12 @@ {1}{ \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_major_tl, - \c__nwafu_name_researchfield_tl, - \c__nwafu_name_author_tl, - \c__nwafu_name_supervisor_tl, - \c__nwafu_name_cosupervisor_tl, - \c__nwafu_name_date_tl, + { \c__nwafu_name_major_tl }, + { \c__nwafu_name_researchfield_tl }, + { \c__nwafu_name_author_tl }, + { \c__nwafu_name_supervisor_tl }, + { \c__nwafu_name_cosupervisor_tl }, + { \c__nwafu_name_date_tl, } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \clist_set:Nx \l__nwafu_tmpb_clist @@ -1890,12 +1937,12 @@ {2}{ \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_professionaltype_tl, - \c__nwafu_name_professionalfield_tl, - \c__nwafu_name_author_tl, - \c__nwafu_name_supervisor_tl, - \c__nwafu_name_cosupervisor_tl, - \c__nwafu_name_date_tl, + { \c__nwafu_name_professionaltype_tl }, + { \c__nwafu_name_professionalfield_tl }, + { \c__nwafu_name_author_tl }, + { \c__nwafu_name_supervisor_tl }, + { \c__nwafu_name_cosupervisor_tl }, + { \c__nwafu_name_date_tl } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \clist_set:Nx \l__nwafu_tmpb_clist @@ -1914,13 +1961,13 @@ {3}{ \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_department_tl, - \c__nwafu_name_major_tl, - \c__nwafu_name_enroll_tl\c__nwafu_name_class_id_tl, - \c__nwafu_name_author_tl, - \c__nwafu_name_supervisor_tl, - \c__nwafu_name_cosupervisor_tl, - \c__nwafu_name_date_tl, + { \c__nwafu_name_department_tl }, + { \c__nwafu_name_major_tl }, + { \c__nwafu_name_enroll_tl\c__nwafu_name_class_id_tl }, + { \c__nwafu_name_author_tl }, + { \c__nwafu_name_supervisor_tl }, + { \c__nwafu_name_cosupervisor_tl }, + { \c__nwafu_name_date_tl } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \clist_set:Nx \l__nwafu_tmpb_clist @@ -1955,12 +2002,12 @@ {1}{ \clist_set:Nx \l__nwafu_tmpa_clist { - {\c__nwafu_name_major_en_tl{\l__nwafu_info_major_en_tl}}, - {\c__nwafu_name_researchfield_en_tl{\l__nwafu_info_researchfield_en_tl}}, - {\c__nwafu_name_author_en_tl{\l__nwafu_info_author_en_tl}}, - {\c__nwafu_name_supervisor_en_tl{\l__nwafu_info_supervisor_en_tl}}, - {\c__nwafu_name_cosupervisor_en_tl{\l__nwafu_info_cosupervisor_en_tl}}, - {\c__nwafu_name_date_en_tl{\l__nwafu_info_date_en_tl}}, + {\c__nwafu_name_major_en_tl{\l__nwafu_info_major_en_tl} }, + {\c__nwafu_name_researchfield_en_tl{\l__nwafu_info_researchfield_en_tl} }, + {\c__nwafu_name_author_en_tl{\l__nwafu_info_author_en_tl} }, + {\c__nwafu_name_supervisor_en_tl{\l__nwafu_info_supervisor_en_tl} }, + {\c__nwafu_name_cosupervisor_en_tl{\l__nwafu_info_cosupervisor_en_tl} }, + {\c__nwafu_name_date_en_tl{\l__nwafu_info_date_en_tl} } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \dim_add:Nn \l__nwafu_tmpa_dim {2.5em} @@ -1968,12 +2015,12 @@ \flushleft \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_major_en_tl, - \c__nwafu_name_researchfield_en_tl, - \c__nwafu_name_author_en_tl, - \c__nwafu_name_supervisor_en_tl, - \c__nwafu_name_cosupervisor_en_tl, - \c__nwafu_name_date_en_tl, + { \c__nwafu_name_major_en_tl }, + { \c__nwafu_name_researchfield_en_tl }, + { \c__nwafu_name_author_en_tl }, + { \c__nwafu_name_supervisor_en_tl }, + { \c__nwafu_name_cosupervisor_en_tl }, + { \c__nwafu_name_date_en_tl } } \clist_set:Nx \l__nwafu_tmpb_clist { @@ -2002,12 +2049,12 @@ {1}{ \clist_set:Nx \l__nwafu_tmpa_clist { - {\c__nwafu_name_major_en_tl{\l__nwafu_info_major_en_tl}}, - {\c__nwafu_name_researchfield_en_tl{\l__nwafu_info_researchfield_en_tl}}, - {\c__nwafu_name_author_en_tl{\l__nwafu_info_author_en_tl}}, - {\c__nwafu_name_supervisor_en_tl{\l__nwafu_info_supervisor_en_tl}}, - {\c__nwafu_name_cosupervisor_en_tl{\l__nwafu_info_cosupervisor_en_tl}}, - {\c__nwafu_name_date_en_tl{\l__nwafu_info_date_en_tl}}, + {\c__nwafu_name_major_en_tl{\l__nwafu_info_major_en_tl} }, + {\c__nwafu_name_researchfield_en_tl{\l__nwafu_info_researchfield_en_tl} }, + {\c__nwafu_name_author_en_tl{\l__nwafu_info_author_en_tl} }, + {\c__nwafu_name_supervisor_en_tl{\l__nwafu_info_supervisor_en_tl} }, + {\c__nwafu_name_cosupervisor_en_tl{\l__nwafu_info_cosupervisor_en_tl} }, + {\c__nwafu_name_date_en_tl{\l__nwafu_info_date_en_tl} } } \__nwafu_get_max_text_width:NN \l__nwafu_tmpa_dim \l__nwafu_tmpa_clist \dim_add:Nn \l__nwafu_tmpa_dim {2.5em} @@ -2015,12 +2062,12 @@ \flushleft \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_major_en_tl, - \c__nwafu_name_researchfield_en_tl, - \c__nwafu_name_author_en_tl, - \c__nwafu_name_supervisor_en_tl, - \c__nwafu_name_cosupervisor_en_tl, - \c__nwafu_name_date_en_tl, + { \c__nwafu_name_major_en_tl }, + { \c__nwafu_name_researchfield_en_tl }, + { \c__nwafu_name_author_en_tl }, + { \c__nwafu_name_supervisor_en_tl }, + { \c__nwafu_name_cosupervisor_en_tl }, + { \c__nwafu_name_date_en_tl } } \clist_set:Nx \l__nwafu_tmpb_clist { @@ -2059,12 +2106,12 @@ \flushleft \clist_set:Nx \l__nwafu_tmpa_clist { - \c__nwafu_name_professionaltype_en_tl, - \c__nwafu_name_professionalfield_en_tl, - \c__nwafu_name_author_en_tl, - \c__nwafu_name_supervisor_en_tl, - \c__nwafu_name_cosupervisor_en_tl, - \c__nwafu_name_date_en_tl, + { \c__nwafu_name_professionaltype_en_tl }, + { \c__nwafu_name_professionalfield_en_tl }, + { \c__nwafu_name_author_en_tl }, + { \c__nwafu_name_supervisor_en_tl }, + { \c__nwafu_name_cosupervisor_en_tl }, + { \c__nwafu_name_date_en_tl } } \clist_set:Nx \l__nwafu_tmpb_clist { @@ -2450,14 +2497,18 @@ \UseInstance { nwafu / cover } { cover-vii-default } \restoregeometry } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } +\cs_new_protected:Npn \__nwafu_declare_cover_i_template: { - \DeclareCoverTemplate { cover-i } - { logo, type, title, info } - }{ - \DeclareCoverTemplate { cover-i } - { id, logo, type, title, info } + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } + { + \DeclareCoverTemplate { cover-i } + { logo, type, title, info } + }{ + \DeclareCoverTemplate { cover-i } + { id, logo, type, title, info } + } } +\__nwafu_declare_cover_i_template: \DeclareCoverTemplate { cover-ii } { type, title, info, department, nwafu } @@ -2491,129 +2542,137 @@ authorization-decl-sig, supervisor-decl-sig } -\int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } - { - \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } - { - bottom-skip = 0 pt plus 1.5 fill, - logo / content = \__nwafu_cover_logo:, - logo / bottom-skip = -45 pt plus 0.3 fill, - logo / align = center, - type / content = \__nwafu_cover_type:, - type / format = \sffamily \zihao { 0 },% \bfseries, - type / bottom-skip = -20 pt plus 0.3 fill, - type / align = center, - title / content = - \__nwafu_fixed_width_center_box:nn - { 0.9 \textwidth } { \l__nwafu_info_title_tl }, - title / format = \nwafu@hei \bfseries \zihao { 2 }, - title / bottom-skip = 80 pt plus 0.3 fill, - title / align = center, - info / content = \__nwafu_cover_info:, - info / format = \__nwafu_line_spread:n {1.05}\nwafu@hei \zihao { -3 }, - info / align = center, +\cs_new_protected:Npn \__nwafu_define_cover_i_entities: + { + \int_compare:nNnTF { \g__nwafu_thesis_type_int } < { 3 } + { + \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } + { + bottom-skip = 0 pt plus 1.5 fill, + logo / content = \__nwafu_cover_logo:, + logo / bottom-skip = -45 pt plus 0.3 fill, + logo / align = center, + type / content = \__nwafu_cover_type:, + type / format = \sffamily \zihao { 0 },% \bfseries, + type / bottom-skip = -20 pt plus 0.3 fill, + type / align = center, + title / content = + \__nwafu_fixed_width_center_box:nn + { 0.9 \textwidth } { \l__nwafu_info_title_tl }, + title / format = \nwafu@hei \bfseries \zihao { 2 }, + title / bottom-skip = 80 pt plus 0.3 fill, + title / align = center, + info / content = \__nwafu_cover_info:, + info / format = \__nwafu_line_spread:n {1.05}\nwafu@hei \zihao { -3 }, + info / align = center, + } + }{ + \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } + { + bottom-skip = 0 pt plus 0.5 fill, + id / content = \__nwafu_cover_id:, + id / format = \bfseries\zihao { 4 }, + id / bottom-skip = 0 pt plus 0.3 fill, + id / align = right, + logo / content = \__nwafu_cover_logo:, + logo / bottom-skip = -30 pt,% plus 0.3 fill, + logo / align = center, + type / content = \__nwafu_cover_type:, + type / format = \bfseries\nwafu@kai\zihao { 1 }, + type / bottom-skip = -20 pt plus 0.3 fill, + type / align = center, + title / content = + \__nwafu_fixed_width_center_box:nn + { 0.9 \textwidth } { \l__nwafu_info_title_tl }, + title / format = \nwafu@hei \bfseries\zihao { 2 }, + title / bottom-skip = 80 pt plus 0.3 fill, + title / align = center, + info / content = \__nwafu_cover_info:, + info / format = \rmfamily\zihao { 3 }, + info / align = center, + } } - }{ - \DeclareInstance { nwafu / cover } { cover-i-default } { cover-i } - { - bottom-skip = 0 pt plus 0.5 fill, - id / content = \__nwafu_cover_id:, - id / format = \bfseries\zihao { 4 }, - id / bottom-skip = 0 pt plus 0.3 fill, - id / align = right, - logo / content = \__nwafu_cover_logo:, - logo / bottom-skip = -30 pt,% plus 0.3 fill, - logo / align = center, - type / content = \__nwafu_cover_type:, - type / format = \bfseries\nwafu@kai\zihao { 1 }, - type / bottom-skip = -20 pt plus 0.3 fill, - type / align = center, - title / content = - \__nwafu_fixed_width_center_box:nn - { 0.9 \textwidth } { \l__nwafu_info_title_tl }, - title / format = \nwafu@hei \bfseries\zihao { 2 }, - title / bottom-skip = 80 pt plus 0.3 fill, - title / align = center, - info / content = \__nwafu_cover_info:, - info / format = \rmfamily\zihao { 3 }, - info / align = center, - } - } -\int_case:nn {\g__nwafu_thesis_type_int} - { - {1}{ - \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } - { - bottom-skip = 0 pt plus 0.5 fill, - type / content = - \__nwafu_fixed_width_center_box:nn { 0.7\textwidth } { - Thesis~Submitted~to~\c__nwafu_name_en_tl\\ - in~Partial~Fulfillment~of~the~Requirements\\ - for~Degree~of\\ - Doctor~of~Philosophy - }, - type / format = \__nwafu_line_spread:n {1.22} \zihao { -3 }, - type / bottom-skip = 42 pt,% plus 0.3 fill, - type / align = center, - title / content = \l__nwafu_info_title_en_tl, - title / format = \__nwafu_line_spread:n {0.90} - \zihao { 1 } \bfseries, - title / bottom-skip = 35 pt,% plus 0.3 fill, - title / align = center, - info / content = \__nwafu_cover_info_en:, - info / format = \__nwafu_line_spread:n {1.12} \zihao { -3 }, - info / bottom-skip = 72 pt,% plus 0.3 fill, - info / align = center, - department / content = \l__nwafu_info_department_en_tl, - department / format = \zihao { -3 }, - department / bottom-skip = -32 pt,% plus 0.3 fill, - department / align = center, - nwafu / content = \c__nwafu_name_en_tl, - nwafu / format = \zihao { -3 }, - nwafu / align = center, - } - } - {2}{ - \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } - { - bottom-skip = 0 pt plus 0.5 fill, - type / content = - \__nwafu_fixed_width_center_box:nn { 0.7\textwidth } { - Thesis~Submitted~to~\c__nwafu_name_en_tl\\ - in~Partial~Fulfillment~of~the~Requirements\\ - for~Degree~of\\ - Master~of - \int_case:nn {\l__nwafu_info_degree_type_int} - { - {1}{ - \__nwafu_text_uline:V \l__nwafu_info_mastertype_en_tl - } - {2}{ - \__nwafu_text_uline:V \l__nwafu_info_professionaltype_en_tl - } - } - }, - type / format = \__nwafu_line_spread:n {1.22} \zihao { -3 }, - type / bottom-skip = 42 pt,% plus 0.3 fill, - type / align = center, - title / content = \l__nwafu_info_title_en_tl, - title / format = \__nwafu_line_spread:n {0.90} \zihao { 1 } \bfseries, - title / bottom-skip = 35 pt,% plus 0.3 fill, - title / align = center, - info / content = \__nwafu_cover_info_en:, - info / format = \__nwafu_line_spread:n {1.12} \zihao { -3 }, - info / bottom-skip = 72 pt,% plus 0.3 fill, - info / align = center, - department / content = \l__nwafu_info_department_en_tl, - department / format = \zihao { -3 }, - department / bottom-skip = -32 pt,% plus 0.3 fill, - department / align = center, - nwafu / content = \c__nwafu_name_en_tl, - nwafu / format = \zihao { -3 }, - nwafu / align = center, - } - } } +\__nwafu_define_cover_i_entities: +\cs_new_protected:Npn \__nwafu_define_cover_ii_entities: + { + \int_case:nn {\g__nwafu_thesis_type_int} + { + {1}{ + \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } + { + bottom-skip = 0 pt plus 0.5 fill, + type / content = + \__nwafu_fixed_width_center_box:nn { 0.7\textwidth } { + Thesis~Submitted~to~\c__nwafu_name_en_tl\\ + in~Partial~Fulfillment~of~the~Requirements\\ + for~Degree~of\\ + Doctor~of~Philosophy + }, + type / format = \__nwafu_line_spread:n {1.22} \zihao { -3 }, + type / bottom-skip = 42 pt,% plus 0.3 fill, + type / align = center, + title / content = \l__nwafu_info_title_en_tl, + title / format = \__nwafu_line_spread:n {0.90} + \zihao { 1 } \bfseries, + title / bottom-skip = 35 pt,% plus 0.3 fill, + title / align = center, + info / content = \__nwafu_cover_info_en:, + info / format = \__nwafu_line_spread:n {1.12} \zihao { -3 }, + info / bottom-skip = 72 pt,% plus 0.3 fill, + info / align = center, + department / content = \l__nwafu_info_department_en_tl, + department / format = \zihao { -3 }, + department / bottom-skip = -32 pt,% plus 0.3 fill, + department / align = center, + nwafu / content = \c__nwafu_name_en_tl, + nwafu / format = \zihao { -3 }, + nwafu / align = center, + } + } + {2}{ + \DeclareInstance { nwafu / cover } { cover-ii-default } { cover-ii } + { + bottom-skip = 0 pt plus 0.5 fill, + type / content = + \__nwafu_fixed_width_center_box:nn { 0.7\textwidth } { + Thesis~Submitted~to~\c__nwafu_name_en_tl\\ + in~Partial~Fulfillment~of~the~Requirements\\ + for~Degree~of\\ + Master~of + \int_case:nn {\l__nwafu_info_degree_type_int} + { + {1}{ + \__nwafu_text_uline:V \l__nwafu_info_mastertype_en_tl + } + {2}{ + \__nwafu_text_uline:V \l__nwafu_info_professionaltype_en_tl + } + } + }, + type / format = \__nwafu_line_spread:n {1.22} \zihao { -3 }, + type / bottom-skip = 42 pt,% plus 0.3 fill, + type / align = center, + title / content = \l__nwafu_info_title_en_tl, + title / format = \__nwafu_line_spread:n {0.90} \zihao { 1 } \bfseries, + title / bottom-skip = 35 pt,% plus 0.3 fill, + title / align = center, + info / content = \__nwafu_cover_info_en:, + info / format = \__nwafu_line_spread:n {1.12} \zihao { -3 }, + info / bottom-skip = 72 pt,% plus 0.3 fill, + info / align = center, + department / content = \l__nwafu_info_department_en_tl, + department / format = \zihao { -3 }, + department / bottom-skip = -32 pt,% plus 0.3 fill, + department / align = center, + nwafu / content = \c__nwafu_name_en_tl, + nwafu / format = \zihao { -3 }, + nwafu / align = center, + } + } + } + } +\__nwafu_define_cover_ii_entities: \DeclareInstance { nwafu / cover } { cover-iii-default } { cover-iii } { top-skip = -55 pt plus 0.1 fill, @@ -2850,7 +2909,7 @@ \tableofcontents } } -\AfterEndPreamble +\ctex_after_end_preamble:n { \bool_if:NT \l__nwafu_auto_make_cover_bool { @@ -3164,11 +3223,11 @@ \vspace{32bp}{\zihao{-4}\nwafu@hei\bfseries\centerline{#1}}\par\vspace{14bp} } \newlist{publications}{enumerate}{1} -\setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=6bp, - leftmargin=10mm,before=\zihao{-4},resume} +\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=6bp, - leftmargin=10mm,before=\zihao{-4}} +\setlist[achievements]{label=[\arabic*],align=left,nosep,itemsep=3bp, + leftmargin=10mm,before=\zihao{5}} \def\publicationskip{\bigskip\bigskip} \clist_new:N \l__nwafu_bib_resource_clist \keys_define:nn { nwafu / style } @@ -3183,363 +3242,16 @@ } \cs_new_protected:Npn \__nwafu_biblatex_pre_setup: { - \__nwafu_pass_options_to_biblatex:n { style = gb7714-2015ay } - \__nwafu_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, - } + \__nwafu_pass_options_to_biblatex:n { style = gb7714-NWAFU } + \__nwafu_pass_options_to_biblatex:n { backend = biber, } } \cs_new_protected:Npn \__nwafu_biblatex_post_setup: { - \__nwafu_biblatex_misc: \clist_map_function:NN \l__nwafu_bib_resource_clist \addbibresource - \__nwafu_biblatex_allow_url_break: \defbibheading { bibliography } [ \bibname ] { \__nwafu_chapter:n {##1} } } \cs_new_protected:Npn \__nwafu_pass_options_to_biblatex:n #1 { \PassOptionsToPackage {#1} { biblatex } } -\cs_new:Npn \__nwafu_biblatex_misc: - { - \DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{$\sim$}} - \newcommand\nwafu@font@bib{\__nwafu_line_spread:n {1.3}\zihao{5}} - \renewcommand{\bibfont}{\nwafu@font@bib} - \DeclareFieldFormat[article]{journaltitle}{\iffieldequalstr{userd}{chinese}{##1}{\textit{##1}}\isdot} - \renewcommand{\postnotedelim}{\addcolon\space} - \DeclareFieldFormat{postnote}{##1} - \DeclareDelimFormat[cite,parencite,pagescite]{nameyeardelim}{\space} - \DeclareDelimFormat[textcite]{nameyeardelim}{\space} - \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addperiod\space} - \renewcommand*{\finentrypunct}{} - \DefineBibliographyStrings{english}{ - andincitecn = {和}, - andincite = {and}, - mathesiscn={[硕士学位论文]}, - phdthesiscn={[博士学位论文]}, - in={In:\addspace}, - incn={见:\addspace}, - } - \DeclareDelimFormat{finalnamedelim}{% - \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% - \edef\userfieldabcde{userd}% - \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% - \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% - \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% - \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% - \ifcase\value{gbcitelocalcase}% - \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andincitecn}}{}% - \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% - \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andjp}}{}% - \iffieldequalstr{\userfieldabcde}{english}{\addspace\bibstring{andincite}\addspace}{}% - \iffieldequalstr{\userfieldabcde}{french}{\addspace\bibstring{and}\addspace}{}% - \iffieldequalstr{\userfieldabcde}{russian}{\addspace\bibstring{and}\addspace}{}% - \or% - \bibstring{andincitecn}% - \or% - \addspace\bibstring{andincite}\addspace% - \fi - } - \DeclareDelimFormat{strandothersdelim}{% - \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% - %\addspace% - \edef\userfieldabcde{userd}% - \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% - \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% - \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% - \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% - \ifcase\value{gbcitelocalcase}% - \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andothersincitecn}}{}% - \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}% - \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andothersjp}}{}% - \iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothersincite}}{}% - \iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}% - \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}% - \or% - \bibstring{andothersincitecn}% - \or% - \bibstring{andothersincite}% - \fi - } - \AtEveryCitekey{% - \iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{}}%\addthinspace - {\renewcommand*{\andothersdelim}{\addspace}}% - } - \renewbibmacro*{cite:extradate}{% - \iffieldundef{extradate} {} - {\printtext[bibhyperref]{\printlabeldateextra}}%\printfield{extradate} - } - \renewbibmacro*{date+extradate}{% - \iffieldundef{labelyear}{}% - {\ifboolexpr{% - test {\ifentrytype{patent}} - or - (test {\ifentrytype{newspaper}} )% - }% - {\printtext{\blx@isodate{}{}}}% - {\printtext{% - \iflabeldateisdate - {\printdateextra} - {\printlabeldateextra} - } - }% - }% - } - \newbibmacro*{origdate+extradate}{% - \printtext{\printorigdate}% - } - \renewbibmacro*{bytranslator+others}{% - \ifnameundef{translator} - {} - {\printnames[bytranslator]{translator}% - \usebibmacro{bytranslator+othersstrg}%“译”的位置换到下面来,即放到译者后面。 - \newunit - }% - \usebibmacro{withothers}% - \ifboolexpr{% - test {\iffieldundef{origyear}} or test {\ifnameundef{translator}}%% - }{}{\printtext{\printdate}}% - } - \renewbibmacro*{url+urldate}{% - \usebibmacro{url}% - \iffieldundef{urlyear}% - {} - {\usebibmacro{urldate} - } - } - \DeclareFieldFormat{addnumflag}{% - \ifentrytype{newspaper} - {\setunit{\addcomma\addspace}\printtext{##1}} - {\nobreak\printtext{(}\nobreak ##1\nobreak\printtext{)}} - } - \renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件 - \ifboolexpr{% - test{\iffieldundef{title}}% - and% - test{\iffieldundef{subtitle}}% - }% - {}% - { - \printtext[title]{\bibtitlefont% - \printfield[titlecase]{title}% - \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 - {} - { - \setunit{\subtitlepunct}% - \printfield[titlecase]{subtitle}}% - \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - \setunit{\adddot\addspace}\printfield{number}%写专利号 - \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}% - }% - }% - } - \renewbibmacro*{name:andothers}{% - \ifboolexpr{ - test {\ifnumequal{\value{listcount}}{\value{liststop}}} - and - test \ifmorenames - }{\ifnumgreater{\value{liststop}}{1}% - {\finalandcomma}% - {}% - \printdelim{andothersdelim}\printdelim{strandothersdelim}% - }{%当是译者的时候需要特殊处理 - \ifcurrentname{translator}{\addcomma}{}% - } - } - \DeclareFieldFormat{edition}{% - \testCJKfirst{userd}% - \iftoggle{ifCJKforgbt}% - {\ifinteger{##1}% - {\printtext{\bibstring{serialcn}\zhnumber{##1}\str@edition}}% - {##1\isdot} - }% - {\ifinteger{##1}% - {\mkbibordedition{##1}~\bibstring{edition}}% - {##1\isdot} - } - } - \renewbibmacro*{author}{% - \ifboolexpr{ - test \ifuseauthor - and - not test {\ifnameundef{author}} - }{\usebibmacro{bbx:dashcheck} - {\printnames{author}\setunit{\printdelim{nameyeardelim}}%把标点也带上 - }{\usebibmacro{bbx:savehash}% - \printnames{author}% - \iffieldundef{authortype} - {\setunit{\printdelim{nameyeardelim}}} - {\setunit{\printdelim{authortypedelim}}} - }% - \iffieldundef{authortype} - {} - {\usebibmacro{authorstrg}% - \setunit{\printdelim{nameyeardelim}} - } - }% - {\global\undef\bbx@lasthash - \usebibmacro{labeltitle}% - \setunit*{\printdelim{nonameyeardelim}} - }% - \ifboolexpr{% - test {\iffieldundef{origyear}} or test {\ifnameundef{translator}}% - }{\usebibmacro{date+extradate}}% - {\usebibmacro{origdate+extradate}}% - } - \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/editor+others/translator+others}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{maintitle+title}% - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock% - \usebibmacro{byauthor}% - \newunit\newblock% - }% - \newunit% - \printfield{edition}% - \newunit% - \usebibmacro{byeditor+others}% - \newunit\newblock% - \iftoggle{bbx:gbstrict}{}{% - \iffieldundef{maintitle}% - {% - \printfield{volume}% - \printfield{part}% - }% - {}% - \newunit% - \printfield{volumes}% - \newunit\newblock% - \usebibmacro{series+number}% - }% - \newunit\newblock% - \usebibmacro{publisher+location+date}% - \usebibmacro{chapter+pages}% - \iffieldundef{url}{}{%当没有网址时也不输出 - \usebibmacro{modifydate}%带括号的修改或更新日期, - }% - \usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 - \newunit\newblock% - \printfield{pagetotal}% - \newunit\newblock% - \iftoggle{bbx:isbn}% - {\printfield{isbn}} - {}% - \newunit\newblock% - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock% - \iftoggle{bbx:related}% - {\usebibmacro{related:init}% - \usebibmacro{related}% - }{}% - \usebibmacro{finentry} - } - \DeclareBibliographyDriver{online}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/editor+others/translator+others}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{title}% - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor}% - \newunit\newblock - \usebibmacro{byeditor+others}% - \newunit\newblock - \printfield{note} - }% - \newunit - \printfield{version}% - \newunit\newblock - \printlist{institution}% - \newunit\newblock - \ifboolexpr{% - test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% - }{\usebibmacro{date}}% - \usebibmacro{url+urldate}%从下面移上来 - \newunit\newblock - \iftoggle{bbx:eprint} - {\usebibmacro{eprint}} - {}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related}} - {}% - \usebibmacro{finentry} - } - \DeclareBibliographyDriver{patent}{%源来自standard.BBX - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author}% - \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 - \usebibmacro{patenttitle}%给出专利专用的标题输出 - \iftoggle{bbx:gbstrict}{}{% - \newunit% - \printlist{language}% - \newunit\newblock - \usebibmacro{byauthor} - }% - \newunit\newblock - \printfield{type}% - \setunit*{\addspace}% - \iflistundef{location} - {} - {\setunit*{\addspace}% - \printtext{%[parens] - \printlist[][-\value{listtotal}]{location}} - }% - \newunit\newblock - \usebibmacro{byholder}% - \newunit\newblock - \printfield{note}% - \newunit\newblock - \usebibmacro{doi+eprint+url}% - \newunit\newblock - \usebibmacro{addendum+pubstate}% - \setunit{\bibpagerefpunct}\newblock - \usebibmacro{pageref}% - \newunit\newblock - \iftoggle{bbx:related} - {\usebibmacro{related:init}% - \usebibmacro{related} - } - {}% - \usebibmacro{finentry} - } - \setlength{\bibitemsep}{2pt} - \setlength{\bibnamesep}{0ex} - \setlength{\bibinitsep}{0ex} - \setlength{\bibitemindent}{-2\ccwd}% bibitemindent表示一条文献中第一行相对后面各行的缩进 - \setlength{\bibhang}{2\ccwd} % 表示的各行起始位置到页边的距离 - } -\cs_new:Npn \__nwafu_biblatex_allow_url_break: - { - \int_set_eq:NN \c@biburlucpenalty \c_one_int - \int_set_eq:NN \c@biburlnumpenalty \c_one_int - \int_set_eq:NN \c@biburllcpenalty \c_one_int - } -\cs_new:Npn \__nwafu_set_cite_style_author_year: - { - \NAT@numbersfalse - \cs_set_eq:NN \NAT@open \c__nwafu_fwid_left_paren_tl - \cs_set_eq:NN \NAT@close \c__nwafu_fwid_right_paren_tl - \cs_set_eq:NN \NAT@sep \c__nwafu_fwid_semicolon_tl - \cs_set_eq:NN \NAT@aysep \c__nwafu_fwid_comma_tl - \cs_set_eq:NN \NAT@yrsep \c__nwafu_ideo_comma_tl - } \skip_set:Nn \parskip { 0pt plus 2pt minus 1pt } \skip_set:Nn \intextsep { 14pt plus 2pt minus 2pt } \skip_set:Nn \textfloatsep { 16pt plus 2pt minus 4pt } @@ -3558,12 +3270,9 @@ { bullet } { \textbullet }, { endash } { \normalfont\bfseries\textendash }, { asterisk } { \textasteriskcentered }, - { arabic } { \bool_if:NTF \l__nwafu_withchap_bool - { \arabic*. }{ (\arabic*) } }, - { alph } { \bool_if:NTF \l__nwafu_withchap_bool - { \alph*. }{ (\alph*) } }, - { roman } { \bool_if:NTF \l__nwafu_withchap_bool - { \roman*. }{ (\roman*) } }, + { arabic } { (\arabic*) }, + { alph } { (\alph*) }, + { roman } { (\roman*) }, { alph } { (\alph*) }, { roman } { \roman*. }, { outline } { \upshape\ding{111} } -- cgit v1.2.3