| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: hduthesis.dtx |
| 4 |
% ----------------------------------------------------------------------- |
| 5 |
% Copyright (C) 2023-2025 by Mingyu Xia <[email protected]> * |
| 6 |
% * |
| 7 |
% It may be distributed and/or modified under the conditions of the * |
| 8 |
% LaTeX Project Public License (LPPL), either version 1.3c of this * |
| 9 |
% license or (at your option) any later version. The latest version * |
| 10 |
% of this license is in the file * |
| 11 |
% * |
| 12 |
% http://www.latex-project.org/lppl.txt * |
| 13 |
% * |
| 14 |
% This work has the LPPL maintenance status `maintained'. * |
| 15 |
% * |
| 16 |
% The Current Maintainer of this work is Mingyu Xia. * |
| 17 |
% * |
| 18 |
% This work consists of the files hduthesis.dtx, * |
| 19 |
% hdu-graphics.dtx, * |
| 20 |
% and hduthesis.ins, * |
| 21 |
% and the derived files hduthesis.cls, * |
| 22 |
% hdu-<module>.code.tex, * |
| 23 |
% beamerthemehdu.sty, * |
| 24 |
% hdu-logo.pdf, * |
| 25 |
% hdu-title.pdf, * |
| 26 |
% hdu-badge.pdf, * |
| 27 |
% hdu-motto.pdf, * |
| 28 |
% hduthesis.pdf, * |
| 29 |
% hdu-graphics.pdf, * |
| 30 |
% and README.md. * |
| 31 |
% ----------------------------------------------------------------------- |
| 32 |
% |
| 33 |
% Any modification of this file should ensure that the copyright and |
| 34 |
% license information is placed in the derived files. |
| 35 |
% |
| 36 |
% ----------------------------------------------------------------------- |
| 37 |
% |
| 38 |
%<*internal> |
| 39 |
\iffalse |
| 40 |
%</internal> |
| 41 |
% |
| 42 |
%<*readme> |
| 43 |
The `hduthesis` Class: LaTeX class for Hangzhou Dianzi University |
| 44 |
================================================================= |
| 45 |
|
| 46 |
LaTeX class for bachelor and mphil theses in Hangzhou Dianzi |
| 47 |
University is constructed by `LaTeX-expl3`. This class provides typesets |
| 48 |
for bachelors' and mphils' thesis in Hangzhou Dianzi University. |
| 49 |
|
| 50 |
Modules of `hduThesiS` provide the following supports: |
| 51 |
|
| 52 |
- `typeset`: Math and text Typeset |
| 53 |
|
| 54 |
- `layout`: Some central layout typeset interfaces |
| 55 |
|
| 56 |
- `bc.config`: Configuration for bachelor thesis' style |
| 57 |
|
| 58 |
- `pg.config`: Configuration for mphil thesis' style |
| 59 |
|
| 60 |
- `beamer`: HDU Beamer theme |
| 61 |
|
| 62 |
- `stationery`: Creation of HDU's stationery |
| 63 |
|
| 64 |
- `exam`: Typeset for HDU examinations' solution |
| 65 |
|
| 66 |
- `l3doc`: Configuration for class's `l3doc` manual |
| 67 |
|
| 68 |
Issues |
| 69 |
------ |
| 70 |
|
| 71 |
The issue tracker for `hduthesis` is currently located |
| 72 |
[on GitHub](https://github.com/myhsia/hduthesis/issues). |
| 73 |
|
| 74 |
--- |
| 75 |
|
| 76 |
杭州电子科技大学学位论文 LaTeX 模板 |
| 77 |
============================== |
| 78 |
|
| 79 |
杭州电子科技大学学位论文 LaTeX 模板以 `LaTeX-expl3` 构建,提供杭州电子科技大学学士和硕士学位论文格式. |
| 80 |
|
| 81 |
`hduThesiS` 的模块提供以下支持: |
| 82 |
|
| 83 |
- `typeset`: 数学和文本排版 |
| 84 |
|
| 85 |
- `layout`: 封面和浮动题布局 |
| 86 |
|
| 87 |
- `bc.config`: 学士论文格式配置 |
| 88 |
|
| 89 |
- `pg.config`: 硕士论文格式配置 |
| 90 |
|
| 91 |
- `beamer`: HDU Beamer 主题 |
| 92 |
|
| 93 |
- `stationery.config`: 学校信纸生成 |
| 94 |
|
| 95 |
- `exam`: HDU 试卷解析模板 |
| 96 |
|
| 97 |
- `hdu.l3doc`: 模板 `l3doc` 用户手册配置 |
| 98 |
|
| 99 |
--- |
| 100 |
|
| 101 |
References |
| 102 |
---------- |
| 103 |
|
| 104 |
> \[1\]. The LaTeX3 Interfaces |
| 105 |
|
| 106 |
> \[2\]. CTeX 宏集 |
| 107 |
|
| 108 |
> \[3\]. LaTeX for package and class authors current version |
| 109 |
|
| 110 |
> \[4\]. The LaTeX2e Sources |
| 111 |
|
| 112 |
> \[5\]. The LaTeX3 kernel: style guide for code authors |
| 113 |
|
| 114 |
> \[6\]. Package `etoolbox`, `geometry`, `tocloft`, `fancyhdr`, etc. |
| 115 |
|
| 116 |
> \[7\]. [毕业设计(论文)的写作规范及格式要求(含写作模板)](https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm) |
| 117 |
|
| 118 |
> \[8\]. [杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)](https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm) |
| 119 |
|
| 120 |
|
| 121 |
Copyright and License |
| 122 |
--------------------- |
| 123 |
|
| 124 |
Copyright (C) 2023-2025 by Mingyu Xia <[email protected]> |
| 125 |
|
| 126 |
It may be distributed and/or modified under the conditions of the |
| 127 |
LaTeX Project Public License (LPPL), either version 1.3c of this |
| 128 |
license or (at your option) any later version. The latest version |
| 129 |
of this license is in the file <http://www.latex-project.org/lppl.txt> |
| 130 |
|
| 131 |
This work has the LPPL maintenance status `maintained`. |
| 132 |
|
| 133 |
The Current Maintainer of this work is Mingyu Xia. |
| 134 |
%</readme> |
| 135 |
% |
| 136 |
%<*internal> |
| 137 |
\fi |
| 138 |
%</internal> |
| 139 |
% |
| 140 |
%<*driver|package> |
| 141 |
\RequirePackage{etoolbox} |
| 142 |
%</driver|package> |
| 143 |
%<*driver> |
| 144 |
\documentclass[mode = l3doc, full]{hduthesis} |
| 145 |
\usepackage[mono = false]{libertine} |
| 146 |
\makeindex |
| 147 |
\begin{document} |
| 148 |
\DocInput{\jobname.dtx} |
| 149 |
\end{document} |
| 150 |
%</driver> |
| 151 |
% \fi |
| 152 |
% |
| 153 |
% \title{\bfseries |
| 154 |
% \hologo{hduThesiS} 文档类\\^^A |
| 155 |
% 杭州电子科技大学学位论文 \hologo{LaTeX} 模板^^A |
| 156 |
% \thanks{^^A |
| 157 |
% 在 杭州电子科技大学非毕业生 / 教师 中寻找模板的接班人, |
| 158 |
% 要求熟悉 \pkg{expl3} 与文学编程. 欢迎有意愿者邮件联系. |
| 159 |
% } |
| 160 |
% } |
| 161 |
% |
| 162 |
% \author{^^A |
| 163 |
% Mingyu Xia \mailto{[email protected]}^^A |
| 164 |
% \thanks{Physics Department, Graduate in 07/2025} |
| 165 |
% } |
| 166 |
% |
| 167 |
% \maketitle |
| 168 |
% |
| 169 |
% \begin{documentation} |
| 170 |
% |
| 171 |
% \begin{abstract} |
| 172 |
% \hologo{hduthesis} 是杭州电子科技大学学位论文 \hologo{LaTeX} 模板, |
| 173 |
% 支持学士、硕士学位论文排版,同时提供了学校信笺、Beamer(幻灯片)与试卷解析模板. |
| 174 |
% \end{abstract} |
| 175 |
% |
| 176 |
% \begin{center} |
| 177 |
% \small\bfseries 用户协议 |
| 178 |
% \end{center} |
| 179 |
% \begin{enumerate}[itemsep = 2em, itemsep = 0pt]\small |
| 180 |
% \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件. |
| 181 |
% \item 本模板根据杭州电子科技大学教务处颁发的 |
| 182 |
% \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm} |
| 183 |
% {杭电理工类毕业论文写作规范} 编写而成,作者不对使用本模板产生的格式审查问题负责. |
| 184 |
% 如果您所在的学院因论文查重、收录等原因要求提交 \file{.docx} 格式, |
| 185 |
% 不接收 \file{.pdf} 论文稿件,请勿执意使用本模板,避免因格式转换带来不必要的麻烦. |
| 186 |
% 使用本模板时,请按编译错误提示操作来勾选同意用户协议. |
| 187 |
% \item 欢迎前往 \href{https://github.com/myhsia/hduthesis/issues}{GitHub} |
| 188 |
% 提交反馈意见,为推动学校认证与规范化 \hologo{hduthesis} 贡献力量. |
| 189 |
% \end{enumerate} |
| 190 |
% |
| 191 |
% \setcounter{tocdepth}{2} \tableofcontents |
| 192 |
% |
| 193 |
% \section{\hologo{hduthesis} 模板介绍} |
| 194 |
% |
| 195 |
% \hologo{hduthesis}(\textbf Hangzhou \textbf Dianzi \textbf University |
| 196 |
% \hologo{LaTeX} \textbf{Thesis} Template) 是杭州电子科技大学学位论文 |
| 197 |
% \underline{非官方} \hologo{LaTeX} 模板,以 \hologo{LaTeX3} 构建, |
| 198 |
% 支持学士和硕士学位论文排版. |
| 199 |
% |
| 200 |
% 本模板文档将尽量完整地介绍模板的使用方法,如有不清楚之处,或者想提出改进建议, |
| 201 |
% 可以在 \href{https://github.com/myhsia/hduthesis/issues}{GitHub Issues} |
| 202 |
% 提交反馈意见及贡献代码. |
| 203 |
% |
| 204 |
% 对于未接触过 \hologo{LaTeX} 的初学者,推荐阅读 |
| 205 |
% \href{https://tug.ctan.org/info/lshort/english/lshort.pdf} |
| 206 |
% {The Not So Short Introduction to \hologo{LaTeX2e}} |
| 207 |
% (可在终端执行 |texdoc lshort| 获取)或者其中文版 |
| 208 |
% \href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf} |
| 209 |
% {《一份(不太)简短的 \hologo{LaTeX2e} 介绍》} |
| 210 |
% (可在终端执行 |texdoc lshort-zh-cn| 获取). |
| 211 |
% |
| 212 |
% \subsection{模板组成} |
| 213 |
% |
| 214 |
% \hologo{hduthesis} 模板的 \file{./tex/} 文件夹中包含了模板的所有 Runtime 文件. |
| 215 |
% 其中,\file{hduthesis.cls} 是模板的核心文件,实质上并不提供主要功能, |
| 216 |
% 只用于对全局选项的控制加载模板的各个模块. 模板的功能模块如下 |
| 217 |
% |
| 218 |
% \begin{tasks}(2) |
| 219 |
% \task \file{typeset}:字体和公式设置. |
| 220 |
% \task \file{layout}:版面核心排版接口. |
| 221 |
% \task \file{pg.config}:硕士学位论文配置模块. |
| 222 |
% \task \file{bc.config}:本科学位论文配置模块. |
| 223 |
% \task \file{beamerthemehdu}:Beamer 主题. |
| 224 |
% \task \file{stationery}:信纸模块. |
| 225 |
% \task \file{exam}:HDU 试卷解析模板. |
| 226 |
% \task \file{l3doc}:用户手册模块. |
| 227 |
% \end{tasks} |
| 228 |
% |
| 229 |
% 以上模块包含在 \file{hdu-}\meta{module name}\file{.code.tex} 文件中. |
| 230 |
% 同时,\file{./tex/} 文件夹中还包含了 \file{hdu-logo.pdf}、\file{hdu-title.pdf}、 |
| 231 |
% \file{hdu-motto.pdf}、\file{hdu-badge.pdf},分别提供杭州电子科技大学校徽、校名、 |
| 232 |
% 校训和校牌的矢量图. |
| 233 |
% \footnote{如果你通过 |tlmgr| 安装了此模板,在其他文档类中也可以调用这些素材.} |
| 234 |
% |
| 235 |
% 模板预加载的宏包有 |
| 236 |
% |
| 237 |
% \begin{table}[htbp] |
| 238 |
% \centering \renewcommand* \arraystretch {.72} |
| 239 |
% \begin{tabular*}{\linewidth} |
| 240 |
% {*9{@{\hspace{1ex}}>{\footnotesize}l@{\hspace{1ex}}}} |
| 241 |
% \toprule |
| 242 |
% \pkg{amssymb} & \pkg{bm} & \pkg{booktabs} & |
| 243 |
% \pkg{cancel} & \pkg{circuitikz} & \pkg{cleveref} & |
| 244 |
% \pkg{derivative} & \pkg{extarrows} & \pkg{fixdif} \\ |
| 245 |
% \midrule |
| 246 |
% \pkg{hyperref} & \pkg{listings} & \pkg{mathtools} & |
| 247 |
% \pkg{multicol} & \pkg{pgfplots} & \pkg{physics2} & |
| 248 |
% \pkg{siunitx} & |
| 249 |
% \multicolumn{2}{@{}>{\footnotesize}l}{\pkg{unicode-math}}\\ |
| 250 |
% \bottomrule |
| 251 |
% \end{tabular*} |
| 252 |
% \end{table} |
| 253 |
% |
| 254 |
% \subsection{文件结构} |
| 255 |
% |
| 256 |
% \noindent \begin{minipage}[t]{.54\linewidth} |
| 257 |
% \subsubsection{源文件 \& 使用用例} |
| 258 |
% \dirtree |
| 259 |
% {^^A |
| 260 |
% .1 ./hduthesis.tar.gz/. |
| 261 |
% .2 hduthesis.dtx, *.pdf. |
| 262 |
% .2 hdu-graphics.dtx, *.pdf. |
| 263 |
% .2 hduthesis.ins. |
| 264 |
% .2 example/. |
| 265 |
% .3 hduthesis-bachelor.tex, *.pdf. |
| 266 |
% .3 hduthesis-mphil.tex, *.pdf. |
| 267 |
% .3 reference.bib. |
| 268 |
% .3 cha/. |
| 269 |
% .3 figures/. |
| 270 |
% .2 README.md. |
| 271 |
% } |
| 272 |
% \end{minipage} \hspace*{\fill} |
| 273 |
% \begin{minipage}[t]{.42\linewidth} |
| 274 |
% \subsubsection{Runtime 文件} \label{1.2.2} |
| 275 |
% \dirtree |
| 276 |
% {^^A |
| 277 |
% .1 ./hduthesis.tar.gz/. |
| 278 |
% .2 hduthesis.dtx/. |
| 279 |
% .3 hduthesis.cls. |
| 280 |
% .3 hdu-<module>.code.tex. |
| 281 |
% .3 beamerthemehdu.sty. |
| 282 |
% .3 README.md. |
| 283 |
% .2 hdu-graphics.dtx/. |
| 284 |
% .3 hdu-logo.pdf. |
| 285 |
% .3 hdu-title.pdf. |
| 286 |
% .3 hdu-badge.pdf. |
| 287 |
% .3 hdu-motto.pdf. |
| 288 |
% } |
| 289 |
% \end{minipage} |
| 290 |
% |
| 291 |
% \subsection{模板的妥协与僵持} |
| 292 |
% |
| 293 |
% \begin{enumerate} |
| 294 |
% \item 模板的章节(\cs[no-index]{chapter}、\cs[no-index]{section}、 |
| 295 |
% \cs[no-index]{subsection})字体、前后间距完全按照 |
| 296 |
% 杭电理工类毕业论文写作规范 进行设置,虽然这样的设置可能与您的审美不符, |
| 297 |
% 但是这是为了保证论文的格式符合学校的要求. |
| 298 |
% \item 杭电理工类毕业论文写作规范中要求 |
| 299 |
% 参考文献书写格式应符合GB7714-1987,但目前 |
| 300 |
% GB7714-2015 为学术界通用格式,在已有新标准情况下旧标准理应废止使用. |
| 301 |
% 所以本模板默认使用 \pkg{gbt7714} 宏包. |
| 302 |
% \end{enumerate} |
| 303 |
% |
| 304 |
% \section{模板安装} |
| 305 |
% |
| 306 |
% \subsection{系统要求} |
| 307 |
% |
| 308 |
% 本模板支持在 |macOS|、|Windows|、|Linux|、|Overleaf|、|LoongTeX|、|TeXPage| |
| 309 |
% 等平台使用,兼容发行版 \hologo{TeX} Live 2023 及更新版本^^A |
| 310 |
% \footnote{ |
| 311 |
% 本模板均可在 |macOS Sequoia Version 15.4| / |
| 312 |
% |Ubuntu 24.04.1 LTS| / |Overleaf| / |
| 313 |
% |LoongTeX| / |TeXPage| |
| 314 |
% 上的 \hologo{TeX} Live 2024 中顺利编译. |
| 315 |
% \hologo{MiKTeX} 发行版以及 Windows 平台未作测试. 如在这些平台编译无法通过, |
| 316 |
% 建议转向在线平台,本模板在诸多在线平台编译性能良好. |
| 317 |
% }. |
| 318 |
% 本模板生成学位论文时支持 \hologo{XeLaTeX}、\hologo{ApTeX} 与 \hologo{LuaLaTeX} |
| 319 |
% 编译;使用本模板生成信纸、试题解析时支持所有编译方式. |
| 320 |
% |
| 321 |
% \subsection{标准安装} |
| 322 |
% |
| 323 |
% 强烈建议您使用 |tlmgr| 进行安装与升级. 在终端(Terminal) |
| 324 |
% 执行以下命令即可安装最新版本的 \hologo{hduthesis} 模板. |
| 325 |
% \begin{quote} |
| 326 |
% "sudo tlmgr install hduthesis" |
| 327 |
% \end{quote} |
| 328 |
% |
| 329 |
% Windows 系统用户无需 |sudo|,请以管理员身份运行命令提示符. |
| 330 |
% 有些时候,您需要手动更新 |tlmgr| 才能正常使用 |tlmgr| 命令安装宏包. |
| 331 |
% \begin{quote} |
| 332 |
% "sudo tlmgr update --self" |
| 333 |
% \end{quote} |
| 334 |
% |
| 335 |
% 升级该模板,在终端(Terminal)执行以下命令即可 |
| 336 |
% \begin{quote} |
| 337 |
% "sudo tlmgr update hduthesis" |
| 338 |
% \end{quote} |
| 339 |
% 发行版 \hologo{TeX} Live 2025 以及更新版本已自带本模板,无需安装. 只需在必要时升级即可. |
| 340 |
% |
| 341 |
% \subsection{手动安装} |
| 342 |
% |
| 343 |
% 本模板采用 \pkg{l3build} 脚本进行打包. 用户可在 |
| 344 |
% \href{https://ctan.org/pkg/hduthesis}{CTAN}、 |
| 345 |
% \href{https://github.com/myhsia/hduthesis/}{GitHub} 和 |
| 346 |
% \href{https://gitee.com/myhsia/hduthesis}{Gitee} 平台 |
| 347 |
% Clone 项目\footnote{CTAN 平台并未提供 \file{build.lua} 脚本}. |
| 348 |
% 解压后在当前目录运行 |
| 349 |
% \begin{quote} |
| 350 |
% "l3build ctan"\\ |
| 351 |
% "l3build install" |
| 352 |
% \end{quote} |
| 353 |
% 会生成如 \ref{1.2.2} 所示的 Runtime 文件,并将模板安装至本地. |
| 354 |
% |
| 355 |
% \section{全局选项} |
| 356 |
% |
| 357 |
% \subsection{用户协议} |
| 358 |
% |
| 359 |
% 使用本模板编译本科、硕士学位论文时遇到``编译受阻''报错,请认真阅读封面的用户协议. |
| 360 |
% 添加选项 |agreed| 后(即|\documentclass [ agreed ] { hduthesis }|), |
| 361 |
% 方可顺利编译,并默认您已同意用户协议. |
| 362 |
% |
| 363 |
% 使用 \hologo{hduthesis} 编译信纸、试题解析、Beamer 和本用户手册时,无需 |agreed| 选项. |
| 364 |
% |
| 365 |
% \subsection{字体设置} |
| 366 |
% |
| 367 |
% 用户可通过全局选项设置文档的数学和中文字体. 设置的方式为键值对. |
| 368 |
% \begin{keyval} |
| 369 |
% \item [\key{math-font}] \val{font family name} 用于设置数学字体. |
| 370 |
% \item [\key{CJKmain-font}] \val{xeCJK interface} 用于设置罗马族的 CJK 字体. |
| 371 |
% \item [\key{CJKsans-font}] \val{xeCJK interface} 用于设置无衬线族的 CJK 字体. |
| 372 |
% \item [\key{CJKmono-font}] \val{xeCJK interface} 用于设置等宽族的 CJK 字体. |
| 373 |
% \end{keyval} |
| 374 |
% \begin{verbatim} |
| 375 |
% \documentclass |
| 376 |
% [ |
| 377 |
% math-font = STIX Two Math, agreed, |
| 378 |
% CJKmain-font = {{Songti SC}[AutoFakeBold = 2.5, AutoFakeSlant]}, |
| 379 |
% CJKsans-font = {{STHeiti}[AutoFakeBold = 2]} |
| 380 |
% ] {hduthesis} |
| 381 |
% \end{verbatim} |
| 382 |
% 更加详细的字体设置请参考 \pkg{xeCJK} 宏包的文档. |
| 383 |
% |
| 384 |
% \section{文档信息设置} |
| 385 |
% |
| 386 |
% \begin{function}{\hduset} |
| 387 |
% \begin{syntax} |
| 388 |
% \cs{DocInfo}\marg{key values} |
| 389 |
% \end{syntax} |
| 390 |
% 此命令接收键值,用于设置文档信息,需在导言区中执行. |
| 391 |
% \begin{keyval} |
| 392 |
% \item [\key{title}] \val{list} 用于设置论文题目与封面大标题. |
| 393 |
% \item [\key{department}] \val{string} 用于设置学院. |
| 394 |
% \item [\key{major}] \val{string} 用于设置专业. |
| 395 |
% \item [\key{class}] \val{string} 用于设置班级. |
| 396 |
% \item [\key{stdntid}] \val{string} 用于设置学号, |
| 397 |
% 会根据输入的学号自动选择本科生/研究生格式. |
| 398 |
% \item [\key{author}] \val{string} 用于设置作者. |
| 399 |
% \item [\key{supervisor}] \val{list} 用于设置导师. |
| 400 |
% \item [\key{bibsource}] \val{string} 用于设置插入参考文献文件源. |
| 401 |
% \end{keyval} |
| 402 |
% \end{function} |
| 403 |
% |
| 404 |
% 本科生输入样例如下. 考虑到不同学院对封面样式的要求不同 |毕业论文|、|毕业设计|、 |
| 405 |
% |毕业论文(设计)|,\key*{title} 提供了接口供设置封面大标题: |
| 406 |
% 论文题目和大标题之间用斜线 (|/|) 分隔. 指导教师职称和姓名之间用半角冒号 (|:|) 分隔. |
| 407 |
% \begin{verbatim} |
| 408 |
% \hduset |
| 409 |
% { |
| 410 |
% title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ |
| 411 |
% 本科毕业设计, department = 理学院, |
| 412 |
% major = 物理学, stdntid = C668668E, |
| 413 |
% author = 申智能, bibsource = reference, |
| 414 |
% class = 英才班, supervisor = 教授:葉芷晴, |
| 415 |
% } |
| 416 |
% \end{verbatim} |
| 417 |
% |
| 418 |
% 研究生输入样例如下. 硕士学位论文扉页需同时有英文版,因此需要在键 |
| 419 |
% \key*{title} \key*{author} \key*{supervisor} 中分别输入中文和英文信息, |
| 420 |
% 中英信息使用斜线 (|/|) 分隔,指导教师职称和姓名之间用半角冒号 (|:|) 分隔. |
| 421 |
% |
| 422 |
% \begin{verbatim} |
| 423 |
% \hduset |
| 424 |
% { |
| 425 |
% title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ |
| 426 |
% \hologo{LaTeX} Template for Thesis at |
| 427 |
% Hangzhou Dianzi University, |
| 428 |
% major = 物理学, stdntid = 216686680, |
| 429 |
% author = 申智能/SAN Chi Nan, bibsource = reference |
| 430 |
% supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, |
| 431 |
% } |
| 432 |
% \end{verbatim} |
| 433 |
% |
| 434 |
% \subsection{生成封面 \& 扉页} |
| 435 |
% |
| 436 |
% \begin{function}{\maketitle} |
| 437 |
% 在正文区域,使用命令 \cs{maketitle} 即可生成论文封面和扉页. |
| 438 |
% 生成的封面和扉页会根据所设置的文档信息自动生成. |
| 439 |
% \end{function} |
| 440 |
% |
| 441 |
% \DescribeMacro{\l__hduthesis_grade_int} |
| 442 |
% 封面上的论文完成日期和学生毕业年份会根据当前系统时间自动生成. |
| 443 |
% 针对本科论文,如果当前月份在8月及以前,毕业年份会显示今年; |
| 444 |
% 如果当前月份在9月及以后,毕业年份会显示次年. |
| 445 |
% 在 \cs{DocInfo} 后对整型 \cs{l__hduthesis_grade_int} 重新赋值可手动更改毕业年份. |
| 446 |
% |
| 447 |
% \begin{quote} |
| 448 |
% "\ExplSyntaxOn"\\ |
| 449 |
% "\int_set:Nn \l__hduthesis_grade_int" \marg{Year}\\ |
| 450 |
% "\ExplSyntaxOff" |
| 451 |
% \end{quote} |
| 452 |
% |
| 453 |
% \subsection{生成承诺书} |
| 454 |
% |
| 455 |
% \begin{function}{\commitment} |
| 456 |
% \begin{syntax} |
| 457 |
% \cs{commitment} \oarg{file-date combined comma list} |
| 458 |
% \end{syntax} |
| 459 |
% |
| 460 |
% 此命令用于生成承诺书. 命令的可选参数接收数组,用于指定签名文件和输入签名的日期. |
| 461 |
% 签名文件和签名的日期之间用 |/| 分隔,多组签名之间用 |,| 分隔. |
| 462 |
% 签名文件接收 \file{.pdf} / \file{.png} / \file{.jpg} 等格式. |
| 463 |
% 日期的输入格式为 |yyyy-mm-dd|. |
| 464 |
% \end{function} |
| 465 |
% |
| 466 |
% 对于本科生,只需要签署 ``诚信承诺'' 一组签名; |
| 467 |
% 对于研究生,则需要签署 ``原创性声明''、 |
| 468 |
% ``(作者同意)学位论文使用授权声明'' 和 |
| 469 |
% ``(导师同意)学位论文使用授权声明'' 三组签名. 使用用例如下 |
| 470 |
% |
| 471 |
% \begin{verbatim} |
| 472 |
% \begin{document} ... \maketitle |
| 473 |
% \commitment |
| 474 |
% [ example-image-a/2025-05-31, example-image-a/2025-05-31, |
| 475 |
% example-image-b/2025-06-01 ] |
| 476 |
% ... \end{document} |
| 477 |
% \end{verbatim} |
| 478 |
% |
| 479 |
% 如果使用者暂未生成签名但是需要添加日期,则将签名文件留空即可,但分隔符 |/| 仍需保留. 例如 |
| 480 |
% \verb|\commitment [ /2024-05-31 ]|. 如果不需要添加日期,则直接留空即可. |
| 481 |
% |
| 482 |
% 论文封面、扉页和承诺书如下图. |
| 483 |
% 可在终端执行 |texdoc hduthesis-bachelor| 和 |texdoc hduthesis-mphil| |
| 484 |
% 分别获取本科和硕士学位论文样例文件. |
| 485 |
% |
| 486 |
% \begin{center} |
| 487 |
% \begin{minipage}{.32\linewidth} |
| 488 |
% \centering |
| 489 |
% \fbox{^^A |
| 490 |
% \includegraphics[width = .94\linewidth, page = 1] |
| 491 |
% {hduthesis-bachelor.pdf}^^A |
| 492 |
% } |
| 493 |
% \end{minipage} \hspace*{\fill} |
| 494 |
% \begin{minipage}{.32\linewidth} |
| 495 |
% \centering |
| 496 |
% \fbox{^^A |
| 497 |
% \includegraphics[width = .94\linewidth, page = 2] |
| 498 |
% {hduthesis-bachelor.pdf}^^A |
| 499 |
% } |
| 500 |
% \end{minipage} \hspace*{\fill} |
| 501 |
% \begin{minipage}{.32\linewidth} |
| 502 |
% \centering |
| 503 |
% \fbox{^^A |
| 504 |
% \includegraphics[width = .94\linewidth, page = 1] |
| 505 |
% {hduthesis-mphil.pdf}^^A |
| 506 |
% } |
| 507 |
% \end{minipage}\\ |
| 508 |
% \begin{minipage}{.32\linewidth} |
| 509 |
% \centering |
| 510 |
% \fbox{^^A |
| 511 |
% \includegraphics[width = .94\linewidth, page = 2] |
| 512 |
% {hduthesis-mphil.pdf}^^A |
| 513 |
% } |
| 514 |
% \end{minipage} \hspace*{\fill} |
| 515 |
% \begin{minipage}{.32\linewidth} |
| 516 |
% \centering |
| 517 |
% \fbox{^^A |
| 518 |
% \includegraphics[width = .94\linewidth, page = 3] |
| 519 |
% {hduthesis-mphil.pdf}^^A |
| 520 |
% } |
| 521 |
% \end{minipage} \hspace*{\fill} |
| 522 |
% \begin{minipage}{.32\linewidth} |
| 523 |
% \centering |
| 524 |
% \fbox{^^A |
| 525 |
% \includegraphics[width = .94\linewidth, page = 4] |
| 526 |
% {hduthesis-mphil.pdf}^^A |
| 527 |
% } |
| 528 |
% \end{minipage} |
| 529 |
% \end{center} |
| 530 |
% |
| 531 |
% \section{章节设置} |
| 532 |
% |
| 533 |
% \subsection{输入中 / 英摘要} |
| 534 |
% |
| 535 |
% \DescribeEnv{abstract} |
| 536 |
% 环境 \env{abstract} 用于生成摘要,其可选参数可设置语言格式. |
| 537 |
% |
| 538 |
% \begin{function}{\keywords} |
| 539 |
% 命令 \cs{keywords} 需在 \env{abstract} 环境内执行, |
| 540 |
% 其会根据 \env{abstract} 环境所选择的语言,自动生成英文 / 中文格式的关键词. |
| 541 |
% \begin{quote} |
| 542 |
% |\begin{abstract}|\oarg{language}\\ |
| 543 |
% | ... |\\ |
| 544 |
% | |\cs{keywords}\marg{keywords list}\\ |
| 545 |
% |\end{abstract}| |
| 546 |
% \end{quote} |
| 547 |
% 通过命令 \cs{keywords} 以半角逗号 (,) 为分隔输入关键词列表, |
| 548 |
% 输出时会根据所处 \env{abstract} 环境选择的语言不同,自动以半 / 全角分号分隔. |
| 549 |
% \end{function} |
| 550 |
% |
| 551 |
% \subsection{输入目录 \& 正文} |
| 552 |
% |
| 553 |
% 通过命令 \cs{tableofcontents} 可生成目录. \cs{chapter}、\cs{section}、 |
| 554 |
% \cs{subsection} 等章节级次均按照 |
| 555 |
% \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm} |
| 556 |
% {杭电理工类毕业论文写作规范} 定制. |
| 557 |
% |
| 558 |
% \subsection{参考文献 \& 附录} |
| 559 |
% |
| 560 |
% 通过命令 \cs{DocInfo} 指定 \file{.bib} 文件后使用命令 \cs{printbiblography} |
| 561 |
% 即可输出参考文献列表. 参考文献格式已设置为 |gb7714-2015|. |
| 562 |
% 若未指定参考文献 \file{.bib} 文件,为加速编译,\pkg{gbt7714} 宏包将不会加载. |
| 563 |
% |
| 564 |
% 可以直接使用带有星号的章节命令生成附录章节,如 \verb|\chapter*{附录}|. |
| 565 |
% |
| 566 |
% \clearpage |
| 567 |
% |
| 568 |
% \section{附加模块} |
| 569 |
% |
| 570 |
% \subsection{用户手册} |
| 571 |
% |
| 572 |
% 本手册为 \cls{hduthesis} 加载 \pkg{l3doc} 模块后生成,此模块无需 \pkg{agreed} 选项. |
| 573 |
% \begin{quote} |
| 574 |
% |\documentclass [ mode = l3doc ] { hduthesis }| |
| 575 |
% \end{quote} |
| 576 |
% \subsection{杭州电子科技大学信笺} |
| 577 |
% |
| 578 |
% 加载模块 \pkg{stationery},并进行文档信息设置,即可生成信纸. |
| 579 |
% 可用于推荐信撰写或生成笔记纸. 此模块无需 \pkg{agreed} 选项. |
| 580 |
% \begin{quote} |
| 581 |
% |\documentclass [ mode = stationery ] { hduthesis }| |
| 582 |
% \end{quote} |
| 583 |
% 与学士 / 硕士学位论文文档信息设置类似,使用 \cs{DocInfo} 命令, |
| 584 |
% 对信件主题、发件人、邮箱、日期和水印进行设置. 此时 \cs{DocInfo} 命令接受键 |
| 585 |
% \key*{title} \key*{author} \key*{mail} |
| 586 |
% \key*{date} \key*{watermark}. 下页为生成信纸的样例. |
| 587 |
% |
| 588 |
% \begin{verbatim} |
| 589 |
% \hduset |
| 590 |
% { |
| 591 |
% title = Recommendation Letter for SAN Chi Nan, |
| 592 |
% author = YIP Tsz Ching, mail = [email protected], |
| 593 |
% date = {23\textsuperscript{th} December, 2024}, |
| 594 |
% watermark = true |
| 595 |
% } |
| 596 |
% \begin{document} \maketitle ... \end{document} |
| 597 |
% \end{verbatim} |
| 598 |
% |
| 599 |
% \begin{function}{\notelines} |
| 600 |
% \begin{syntax} |
| 601 |
% \cs{notelines} \oarg{num} |
| 602 |
% \end{syntax} |
| 603 |
% 用于在信纸上添加笔记线,其可选参数接收笔记线的数量,默认值为20. |
| 604 |
% 下页为生成的信纸和笔记纸样例,可在终端执行 |texdoc hduthesis-stationery| |
| 605 |
% 获取此样例文件. |
| 606 |
% \end{function} |
| 607 |
% |
| 608 |
% \includepdf [ pages = -, nup = 1x2, angle = -90, frame, |
| 609 |
% linktodoc, scale = 0.96, delta = 0in .25in |
| 610 |
% ] {hduthesis-stationery} |
| 611 |
% |
| 612 |
% \subsection{Beamer 主题} |
| 613 |
% |
| 614 |
% 本模板中存在独立的 Beamer 主题 |hdu|,用于生成杭州电子科技大学风格的 Beamer 幻灯片. |
| 615 |
% 该主题目前暂不开放更改主题色杭电蓝和 Logo. |
| 616 |
% |
| 617 |
% 加载模块 \pkg{beamer} 后可通过 \cs{hduset} 接口设置文档信息. |
| 618 |
% 此模块无需 \pkg{agreed} 选项. |
| 619 |
% \begin{quote} |
| 620 |
% "\documentclass [ mode = beamer ] { hduthesis }" |
| 621 |
% \end{quote} |
| 622 |
% 与学士 / 硕士学位论文文档信息设置类似,使用 \cs{DocInfo} 命令, |
| 623 |
% 对信件主题、发件人、邮箱、日期和水印进行设置. 此时 \cs{DocInfo} 命令接受键 |
| 624 |
% \key*{title} \key*{subtitle} \key*{author} \key*{date} \key*{supervisor} |
| 625 |
% \key*{reference}. 下页为生成Beamer的样例. |
| 626 |
% \begin{verbatim} |
| 627 |
% \hduset |
| 628 |
% { |
| 629 |
% title = Beamer Theme for Hangzhou Dianzi University |
| 630 |
% Based on \LaTeX3, |
| 631 |
% subtitle = hdu Undergraduate Thesis Proposal, |
| 632 |
% author = SAN Chi Nan (C668668E0), |
| 633 |
% date = {\today{} / Building 6, Room 321}, |
| 634 |
% supervisor = Prof. YIP Tsz Ching, |
| 635 |
% bibsource = reference.bib, |
| 636 |
% } |
| 637 |
% \end{verbatim} |
| 638 |
% |
| 639 |
% \subsection{HDU 试卷解析模块} |
| 640 |
% |
| 641 |
% 加载模块 \pkg{exam} 后即可使用此模块, |
| 642 |
% 此模块无需 \pkg{agreed} 选项. |
| 643 |
% \begin{quote} |
| 644 |
% "\documentclass [ mode = exam ] { hduthesis }" |
| 645 |
% \end{quote} |
| 646 |
% 此模块中预制了 \env{problem} 和 \env{solution} 环境. |
| 647 |
% |
| 648 |
% \includepdf [ pages = -, nup = 2x4, frame, linktodoc, |
| 649 |
% scale = 0.96, delta = .25in .2in |
| 650 |
% ] {hduthesis-beamer} |
| 651 |
% |
| 652 |
% \includepdf [ pages = -, nup = 1x2, angle = -90, frame, |
| 653 |
% linktodoc, scale = 0.96, delta = 0in .25in |
| 654 |
% ] {hduthesis-exam} |
| 655 |
% |
| 656 |
% \begin{thebibliography}{99} |
| 657 |
% \bibitem{interface3} The \hologo{LaTeX} Project. |
| 658 |
% The \hologo{LaTeX3} Interfaces. CTAN: Released 2025-03-10. |
| 659 |
% \bibitem{ctex} \url{CTEX.ORG}. C\hologo{TeX} 宏集. 2022-07-14 v2.5.10. |
| 660 |
% \bibitem{clsguide} \hologo{LaTeX} Project Team. |
| 661 |
% \hologo{LaTeX} for package and class authors current version |
| 662 |
% \copyright{} Copyright 2023 -- 2024. 2024-09-15. |
| 663 |
% \bibitem{source2e} B. Johannes, C. David, J. Alan, L. Leslie L, M. Frank, |
| 664 |
% R. Chris, and S. Rainer. |
| 665 |
% \hologo{LaTeX} for package and class authors current version. |
| 666 |
% 2024-11-01 Patch level 2. |
| 667 |
% \bibitem{l3styleguide} The \hologo{LaTeX} Project. |
| 668 |
% The \hologo{LaTeX3} kernel: style guide for code authors. |
| 669 |
% CTAN: Released 2025-03-10. |
| 670 |
% \bibitem{packages} Package \pkg{etoolbox}, \pkg{geometry}, \pkg{tocloft}, |
| 671 |
% \pkg{fancyhdr}, etc. |
| 672 |
% \bibitem{hdubachelor} 杭州电子科技大学教务处. |
| 673 |
% \href{https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm} |
| 674 |
% {毕业设计(论文)的写作规范及格式要求} |
| 675 |
% \bibitem{hdumphil} 杭州电子科技大学研究生院. |
| 676 |
% \href{https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm} |
| 677 |
% {杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)} |
| 678 |
% \end{thebibliography} |
| 679 |
% \end{documentation} |
| 680 |
% \restoregeometry \appendix |
| 681 |
% \begin{implementation} |
| 682 |
% |
| 683 |
% \section{实现细节} |
| 684 |
% |
| 685 |
% \subsection{HDU 校徽 \& 校名 \& 校牌 \& 校训的实现} |
| 686 |
% |
| 687 |
% \subsubsection{原始素材预处理} |
| 688 |
% |
| 689 |
% 前往 \href{https://www.hdu.edu.cn/666/list.htm}{校情纵览/校标规范} |
| 690 |
% 资源后,使用 Inkscape(或 Adobe Illustrator,Affinity Design,Vectornator 等) |
| 691 |
% 分别将校徽、校名、校牌、校训导出 |.pdf| 格式. 校牌可能需要手动将校徽、校名手动拼接. |
| 692 |
% |
| 693 |
% \subsubsection{PDF 文件处理} |
| 694 |
% |
| 695 |
% 由于发行版 \hologo{TeX} Live 2024 及更早版本中的 |dvipdfmx| 程序在以指定透明度插入经 |
| 696 |
% Inkscape 导出的 |.pdf| 文件时存在透明度失效问题\footnote |
| 697 |
% {感谢 \hologo{TeX} 专家 \href{https://www.zhihu.com/people/li-a-ling} |
| 698 |
% {|@李阿玲|} 修复了这一 Bug (Commit: |fdefe61|).}, |
| 699 |
% 所以先使用 |Ghostscript| 程序修复 |.pdf| 文件 |
| 700 |
% \begin{quote} |
| 701 |
% "gs -o" \meta{input file}".pdf -sDEVICE=pdfwrite" \meta{output file}".pdf" |
| 702 |
% \end{quote} |
| 703 |
% 此时若使用 Text Editor 查看导出的 |.pdf| 文件,会发现里面存在许多无法识别的字符. |
| 704 |
% 这时需要使用 mutool 工具对 |.pdf| 文件的内容流进行清理、消毒、压缩和数据转换. 命令如下 |
| 705 |
% \begin{quote} |
| 706 |
% "mutool clean -a -z -gggg" \meta{input file}".pdf" \meta{output file}".pdf" |
| 707 |
% \end{quote} |
| 708 |
% |
| 709 |
% \subsubsection{素材打包} |
| 710 |
% |
| 711 |
% 由于每个 |.pdf| 文件均存在以 |%| 开头的代码 |
| 712 |
% \begin{verbatim} |
| 713 |
% %PDF-1.7 |
| 714 |
% %µ¶ |
| 715 |
% %%EOF |
| 716 |
% \end{verbatim} |
| 717 |
% 需更改 Docstrip 处理 |%| 行为:|%| 改为 |%%|,|%%| 改为 |%%%|, |
| 718 |
% 并在 \file{hduthesis.ins} 添加 |
| 719 |
% \begin{quote} |
| 720 |
% "\let \MetaPrefix \perCent" |
| 721 |
% \end{quote} |
| 722 |
% 现可将处理结束后得到 ASCII 编码的 |.pdf| 文件,打包至 \file{hdu-graphics.dtx}. |
| 723 |
% |
| 724 |
% \subsection{\file{hduthesis.cls} 的实现} |
| 725 |
% |
| 726 |
% \begin{macrocode} |
| 727 |
%<@@=hdu> |
| 728 |
% \end{macrocode} |
| 729 |
% |
| 730 |
% \begin{macrocode} |
| 731 |
%<*class> |
| 732 |
% \end{macrocode} |
| 733 |
% |
| 734 |
% \begin{macrocode} |
| 735 |
\def \hduthesis@date {2025-03-23} |
| 736 |
\def \hduthesis@version {1.1.1} |
| 737 |
\def \hduthesis@maintainerid {myhsia} |
| 738 |
% \end{macrocode} |
| 739 |
% |
| 740 |
% \begin{macrocode} |
| 741 |
\ProvidesExplClass {hduthesis} {\hduthesis@date} {\hduthesis@version} |
| 742 |
{LaTeX Template Bundle for Hangzhou Dianzi University} |
| 743 |
% \end{macrocode} |
| 744 |
% 兼容 \hologo{TeX} Live 2023 及之后的版本. 当对应命令不存在时,在已有命令基础上新增变体 |
| 745 |
% \begin{macrocode} |
| 746 |
\cs_if_exist:NF \seq_set_split:Nne |
| 747 |
{ \cs_generate_variant:Nn \seq_set_split:Nnn { Nne } } |
| 748 |
\cs_if_exist:NF \seq_set_split:Nee |
| 749 |
{ \cs_generate_variant:Nn \seq_set_split:Nnn { Nee } } |
| 750 |
\cs_if_exist:NF \tl_set:Ne |
| 751 |
{ \cs_generate_variant:Nn \tl_set:Nn { Ne } } |
| 752 |
\cs_if_exist:NF \tl_gset:Ne |
| 753 |
{ \cs_generate_variant:Nn \tl_gset:Nn { Ne } } |
| 754 |
% \end{macrocode} |
| 755 |
% 警告信息设置 |
| 756 |
% \begin{macrocode} |
| 757 |
\cs_new_protected:Npn \@@_msg_new:nn #1#2 |
| 758 |
{ \msg_new:nnn { hduthesis } {#1} {#2} } |
| 759 |
\cs_new_protected:Npn \@@_msg_error:nn #1#2 |
| 760 |
{ \msg_error:nnn { hduthesis } {#1} {#2} } |
| 761 |
\cs_generate_variant:Nn \@@_msg_error:nn { nx } |
| 762 |
\cs_new_protected:Npn \@@_msg_warning:nn #1#2 |
| 763 |
{ \msg_warning:nnn { hduthesis } {#1} {#2} } |
| 764 |
\cs_generate_variant:Nn \@@_msg_warning:nn { nx } |
| 765 |
\@@_msg_new:nn { not found module } |
| 766 |
{ The ~ hduthesis ~ module ~ `#1' ~ not ~ found. } |
| 767 |
\@@_msg_new:nn { unknown mode } |
| 768 |
{ |
| 769 |
Unknown ~ hduthesis ~ mode ~ `#1',~ |
| 770 |
loading ~ mode ~ `thesis' ~ instead. |
| 771 |
} |
| 772 |
\@@_msg_new:nn { Users Agreement } |
| 773 |
{ |
| 774 |
\exp_not:n |
| 775 |
{ |
| 776 |
编译受阻!~ 使用模板前请阅读用户手册中的「用户协议」 |
| 777 |
\MessageBreak |
| 778 |
!模板作者 (@myhsia) 不对使用本模板产生的格式审查问题负责! |
| 779 |
\MessageBreak |
| 780 |
如果您同意协议,在全局选项中添加 `agreed' 即可解除本错误 |
| 781 |
\MessageBreak |
| 782 |
欢迎您通过邮件 ([email protected]) 或 GitHub 反馈意见 |
| 783 |
} |
| 784 |
} |
| 785 |
% \end{macrocode} |
| 786 |
% \begin{macro}{\@@_load_module:n, \@@_provide_module:n} |
| 787 |
% 加载 / 提供 \cls{hduthesis} 的模块 |
| 788 |
% \begin{macrocode} |
| 789 |
\cs_new_protected_nopar:Npn \@@_load_module:n #1 |
| 790 |
{ |
| 791 |
\clist_map_inline:nn {#1} |
| 792 |
{ |
| 793 |
\file_if_exist_input:nF { hdu-##1.code.tex } |
| 794 |
{ \@@_msg_error:nn { not found module } {##1} } |
| 795 |
} |
| 796 |
} |
| 797 |
\cs_new_protected_nopar:Npn \@@_provide_module:n #1 |
| 798 |
{ |
| 799 |
\ProvidesExplFile{hdu-#1.code.tex} |
| 800 |
{\hduthesis@date}{\hduthesis@version} |
| 801 |
{hduThesiS ~ \text_titlecase:n {#1} ~ Module} |
| 802 |
} |
| 803 |
% \end{macrocode} |
| 804 |
% \end{macro} |
| 805 |
% \begin{variable} |
| 806 |
% { |
| 807 |
% \g_@@_agreement_bool, \g_@@_mode_tl, |
| 808 |
% \g_@@_math_font, \g_@@_main_CJK_font, |
| 809 |
% \g_@@_sans_CJK_font, \g_@@_mono_CJK_font |
| 810 |
% } |
| 811 |
% 定义文档类全局选项的键. |
| 812 |
% \begin{macrocode} |
| 813 |
\keys_define:nn { hduthesis / classoption } |
| 814 |
{ |
| 815 |
agreed .bool_set:N = \g_@@_agreement_bool, |
| 816 |
agreed .initial:n = false, |
| 817 |
agreed .default:n = true, |
| 818 |
mode .tl_set:N = \g_@@_mode_tl, |
| 819 |
math-font .tl_set:N = \g_@@_math_font, |
| 820 |
CJKmain-font .tl_set:N = \g_@@_main_CJK_font, |
| 821 |
CJKsans-font .tl_set:N = \g_@@_sans_CJK_font, |
| 822 |
CJKmono-font .tl_set:N = \g_@@_mono_CJK_font, |
| 823 |
unknown .code:n = \@@_unknown_option:n {#1}, |
| 824 |
} |
| 825 |
% \end{macrocode} |
| 826 |
% \end{variable} |
| 827 |
% \begin{macro}{\@@_unknown_option:n} |
| 828 |
% \begin{variable}{\g_@@_base_options_clist} |
| 829 |
% 用于接收其他对此文档类未知选项. |
| 830 |
% \begin{macrocode} |
| 831 |
\clist_new:N \g_@@_base_options_clist |
| 832 |
% \end{macrocode} |
| 833 |
% \end{variable} |
| 834 |
% 处理未知选项:移交基本文档类处理. |
| 835 |
% \begin{macrocode} |
| 836 |
\cs_new_protected_nopar:Npn \@@_unknown_option:n #1 |
| 837 |
{ |
| 838 |
\tl_if_empty:nTF { #1 } |
| 839 |
{ |
| 840 |
\clist_gput_right:NV |
| 841 |
\g_@@_base_options_clist \l_keys_key_str |
| 842 |
} |
| 843 |
{ |
| 844 |
\exp_args:NNx |
| 845 |
\clist_gput_right:Nn \g_@@_base_options_clist |
| 846 |
{ \l_keys_key_str = \exp_not:n {#1} } |
| 847 |
} |
| 848 |
} |
| 849 |
% \end{macrocode} |
| 850 |
% \end{macro} |
| 851 |
% 处理接收到的全局选项. |
| 852 |
% \begin{macrocode} |
| 853 |
\ProcessKeyOptions [ hduthesis / classoption ] |
| 854 |
% \end{macrocode} |
| 855 |
% 遇到未知模块时返回警告信息. |
| 856 |
% \begin{macrocode} |
| 857 |
\bool_lazy_all:nT |
| 858 |
{ |
| 859 |
{ !\str_if_empty_p:N \g_@@_mode_tl } |
| 860 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { thesis } } |
| 861 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { beamer } } |
| 862 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { stationery } } |
| 863 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { exam } } |
| 864 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { l3doc } } |
| 865 |
} |
| 866 |
{ \@@_msg_warning:nx { unknown mode } { \g_@@_mode_tl } } |
| 867 |
% \end{macrocode} |
| 868 |
% 加载 \module{beamer} 模块. |
| 869 |
% \begin{macrocode} |
| 870 |
\str_if_eq:eeT { \g_@@_mode_tl } { beamer } |
| 871 |
{ |
| 872 |
\PassOptionsToClass { aspectratio = 2013 } { beamer } |
| 873 |
\exp_args:NNV |
| 874 |
\LoadClass [ \g_@@_base_options_clist ] { beamer } |
| 875 |
\usetheme{hdu} |
| 876 |
\endinput |
| 877 |
} |
| 878 |
% \end{macrocode} |
| 879 |
% 加载 \module{stationery} 模块. |
| 880 |
% \begin{macrocode} |
| 881 |
\str_if_eq:eeT { \g_@@_mode_tl } { stationery } |
| 882 |
{ |
| 883 |
\PassOptionsToClass { 12pt } { letter } |
| 884 |
\exp_args:NNV |
| 885 |
\LoadClass [ \g_@@_base_options_clist ] { letter } |
| 886 |
\@@_load_module:n { stationery } |
| 887 |
\endinput |
| 888 |
} |
| 889 |
% \end{macrocode} |
| 890 |
% 加载 \module{exam} 模块. |
| 891 |
% \begin{macrocode} |
| 892 |
\str_if_eq:eeT { \g_@@_mode_tl } { exam } |
| 893 |
{ |
| 894 |
\exp_args:NNV |
| 895 |
\LoadClass [ \g_@@_base_options_clist ] { article } |
| 896 |
\@@_load_module:n { exam } |
| 897 |
\endinput |
| 898 |
} |
| 899 |
% \end{macrocode} |
| 900 |
% 加载 \module{l3doc} 模块. |
| 901 |
% \begin{macrocode} |
| 902 |
\str_if_eq:eeT { \g_@@_mode_tl } { l3doc } |
| 903 |
{ |
| 904 |
\PassOptionsToClass { 11pt, letterpaper, kernel } { l3doc } |
| 905 |
\RequirePackage{minted} |
| 906 |
\exp_args:NNV |
| 907 |
\LoadClass [ \g_@@_base_options_clist ] { l3doc } |
| 908 |
\@@_load_module:n { l3doc } |
| 909 |
\endinput |
| 910 |
} |
| 911 |
% \end{macrocode} |
| 912 |
% 其余情况下,默认加载 \module{thesis} 模块,并根据所输入的学号位数加载不同配置. |
| 913 |
% 未确认用户协议时,返回错误信息. |
| 914 |
% \begin{macrocode} |
| 915 |
\bool_lazy_any:nT |
| 916 |
{ |
| 917 |
{ \str_if_eq_p:ee { \g_@@_mode_tl } { thesis } } |
| 918 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { beamer } } |
| 919 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { stationery } } |
| 920 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { exam } } |
| 921 |
{ !\str_if_eq_p:ee { \g_@@_mode_tl } { l3doc } } |
| 922 |
} |
| 923 |
{ |
| 924 |
\PassOptionsToClass { a4paper, zihao = -4 } { ctexrep } |
| 925 |
\PassOptionsToPackage { quiet, no-math } { xeCJK } |
| 926 |
\exp_args:NNV |
| 927 |
\LoadClass [ \g_@@_base_options_clist ] { ctexrep } |
| 928 |
\bool_if:NTF \g_@@_agreement_bool |
| 929 |
{ |
| 930 |
\RequirePackage{hyperref} |
| 931 |
\pdfstringdefDisableCommands |
| 932 |
{ |
| 933 |
\def \cite#1 {<#1>} |
| 934 |
\def \hologoRobust#1 {<#1>} |
| 935 |
} |
| 936 |
\AtBeginDocument |
| 937 |
{ |
| 938 |
\hypersetup |
| 939 |
{ hidelinks, pdfproducer = hduThesiS ~ by ~ Mingyu ~ Xia } |
| 940 |
} |
| 941 |
} { \@@_msg_error:nn { Users Agreement } { Unconfirmed } } |
| 942 |
\@@_load_module:n { typeset } |
| 943 |
\@@_load_module:n { layout } |
| 944 |
\cs_new_protected:Nn \@@_docinfo_degree_if_aux: |
| 945 |
{ |
| 946 |
\int_compare:nNnTF |
| 947 |
{ \tl_count:N \l_@@_set_stdntid_tl } = { 8 } |
| 948 |
{ \@@_load_module:n { bc.config } } |
| 949 |
{ \@@_load_module:n { pg.config } } |
| 950 |
} |
| 951 |
\endinput |
| 952 |
} |
| 953 |
% \end{macrocode} |
| 954 |
% |
| 955 |
% \begin{macrocode} |
| 956 |
%</class> |
| 957 |
% \end{macrocode} |
| 958 |
% |
| 959 |
% \subsection{\module{typeset} 模块的实现} |
| 960 |
% |
| 961 |
% \begin{macrocode} |
| 962 |
%<*typeset> |
| 963 |
% \end{macrocode} |
| 964 |
% |
| 965 |
% \begin{macrocode} |
| 966 |
\@@_provide_module:n {typeset} |
| 967 |
% \end{macrocode} |
| 968 |
% |
| 969 |
% \begin{macrocode} |
| 970 |
\RequirePackage { circuitikz, pgfplots, listings, hologo, |
| 971 |
lipsum, zhlipsum, booktabs, multicol } |
| 972 |
\pgfplotsset { compat = newest } |
| 973 |
% \end{macrocode} |
| 974 |
% 插图相对路径设置. |
| 975 |
% \begin{macrocode} |
| 976 |
\graphicspath |
| 977 |
{ |
| 978 |
{./figure/} {./figures/} {./image/} {./images/} |
| 979 |
{./graphics/} {./graphic/} {./pictures/} {./picture/} |
| 980 |
} |
| 981 |
% \end{macrocode} |
| 982 |
% 设置行距倍数、缩进和公式前后间距. |
| 983 |
% \begin{macrocode} |
| 984 |
\linespread{1.39} |
| 985 |
\AtBeginDocument |
| 986 |
{ |
| 987 |
\dim_set:Nn \abovedisplayskip {3pt} |
| 988 |
\dim_set:Nn \belowdisplayskip {3pt} |
| 989 |
\dim_set:Nn \parindent { 2\ccwd } |
| 990 |
} |
| 991 |
% \end{macrocode} |
| 992 |
% 公式排版必要宏包加载,行间公式前后间距设置. |
| 993 |
% \begin{macrocode} |
| 994 |
\RequirePackage { mathtools, amssymb, cancel, fixdif, |
| 995 |
derivative, siunitx, physics2, bm } |
| 996 |
\usephysicsmodule { ab, braket, op.legacy, qtext.legacy } |
| 997 |
% \end{macrocode} |
| 998 |
% \begin{macro}{\@@_font_semilarge:, \@@_font_semiLarge:} |
| 999 |
% 两种新字体尺寸设置. |
| 1000 |
% \begin{macrocode} |
| 1001 |
\cs_new_protected:Nn \@@_font_semilarge: |
| 1002 |
{ \@setfontsize \@@_font_semilarge:{14}{16.5} } |
| 1003 |
\cs_new_protected:Nn \@@_font_semiLarge: |
| 1004 |
{ \@setfontsize \@@_font_semiLarge:{16.5}{17.5} } |
| 1005 |
% \end{macrocode} |
| 1006 |
% \end{macro} |
| 1007 |
% 设置西文字体、数学字体、中文字体. |
| 1008 |
% \begin{macrocode} |
| 1009 |
\sys_if_engine_xetex:T |
| 1010 |
{ |
| 1011 |
\RequirePackage |
| 1012 |
[ warnings-off = { mathtools-colon, mathtools-overbracket } |
| 1013 |
] {unicode-math} |
| 1014 |
\setmainfont{texgyretermes} |
| 1015 |
[ |
| 1016 |
Extension = .otf, UprightFont = *-regular, |
| 1017 |
BoldFont = *-bold, ItalicFont = *-italic, |
| 1018 |
BoldItalicFont = *-bolditalic |
| 1019 |
] |
| 1020 |
\setsansfont{texgyreheros} |
| 1021 |
[ |
| 1022 |
Extension = .otf, BoldItalicFont = *-bolditalic, |
| 1023 |
UprightFont = *-regular, BoldFont = *-bold, |
| 1024 |
ItalicFont = *-italic, Scale = .9 |
| 1025 |
] |
| 1026 |
\tl_if_empty:NF \g__hdu_math_font |
| 1027 |
{ \setmathfont { \g__hdu_math_font } } |
| 1028 |
\tl_if_empty:NF \g__hdu_main_CJK_font |
| 1029 |
{ \exp_last_unbraced:No \setCJKmainfont \g__hdu_main_CJK_font } |
| 1030 |
\tl_if_empty:NF \g__hdu_sans_CJK_font |
| 1031 |
{ \exp_last_unbraced:No \setCJKsansfont \g__hdu_sans_CJK_font } |
| 1032 |
\tl_if_empty:NF \g__hdu_mono_CJK_font |
| 1033 |
{ \exp_last_unbraced:No \setCJKmonofont \g__hdu_mono_CJK_font } |
| 1034 |
} |
| 1035 |
% \end{macrocode} |
| 1036 |
% |
| 1037 |
% \begin{macrocode} |
| 1038 |
%</typeset> |
| 1039 |
% \end{macrocode} |
| 1040 |
% |
| 1041 |
% \subsection{\module{layout} 模块的实现} |
| 1042 |
% |
| 1043 |
% \begin{macrocode} |
| 1044 |
%<*layout> |
| 1045 |
% \end{macrocode} |
| 1046 |
% |
| 1047 |
% \begin{macrocode} |
| 1048 |
\@@_provide_module:n {layout} |
| 1049 |
% \end{macrocode} |
| 1050 |
% 页面样式、编号、列表设置. |
| 1051 |
% \begin{macrocode} |
| 1052 |
\RequirePackage { geometry, array, setspace, |
| 1053 |
fancyhdr, enumitem, cleveref } |
| 1054 |
\RequirePackage |
| 1055 |
[ skip = 1.75ex, labelsep = quad, font = small ]{caption} |
| 1056 |
\fancyhf{} |
| 1057 |
\pagestyle{fancy} |
| 1058 |
\renewcommand*\headrulewidth {.8pt} |
| 1059 |
\renewcommand*\thefigure {\arabic{chapter}-\arabic{figure}} |
| 1060 |
\renewcommand*\thetable {\arabic{chapter}-\arabic{table}} |
| 1061 |
\renewcommand*\theequation {\arabic{chapter}-\arabic{equation}} |
| 1062 |
\AddToHook{env/figure/after}{\vspace*{-2.3ex}} |
| 1063 |
\AddToHook{env/table/after}{\vskip-1.9ex} |
| 1064 |
\setlist[enumerate,1] |
| 1065 |
{ |
| 1066 |
label = (\,\arabic*\,), itemindent = 4em, leftmargin = 0em, |
| 1067 |
labelsep = 1ex, topsep = 0pt, itemsep = 0pt, partopsep = 0pt, |
| 1068 |
parsep = 0em, listparindent = 2\ccwd |
| 1069 |
} |
| 1070 |
\crefformat{figure}{图#2#1#3} |
| 1071 |
\crefformat{table}{表#2#1#3} |
| 1072 |
% \end{macrocode} |
| 1073 |
% \begin{macro}{\@@_cover_spread_box:nn, \@@_cover_center_box:nn} |
| 1074 |
% 分散对齐盒子与 下划线居中对齐盒子. |
| 1075 |
% \footnote{由 \url{tex.stackexchange.com} 论坛上 |@egreg| 提供接口.} |
| 1076 |
% \begin{macrocode} |
| 1077 |
\cs_new_protected:Npn \@@_cover_spread_box:nn #1#2 |
| 1078 |
{ |
| 1079 |
\mode_leave_vertical: |
| 1080 |
\hbox_to_wd:nn {#1} |
| 1081 |
{ \exp_args:Nee \tl_map_inline:nn {#2} { ##1 \hfil } \unskip } |
| 1082 |
} |
| 1083 |
\cs_new_protected:Npn \@@_cover_center_box:nn #1#2 |
| 1084 |
{ |
| 1085 |
\mode_leave_vertical: |
| 1086 |
\dim_set:Nn \l_tmpa_dim {#1} |
| 1087 |
\global\setbox1 = \box\voidb@x |
| 1088 |
\group_begin: |
| 1089 |
\setbox0 = \vbox |
| 1090 |
{ |
| 1091 |
\dim_set:Nn \hsize {#1}\relax |
| 1092 |
\dim_set:Nn \parindent {0pt} |
| 1093 |
\skip_set:Nn \leftskip {0pt plus 1fil} |
| 1094 |
\skip_set:Nn \rightskip {0pt plus -1fil} |
| 1095 |
\skip_set:Nn \parfillskip {0pt plus 2fil} |
| 1096 |
#2 \par |
| 1097 |
\loop |
| 1098 |
\setbox2 = \lastbox |
| 1099 |
\unless\ifvoid2 |
| 1100 |
\global\setbox1 = \vtop |
| 1101 |
{ \hbox to\hsize{\strut\unhbox2} |
| 1102 |
\vskip-4pt \hrule height .5pt |
| 1103 |
\vskip9.6pt \unvbox1 |
| 1104 |
} |
| 1105 |
\unskip\unpenalty |
| 1106 |
\repeat |
| 1107 |
} |
| 1108 |
\group_end: |
| 1109 |
\box1 |
| 1110 |
} |
| 1111 |
% \end{macrocode} |
| 1112 |
% \end{macro} |
| 1113 |
% \begin{macro}{\@@_process_array:NnnN} |
| 1114 |
% 拆分 \cs{hduset} 部分键值输入二维数组. |
| 1115 |
% \begin{macrocode} |
| 1116 |
\cs_new_protected_nopar:Npn \@@_process_array:NnnN #1#2#3#4 |
| 1117 |
{ |
| 1118 |
\seq_set_split:Nee \l_@@_process_array_seq { / } {#1} |
| 1119 |
\seq_set_split:Nee \l_@@_process_array_row_seq { \c_colon_str } |
| 1120 |
{ \seq_item:Nn \l_@@_process_array_seq {#2} } |
| 1121 |
\tl_if_eq:nnTF {#3} {:} |
| 1122 |
{ |
| 1123 |
\tl_gset:Ne #4 |
| 1124 |
{ \seq_use:Nn \l_@@_process_array_row_seq {} } |
| 1125 |
} |
| 1126 |
{ |
| 1127 |
\tl_gset:Ne #4 |
| 1128 |
{ \seq_item:Nn \l_@@_process_array_row_seq {#3} } |
| 1129 |
} |
| 1130 |
\seq_clear:N \l_@@_process_array_seq |
| 1131 |
\seq_clear:N \l_@@_process_array_row_seq |
| 1132 |
} |
| 1133 |
% \end{macrocode} |
| 1134 |
% \end{macro} |
| 1135 |
% \begin{variable}{\g_@@_month_clist} |
| 1136 |
% 存储英文月份表达. |
| 1137 |
% \begin{macrocode} |
| 1138 |
\clist_set:Nn \g_@@_month_clist |
| 1139 |
{ |
| 1140 |
January, February, March, April, May, June, |
| 1141 |
July, August, September, October, November, December |
| 1142 |
} |
| 1143 |
% \end{macrocode} |
| 1144 |
% \end{variable} |
| 1145 |
% \begin{variable} |
| 1146 |
% { |
| 1147 |
% \l_@@_set_title_tl, \l_@@_set_department_tl, |
| 1148 |
% \l_@@_set_major_tl, \l_@@_set_class_tl, |
| 1149 |
% \l_@@_set_stdntid_tl, \l_@@_set_author_tl, |
| 1150 |
% \l_@@_set_supervisor_tl, \l_@@_set_bibsource_tl |
| 1151 |
% } |
| 1152 |
% 模式 \module{thesis} 下 \cs{hduset} 接口键值的定义. |
| 1153 |
% \begin{macrocode} |
| 1154 |
\keys_define:nn { thesis / hduset } |
| 1155 |
{ |
| 1156 |
title .clist_set:N = \l_@@_set_title_tl, |
| 1157 |
department .tl_set:N = \l_@@_set_department_tl, |
| 1158 |
major .tl_set:N = \l_@@_set_major_tl, |
| 1159 |
class .tl_set:N = \l_@@_set_class_tl, |
| 1160 |
stdntid .tl_set:N = \l_@@_set_stdntid_tl, |
| 1161 |
author .clist_set:N = \l_@@_set_author_tl, |
| 1162 |
supervisor .tl_set:N = \l_@@_set_supervisor_tl, |
| 1163 |
bibsource .tl_set:N = \l_@@_set_bibsource_tl, |
| 1164 |
} |
| 1165 |
% \end{macrocode} |
| 1166 |
% \end{variable} |
| 1167 |
% \begin{macro}{\hduset} |
| 1168 |
% 模式 \module{thesis} 下设置文档信息. |
| 1169 |
% \begin{macrocode} |
| 1170 |
\NewDocumentCommand \hduset { m } |
| 1171 |
{ |
| 1172 |
\keys_set:nn { thesis / hduset } {#1} |
| 1173 |
\@@_docinfo_process_aux: |
| 1174 |
\@@_docinfo_degree_if_aux: |
| 1175 |
} |
| 1176 |
% \end{macrocode} |
| 1177 |
% \end{macro} |
| 1178 |
% \begin{macro}{\@@_docinfo_process_aux:} |
| 1179 |
% 模式 \module{thesis} 下 \cs{hduset} 的辅助命令:拆分数组 / 设置参考文献. |
| 1180 |
% \begin{macrocode} |
| 1181 |
\cs_set_protected_nopar:Nn \@@_docinfo_process_aux: |
| 1182 |
{ |
| 1183 |
\@@_process_array:NnnN \l_@@_set_title_tl {1} {:} \@title |
| 1184 |
\@@_process_array:NnnN \l_@@_set_title_tl {2} {:} |
| 1185 |
\l_@@_set_entitle_tl |
| 1186 |
\@@_process_array:NnnN \l_@@_set_author_tl {1} {:} \@author |
| 1187 |
\@@_process_array:NnnN \l_@@_set_author_tl {2} {:} |
| 1188 |
\l_@@_set_enauthor_tl |
| 1189 |
\@@_process_array:NnnN \l_@@_set_supervisor_tl {1} {1} |
| 1190 |
\l_@@_set_cnrole_tl |
| 1191 |
\@@_process_array:NnnN \l_@@_set_supervisor_tl {1} {2} |
| 1192 |
\l_@@_set_cnsupervisor_tl |
| 1193 |
\@@_process_array:NnnN \l_@@_set_supervisor_tl {2} {1} |
| 1194 |
\l_@@_set_enrole_tl |
| 1195 |
\@@_process_array:NnnN \l_@@_set_supervisor_tl {2} {2} |
| 1196 |
\l_@@_set_ensupervisor_tl |
| 1197 |
\bool_if:NF \g_@@_agreement_bool |
| 1198 |
{ \tl_clear:N \l_@@_set_bibsource_tl } |
| 1199 |
\tl_if_empty:NTF \l_@@_set_bibsource_tl |
| 1200 |
{ |
| 1201 |
\newcommand*\printbibliography{\chapter*{参考文献}} |
| 1202 |
\newcounter {citecount} |
| 1203 |
\renewcommand*\cite[1] |
| 1204 |
{ |
| 1205 |
\refstepcounter{citecount} |
| 1206 |
\textsuperscript{[\thecitecount]} |
| 1207 |
} |
| 1208 |
} |
| 1209 |
{ |
| 1210 |
\RequirePackage[sort&compress]{gbt7714} |
| 1211 |
\bibliographystyle{gbt7714-numerical} |
| 1212 |
\dim_set:Nn \bibsep {.35ex} |
| 1213 |
\newcommand*\printbibliography |
| 1214 |
{ |
| 1215 |
\bibliography { \l_@@_set_bibsource_tl } |
| 1216 |
\addcontentsline{toc}{chapter}{参考文献} |
| 1217 |
} |
| 1218 |
} |
| 1219 |
} |
| 1220 |
% \end{macrocode} |
| 1221 |
% \end{macro} |
| 1222 |
% \begin{macro}{\@@_commitment_sign:N} |
| 1223 |
% 插入签名图片. |
| 1224 |
% \begin{macrocode} |
| 1225 |
\cs_new_protected:Npn \@@_commitment_sign:N #1 |
| 1226 |
{ |
| 1227 |
\leavevmode@ifvmode |
| 1228 |
\lower \dimexpr \f@size\p@ * 9/16 |
| 1229 |
\hbox |
| 1230 |
{ |
| 1231 |
\includegraphics |
| 1232 |
[ height = { \fp_eval:n { 2*\f@size }\p@ } ] {#1} |
| 1233 |
} |
| 1234 |
} |
| 1235 |
% \end{macrocode} |
| 1236 |
% \end{macro} |
| 1237 |
% \begin{macro}{\@@_sign_process_aux:nnn} |
| 1238 |
% 处理承诺书签名数组的辅助命令. 签名文件名需要展开后存入 |
| 1239 |
% \cs{l_@@_sign_figure_tl} 中. |
| 1240 |
% \begin{macrocode} |
| 1241 |
\cs_new_protected_nopar:Npn \@@_sign_process_aux:nnn #1#2#3 |
| 1242 |
{ |
| 1243 |
\clist_set:Nn \l_@@_sign_process_clist {#1} |
| 1244 |
\seq_set_split:Nne \l_@@_sign_figure_seq {/} |
| 1245 |
{ \clist_item:Nn \l_@@_sign_process_clist {#2} } |
| 1246 |
\int_compare:nNnTF {#3} = {0} |
| 1247 |
{ |
| 1248 |
\tl_set:Ne \l_@@_sign_figure_tl |
| 1249 |
{ \seq_item:Nn \l_@@_sign_figure_seq { #3 + 1 } } |
| 1250 |
\seq_clear:N \l_@@_sign_figure_seq |
| 1251 |
} |
| 1252 |
{ |
| 1253 |
\seq_set_split:Nne \l_@@_sign_date_seq {-} |
| 1254 |
{ \seq_item:Nn \l_@@_sign_figure_seq {2} } |
| 1255 |
\seq_item:Nn \l_@@_sign_date_seq {#3} |
| 1256 |
\seq_clear:N \l_@@_sign_date_seq |
| 1257 |
} |
| 1258 |
\clist_clear:N \l_@@_sign_process_clist |
| 1259 |
} |
| 1260 |
% \end{macrocode} |
| 1261 |
% \end{macro} |
| 1262 |
% |
| 1263 |
% \begin{macrocode} |
| 1264 |
%</layout> |
| 1265 |
% \end{macrocode} |
| 1266 |
% |
| 1267 |
% \subsection{\module{bc.config} 模块的实现} |
| 1268 |
% |
| 1269 |
% \begin{macrocode} |
| 1270 |
%<*bc.config> |
| 1271 |
% \end{macrocode} |
| 1272 |
% |
| 1273 |
% \begin{macrocode} |
| 1274 |
\ExplSyntaxOn \makeatletter |
| 1275 |
% \end{macrocode} |
| 1276 |
% |
| 1277 |
% \begin{macrocode} |
| 1278 |
\@@_provide_module:n {bc.config} |
| 1279 |
% \end{macrocode} |
| 1280 |
% 设置页面布局、页眉、目录页码格式. |
| 1281 |
% \begin{macrocode} |
| 1282 |
\geometry { top = 3.25cm, bottom = 2.4cm, |
| 1283 |
left = 4cm, right = 2cm, |
| 1284 |
headsep = .72cm, headheight = 15pt } |
| 1285 |
\fancyhead[C] |
| 1286 |
{ |
| 1287 |
\raisebox { .12ex } |
| 1288 |
{ \small 杭州电子科技大学 \l_@@_set_entitle_tl } |
| 1289 |
} |
| 1290 |
\hook_gput_code:nnn {cmd/tableofcontents/before} { . } |
| 1291 |
{ |
| 1292 |
\clearpage |
| 1293 |
\pagenumbering{Roman} \cfoot{\small \thepage} |
| 1294 |
} |
| 1295 |
\hook_gput_code:nnn { cmd/tableofcontents/after } { . } |
| 1296 |
{ |
| 1297 |
\thispagestyle{fancy} \clearpage |
| 1298 |
\pagenumbering{arabic} \cfoot{} |
| 1299 |
} |
| 1300 |
% \end{macrocode} |
| 1301 |
% \begin{macro}{\maketitle} |
| 1302 |
% 重新定义封面布局. |
| 1303 |
% \begin{macrocode} |
| 1304 |
\RenewDocumentCommand \maketitle {} |
| 1305 |
{ |
| 1306 |
\newgeometry { margin = 3cm } |
| 1307 |
\titlepage \@@_maketitle_bc_auxi: \endtitlepage |
| 1308 |
\restoregeometry |
| 1309 |
} |
| 1310 |
% \end{macrocode} |
| 1311 |
% \end{macro} |
| 1312 |
% \begin{variable}{\l_@@_grade_int} |
| 1313 |
% 存储毕业年份. 根据当前月份判断. |
| 1314 |
% \begin{macrocode} |
| 1315 |
\int_new:N \l_@@_grade_int |
| 1316 |
\int_set:Nn \l_@@_grade_int |
| 1317 |
{ |
| 1318 |
\int_compare:nNnTF { \c_sys_month_int } < 9 |
| 1319 |
{ \c_sys_year_int } { \int_eval:n { \c_sys_year_int + 1 } } |
| 1320 |
} |
| 1321 |
% \end{macrocode} |
| 1322 |
% \end{variable} |
| 1323 |
% \begin{macro}{\@@_maketitle_bc_auxi:} |
| 1324 |
% \cs{maketitle} 的辅助命令. |
| 1325 |
% \begin{macrocode} |
| 1326 |
\cs_new_protected_nopar:Nn \@@_maketitle_bc_auxi: |
| 1327 |
{ |
| 1328 |
\begin{center} |
| 1329 |
\vspace*{14\p@} |
| 1330 |
\includegraphics[ width = .64\linewidth ]{hdu-title} |
| 1331 |
\par \vspace*{36\p@} |
| 1332 |
\scalebox{2.75} |
| 1333 |
{ |
| 1334 |
\textbf |
| 1335 |
{ |
| 1336 |
\@@_cover_spread_box:nn |
| 1337 |
{ .205\paperwidth } { \l_@@_set_entitle_tl } |
| 1338 |
} |
| 1339 |
} |
| 1340 |
\par \vspace*{1.5\baselineskip} |
| 1341 |
{ \LARGE (\int_use:N \l_@@_grade_int \bfseries 届) } |
| 1342 |
\par \vspace*{3.0\baselineskip} |
| 1343 |
\begin{tabular} |
| 1344 |
{ |
| 1345 |
>{\large\bfseries}p{5.5\ccwd}@{} |
| 1346 |
>{\large\centering\arraybackslash\kaishu}p{.65\linewidth}@{} |
| 1347 |
} |
| 1348 |
\@@_cover_spread_box:nn { 4\ccwd } { 题目 } & |
| 1349 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1350 |
{ \@title }\\[5.2ex] |
| 1351 |
\@@_cover_spread_box:nn { 4\ccwd } { 学院 } & |
| 1352 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1353 |
{ \l_@@_set_department_tl }\\[5.2ex] |
| 1354 |
\@@_cover_spread_box:nn { 4\ccwd } { 专业 } & |
| 1355 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1356 |
{ \l_@@_set_major_tl }\\[5.2ex] |
| 1357 |
\@@_cover_spread_box:nn { 4\ccwd } { 班级 } & |
| 1358 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1359 |
{ \l_@@_set_class_tl }\\[5.2ex] |
| 1360 |
\@@_cover_spread_box:nn { 4\ccwd } { 学号 } & |
| 1361 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1362 |
{ \l_@@_set_stdntid_tl }\\[5.2ex] |
| 1363 |
\@@_cover_spread_box:nn { 4\ccwd } { 学生姓名 } & |
| 1364 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1365 |
{ \@author }\\[5.2ex] |
| 1366 |
\@@_cover_spread_box:nn { 4\ccwd } { 指导教师 } & |
| 1367 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1368 |
{ |
| 1369 |
\l_@@_set_cnsupervisor_tl \quad |
| 1370 |
\l_@@_set_cnrole_tl |
| 1371 |
}\\[5.2ex] |
| 1372 |
\@@_cover_spread_box:nn { 4\ccwd } { 完成日期 } & |
| 1373 |
\@@_cover_center_box:nn { .95\linewidth } |
| 1374 |
{ |
| 1375 |
\textsf{\int_use:N \c_sys_year_int} 年 |
| 1376 |
\textsf{\int_use:N \c_sys_month_int} 月 |
| 1377 |
} |
| 1378 |
\end{tabular} |
| 1379 |
\end{center} |
| 1380 |
} |
| 1381 |
% \end{macrocode} |
| 1382 |
% \end{macro} |
| 1383 |
% \begin{macro}{\commitment} |
| 1384 |
% 生成承诺书 |
| 1385 |
% \begin{macrocode} |
| 1386 |
\NewDocumentCommand \commitment { O{} } |
| 1387 |
{ |
| 1388 |
\newgeometry{ margin = 3cm } |
| 1389 |
\titlepage |
| 1390 |
\@@_commitment_bc_aux:n {#1} |
| 1391 |
\endtitlepage |
| 1392 |
\restoregeometry |
| 1393 |
} |
| 1394 |
% \end{macrocode} |
| 1395 |
% \end{macro} |
| 1396 |
% \begin{macro}{\@@_commitment_bc_aux:n} |
| 1397 |
% \cs{commitment} 的辅助命令. |
| 1398 |
% \begin{macrocode} |
| 1399 |
\cs_new_protected_nopar:Npn \@@_commitment_bc_aux:n #1 |
| 1400 |
{ |
| 1401 |
\vspace*{65\p@} |
| 1402 |
\begin{center} |
| 1403 |
\@beginparpenalty \@lowpenalty |
| 1404 |
\Large \textsf |
| 1405 |
{ \bfseries \@@_cover_spread_box:nn { 6\ccwd }{ 诚信承诺 } } |
| 1406 |
\@endparpenalty \@M |
| 1407 |
\end{center} |
| 1408 |
\vspace*{.4\baselineskip} \par |
| 1409 |
\linespread{2.1} |
| 1410 |
{ |
| 1411 |
\@@_font_semilarge: |
| 1412 |
我谨在此承诺:本人所写的毕业论文《\@title 》均系本人独立完成, |
| 1413 |
没有抄袭行为,凡涉及其他作者的观点和材料,均作了注释,若有不实, |
| 1414 |
后果由本人承担。 |
| 1415 |
\par\vspace*{\baselineskip} \bfseries\sffamily |
| 1416 |
\hskip.48\linewidth 承诺人(签名): |
| 1417 |
\@@_sign_process_aux:nnn {#1} { 1 } { 0 } |
| 1418 |
\tl_if_empty:NF \l_@@_sign_figure_tl |
| 1419 |
{ |
| 1420 |
\@@_commitment_sign:N |
| 1421 |
\l_@@_sign_figure_tl |
| 1422 |
\tl_clear:N \l_@@_sign_figure_tl |
| 1423 |
} |
| 1424 |
\par \vspace*{.5\baselineskip} |
| 1425 |
\hskip \dim_eval:n { .48\linewidth - 1em } |
| 1426 |
\makebox [ 3em ] |
| 1427 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 1 } } 年 |
| 1428 |
\makebox [ 2em ] |
| 1429 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 2 } } 月 |
| 1430 |
\makebox [ 2em ] |
| 1431 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 3 } } 日 |
| 1432 |
} |
| 1433 |
} |
| 1434 |
% \end{macrocode} |
| 1435 |
% \end{macro} |
| 1436 |
% \DescribeEnv{abstract} |
| 1437 |
% 重新定义摘要环境,加入中英文判断. |
| 1438 |
% \begin{macrocode} |
| 1439 |
\RenewDocumentEnvironment {abstract} { O{en} } |
| 1440 |
{ |
| 1441 |
\str_if_eq:nnT {#1} {en} |
| 1442 |
{ |
| 1443 |
\tl_set:Nn \l_@@_keywords_name_tl {Keywords:~} |
| 1444 |
\tl_set:Nn \l_@@_keywords_sep_tl {;~} |
| 1445 |
\@beginparpenalty \@lowpenalty |
| 1446 |
\chapter*{\normalfont\bfseries ABSTRACT} |
| 1447 |
} |
| 1448 |
\str_if_eq:nnT {#1} {cn} |
| 1449 |
{ |
| 1450 |
\tl_set:Nn \l_@@_keywords_name_tl {\textsf{关键词:}} |
| 1451 |
\tl_set:Nn \l_@@_keywords_sep_tl {;} |
| 1452 |
\@beginparpenalty \@lowpenalty |
| 1453 |
\chapter*{摘\qquad 要} |
| 1454 |
} |
| 1455 |
} |
| 1456 |
{ |
| 1457 |
\tl_clear:N \l_@@_abstract_title_tl |
| 1458 |
\cfoot{} \clearpage |
| 1459 |
} |
| 1460 |
% \end{macrocode} |
| 1461 |
% \begin{variable}{\l_@@_keywords_clist} |
| 1462 |
% 存储关键词列表. |
| 1463 |
% \begin{macrocode} |
| 1464 |
\clist_new:N \l_@@_keywords_clist |
| 1465 |
% \end{macrocode} |
| 1466 |
% \end{variable} |
| 1467 |
% \begin{macro}{\keywords} |
| 1468 |
% 重新定义 \cs{keywords} 命令,关键词样式会根据 \env{abstract} 所选语言自动变化. |
| 1469 |
% \begin{macrocode} |
| 1470 |
\NewDocumentCommand \keywords { m } |
| 1471 |
{ |
| 1472 |
\par \vspace*{\baselineskip} |
| 1473 |
\noindent\textbf{\l_@@_keywords_name_tl} |
| 1474 |
\clist_set:Nn \l_@@_keywords_clist {#1} |
| 1475 |
\clist_use:Nn \l_@@_keywords_clist {\l_@@_keywords_sep_tl} |
| 1476 |
} |
| 1477 |
% \end{macrocode} |
| 1478 |
% \end{macro} |
| 1479 |
% 设置目录样式. |
| 1480 |
% \begin{macrocode} |
| 1481 |
\RequirePackage{tocloft} |
| 1482 |
\renewcommand \contentsname {\hfill 目 \qquad 录 \hfill} |
| 1483 |
\renewcommand* \cfttoctitlefont {\sffamily\@@_font_semiLarge:} |
| 1484 |
\dim_set:Nn \cftbeforetoctitleskip {3pt} |
| 1485 |
\dim_set:Nn \cftaftertoctitleskip {24pt} |
| 1486 |
\dim_set:Nn \cftbeforechapskip {1pt} |
| 1487 |
\dim_set:Nn \cftbeforesecskip {-.2pt} |
| 1488 |
\patchcmd { \@dottedtocline } |
| 1489 |
{ |
| 1490 |
\leaders |
| 1491 |
\hbox { $\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$ } |
| 1492 |
} |
| 1493 |
{ |
| 1494 |
\kern 4pt \leaders |
| 1495 |
\hbox { $\m@th\mkern .4 mu\hbox{-}\mkern .4 mu$ } |
| 1496 |
} {}{} |
| 1497 |
\renewcommand* \l@chapter {\@dottedtocline{1}{0em}{1.6em}} |
| 1498 |
\renewcommand* \l@section {\@dottedtocline{1}{2.3em}{2.1em}} |
| 1499 |
\renewcommand* \@dotsep {1.7} |
| 1500 |
\renewcommand* \@pnumwidth {2.5ex} |
| 1501 |
\renewcommand* \cftchapfont {\normalfont} |
| 1502 |
\setcounter{tocdepth}{1} |
| 1503 |
% \end{macrocode} |
| 1504 |
% 使用 \cs{ctexset} 提供的接口设置章节样式. |
| 1505 |
% \begin{macrocode} |
| 1506 |
\ctexset |
| 1507 |
{ |
| 1508 |
chapter = |
| 1509 |
{ |
| 1510 |
fixskip = true, name = {}, beforeskip = 21pt, |
| 1511 |
format+ = \sffamily \large, afterskip = 34pt, |
| 1512 |
number = \arabic{chapter}, pagestyle = fancy, |
| 1513 |
}, |
| 1514 |
section = |
| 1515 |
{ |
| 1516 |
beforeskip = 1.25ex, fixskip = true, |
| 1517 |
afterskip = 1.5ex, format = \sffamily \@@_font_semilarge: |
| 1518 |
}, |
| 1519 |
subsection = |
| 1520 |
{ |
| 1521 |
beforeskip = 1.25ex, fixskip = true, |
| 1522 |
afterskip = 1.5ex, format = \sffamily |
| 1523 |
} |
| 1524 |
} |
| 1525 |
% \end{macrocode} |
| 1526 |
% |
| 1527 |
% \begin{macrocode} |
| 1528 |
\makeatother \ExplSyntaxOff |
| 1529 |
% \end{macrocode} |
| 1530 |
% |
| 1531 |
% \begin{macrocode} |
| 1532 |
%</bc.config> |
| 1533 |
% \end{macrocode} |
| 1534 |
% |
| 1535 |
% \subsection{\module{pg.config} 模块的实现} |
| 1536 |
% |
| 1537 |
% \begin{macrocode} |
| 1538 |
%<*pg.config> |
| 1539 |
% \end{macrocode} |
| 1540 |
% |
| 1541 |
% \begin{macrocode} |
| 1542 |
\ExplSyntaxOn \makeatletter |
| 1543 |
% \end{macrocode} |
| 1544 |
% |
| 1545 |
% \begin{macrocode} |
| 1546 |
\@@_provide_module:n {pg.config} |
| 1547 |
% \end{macrocode} |
| 1548 |
% 设置页面布局、页眉、目录页码格式. |
| 1549 |
% \begin{macrocode} |
| 1550 |
\geometry { top = 2.8cm, bottom = 3.2cm, left = 3.2cm, right = 3.2cm, |
| 1551 |
headheight = 15pt, headsep = .72cm, footskip = 1.5cm } |
| 1552 |
\fancyhead[C] |
| 1553 |
{ \raisebox { .12ex } { \small 杭州电子科技大学硕士学位论文 } } |
| 1554 |
\hook_gput_code:nnn { cmd/tableofcontents/after } { . } |
| 1555 |
{ |
| 1556 |
\clearpage |
| 1557 |
\pagenumbering{arabic} |
| 1558 |
\cfoot{\small \thepage} |
| 1559 |
} |
| 1560 |
% \end{macrocode} |
| 1561 |
% 重新定义封面布局. |
| 1562 |
% \begin{macrocode} |
| 1563 |
\RenewDocumentCommand \maketitle {} |
| 1564 |
{ |
| 1565 |
\newgeometry{margin = 2.75cm} |
| 1566 |
\begin{titlepage} |
| 1567 |
\@@_maketitle_pg_auxi: |
| 1568 |
\end{titlepage} |
| 1569 |
\titlepage |
| 1570 |
\@@_maketitle_pg_auxii: |
| 1571 |
\endtitlepage |
| 1572 |
\titlepage |
| 1573 |
\@@_maketitle_pg_auxiii: |
| 1574 |
\endtitlepage |
| 1575 |
\restoregeometry |
| 1576 |
\pagenumbering{Roman} |
| 1577 |
\cfoot {\small \thepage} |
| 1578 |
} |
| 1579 |
% \end{macrocode} |
| 1580 |
% \begin{macro} |
| 1581 |
% {\@@_maketitle_pg_auxi:, \@@_maketitle_pg_auxii:, \@@_maketitle_pg_auxiii:} |
| 1582 |
% \cs{maketitle} 的辅助命令:封面设置、中文扉页设置、英文扉页设置. |
| 1583 |
% \begin{macrocode} |
| 1584 |
\cs_new_protected_nopar:Nn \@@_maketitle_pg_auxi: |
| 1585 |
{ |
| 1586 |
\begin{center} |
| 1587 |
\null |
| 1588 |
\includegraphics[height = 2.35cm]{hdu-title} |
| 1589 |
\par \vspace*{40\p@} |
| 1590 |
{ |
| 1591 |
\LARGE |
| 1592 |
\@@_cover_spread_box:nn {.575\linewidth} {硕士学位论文} |
| 1593 |
} |
| 1594 |
\par\vspace*{100\p@} |
| 1595 |
\@@_font_semiLarge: 题 \qquad 目: |
| 1596 |
\@@_cover_center_box:nn { .75\linewidth } { \kaishu \@title } |
| 1597 |
\vspace*{24\p@}\par |
| 1598 |
\begin{tabular} |
| 1599 |
{ |
| 1600 |
>{ \@@_font_semiLarge: \centering \arraybackslash } |
| 1601 |
p{4\ccwd}@{} |
| 1602 |
>{ \@@_font_semiLarge: \centering \arraybackslash \kaishu } |
| 1603 |
p{.65\linewidth}@{} |
| 1604 |
} |
| 1605 |
\@@_cover_spread_box:nn { 4\ccwd } { 研究生 } & |
| 1606 |
\@@_cover_center_box:nn { .96\linewidth } { \@author }\\ |
| 1607 |
\@@_cover_spread_box:nn { 4\ccwd } { 专业 } & |
| 1608 |
\@@_cover_center_box:nn { .96\linewidth } |
| 1609 |
{ \l_@@_set_major_tl }\\ |
| 1610 |
\@@_cover_spread_box:nn { 4\ccwd } { 指导教师 } & |
| 1611 |
\@@_cover_center_box:nn { .96\linewidth } |
| 1612 |
{ |
| 1613 |
\l_@@_set_cnsupervisor_tl \qquad \l_@@_set_cnrole_tl |
| 1614 |
}\\[13.5ex] |
| 1615 |
\@@_font_semilarge: 完成日期 & |
| 1616 |
\@@_cover_center_box:nn { .96\linewidth } |
| 1617 |
{ |
| 1618 |
\@@_font_semilarge: |
| 1619 |
\textsf { \int_use:N \c_sys_year_int } 年 |
| 1620 |
\textsf { \int_use:N \c_sys_month_int } 月 |
| 1621 |
} |
| 1622 |
\end{tabular} |
| 1623 |
\end{center} |
| 1624 |
} |
| 1625 |
\cs_new_protected_nopar:Nn \@@_maketitle_pg_auxii: |
| 1626 |
{ |
| 1627 |
\begin{center} |
| 1628 |
\vspace*{25\p@} |
| 1629 |
{ \LARGE 杭州电子科技大学硕士学位论文 } |
| 1630 |
\vspace*{140\p@} \par |
| 1631 |
\begin{spacing}{1.15} |
| 1632 |
\huge\textsf{ \@title } |
| 1633 |
\end{spacing} |
| 1634 |
\vspace*{128\p@} \par |
| 1635 |
\begin{tabular} |
| 1636 |
{ |
| 1637 |
>{ \@@_font_semiLarge: } p{6.25\ccwd} |
| 1638 |
>{ \@@_font_semiLarge: \kaishu } l |
| 1639 |
} |
| 1640 |
\@@_cover_spread_box:nn { 4\ccwd } { 研究生 }:& |
| 1641 |
\@@_cover_spread_box:nn { 4\ccwd } { \@author }\\[2ex] |
| 1642 |
\@@_cover_spread_box:nn { 4\ccwd } { 指导教师 }:& |
| 1643 |
\@@_cover_spread_box:nn { 4\ccwd } |
| 1644 |
{ \l_@@_set_cnsupervisor_tl } |
| 1645 |
\hskip 1.5em \l_@@_set_cnrole_tl |
| 1646 |
\end{tabular} |
| 1647 |
\par \vspace{60\p@} \@@_font_semilarge: |
| 1648 |
\textsf { \int_use:N \c_sys_year_int } \kaishu 年 |
| 1649 |
\textsf { \int_use:N \c_sys_month_int } \kaishu 月 |
| 1650 |
\end{center} |
| 1651 |
} |
| 1652 |
\cs_new_protected_nopar:Nn \@@_maketitle_pg_auxiii: |
| 1653 |
{ |
| 1654 |
\begin{center} |
| 1655 |
\vspace*{16\p@} |
| 1656 |
{ |
| 1657 |
\bfseries \@@_font_semilarge: |
| 1658 |
Dissertation ~ Submitted ~ to ~ |
| 1659 |
Hangzhou ~ Dianzi ~ University\\[.8ex] |
| 1660 |
for ~ the ~ Degree ~ of ~ Master |
| 1661 |
} |
| 1662 |
\vspace*{120\p@} \par |
| 1663 |
\begin{spacing}{1.12} |
| 1664 |
\huge \bfseries \l_@@_set_entitle_tl |
| 1665 |
\end{spacing} |
| 1666 |
\vspace*{112\p@} \par |
| 1667 |
\begin{tabular}{*2{>{\bfseries\large}l}} |
| 1668 |
\@@_cover_spread_box:nn { 5em } {Candidate:~} & |
| 1669 |
\l_@@_set_enauthor_tl\\[3ex] |
| 1670 |
\@@_cover_spread_box:nn { 5em } {Supervisor:~} & |
| 1671 |
\l_@@_set_enrole_tl{} ~ \l_@@_set_ensupervisor_tl |
| 1672 |
\\[11ex] |
| 1673 |
\end{tabular} |
| 1674 |
\vspace*{8\p@}\par |
| 1675 |
\bfseries \large |
| 1676 |
\clist_item:Nn |
| 1677 |
\g_@@_month_clist { \int_use:N \c_sys_month_int },~ |
| 1678 |
\int_use:N \c_sys_year_int |
| 1679 |
\end{center} |
| 1680 |
} |
| 1681 |
% \end{macrocode} |
| 1682 |
% \end{macro} |
| 1683 |
% \begin{macro}{\commitment} |
| 1684 |
% 生成承诺书 |
| 1685 |
% \begin{macrocode} |
| 1686 |
\NewDocumentCommand \commitment { O{} } |
| 1687 |
{ |
| 1688 |
\cfoot {} |
| 1689 |
\newgeometry{margin = 2.75cm} |
| 1690 |
\titlepage |
| 1691 |
\@@_commitment_pg_aux:n {#1} |
| 1692 |
\endtitlepage |
| 1693 |
\restoregeometry |
| 1694 |
\cfoot {\small \thepage} |
| 1695 |
} |
| 1696 |
% \end{macrocode} |
| 1697 |
% \end{macro} |
| 1698 |
% \begin{macro}{\@@_commitment_pg_aux:n} |
| 1699 |
% \cs{commitment} 的辅助命令. |
| 1700 |
% \begin{macrocode} |
| 1701 |
\cs_new_protected_nopar:Npn \@@_commitment_pg_aux:n #1 |
| 1702 |
{ |
| 1703 |
\vspace*{-12\p@} |
| 1704 |
\begin{center} |
| 1705 |
\large |
| 1706 |
杭州电子科技大学\\[1ex] 学位论文原创性声明和使用授权说明 |
| 1707 |
\end{center} |
| 1708 |
\vspace*{20\p@} |
| 1709 |
\begin{center} |
| 1710 |
\@@_font_semilarge: 原创性声明 |
| 1711 |
\end{center} |
| 1712 |
\par \vspace*{.4\baselineskip} |
| 1713 |
\begin{spacing}{1.65} |
| 1714 |
本人郑重声明:所呈交的学位论文,是本人在导师的指导下, |
| 1715 |
独立进行研究工作所取得的成果。除文中已经注明引用的内容外, |
| 1716 |
本论文不含任何其他个人或集体已经发表或撰写过的作品或成果。 |
| 1717 |
对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par |
| 1718 |
\noindent 申请学位论文与资料若有不实之处,本人承担一切相关责任。 |
| 1719 |
\par \vspace*{1.25\baselineskip} |
| 1720 |
\noindent \makebox [ .45\linewidth ] [ l ] |
| 1721 |
{ |
| 1722 |
论文作者签名: |
| 1723 |
\@@_sign_process_aux:nnn {#1} { 1 } { 0 } |
| 1724 |
\tl_if_empty:NF \l_@@_sign_figure_tl |
| 1725 |
{ |
| 1726 |
\@@_commitment_sign:N |
| 1727 |
\l_@@_sign_figure_tl |
| 1728 |
\tl_clear:N \l_@@_sign_figure_tl |
| 1729 |
} |
| 1730 |
} |
| 1731 |
日期: |
| 1732 |
\makebox [ 2.5em ] [ l ] |
| 1733 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 1 } } 年 |
| 1734 |
\makebox [ 2em ] |
| 1735 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 2 } } 月 |
| 1736 |
\makebox [ 2em ] |
| 1737 |
{ \@@_sign_process_aux:nnn {#1} { 1 } { 3 } } 日 |
| 1738 |
\par\vspace*{20\p@} |
| 1739 |
\begin{center} |
| 1740 |
\@@_font_semilarge: 学位论文使用授权说明 |
| 1741 |
\end{center} |
| 1742 |
\par \vspace*{.4\baselineskip} |
| 1743 |
本人完全了解杭州电子科技大学关于保留和使用学位论文的规定, |
| 1744 |
即:研究生在校攻读学位期间论文工作的知识产权单位属杭州电子科技大学。 |
| 1745 |
本人保证毕业离校后, |
| 1746 |
发表论文或使用论文工作成果时署名单位仍然为杭州电子科技大学。 |
| 1747 |
学校有权保留送交论文的复印件,允许查阅和借阅论文; |
| 1748 |
学校可以公布论文的全部或部分内容, |
| 1749 |
可以允许采用影印、缩印或其它复制手段保存论文。 |
| 1750 |
(保密论文在解密后遵守此规定) |
| 1751 |
\par \vspace*{1.25\baselineskip} |
| 1752 |
\noindent \makebox [.45\linewidth] [ l ] |
| 1753 |
{ |
| 1754 |
论文作者签名: |
| 1755 |
\@@_sign_process_aux:nnn {#1} { 2 } { 0 } |
| 1756 |
\tl_if_empty:NF \l_@@_sign_figure_tl |
| 1757 |
{ |
| 1758 |
\@@_commitment_sign:N |
| 1759 |
\l_@@_sign_figure_tl |
| 1760 |
\tl_clear:N \l_@@_sign_figure_tl |
| 1761 |
} |
| 1762 |
} |
| 1763 |
日期: |
| 1764 |
\makebox [ 2.5em ] [ l ] |
| 1765 |
{ \@@_sign_process_aux:nnn {#1} { 2 } { 1 } } 年 |
| 1766 |
\makebox [ 2em ] |
| 1767 |
{ \@@_sign_process_aux:nnn {#1} { 2 } { 2 } } 月 |
| 1768 |
\makebox [ 2em ] |
| 1769 |
{ \@@_sign_process_aux:nnn {#1} { 2 } { 3 } } 日 |
| 1770 |
\par \vspace*{\baselineskip} |
| 1771 |
\noindent \makebox [ .45\linewidth ] [ l ] |
| 1772 |
{ |
| 1773 |
指导教师签名: |
| 1774 |
\@@_sign_process_aux:nnn {#1} { 3 } { 0 } |
| 1775 |
\tl_if_empty:NF \l_@@_sign_figure_tl |
| 1776 |
{ |
| 1777 |
\@@_commitment_sign:N |
| 1778 |
\l_@@_sign_figure_tl |
| 1779 |
\tl_clear:N \l_@@_sign_figure_tl |
| 1780 |
} |
| 1781 |
} |
| 1782 |
日期: |
| 1783 |
\makebox [ 2.5em ] [ l ] |
| 1784 |
{ \@@_sign_process_aux:nnn {#1} { 3 } { 1 } } 年 |
| 1785 |
\makebox [ 2em ] |
| 1786 |
{ \@@_sign_process_aux:nnn {#1} { 3 } { 2 } } 月 |
| 1787 |
\makebox [ 2em ] |
| 1788 |
{ \@@_sign_process_aux:nnn {#1} { 3 } { 3 } } 日 |
| 1789 |
\end{spacing} |
| 1790 |
} |
| 1791 |
% \end{macrocode} |
| 1792 |
% \end{macro} |
| 1793 |
% \DescribeEnv{abstract} |
| 1794 |
% 重新定义摘要环境,加入中英文判断. |
| 1795 |
% \begin{macrocode} |
| 1796 |
\RenewDocumentEnvironment {abstract} { O{en} } |
| 1797 |
{ |
| 1798 |
\str_if_eq:nnT {#1} {en} |
| 1799 |
{ |
| 1800 |
\tl_set:Nn \l_@@_keywords_name_tl {Keywords:~} |
| 1801 |
\tl_set:Nn \l_@@_keywords_sep_tl {,~} |
| 1802 |
\@beginparpenalty \@lowpenalty |
| 1803 |
\chapter*{\normalfont\bfseries Abstract} |
| 1804 |
\addcontentsline{toc}{chapter}{\bfseries Abstract} |
| 1805 |
} |
| 1806 |
\str_if_eq:nnT {#1} {cn} |
| 1807 |
{ |
| 1808 |
\tl_set:Nn \l_@@_keywords_name_tl {\textsf{关键词:}} |
| 1809 |
\tl_set:Nn \l_@@_keywords_sep_tl {,} |
| 1810 |
\@beginparpenalty \@lowpenalty |
| 1811 |
\chapter*{摘要} |
| 1812 |
\addcontentsline{toc}{chapter}{摘要} |
| 1813 |
} |
| 1814 |
} |
| 1815 |
{ |
| 1816 |
\tl_clear:N \l_@@_abstract_title_tl |
| 1817 |
\clearpage |
| 1818 |
} |
| 1819 |
% \end{macrocode} |
| 1820 |
% \begin{variable}{\l_@@_keywords_clist} |
| 1821 |
% 存储关键词列表. |
| 1822 |
% \begin{macrocode} |
| 1823 |
\clist_new:N \l_@@_keywords_clist |
| 1824 |
% \end{macrocode} |
| 1825 |
% \end{variable} |
| 1826 |
% \begin{macro}{\keywords} |
| 1827 |
% 重新定义 \cs{keywords} 命令,关键词样式会根据 \env{abstract} 所选语言自动变化. |
| 1828 |
% \begin{macrocode} |
| 1829 |
\NewDocumentCommand \keywords { m } |
| 1830 |
{ |
| 1831 |
\par \vspace*{\baselineskip} |
| 1832 |
\noindent\textbf{\l_@@_keywords_name_tl} |
| 1833 |
\clist_set:Nn \l_@@_keywords_clist {#1} |
| 1834 |
\clist_use:Nn \l_@@_keywords_clist { \l_@@_keywords_sep_tl } |
| 1835 |
} |
| 1836 |
% \end{macrocode} |
| 1837 |
% \end{macro} |
| 1838 |
% 设置目录样式. |
| 1839 |
% \begin{macrocode} |
| 1840 |
\RequirePackage{tocloft} |
| 1841 |
\renewcommand \contentsname {\hfill 目录 \hfill} |
| 1842 |
\renewcommand* \cfttoctitlefont{\sffamily\@@_font_semiLarge:} |
| 1843 |
\dim_set:Nn \cftbeforetoctitleskip {12pt} |
| 1844 |
\dim_set:Nn \cftaftertoctitleskip {24pt} |
| 1845 |
\dim_set:Nn \cftbeforechapskip {1pt} |
| 1846 |
\dim_set:Nn \cftbeforesecskip {-.2pt} |
| 1847 |
\patchcmd { \@dottedtocline } |
| 1848 |
{ |
| 1849 |
\leaders |
| 1850 |
\hbox { $\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$ } |
| 1851 |
} |
| 1852 |
{ |
| 1853 |
\kern 4pt \leaders |
| 1854 |
\hbox { $\m@th\mkern .4 mu\hbox{.}\mkern .4 mu$ } |
| 1855 |
} {}{} |
| 1856 |
\renewcommand* \l@chapter {\@dottedtocline{1}{0em}{1.6em}} |
| 1857 |
\renewcommand* \l@section {\@dottedtocline{1}{2.3em}{2.1em}} |
| 1858 |
\renewcommand* \@dotsep {1.7} |
| 1859 |
\renewcommand* \@pnumwidth {2.5ex} |
| 1860 |
\renewcommand* \cftchapfont {\normalfont} |
| 1861 |
\setcounter{tocdepth}{1} |
| 1862 |
% \end{macrocode} |
| 1863 |
% 使用 \cs{ctexset} 提供的接口设置章节样式. |
| 1864 |
% \begin{macrocode} |
| 1865 |
\ctexset |
| 1866 |
{ |
| 1867 |
chapter = |
| 1868 |
{ |
| 1869 |
aftername = \hspace{.5\ccwd}, fixskip = true, |
| 1870 |
beforeskip = 32pt, afterskip = 32pt, |
| 1871 |
format+ = \sffamily \@@_font_semiLarge:, |
| 1872 |
pagestyle = fancy |
| 1873 |
}, |
| 1874 |
section = |
| 1875 |
{ |
| 1876 |
aftername = \hspace{.5\ccwd}, fixskip = true, |
| 1877 |
beforeskip = 2ex, afterskip = 2.75ex, |
| 1878 |
format = \sffamily \large |
| 1879 |
}, |
| 1880 |
subsection = |
| 1881 |
{ |
| 1882 |
aftername = \hspace{.5\ccwd}, fixskip = true, |
| 1883 |
beforeskip = 2ex, afterskip = 2.75ex, |
| 1884 |
format = \sffamily \@@_font_semilarge: |
| 1885 |
} |
| 1886 |
} |
| 1887 |
% \end{macrocode} |
| 1888 |
% |
| 1889 |
% \begin{macrocode} |
| 1890 |
\makeatother \ExplSyntaxOff |
| 1891 |
% \end{macrocode} |
| 1892 |
% |
| 1893 |
% \begin{macrocode} |
| 1894 |
%</pg.config> |
| 1895 |
% \end{macrocode} |
| 1896 |
% |
| 1897 |
% \subsection{Beamer 主题的实现} |
| 1898 |
% |
| 1899 |
% \begin{macrocode} |
| 1900 |
%<*beamer> |
| 1901 |
% \end{macrocode} |
| 1902 |
% |
| 1903 |
% \begin{macrocode} |
| 1904 |
\ProvidesExplPackage{beamerthemehdu}{\hduthesis@date}{\hduthesis@version} |
| 1905 |
{hduThesiS ~ \text_titlecase:n {beamer} ~ Module} |
| 1906 |
% \end{macrocode} |
| 1907 |
% |
| 1908 |
% \begin{macrocode} |
| 1909 |
\mode<presentation> |
| 1910 |
% \end{macrocode} |
| 1911 |
% |
| 1912 |
% \begin{macrocode} |
| 1913 |
\RequirePackage{tikz} |
| 1914 |
\usetikzlibrary{fadings} |
| 1915 |
% \end{macrocode} |
| 1916 |
% 插图相对路径设置. |
| 1917 |
% \begin{macrocode} |
| 1918 |
\graphicspath |
| 1919 |
{ |
| 1920 |
{./figure/} {./image/} {./graphic/} {./picture/} |
| 1921 |
{./figures/} {./images/} {./graphics/} {./pictures/} |
| 1922 |
} |
| 1923 |
% \end{macrocode} |
| 1924 |
% 模式 \module{beamer} 下 \cs{hduset} 接口键值的定义. |
| 1925 |
% \begin{variable} |
| 1926 |
% { |
| 1927 |
% \l_@@_set_title_tl, \l_@@_set_subtitle_tl, |
| 1928 |
% \l_@@_set_author_tl, \l_@@_set_date_tl, |
| 1929 |
% \l_@@_set_supervisor_tl, \l_@@_set_reference_tl, |
| 1930 |
% } |
| 1931 |
% \begin{macrocode} |
| 1932 |
\keys_define:nn { beamer / hduset } |
| 1933 |
{ |
| 1934 |
title .tl_set:N = \l_@@_set_title_tl, |
| 1935 |
subtitle .tl_set:N = \l_@@_set_subtitle_tl, |
| 1936 |
author .tl_set:N = \l_@@_set_author_tl, |
| 1937 |
date .tl_set:N = \l_@@_set_date_tl, |
| 1938 |
supervisor .tl_set:N = \l_@@_set_supervisor_tl, |
| 1939 |
bibsource .tl_set:N = \l_@@_set_bibsource_tl, |
| 1940 |
} |
| 1941 |
% \end{macrocode} |
| 1942 |
% \end{variable} |
| 1943 |
% \begin{macro}{\hduset} |
| 1944 |
% 模式 \module{beamer} 下设置文档信息. |
| 1945 |
% \begin{macrocode} |
| 1946 |
\NewDocumentCommand \hduset { m } |
| 1947 |
{ |
| 1948 |
\keys_set:nn { beamer / hduset } { #1 } |
| 1949 |
\title { \large \l_@@_set_title_tl } |
| 1950 |
\tl_set:Nn \insertshorttitle { \textsc \l_@@_set_subtitle_tl } |
| 1951 |
\author [ \l_@@_set_author_tl ] |
| 1952 |
{ |
| 1953 |
\l_@@_set_author_tl |
| 1954 |
\tl_if_empty:NF \l_@@_set_supervisor_tl |
| 1955 |
{ |
| 1956 |
\texorpdfstring |
| 1957 |
{ \\[2ex] |
| 1958 |
\small Supervised ~ by ~ \l_@@_set_supervisor_tl |
| 1959 |
} {} |
| 1960 |
} |
| 1961 |
} |
| 1962 |
\date { \l_@@_set_date_tl } |
| 1963 |
\tl_if_empty:NTF \l_@@_set_bibsource_tl |
| 1964 |
{ |
| 1965 |
\newcommand* \printbibliography |
| 1966 |
{ |
| 1967 |
\begin{frame}[t] |
| 1968 |
\frametitle{Bibliography} |
| 1969 |
\end{frame} |
| 1970 |
} |
| 1971 |
\newcounter {citecount} |
| 1972 |
\renewcommand*\cite[1] |
| 1973 |
{ |
| 1974 |
\refstepcounter{citecount} |
| 1975 |
\textsuperscript{[\thecitecount]} |
| 1976 |
} |
| 1977 |
} |
| 1978 |
{ |
| 1979 |
\RequirePackage [ natbib = true, sorting = none, backend = biber, |
| 1980 |
autocite = superscript, style = numeric-comp ] |
| 1981 |
{ biblatex } |
| 1982 |
\addbibresource { \l_@@_set_reference_tl } |
| 1983 |
\let \@printbibliography \printbibliography |
| 1984 |
\renewcommand* \printbibliography |
| 1985 |
{ |
| 1986 |
\begin{frame}[t, allowframebreaks]{Bibliography} |
| 1987 |
\small |
| 1988 |
\@printbibliography |
| 1989 |
\end{frame} |
| 1990 |
} |
| 1991 |
} |
| 1992 |
} |
| 1993 |
% \end{macrocode} |
| 1994 |
% \end{macro} |
| 1995 |
% |Beamer| 背景 \& 标头设置. |
| 1996 |
% \begin{macrocode} |
| 1997 |
\usebackgroundtemplate |
| 1998 |
{ |
| 1999 |
\tikz [ remember~picture, overlay ] |
| 2000 |
\node [ inner~sep = 0pt, outer~sep = auto, |
| 2001 |
opacity = .1, xshift = -2em |
| 2002 |
] at (current~page.east) |
| 2003 |
{ \includegraphics [ height = .75\paperheight ] { hdu-logo.pdf } }; |
| 2004 |
} |
| 2005 |
\titlegraphic |
| 2006 |
{ |
| 2007 |
\tikz [ remember~picture, overlay ] |
| 2008 |
\node [ below~right, yshift = -1em ] at (current~page.north~west) |
| 2009 |
{ \includegraphics [ width = 2\textwidth/7 ]{ hdu-badge.pdf } }; |
| 2010 |
} |
| 2011 |
% \end{macrocode} |
| 2012 |
% |Beamer| 原生主题调用. |
| 2013 |
% \begin{macrocode} |
| 2014 |
\useoutertheme{infolines} |
| 2015 |
\useinnertheme[shadow = false]{rounded} |
| 2016 |
\definecolor{hdu}{HTML}{163479} |
| 2017 |
\definecolor{hduRed}{HTML}{BF6236} |
| 2018 |
\usecolortheme[named = hdu]{structure} |
| 2019 |
\setbeamercolor*{palette~primary} |
| 2020 |
{ |
| 2021 |
use = structure, fg = black, |
| 2022 |
bg = structure.fg!30!white |
| 2023 |
} |
| 2024 |
\setbeamercolor*{palette~secondary} |
| 2025 |
{ |
| 2026 |
use = structure, fg = white, |
| 2027 |
bg = structure.fg!60!white |
| 2028 |
} |
| 2029 |
\setbeamercolor*{palette~tertiary} |
| 2030 |
{ |
| 2031 |
use = structure, fg = white, |
| 2032 |
bg = structure.fg!90!white |
| 2033 |
} |
| 2034 |
\setbeamercolor{block~title} |
| 2035 |
{ |
| 2036 |
use = structure, fg = structure.fg, |
| 2037 |
bg = structure.fg!20!bg |
| 2038 |
} |
| 2039 |
\setbeamercolor{block~body} |
| 2040 |
{ |
| 2041 |
use = block~title, parent = normal~text, |
| 2042 |
bg = block~title.bg!50!bg |
| 2043 |
} |
| 2044 |
\addtobeamertemplate{block~begin} |
| 2045 |
{\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} |
| 2046 |
\setbeamercolor{block~title~alerted} |
| 2047 |
{ |
| 2048 |
use = alerted~text, fg = alerted~text.fg, |
| 2049 |
bg = alerted~text.fg!20!bg |
| 2050 |
} |
| 2051 |
\setbeamercolor{block~body~alerted} |
| 2052 |
{ |
| 2053 |
use = block~title~alerted, parent = normal~text, |
| 2054 |
bg = block~title~alerted.bg!50!bg |
| 2055 |
} |
| 2056 |
\addtobeamertemplate{block~alerted~begin} |
| 2057 |
{\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} |
| 2058 |
\setbeamercolor{block~title~example} |
| 2059 |
{ |
| 2060 |
use = example~text,fg = example~text.fg, |
| 2061 |
bg = example~text.fg!20!bg |
| 2062 |
} |
| 2063 |
\setbeamercolor{block~body~example} |
| 2064 |
{ |
| 2065 |
use = block~title~example, parent=normal~text, |
| 2066 |
bg = block~title~example.bg!50!bg |
| 2067 |
} |
| 2068 |
\addtobeamertemplate{block~example~begin} |
| 2069 |
{\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}} |
| 2070 |
\setbeamercolor{title}{parent=author~in~head/foot} |
| 2071 |
\setbeamertemplate{title~page}[default][colsep=-4bp,rounded=true] |
| 2072 |
\usesubitemizeitemtemplate |
| 2073 |
{\tiny\raise1.5pt\hbox{\color{beamerstructure}$\blacktriangleright$}} |
| 2074 |
\usesubsubitemizeitemtemplate |
| 2075 |
{ \tiny\raise1.5pt\hbox{\color{beamerstructure}$\bigstar$} } |
| 2076 |
% \end{macrocode} |
| 2077 |
% |Beamer| 顶部进度条配置. |
| 2078 |
% \begin{macrocode} |
| 2079 |
\addtobeamertemplate{headline}{} |
| 2080 |
{ |
| 2081 |
\tikz [ remember~picture, overlay ] |
| 2082 |
{ |
| 2083 |
\filldraw [hduRed, ultra~thick, line~cap = butt] |
| 2084 |
(0,0) --++ |
| 2085 |
(\insertpagenumber\paperwidth/\insertdocumentendpage,0); |
| 2086 |
\draw [white, very~thick, yshift = -.6pt] (0,0) --++ |
| 2087 |
(\paperwidth,0); |
| 2088 |
} |
| 2089 |
} |
| 2090 |
% \end{macrocode} |
| 2091 |
% |Beamer| 章节封面设置. |
| 2092 |
% \begin{macrocode} |
| 2093 |
\AtBeginSection[] |
| 2094 |
{ |
| 2095 |
\begin{frame} |
| 2096 |
\tikz [ remember~picture, overlay ] |
| 2097 |
\node [ below~right, yshift = -1em ] at (current~page.north~west) |
| 2098 |
{ \includegraphics [ width = 2\textwidth/7 ]{ hdu-badge.pdf } }; |
| 2099 |
\vfill |
| 2100 |
\usebeamerfont{title} \insertsectionhead \par |
| 2101 |
\tikz |
| 2102 |
{ |
| 2103 |
\draw [line~cap = round, hdu!20, ultra~thick] |
| 2104 |
(0,0) --++ (2\linewidth/3,0); |
| 2105 |
\filldraw |
| 2106 |
[ line~cap = round, hdu!60, ultra~thick, path~fading = west |
| 2107 |
] (0,0) --++ |
| 2108 |
(\insertpagenumber\linewidth/\insertdocumentendpage * 2/3,0); |
| 2109 |
} |
| 2110 |
\vfill |
| 2111 |
\end{frame} |
| 2112 |
} |
| 2113 |
% \end{macrocode} |
| 2114 |
% 公式排版必要宏包加载. |
| 2115 |
% \begin{macrocode} |
| 2116 |
% math settings |
| 2117 |
\numberwithin{equation}{section} |
| 2118 |
\RequirePackage { keytheorems, amssymb, mathtools, physics2, |
| 2119 |
fixdif, derivative, cancel, siunitx, nicematrix } |
| 2120 |
\renewcommand* \qedsymbol {$\color{gray}\blacksquare$} |
| 2121 |
\usephysicsmodule{ ab, braket, op.legacy } |
| 2122 |
% \end{macrocode} |
| 2123 |
% 浮动体设置. |
| 2124 |
% \begin{macrocode} |
| 2125 |
% Figure settings |
| 2126 |
\RequirePackage [ labelsep = period, figurename = \textsc{Fig}, |
| 2127 |
font = footnotesize ] {caption} |
| 2128 |
\RequirePackage {subcaption, booktabs, anyfontsize, ragged2e} |
| 2129 |
\captionsetup{belowskip=0pt} |
| 2130 |
\captionsetup[sub]{font = scriptsize} |
| 2131 |
\justifying |
| 2132 |
\AtBeginEnvironment{columns}{\vspace*{-.5ex}} |
| 2133 |
% \end{macrocode} |
| 2134 |
% |
| 2135 |
% \begin{macrocode} |
| 2136 |
\mode<all> |
| 2137 |
% \end{macrocode} |
| 2138 |
% |
| 2139 |
% \begin{macrocode} |
| 2140 |
%</beamer> |
| 2141 |
% \end{macrocode} |
| 2142 |
% |
| 2143 |
% \subsection{\module{stationery} 模块的实现} |
| 2144 |
% |
| 2145 |
% \begin{macrocode} |
| 2146 |
%<*stationery> |
| 2147 |
% \end{macrocode} |
| 2148 |
% |
| 2149 |
% \begin{macrocode} |
| 2150 |
\@@_provide_module:n {stationery} |
| 2151 |
% \end{macrocode} |
| 2152 |
% |
| 2153 |
% \begin{macro} |
| 2154 |
% { |
| 2155 |
% \g_@@_set_watermark_bool, |
| 2156 |
% \l_@@_set_title_tl, \l_@@_set_author_tl, |
| 2157 |
% \l_@@_set_mail_tl, \l_@@_set_date_tl |
| 2158 |
% } |
| 2159 |
% 模式 \module{stationery} 下 \cs{hduset} 接口键值的定义. |
| 2160 |
% \begin{macrocode} |
| 2161 |
\keys_define:nn { stationery / hduset } |
| 2162 |
{ |
| 2163 |
watermark .bool_set:N = \g_@@_set_watermark_bool, |
| 2164 |
watermark .initial:n = false, |
| 2165 |
watermark .default:n = true, |
| 2166 |
title .tl_set:N = \l_@@_set_title_tl, |
| 2167 |
author .tl_set:N = \l_@@_set_author_tl, |
| 2168 |
mail .tl_set:N = \l_@@_set_mail_tl, |
| 2169 |
date .tl_set:N = \l_@@_set_date_tl |
| 2170 |
} |
| 2171 |
% \end{macrocode} |
| 2172 |
% \end{macro} |
| 2173 |
% \begin{macrocode} |
| 2174 |
\RequirePackage{ hyperref, geometry, tikz, |
| 2175 |
tikzpagenodes, twemojis, fancyhdr } |
| 2176 |
\hypersetup{hidelinks} |
| 2177 |
\urlstyle{same} |
| 2178 |
% \end{macrocode} |
| 2179 |
% \begin{macro}{\hduset} |
| 2180 |
% 模式 \module{beamer} 下设置文档信息. |
| 2181 |
% \begin{macrocode} |
| 2182 |
\NewDocumentCommand \hduset { m } |
| 2183 |
{ |
| 2184 |
\tl_clear:N \l_@@_set_author_tl |
| 2185 |
\tl_clear:N \l_@@_set_mail_tl |
| 2186 |
\keys_set:nn { stationery / hduset } {#1} |
| 2187 |
\hypersetup |
| 2188 |
{ |
| 2189 |
pdftitle = Hangzhou Dianzi University, |
| 2190 |
pdfsubject = \l_@@_set_title_tl, |
| 2191 |
pdfauthor = \l_@@_set_author_tl |
| 2192 |
} |
| 2193 |
} |
| 2194 |
% \end{macrocode} |
| 2195 |
% \end{macro} |
| 2196 |
% 设置页面布局、页眉页脚格式. |
| 2197 |
% \begin{macrocode} |
| 2198 |
\geometry |
| 2199 |
{ hmargin = .8in, top = 1.95in, bottom = .75in, |
| 2200 |
headheight = 1.2in, headsep = .3in, footskip = .3in } |
| 2201 |
\linespread{1.25} |
| 2202 |
\RequirePackage [ skip = \baselineskip ] { parskip } |
| 2203 |
\renewcommand* \familydefault { \sfdefault } |
| 2204 |
\definecolor{hdu}{HTML}{163479} |
| 2205 |
|
| 2206 |
\renewcommand* \headrulewidth {2pt} |
| 2207 |
\renewcommand* \footrulewidth {2pt} |
| 2208 |
\hook_gput_code:nnn { cmd/headrule/before } { . } { \color{hdu!80} } |
| 2209 |
\hook_gput_code:nnn { cmd/footrule/before } { . } { \color{hdu!80} } |
| 2210 |
\lhead |
| 2211 |
{ {}~ |
| 2212 |
\minipage{.6\linewidth} |
| 2213 |
\medskip \leavevmode \lower -.111in |
| 2214 |
\hbox { \includegraphics [ height = .75in ] {hdu-badge} } |
| 2215 |
\endminipage \medskip \hfill |
| 2216 |
\minipage{.36\linewidth} |
| 2217 |
\medskip \vbox |
| 2218 |
{ |
| 2219 |
\linespread{1.2} |
| 2220 |
\raggedright \small \color{hdu} |
| 2221 |
\texttwemoji{1f4cd} ~ 1158 ~ No.2 ~ St., ~ Hangzhou, ~ 310018\\ |
| 2222 |
\texttwemoji{1f4de} ~ (86) ~ 0571-86915072\\ |
| 2223 |
\texttwemoji{1f310} ~ \url{www.hdu.edu.cn} |
| 2224 |
} \medskip |
| 2225 |
\endminipage |
| 2226 |
} |
| 2227 |
\lfoot |
| 2228 |
{ |
| 2229 |
\small{} ~ \texttwemoji{1f4cd} ~ |
| 2230 |
1158 ~ No.2~Street, ~ Qiantang ~District, ~ |
| 2231 |
Hangzhou, ~ Zhejiang ~ Province, ~ 310018, ~ P.R.China |
| 2232 |
} |
| 2233 |
\cfoot {} |
| 2234 |
\rfoot { \small \texttwemoji{1f310} ~ \url{www.hdu.edu.cn} ~ } |
| 2235 |
\pagestyle{fancy} |
| 2236 |
% \end{macrocode} |
| 2237 |
% \begin{macro}{\maketitle} |
| 2238 |
% 重新定义标题布局,当未给定 \key*{author} 和 \key*{mail} 时,不输出 |From|. |
| 2239 |
% \begin{macrocode} |
| 2240 |
\renewcommand* \maketitle |
| 2241 |
{ |
| 2242 |
\group_begin: \small |
| 2243 |
\bool_lazy_or:nnT |
| 2244 |
{ !\tl_if_empty_p:N \l_@@_set_author_tl } |
| 2245 |
{ !\tl_if_empty_p:N \l_@@_set_mail_tl } |
| 2246 |
{ \makebox [ 4em ] [ l ] { \scshape From } } |
| 2247 |
\tl_if_empty:NTF \l_@@_set_author_tl |
| 2248 |
{ \@latex@warning@no@line {No \noexpand \author given} } |
| 2249 |
{ \l_@@_set_author_tl{} ~ } |
| 2250 |
\tl_if_empty:NF \l_@@_set_mail_tl |
| 2251 |
{ \texttt { <\l_@@_set_mail_tl> } } |
| 2252 |
\bool_lazy_or:nnT |
| 2253 |
{ !\tl_if_empty_p:N \l_@@_set_author_tl } |
| 2254 |
{ !\tl_if_empty_p:N \l_@@_set_mail_tl } { \\ } |
| 2255 |
\makebox [ 4em ] [ l ] { \scshape Date } |
| 2256 |
\tl_if_empty:NTF \l_@@_set_date_tl \today \l_@@_set_date_tl \\ |
| 2257 |
\tl_if_empty:NTF \l_@@_set_title_tl |
| 2258 |
{ \@latex@error {No \noexpand \title given}\@ehc } |
| 2259 |
{ |
| 2260 |
\makebox [ 4em ] [ l ] { \scshape Subject } |
| 2261 |
\l_@@_set_title_tl |
| 2262 |
} |
| 2263 |
\par \vspace{.5\baselineskip} |
| 2264 |
\group_end: |
| 2265 |
} |
| 2266 |
% \end{macrocode} |
| 2267 |
% \end{macro} |
| 2268 |
% 水印设置. |
| 2269 |
% \begin{macrocode} |
| 2270 |
\AtBeginDocument { \color_select:n {black!80} } |
| 2271 |
\DeclareHookRule { shipout / background } { hduthesis / stationery } |
| 2272 |
{ before } { pgfrcs } |
| 2273 |
\AddToHook { shipout / background } [ hduthesis / stationery ] |
| 2274 |
{ |
| 2275 |
\bool_if:NT \g_@@_set_watermark_bool |
| 2276 |
{ |
| 2277 |
\tikz [ remember~picture, overlay ] |
| 2278 |
\node [ opacity = .2 ] at (current~page) |
| 2279 |
{ \includegraphics [ width = .4\linewidth ] {hdu-logo} }; |
| 2280 |
} |
| 2281 |
} |
| 2282 |
% \end{macrocode} |
| 2283 |
% \begin{macro}{\notelines} |
| 2284 |
% 用于添加笔记线. |
| 2285 |
% \begin{macrocode} |
| 2286 |
\NewDocumentCommand \notelines {O{20}} |
| 2287 |
{ |
| 2288 |
\tikz [ remember~picture, overlay ] |
| 2289 |
{ |
| 2290 |
\int_step_inline:nn { #1 - 1 } |
| 2291 |
{ |
| 2292 |
\draw [ hdu, very~thick, opacity = .6 ] |
| 2293 |
([ |
| 2294 |
yshift = -##1 * (\textheight + .6in - 15.87pt ) / #1 |
| 2295 |
+ .3in |
| 2296 |
]current~page~text~area.north~west |
| 2297 |
) --++ (\linewidth, 0); |
| 2298 |
} |
| 2299 |
} |
| 2300 |
} |
| 2301 |
% \end{macrocode} |
| 2302 |
% \end{macro} |
| 2303 |
% |
| 2304 |
% \begin{macrocode} |
| 2305 |
%</stationery> |
| 2306 |
% \end{macrocode} |
| 2307 |
% |
| 2308 |
% \subsection{\module{exam} 模块的实现} |
| 2309 |
% |
| 2310 |
% \begin{macrocode} |
| 2311 |
%<*exam> |
| 2312 |
% \end{macrocode} |
| 2313 |
% |
| 2314 |
% \begin{macrocode} |
| 2315 |
\@@_provide_module:n {exam} |
| 2316 |
\keys_define:nn { hduthesis / exam } |
| 2317 |
{ |
| 2318 |
watermark .tl_set:N = \l_@@_exam_watermark_tl, |
| 2319 |
} |
| 2320 |
\NewDocumentCommand \hdutexset {m} { \keys_set:nn { hduthesis / exam } {#1} } |
| 2321 |
\DeclareHookRule { shipout / background } |
| 2322 |
{ hduthesis / exam } { before } { pgfrcs } |
| 2323 |
\AddToHook { shipout / background } [ hduthesis / exam ] |
| 2324 |
{ |
| 2325 |
\tl_if_empty:NF \l_@@_exam_watermark_tl |
| 2326 |
{ |
| 2327 |
\tikz [ remember~picture, overlay ] |
| 2328 |
\node [ opacity = .2 ] at (current~page) |
| 2329 |
{ |
| 2330 |
\includegraphics [ width = \linewidth ] |
| 2331 |
{ \l_@@_exam_watermark_tl } |
| 2332 |
}; |
| 2333 |
} |
| 2334 |
} |
| 2335 |
\RequirePackage |
| 2336 |
{ |
| 2337 |
geometry, mathtools, array, bm, esint, keytheorems, |
| 2338 |
siunitx, fixdif, derivative, physics2, tasks, anyfontsize |
| 2339 |
} |
| 2340 |
\RequirePackage[inline]{enumitem} |
| 2341 |
\RequirePackage{fontawesome5, fancyqr, circuitikz} |
| 2342 |
\hook_gput_code:nnn { cmd/faIcon/before } { . } |
| 2343 |
{ |
| 2344 |
\group_begin: |
| 2345 |
\fontsize { \fp_eval:n { .9 * \f@size } } { 0 } \selectfont |
| 2346 |
} |
| 2347 |
\hook_gput_code:nnn { cmd/faIcon/after } { . } { \group_end: } |
| 2348 |
\geometry{margin = 1in} |
| 2349 |
\RequirePackage[svgnames]{xcolor} |
| 2350 |
\newkeytheorem{note} |
| 2351 |
[ style = remark, numbered = false, |
| 2352 |
name = \color{DarkRed}\sffamily \faIcon{info-circle}~Tip. ] |
| 2353 |
\newkeytheorem{problem} |
| 2354 |
[ style = definition, |
| 2355 |
name = \color{DarkGreen}\sffamily \faIcon{pen-square}~Problem ] |
| 2356 |
\newkeytheorem{solution} |
| 2357 |
[ style = definition, numbered = false, |
| 2358 |
name = \color{MidnightBlue}\sffamily \faIcon{check-square}~Solution ] |
| 2359 |
\usephysicsmodule{ab, op.legacy} |
| 2360 |
\settasks { label = \sffamily\Alph*., item-indent = 2.5em, label-offset = .5pt } |
| 2361 |
\newcommand \true {\addtocounter{task}{1}\faIcon{check-circle}} |
| 2362 |
\def \@result#1 {\underline{~#1~}} |
| 2363 |
\def \s@result {\textsf{【\qquad 】}} |
| 2364 |
\DeclareRobustCommand \result {\@ifstar\s@result\@result} |
| 2365 |
\keys_define:nn { textfig } |
| 2366 |
{ |
| 2367 |
ratio .tl_set:N = \l_@@_textfig_ratio_tl, |
| 2368 |
ratio .initial:n = 7 \c_colon_str 2, |
| 2369 |
position .tl_set:N = \l_@@_textfig_position_tl, |
| 2370 |
position .initial:n = c, |
| 2371 |
unknown .code:n = \tl_if_novalue:nF {#1} |
| 2372 |
{ \tl_set_eq:NN \l_@@_textfig_position_tl \l_keys_key_tl } |
| 2373 |
} |
| 2374 |
\NewDocumentEnvironment{textfig}{ O{} } |
| 2375 |
{ |
| 2376 |
\group_begin: |
| 2377 |
\keys_set:nn { textfig } {#1} |
| 2378 |
\seq_set_split:Nee \l_@@_textfig_ratio_seq { \c_colon_str } |
| 2379 |
{ \l_@@_textfig_ratio_tl } |
| 2380 |
\noindent |
| 2381 |
\minipage [ \l_@@_textfig_position_tl ] |
| 2382 |
{ |
| 2383 |
\fp_eval:n |
| 2384 |
{ |
| 2385 |
.96*\seq_item:Nn \l_@@_textfig_ratio_seq {1}/ |
| 2386 |
( |
| 2387 |
\seq_item:Nn \l_@@_textfig_ratio_seq {1} + |
| 2388 |
\seq_item:Nn \l_@@_textfig_ratio_seq {2} |
| 2389 |
) |
| 2390 |
}\dimexpr \linewidth |
| 2391 |
} |
| 2392 |
} |
| 2393 |
{ |
| 2394 |
\endminipage |
| 2395 |
\vspace{4.5pt plus 1.5pt minus 1.5pt} \par |
| 2396 |
\group_end: |
| 2397 |
} |
| 2398 |
\NewDocumentCommand \textfigsplit {} |
| 2399 |
{ |
| 2400 |
\endminipage |
| 2401 |
\hspace{.02\linewidth} |
| 2402 |
\minipage [ \l_@@_textfig_position_tl ] |
| 2403 |
{ |
| 2404 |
\fp_eval:n |
| 2405 |
{ |
| 2406 |
.96*\seq_item:Nn \l_@@_textfig_ratio_seq {2}/ |
| 2407 |
( |
| 2408 |
\seq_item:Nn \l_@@_textfig_ratio_seq {1} + |
| 2409 |
\seq_item:Nn \l_@@_textfig_ratio_seq {2} |
| 2410 |
) |
| 2411 |
}\dimexpr \linewidth |
| 2412 |
} |
| 2413 |
} |
| 2414 |
|
| 2415 |
\makeatother \ExplSyntaxOff |
| 2416 |
\usetikzlibrary{ fadings, patterns, arrows, decorations.markings } |
| 2417 |
\tikzset |
| 2418 |
{ |
| 2419 |
> = stealth', |
| 2420 |
every picture/.append style = |
| 2421 |
{ line join = round, line cap = round, thick } |
| 2422 |
} |
| 2423 |
% \end{macrocode} |
| 2424 |
% |
| 2425 |
% \begin{macrocode} |
| 2426 |
%</exam> |
| 2427 |
% \end{macrocode} |
| 2428 |
% |
| 2429 |
% \subsection{\module{l3doc} 模块的实现} |
| 2430 |
% |
| 2431 |
% \begin{macrocode} |
| 2432 |
%<*l3doc> |
| 2433 |
% \end{macrocode} |
| 2434 |
% |
| 2435 |
% \begin{macrocode} |
| 2436 |
\@@_provide_module:n {l3doc} |
| 2437 |
% \end{macrocode} |
| 2438 |
% 定义常用强调命令. |
| 2439 |
% \begin{macrocode} |
| 2440 |
\providecommand \module \texttt |
| 2441 |
\RenewDocumentCommand \pkg {m} |
| 2442 |
{ \href{https://ctan.org/pkg/#1}{\textsf{#1}} } |
| 2443 |
\RenewDocumentCommand \cls {m} |
| 2444 |
{ \href{https://ctan.org/pkg/#1}{\textsf{#1}} } |
| 2445 |
\NewDocumentCommand \mailto {m} { \texttt{<\href{mailto:#1}{#1}>} } |
| 2446 |
\def \@key #1 |
| 2447 |
{ \textcolor{red}{\textbf{\texttt{#1}}} ~ \normalfont \texttt{=} ~ } |
| 2448 |
\def \s@key #1{\textcolor{red}{\textbf{\texttt{#1}}}} |
| 2449 |
\DeclareRobustCommand \key {\@ifstar\s@key\@key} |
| 2450 |
% \end{macrocode} |
| 2451 |
% 用于输入键值对. |
| 2452 |
% \begin{macrocode} |
| 2453 |
\def \val #1{\meta{\textup{#1}}} |
| 2454 |
\def \TFF {true\textbar \textbf{false}} |
| 2455 |
\def \TTF {\textbf{true}\textbar false} |
| 2456 |
\newlist{keyval}{itemize}{10} |
| 2457 |
\setlist[keyval]{leftmargin = 0pt, labelsep = 0pt} |
| 2458 |
% \end{macrocode} |
| 2459 |
% 配置 \pkg{hyperref},调用所需宏包. |
| 2460 |
% \begin{macrocode} |
| 2461 |
\RequirePackage{ hyperref } |
| 2462 |
\RequirePackage [ svgnames ] { xcolor } |
| 2463 |
\hypersetup |
| 2464 |
{ |
| 2465 |
filecolor = DarkGreen, urlcolor = MidnightBlue, |
| 2466 |
linkcolor = FireBrick |
| 2467 |
} |
| 2468 |
\ExplSyntaxOff |
| 2469 |
\pdfstringdefDisableCommands |
| 2470 |
{ |
| 2471 |
\def \file #1 { <#1> } \def \pkg #1 { <#1> } |
| 2472 |
\def \cls #1 { <#1> } \def \mailto #1 { <#1> } |
| 2473 |
} |
| 2474 |
\RequirePackage{tikz} |
| 2475 |
\usetikzlibrary{calc} |
| 2476 |
\ExplSyntaxOn |
| 2477 |
\RequirePackage [ pass ] { geometry } |
| 2478 |
\RequirePackage { enumitem, dirtree, tabularx, |
| 2479 |
tasks, pdfpages, subcaption } |
| 2480 |
\graphicspath { {} } |
| 2481 |
\RequirePackage[fontset = fandol]{ctex} \linespread{1.4} |
| 2482 |
\dim_set:Nn \parindent {0pt} |
| 2483 |
\hook_gput_code:nnn { env/function/before } { . } |
| 2484 |
{ \vspace*{-.6\baselineskip} } |
| 2485 |
\hook_gput_code:nnn { env/syntax/after } { . } |
| 2486 |
{ \par\vspace*{.1\baselineskip} } |
| 2487 |
% \end{macrocode} |
| 2488 |
% 定义新的 \pkg{hologo} 标志. |
| 2489 |
% \begin{macrocode} |
| 2490 |
\def \HoLogo@ApTeX #1{\HOLOGO@mbox {Ap\kern -.1667em\TeX}} |
| 2491 |
\def \HoLogo@hduThesiS #1 |
| 2492 |
{ |
| 2493 |
\raisebox{-.5pt} |
| 2494 |
{ |
| 2495 |
\HOLOGO@mbox |
| 2496 |
{ |
| 2497 |
\tikz [ baseline = (hduthesis.base) ] |
| 2498 |
{ |
| 2499 |
\node [ inner~sep = 0pt ] (hduthesis) |
| 2500 |
{\sffamily\scshape hduThesi\scalebox{1.2}[1.2]{S}}; |
| 2501 |
\draw let \p1 = (hduthesis.west), |
| 2502 |
\p2 = (hduthesis.east) in (\x1,\y1) (\x2,\y2) |
| 2503 |
[ line~width = {.028pt * (\x2 - \x1)} ] |
| 2504 |
([yshift = -.5ex]hduthesis.north~west) |
| 2505 |
to [ bend~right = 5 ] |
| 2506 |
([yshift = .25ex]hduthesis.north~east); |
| 2507 |
} |
| 2508 |
} |
| 2509 |
} |
| 2510 |
} |
| 2511 |
\def \HoLogo@hduthesis #1 |
| 2512 |
{ \raisebox{-.5pt} { \HOLOGO@mbox { \scshape \cls{hduThesiS} } } } |
| 2513 |
% \end{macrocode} |
| 2514 |
% 重新定义封面布局. |
| 2515 |
% \begin{macrocode} |
| 2516 |
\let \old@maketitle \maketitle |
| 2517 |
\RenewDocumentCommand \maketitle {} |
| 2518 |
{ |
| 2519 |
\newgeometry { margin = 1.2in } |
| 2520 |
\titlepage |
| 2521 |
\old@maketitle |
| 2522 |
\begin{center} |
| 2523 |
\tikz |
| 2524 |
{ |
| 2525 |
\node [ opacity = .8 ] |
| 2526 |
{ |
| 2527 |
\includegraphics [ width = .14\paperwidth ] |
| 2528 |
{ hdu-motto.pdf } |
| 2529 |
}; |
| 2530 |
\node [ opacity = .3 ] |
| 2531 |
{ |
| 2532 |
\includegraphics [ width = .21\paperwidth ] |
| 2533 |
{ hdu-logo.pdf } |
| 2534 |
}; |
| 2535 |
} |
| 2536 |
\end{center} |
| 2537 |
\thispagestyle{empty} |
| 2538 |
} |
| 2539 |
\hook_gput_code:nnn { cmd/tableofcontents/before } { . } |
| 2540 |
{ \clearpage } |
| 2541 |
\hook_gput_code:nnn { cmd/tableofcontents/after } { . } |
| 2542 |
{ \endtitlepage \restoregeometry } |
| 2543 |
\date{ |
| 2544 |
Released ~ \hduthesis@date \quad \texttt{v\hduthesis@version} |
| 2545 |
\footnote{ |
| 2546 |
\url{https://github.com/\hduthesis@maintainerid/hduthesis}, ~ |
| 2547 |
\url{https://gitee.com/\hduthesis@maintainerid/hduthesis} |
| 2548 |
} |
| 2549 |
} |
| 2550 |
% \end{macrocode} |
| 2551 |
% |
| 2552 |
% \begin{macrocode} |
| 2553 |
%</l3doc> |
| 2554 |
% \end{macrocode} |
| 2555 |
% |
| 2556 |
% \end{implementation} |
| 2557 |
% \clearpage |
| 2558 |
% \PrintIndex |