diff options
Diffstat (limited to 'macros/xetex/latex')
-rw-r--r-- | macros/xetex/latex/hduthesis/README.md | 21 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/abstract.tex | 12 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/contents.tex | 345 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source.tex | 18 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a1.tex | 224 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a2.tex | 88 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a3.tex | 231 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a4.tex | 4 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a5.tex | 4 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a6.tex | 28 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/cha/source/a7.tex | 35 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/hduthesis.pdf | bin | 857818 -> 960114 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/doc/hduthesis.tex | 250 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/abstract.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/abstract.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha1.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha1.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha2.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha2.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha3.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha3.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha4.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha4.tex) | 4 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha5.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha5.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha6.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha6.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/cha7.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/cha7.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/cha/thanks.tex (renamed from macros/xetex/latex/hduthesis/examples/cha/thanks.tex) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0145.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0145.png) | bin | 18951 -> 18951 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0162.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0162.png) | bin | 14808 -> 14808 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0163.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0163.png) | bin | 6806 -> 6806 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0236.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0236.png) | bin | 4712 -> 4712 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0284.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0284.png) | bin | 6290 -> 6290 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0285.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0285.png) | bin | 11282 -> 11282 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0289.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0289.png) | bin | 17271 -> 17271 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0419.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0419.png) | bin | 13508 -> 13508 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0439.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0439.png) | bin | 9503 -> 9503 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/figures/image-0440.png (renamed from macros/xetex/latex/hduthesis/examples/figures/image-0440.png) | bin | 13350 -> 13350 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-bc.pdf (renamed from macros/xetex/latex/hduthesis/examples/hduthesis-bc.pdf) | bin | 478706 -> 489599 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-bc.tex (renamed from macros/xetex/latex/hduthesis/examples/hduthesis-bc.tex) | 5 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-pg.pdf (renamed from macros/xetex/latex/hduthesis/examples/hduthesis-pg.pdf) | bin | 153643 -> 182025 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-pg.tex (renamed from macros/xetex/latex/hduthesis/examples/hduthesis-pg.tex) | 7 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-stationery.pdf | bin | 0 -> 175923 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/hduthesis-stationery.tex (renamed from macros/xetex/latex/hduthesis/examples/hduthesis-stationery.tex) | 17 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/example/reference.bib (renamed from macros/xetex/latex/hduthesis/examples/reference.bib) | 0 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/examples/hduthesis-stationery.pdf | bin | 179443 -> 0 bytes | |||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-bc.config-module.code.tex | 58 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-hdu.l3doc-module.code.tex | 63 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-hdu.stationery-module.code.tex | 115 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-layout-module.code.tex | 53 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-pg.config-module.code.tex | 99 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis-typeset-module.code.tex | 14 | ||||
-rw-r--r-- | macros/xetex/latex/hduthesis/tex/hduthesis.cls | 30 |
47 files changed, 1319 insertions, 406 deletions
diff --git a/macros/xetex/latex/hduthesis/README.md b/macros/xetex/latex/hduthesis/README.md index ed26215292..6a92084e29 100644 --- a/macros/xetex/latex/hduthesis/README.md +++ b/macros/xetex/latex/hduthesis/README.md @@ -1,7 +1,6 @@ ## 杭州电子科技大学学位论文 LaTeX 模板 -杭州电子科技大学学位论文 LaTeX 模板以 `LaTeX-expl3` 构建. -模板提供杭州电子科技大学学士和硕士学位论文模板. +杭州电子科技大学学位论文 LaTeX 模板以 `LaTeX-expl3` 构建,提供杭州电子科技大学学士和硕士学位论文格式. `hduThesiS` 的模块提供以下支持: @@ -39,7 +38,7 @@ Modules of `hduThesiS` provide the following supports: - `hdu.l3doc`: Configuration for class's `l3doc` manual -**Welcome to pull requests [here](https://github.com/xiamyphys/hduthesis).** +**Welcome to pull requests [here](https://github.com/myhsia/hduthesis).** ## License @@ -53,18 +52,18 @@ The Current Maintainer of this work is [Mingyu Xia](https://www.ctan.org/author/ #### References -> [1]. The LaTeX3 Interfaces +> \[1\]. The LaTeX3 Interfaces -> [2]. CTeX 宏集 +> \[2\]. CTeX 宏集 -> [3]. LaTeX for package and class authors current version +> \[3\]. LaTeX for package and class authors current version -> [4]. The LaTeX2e Sources +> \[4\]. The LaTeX2e Sources -> [4]. The LaTeX3 kernel: style guide for code authors +> \[5\]. The LaTeX3 kernel: style guide for code authors -> [5]. Package `etoolbox`, `geometry`, `tocloft`, `fancyhdr`, etc. +> \[6\]. Package `etoolbox`, `geometry`, `tocloft`, `fancyhdr`, etc. -> [6]. [毕业设计(论文)的写作规范及格式要求(含写作模板)](https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm) +> \[7\]. [毕业设计(论文)的写作规范及格式要求(含写作模板)](https://jwc.hdu.edu.cn/2022/0428/c4555a153813/page.htm) -> [7]. [杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)](https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm) +> \[8\]. [杭州电子科技大学研究生学位论文格式统一要求(杭电研〔2012〕311号)](https://grs.hdu.edu.cn/2013/0507/c1730a51754/page.htm) diff --git a/macros/xetex/latex/hduthesis/doc/cha/abstract.tex b/macros/xetex/latex/hduthesis/doc/cha/abstract.tex new file mode 100644 index 0000000000..3bf688b19b --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/abstract.tex @@ -0,0 +1,12 @@ +\begin{abstract} + \hologo{hduthesis} 是杭州电子科技大学学位论文 \hologo{LaTeX} 模板,支持学士、硕士学位论文排版. +\end{abstract} + +\begin{center} + \small\bfseries 用户协议 +\end{center} +\begin{enumerate} [ itemsep = 0pt ] \small + \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件. + \item 本模板根据杭州电子科技大学教务处颁发的 \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm}{杭电理工类毕业论文写作规范} 编写而成,作者不对使用本模板产生的格式审查问题负责. \emph{如果您所在的学院因论文查重、收录等原因要求提交 \file{.docx} 格式,不接收 \file{.pdf} 论文稿件,请勿执意使用本模板,避免因格式转换带来不必要的麻烦.} 使用本模板时,请按编译错误提示操作来勾选同意用户协议. + \item 欢迎前往 GitHub 提交反馈意见,为推动学校认证与规范化 \hologo{hduthesis} 贡献力量. +\end{enumerate}
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/contents.tex b/macros/xetex/latex/hduthesis/doc/cha/contents.tex new file mode 100644 index 0000000000..72a5eb84da --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/contents.tex @@ -0,0 +1,345 @@ +\section{\hologo{hduthesis} 模板介绍} + +\hologo{hduthesis}(\textbf Hangzhou \textbf Dianzi \textbf University \hologo{LaTeX} \textbf{Thesis} Template) 是杭州电子科技大学学位论文 \underline{非官方} \hologo{LaTeX} 模板,以 \hologo{LaTeX3} 构建,支持学士和硕士学位论文排版. + +本模板文档将尽量完整地介绍模板的使用方法,如有不清楚之处,或者想提出改进建议,可以在 \href{https://github.com/myhsia/hduthesis/issues}{GitHub Issues} 提交反馈意见及贡献代码. + +对于未接触过 \hologo{LaTeX} 的初学者,推荐阅读 +\href{https://tug.ctan.org/info/lshort/english/lshort.pdf} + {\emph{The Not So Short Introduction to \hologo{LaTeX2e}}} +(可在终端执行 \cmd{texdoc lshort} 获取)或者其中文版 +\href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf} + {\emph{《一份(不太)简短的 \hologo{LaTeX2e} 介绍》}} +(可在终端执行 \cmd{texdoc lshort-zh-cn} 获取). + +\subsection{模板组成} + +\hologo{hduthesis} 模板的 \file{./tex/} 文件夹中包含了模板的所有 Runtime 文件. +其中,\file{hduthesis.cls} 是模板的核心文件,实质上并不提供主要功能,只用于对全局选项的控制加载模板的各个模块. 模板的功能模块如下 + +\begin{tasks}(2) + \task! \file{typeset}:排版模块,用于控制字体和公式设置. + \task! \file{layout}:版面模块,用于提供封面所用到的盒子和对输入文档信息的处理. + \task \file{bc.config}:本科学位论文配置模块. + \task \file{pg.config}:硕士学位论文配置模块. + \task \file{hdu.l3doc}:用户手册模块. + \task \file{hdu.stationery}:信纸模块. +\end{tasks} + +以上模块包含在 \file{hduthesis-}\meta{模块名}\file{-module.code.tex} 文件中. +同时,\file{./tex/} 文件夹中还包含了 \file{hdulogo.pdf}、\file{hdutitle.pdf}、\file{hdumotto.pdf}、\file{hdubadge.pdf},分别提供杭州电子科技大学校徽、校名、校训和校牌的矢量图. +\footnote + { + 这些矢量图均由 \href{https://www.hdu.edu.cn/666/list.htm}{校情纵览/校标规范} 所提供素材用 \href{https://inkscape.org}{Inkscape} 裁切制成. 如果你通过 \cmd{tlmgr} 安装了此模板,在其他文档类中也可以调用这些素材,并支持在 \hologo{XeLaTeX} 和 \hologo{pdfLaTeX} 编译器下使用 \cmd{Ti\textit k\/Z} 等方式设置透明度. + } + +模板预制的宏包有 + +\begin{table}[htbp] + \centering \renewcommand* \arraystretch {.72} + \begin{tabularx}{\linewidth}{*{9}{>{\footnotesize}X}} + \toprule + \pkg{amssymb} & \pkg{bm} & \pkg{booktabs} & + \pkg{cancel} & \pkg{circuitikz} & \pkg{cleveref} & + \pkg{derivative} & \pkg{extarrows} & \pkg{fixdif} \\ + \midrule + \pkg{hyperref} & \pkg{listings} & \pkg{mathtools} & + \pkg{multicol} & \pkg{pgfplots} & \pkg{physics2} & + \pkg{siunitx} & \multicolumn{2}{>{\footnotesize}l}{\pkg{unicode-math}}\\ + \bottomrule + \end{tabularx} +\end{table} + +\subsection{文件结构} + +\subsubsection{用户手册} + +\begin{center} + \begin{minipage}{.36\linewidth} + \dirtree + {% + .1 ./doc/. + .2 hduthesis.tex. + .2 hduthesis.pdf. + } + \end{minipage} + \hfill + \begin{minipage}{.6\linewidth} + \dirtree + {% + .1 ./example/. + .2 hduthesis-bc.tex, hduthesis-bc.pdf. + .2 hduthesis-pg.tex, hduthesis-pg.pdf. + } + \end{minipage} +\end{center} + +\subsubsection{Runtime 文件} + +\dirtree + {% + .1 ./tex/. + .2 hduthesis.cls. + .2 hduthesis-typeset-module.code. + .2 hduthesis-layout-module.code. + .2 hduthesis-bc.config-module.code. + .2 hduthesis-pg.config-module.code. + .2 hduthesis-hdu.l3doc-module.code. + .2 hduthesis-hdu.stationery-module.code. + .2 hdulogo.pdf, hdutitle.pdf, hdumotto.pdf, hdubadge.pdf. + } + +\subsubsection{许可证} + +\dirtree + {% + .1 ./LICENSE, README.md. + } +\section{模板安装} + +\subsection{系统要求} + +本模板支持在 \cmd{macOS}、\cmd{Windows}、\cmd{Linux}、\cmd{Overleaf}、\cmd{TeXPage} 等平台使用. +\footnote + { + 所使用的测试平台为 \cmd{macOS Sequoia Version 15.3}、\cmd{Ubuntu 24.04.1 LTS}、\cmd{Overleaf} 上的 \hologo{TeX} Live 2024 发行版,本模板均可顺利编译. + } +本模板最低兼容发行版 \hologo{TeX} Live 2022,推荐使用 \hologo{TeX} Live 2023 或更新版本. +\footnote + { 发行版 \hologo{TeX} Live 2022 中不包含 \pkg{physics2} 宏包,无法快捷输入等高括号. } +\footnote + { + 发行版 \hologo{TeX} Live 2022 中通过导言区设置中文字体伪粗体和伪斜体时可能遇到报错. 详情请见 3.2 节. + } +\footnote + { + 根据 \emph{Plan for \hologo{TeX} Live 2025: 22feb: code freeze for final build, major bug fixes only; 1mar: final updates from CTAN, final doc tweaks.} 本模板将于 2025 年 2 月 22 日移除对 \hologo{TeX} Live 2022 的兼容,建议 \hologo{TeX} Live 2022 用户尽快升级至最新发行版. + } +使用本模板生成学位论文,仅支持 \hologo{XeLaTeX} 编译;使用本模板生成信纸,支持 \hologo{pdfLaTeX} 编译. + +\subsection{标准安装} + +强烈建议您使用 \cmd{tlmgr} 进行安装与升级. 在终端(Terminal)执行以下命令即可安装最新版本的 \hologo{hduthesis} 模板. + +\begin{framed} + \begin{verbatim} + sudo tlmgr install hduthesis + \end{verbatim} +\end{framed} + +Windows 系统用户无需 \verb|sudo|,请以管理员身份运行命令提示符. 有些时候,您需要手动更新 \cmd{tlmgr} + +\begin{framed} + \begin{verbatim} + sudo tlmgr update --self + \end{verbatim} +\end{framed} + +才能正常使用 \cmd{tlmgr} 命令安装宏包. +如果您的 \hologo{TeX} 发行版不支持 \cmd{tlmgr},请尽快升级您的 \hologo{TeX} 发行版. +升级该模板,在终端(Terminal)执行以下命令即可 + +\begin{framed} + \begin{verbatim} + sudo tlmgr update hduthesis + \end{verbatim} +\end{framed} + +\subsection{手动安装} + +本模板已上传至 CTAN、GitHub 和 Gitee 平台. 可以直接从三个平台下载最新版本的 \hologo{hduthesis} 模板. 下载后,将 \file{./hduthesis/tex/} 文件夹中的所有 (runtime) 文件复制到 \file{./hduthesis/example/} 目录下,即可编译 \file{./hduthesis/example/} 文件夹中的样例. + +\section{全局选项} + +\subsection{用户协议} + +使用本模板编译本科、硕士学位论文时遇到``编译受阻''报错,请认真阅读封面的用户协议. +添加选项 \cmd{agreed} 后(即\verb|\documentclass [ agreed ] { hduthesis }|),方可顺利编译,\emph{并默认您已同意用户协议}. + +使用 \hologo{hduthesis} 编译信纸和本用户手册时,无需 \cmd{agreed} 选项. + +\subsection{字体设置} + +用户可通过全局选项设置文档的数学和中文字体. 设置的方式为键值对,键 \keys{\cmdmac~math-font} 用于设置数学字体,键 \keys{\cmdmac~CJKmain-font} 用于设置中文字体,键 \keys{\cmdmac~CJKsans-font} 用于设置中文无衬线字体. 以下是设置示例. + +\begin{framed} + \begin{verbatim} + \documentclass + [ + math-font = STIX Two Math, agreed, + CJKmain-font = {{Songti SC}[AutoFakeBold = 2.5, AutoFakeSlant]}, + CJKsans-font = {{STHeiti}[AutoFakeBold = 2]} + ] {hduthesis} + \end{verbatim} +\end{framed} + +如果你使用的是 \hologo{TeX} Live 2022,设置中文字体的伪粗体和伪斜体时可能会遇到报错. +在此发行版中,最多能对两个选项中的其一赋强度值,且被赋值选项需放在未被赋值选项前. + +更加详细的字体设置请参考 \pkg{xeCJK} 宏包的文档. + +\section{文档信息设置} + +\begin{function}{\DocInfo} + \begin{syntax} + \cs{DocInfo}\marg{keyvals} + \end{syntax} + + 此命令接收键值,用于设置文档信息. 键 \keys{\cmdmac~title} 用于设置论文标题,键 \keys{\cmdmac~department} 用于设置学院,键 \keys{\cmdmac~major} 用于设置专业,键 \keys{\cmdmac~class} 用于设置班级,键 \keys{\cmdmac~stdntid} 用于设置学号,键 \keys{\cmdmac~author} 用于设置作者,键 \keys{\cmdmac~supervisor} 用于设置导师,键 \keys{\cmdmac~bibsource} 用于设置插入参考文献文件源. 命令会根据输入的学号自动判断使用者为本科生/研究生. + + 命令 \cs{DocInfo} 需在导言区中执行. 完成文档信息输入后,在 \verb|\begin{document}| 后执行命令 \cs{maketitle} 会调用所设置的键值自动生成 \emph*{论文封面} 和 \emph*{目录}. +\end{function} + +本科生输入样例如下. 需要使用键 \keys{\cmdmac~title} 设置类型为毕业设计/毕业论文,使用斜线 (/) 分隔,如 \cmd{title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/毕业论文}. + +\begin{framed} + \begin{verbatim} + \DocInfo + { + title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ + 本科毕业设计, department = 理学院, major = 物理学, + bibsource = reference, class = 英才班, stdntid = C668668E, + author = 申智能, supervisor = 教授:葉芷晴, + } + \end{verbatim} +\end{framed} + +研究生输入样例如下. 硕士学位论文扉页需同时有英文版,因此需要在键 \keys{\cmdmac~title} \keys{\cmdmac~author} \keys{\cmdmac~supervisor} 中分别输入中文和英文信息,中英信息使用斜线 (\cmd/) 分隔,指导教师职称和姓名之间用半角冒号 (\cmd:) 分隔. + +\begin{framed} + \begin{verbatim} + \documentclass { hduthesis } + \DocInfo + { + title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ + \hologo{LaTeX} Template for Thesis at + Hangzhou Dianzi University, + major = 物理学, stdntid = 216686680, + author = 申智能/SAN Chi Nan, bibsource = reference + supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, + } + \end{verbatim} +\end{framed} + +\subsection{生成封面 \& 扉页} + +在正文区域,使用命令 \cmd{maketitle} 即可生成论文封面和扉页. 生成的封面和扉页会根据所设置的文档信息自动生成. + +\DescribeMacro{\l__hduthesis_grade_int} +封面上的论文完成日期和学生毕业年份会根据当前系统时间自动生成. +针对本科论文,如果当前月份在8月及以前,毕业年份会显示今年;如果当前月份在9月及以后,毕业年份会显示次年. 在 \cs{DocInfo} 后对整型 \cs{l__hduthesis_grade_int} 重新赋值可手动更改毕业年份. + +\begin{syntax} + \cs{ExplSyntaxOn} \cs{int_set:Nn} \cs{l__hduthesis_grade_int} \marg{Year} \cs{ExplSyntaxOff} +\end{syntax} + +\subsection{生成承诺书} + +\begin{function}{\commitment} + \begin{syntax} + \cs{commitment} \oarg{file1/yyyy-mm-dd, file2/yyyy-mm-dd, file3/yyyy-mm-dd} + \end{syntax} + + 此命令用于生成承诺书. 命令的可选参数接收数组,用于指定签名文件和输入签名的日期. 签名文件和签名的日期之间用 \cmd{/} 分隔,多组签名之间用 \cmd{,} 分隔. 签名文件接收 \file{.pdf} / \file{.png} / \file{.jpg} 等格式. 日期的输入格式为 \texttt{yyyy-mm-dd}. +\end{function} + +对于本科生,只需要签署 ``\emph*{诚信承诺}'' 一组签名;对于研生,则需要签署 ``\emph*{原创性声明}''、``\emph*{(作者同意)学位论文使用授权声明}'' 和 ``\emph*{(导师同意)学位论文使用授权声明}'' 三组签名. 使用用例如下 + +\begin{framed} + \begin{verbatim} + % 本科生使用用例 + ... \maketitle ... \commitment [ example-image-a/2024-05-31 ] ... + % 研究生使用用例 + ... \maketitle ... + \commitment + [ + example-image-a/2025-05-31, example-image-a/2025-05-31, + example-image-b/2025-06-01 + ] + \end{verbatim} +\end{framed} + +如果使用者暂未生成签名但是需要添加日期,则将签名文件留空即可,但分隔符 \cmd{/} 仍需保留. 例如 +\verb|\commitment [ /2024-05-31 ]|. 如果不需要添加日期,则直接留空即可. + +下两页分别为所生成的本科和硕士学位论文封面、扉页和承诺书缩略图. 可在终端执行 \cmd{texdoc hduthesis-bc} 和 \cmd{texdoc hduthesis-pg} 分别获取本科和硕士学位论文样例文件. + +\includepdfmerge + [ nup = 2x3, frame, linktodoc, scale = 0.96, delta = 1in .25in ] + { /Users/myhsia/Documents/GitHub/hduthesis/example/hduthesis-bc.pdf, 1-2, + /Users/myhsia/Documents/GitHub/hduthesis/example/hduthesis-pg.pdf, 1-4 } + +\section{章节设置} + +\subsection{输入中 / 英摘要} + +\DescribeEnv{abstract} +环境 \env{abstract} 用于生成摘要,其可选参数可设置语言格式. + +\DescribeMacro{\keywords} +命令 \cs{keywords} 需在 \env{abstract} 环境内执行,其会根据 \env{abstract} 环境所选择的语言,自动生成英文 / 中文格式的关键词. + +\begin{framed} + \begin{verbatim} + \begin{abstract}[en]...\keywords{keyword1, keyword2} \end{abstract} + \begin{abstract}[cn]...\keywords{关键词1, 关键词2} \end{abstract} + \end{verbatim} +\end{framed} + +通过命令 \cs{keywords} 以半角逗号 (,) 为分隔输入关键词列表,输出时会根据所处 \env{abstract} 环境选择的语言不同,自动以半 / 全角分号分隔. + +\subsection{输入目录 \& 正文} + +通过命令 \cs{tableofcontents} 可生成目录. \cs{chapter}、\cs{section}、\cs{subsection} 等章节级次均按照 \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm}{杭电理工类毕业论文写作规范} 定制. + +\subsection{参考文献 \& 附录} + +通过命令 \cs{DocInfo} 指定 \file{.bib} 文件后使用命令 \cs{printbiblography} 即可输出参考文献列表. 参考文献格式已设置为 \cmd{gb7714-2015}. 若未指定参考文献 \file{.bib} 文件,为加速编译,\pkg{gbt7714} 宏包将不会加载. + +可以直接使用带有星号的章节命令生成附录章节,如 \verb|\chapter*{附录}|. + +\clearpage + +\section{附加模块} + +\subsection{杭州电子科技大学信纸} + +加载全局选项 \pkg{stationery},并进行文档信息设置,即可生成信纸. 可用于推荐信撰写或生成笔记纸. +此模块无需 \pkg{agreed} 选项. + +\begin{framed} + \begin{verbatim} + \documentclass [ stationery ] { hduthesis } + \end{verbatim} +\end{framed} + +与学士 / 硕士学位论文文档信息设置类似,使用 \cs{DocInfo} 命令,对信件主题、发件人、邮箱、日期和水印进行设置. 此时 \cs{DocInfo} 命令接受键 +\keys{\cmdmac~title} \keys{\cmdmac~author} \keys{\cmdmac~mail} +\keys{\cmdmac~date} \keys{\cmdmac~watermark}. 下页为生成信纸的样例. + +\begin{framed} + \begin{verbatim} + \DocInfo + { + title = Recommendation Letter for SAN Chi Nan, + author = YIP Tsz Ching, mail = email@server.domain, + date = {23\textsuperscript{th} December, 2024}, + watermark = true + } + \end{verbatim} +\end{framed} + +若要在信纸上添加笔记线,可使用命令 \cs{noteLine}\oarg{num},其可选参数接收笔记线的数量,默认值为20. 下两页分别为生成的信纸和笔记纸样例,可在终端执行 \cmd{texdoc hduthesis-stationery} 获取此样例文件. + +\subsection{用户手册} + +本手册为 \cls{hduthesis} 加载选项 \pkg{l3doc} 后生成,此模块无需 \pkg{agreed} 选项. + +\begin{framed} + \begin{verbatim} + \documentclass [ l3doc ] { hduthesis } + \end{verbatim} +\end{framed} + +\includepdf[pages = -, nup = 1x2, angle = -90, frame, linktodoc, scale = 0.96, delta = 0in .25in] + {/Users/myhsia/Documents/GitHub/hduthesis/example/hduthesis-stationery}
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source.tex b/macros/xetex/latex/hduthesis/doc/cha/source.tex new file mode 100644 index 0000000000..c92777877f --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source.tex @@ -0,0 +1,18 @@ +\ExplSyntaxOn +\pagecolor{black!\fpeval{100-3200/255}} +\color{black!10} \color_select:n{black!10} \appendix +\colorlet{bg}{black!\fpeval{100-2400/255}} +\hypersetup + { filecolor = DarkGreen!40, urlcolor = MidnightBlue!40, + linkcolor = FireBrick!40 } +\cfoot{\color_select:n{black!10} \thepage} +\lhead{} \rhead{} \let \headrule \relax +\pagestyle{fancy} +\ExplSyntaxOff +\section{实现细节} + +恭喜你已经阅读到了这部分!如你所见,页面已经变成了程序员视力友好颜色. 下面这些内容面向 \hologo{LaTeX} 宏包开发者或者对 \hologo{hduthesis} 开发感兴趣的用户,如果您有任何意见或建议或想法,都欢迎到 \href{https://github.com/myhsia/hduthesis/issues}{GitHub} 提交Issue. 您对模板开发或者本文档的撰写的任何贡献都会受到诚挚欢迎! + +\setlength {\parindent} {0em} + +\foreach \i in {1,...,7} { \input{cha/source/a\i.tex} }
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a1.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a1.tex new file mode 100644 index 0000000000..4bb5fd10be --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a1.tex @@ -0,0 +1,224 @@ +\subsection{\file{hduthesis.cls} 的实现} + +文档类日期/版本号/开发者id +\begin{minted} [ linenos, bgcolor = bg, breaklines ] {tex} + \def\hduthesis@date{2024/12/23} + \def\hduthesis@version{0.5.0} + \def\hduthesis@maintainerid{myhsia} +\end{minted} + +调用 \pkg{etoolbox} 宏包用于给命令打补丁 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage{etoolbox} +\end{minted} + +提供 \cls{hduthesis} 文档类,设置文档类日期、版本号 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \ProvidesExplClass{hduthesis} {\hduthesis@date} {\hduthesis@version} + {LaTeX Class for Thesis at Hangzhou Dianzi University} +\end{minted} + +兼容 \hologo{TeX} Live 2022 及之后的版本. 当对应命令不存在时,在已有命令基础上新增变体 + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_if_exist:NF \seq_set_split:Nne + { \cs_generate_variant:Nn \seq_set_split:Nnn { Nne } } + \cs_if_exist:NF \seq_set_split:Nee + { \cs_generate_variant:Nn \seq_set_split:Nnn { Nee } } + \cs_if_exist:NF \tl_set:Ne + { \cs_generate_variant:Nn \tl_set:Nn { Ne } } + \cs_if_exist:NF \tl_gset:Ne + { \cs_generate_variant:Nn \tl_gset:Nn { Ne } } +\end{minted} + +定义新命令 \cs{hduthesis_msg_new:nn} 和 \cs{hduthesis_msg_error:nn} 用于新增错误消息和将错误消息广播到 Workspace +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected:Npn \hduthesis_msg_new:nn #1#2 + { \msg_new:nnn { hduthesis } {#1} {#2} } + \cs_new_protected:Npn \hduthesis_msg_error:nn #1#2 + { \msg_error:nnn { hduthesis } {#1} {#2} } +\end{minted} + +新增错误消息:用户协议 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \hduthesis_msg_new:nn { 用户协议 } + { \exp_not:n + { + hduThesiS~ 编译受阻.~ + 使用模板前请认真阅读模板说明文档封面上的「用户协议」~ + 模板作者不对使用本模板产生的格式审查问题负责~ + 添加选项 `agreed'[\documentclass[agreed]{hduthesis}]~ + 即可顺利编译并默认代表您已同意本协议.~ 祝君科研顺利!~ + 如遇问题,可邮件反馈至 xiamyphys@gmail.com. + } + } +\end{minted} + +对命令 \cs{hduthesis_msg_error:nn} 新增 \cmd{nx} 变体 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_generate_variant:Nn \hduthesis_msg_error:nn { nx } +\end{minted} + +新增错误消息:未找到模块 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \hduthesis_msg_new:nn { not found module } + { The~hduthesis~module~`#1'~not~found. } +\end{minted} + +定义命令 \cs{hduthesis_load_module:n} 用于加载模块,若模块不存在则输出错误消息 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected_nopar:Npn \hduthesis_load_module:n #1 + { + \file_if_exist_input:nF { hduthesis-##1-module.code.tex } + { \hduthesis_msg_error:nn { not found module } {##1} } + } +\end{minted} + +定义命令 \cs{hduthesis_provide_module:n} 用于提供模块 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected_nopar:Npn \hduthesis_provide_module:n #1 + { + \ProvidesExplFile{hduthesis-#1-module.code.tex} + {\hduthesis@date}{\hduthesis@version} + {hduThesiS~ \text_titlecase:n {#1} ~Module} + } +\end{minted} + +定义新数组 \cs{g__hdu_base_class_options_clist},用于存储文档类选项 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \clist_new:N \g__hdu_base_class_options_clist +\end{minted} + +定义文档类选项的键: +\begin{enumerate} + \item 布尔(Bool)值 \keys{\cmdmac~ agreed}:用户是否同意用户协议,初始值 \cmd{false}. 一旦输入 \cmd{agreed} 选项,则将 \cmd{agreed} 设置为 \cmd{true},即 \cmd{agreed} 等价于 \cmd{agreed = true} + \item 布尔(Bool)值 \keys{\cmdmac~ l3doc}:是否启用 \cls{l3doc} 文档类,初始值 \cmd{false}. 一旦输入 \cmd{l3doc} 选项,则将 \cmd{l3doc} 设置为 \cmd{true},即 \cmd{l3doc} 等价于 \cmd{l3doc = true} + \item 布尔(Bool)值 \keys{\cmdmac~ stationery}:是否启用 \cls{letter} 文档类,初始值 \cmd{false}. 一旦输入 \cmd{stationery} 选项,则将 \cmd{stationery} 设置为 \cmd{true},即 \cmd{stationery} 等价于 \cmd{stationery = true} + \item 令牌(token list)\keys{\cmdmac~ math-font}:数学字体 + \item 令牌(token list) \keys{\cmdmac~ CJKmain-font}:中文主字体 + \item 令牌(token list) \keys{\cmdmac~ CJKsans-font}:中文无衬线字体 + \item 令牌(token list) \keys{\cmdmac~ CJKmono-font}:中文等宽字体 + \item 未知选项 \keys{\cmdmac~ unknown}:将未知选项交给 \cs{__hduthesis_unknown_option:n} 处理 +\end{enumerate} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \keys_define:nn { hduthesis / classoption } + { + agreed .bool_set:N = \g__hduthesis_agreement_bool, + agreed .initial:n = false, + agreed .default:n = true, + l3doc .bool_set:N = \g__hduthesis_doc_bool, + l3doc .initial:n = false, + l3doc .default:n = true, + stationery .bool_set:N = \g__hduthesis_stationery_bool, + stationery .initial:n = false, + stationery .default:n = true, + math-font .tl_set:N = \g__hduthesis_math_font, + CJKmain-font .tl_set:N = \g__hduthesis_main_CJK_font, + CJKsans-font .tl_set:N = \g__hduthesis_sans_CJK_font, + CJKmono-font .tl_set:N = \g__hduthesis_mono_CJK_font, + unknown .code:n = \__hduthesis_unknown_option:n {#1}, + } +\end{minted} + +定义命令 \cs{__hduthesis_unknown_option:n} 用于处理未知选项 + +若未知选项为空,则将 \cs{l_keys_key_str} 加入 \cs{g__hdu_base_class_options_clist} 列表;否则设置 \cs{l_keys_key_str} 为未知选项,并将其加入 \cs{g__hdu_base_class_options_clist} 列表 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected_nopar:Npn \__hduthesis_unknown_option:n #1 + { + \tl_if_empty:nTF { #1 } + { + \clist_gput_right:NV \g__hdu_base_class_options_clist \l_keys_key_str + } + { + \exp_args:NNx \clist_gput_right:Nn \g__hdu_base_class_options_clist + { \l_keys_key_str = \exp_not:n {#1} } + } + } +\end{minted} + +处理文档类选项 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \ProcessKeyOptions [ hduthesis / classoption ] +\end{minted} + +若启用 \cmd{l3doc} 选项,加载 \cls{l3doc} 文档类为基底,加载 \file{hdu.l3doc} 模块并结束输入 + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \bool_if:NT \g__hduthesis_doc_bool + { + \PassOptionsToClass { 11pt, letterpaper } { l3doc } + \exp_args:NNV \LoadClass [ \g__hdu_base_class_options_clist ] { l3doc } + \hduthesis_load_module:n { hdu.l3doc } + \endinput + } +\end{minted} + +若启用 \cmd{stationery} 选项,加载 \cls{letter} 文档类为基底,加载 \file{hdu.stationery} 模块并结束输入 + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \bool_if:NT \g__hduthesis_stationery_bool + { + \PassOptionsToClass { 12pt } { letter } + \exp_args:NNV \LoadClass [ \g__hdu_base_class_options_clist ] { letter } + \hduthesis_load_module:n { hdu.stationery } + \endinput + } +\end{minted} + +为基本文档类 \cls{ctexrep} 添加选项 \keys{a4paper, zihao = -4},为 \pkg{xeCJK} 宏包添加选项 \keys{quiet, no-math},加载 \cls{ctexrep} 文档类为基底,并用 \cs{exp_args:NNV} 将未知选项展开加载到 \cls{ctexrep} 文档类上 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \PassOptionsToClass { a4paper, zihao = -4 } { ctexrep } + \PassOptionsToPackage { quiet, no-math } { xeCJK } + \exp_args:NNV \LoadClass [ \g__hdu_base_class_options_clist ] { ctexrep } +\end{minted} + +如果用户未确认用户协议,输出错误消息,并不加载 \pkg{hyperref} 宏包,以免因``遇到报错而停止编译''而产生额外的 \pkg{hyperref} 警告. 否则,加载 \pkg{hyperref} 宏包,设置 \pkg{hyperref} 宏包选项 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \bool_if:NTF \g__hduthesis_agreement_bool + { + \RequirePackage{hyperref} + \pdfstringdefDisableCommands + { + \def \cite#1 {<#1>} + \def \hologoRobust#1 {<#1>} + } + \AtBeginDocument + { \hypersetup { hidelinks, pdfproducer = hduThesiS~by~Mingyu~Xia } } + } { \hduthesis_msg_error:nn { 用户协议 } { 未确认 } } +\end{minted} + +预加载部分常用包,设置 \pkg{pgfplots} 宏包版本,设置 \pkg{hologo} 宏包字体,设置 \cs{graphicx} 包的相对路径 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage { siunitx, circuitikz, pgfplots, listings, + hologo, lipsum, zhlipsum, booktabs, multicol } + \pgfplotsset { compat = newest } + \hologoFontSetup { general = \sffamily } + \graphicspath + { + {./figure/}{./figures/}{./image/}{./images/} + {./graphics/}{./graphic/}{./pictures/}{./picture/} + } +\end{minted} + +加载 \cmd{typeset} 和 \cmd{layout} 模块. +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \hduthesis_load_module:n { typeset } + \hduthesis_load_module:n { layout } +\end{minted} + +定义命令 \cs{__hduthesis_docinfo_degree_if_aux} 用于判断学号长度,若学号长度为 8,则加载 \cmd{bc.config} 模块;否则加载 \cmd{bc.config} 或 \cmd{pg.config} 模块. 此命令将用在 \file{hduthesis-docinfo-module.code} 模块中,因为学号长度的判断必须发生在设置文档信息后 + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected:Nn \__hduthesis_docinfo_degree_if_aux: + { + \int_compare:nNnTF { \tl_count:N \l__docinfo_stdntid_tl } = { 8 } + { \hduthesis_load_module:n { bc.config } } + { \hduthesis_load_module:n { pg.config } } + } +\end{minted} + +结束 \file{hduthesis.cls} 文件 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \endinput +\end{minted}
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a2.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a2.tex new file mode 100644 index 0000000000..8c78b072a8 --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a2.tex @@ -0,0 +1,88 @@ +\subsection{\file{hduthesis-typeset-module.code} 的实现} + +提供模块 \file{typeset} 文件 +\begin{minted} [ linenos, bgcolor = bg, breaklines ] {tex} + \hduthesis_provide_module:n {typeset} +\end{minted} + +设置行间距 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \linespread{1.39} +\end{minted} + +设置首行缩进 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \dim_set:Nn \parindent { 2\ccwd } +\end{minted} + +新定义字体大小 \cs{semilarge} 和 \cs{semiLarge} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \newcommand \semilarge { \@setfontsize \semilarge{14}{16.5} } + \newcommand \semiLarge { \@setfontsize \semiLarge{16.5}{17.5} } +\end{minted} + +设置英文字体 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage{fontspec} + \setmainfont{texgyretermes} + [ + Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, + ItalicFont = *-italic, BoldItalicFont = *-bolditalic + ] + \setsansfont{texgyreheros} + [ + Extension = .otf, BoldItalicFont = *-bolditalic, + UprightFont = *-regular, BoldFont = *-bold, + ItalicFont = *-italic, Scale = .9, + ] +\end{minted} + +调用 \pkg{amssymb}, \pkg{mathtools}, \pkg{cancel}, \pkg{fixdif}, \pkg{derivative} 宏包 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage { amssymb, mathtools, cancel, fixdif, derivative } +\end{minted} + +如果存在 \pkg{physics2} 宏包,则调用并配置 \pkg{physics2} 宏包 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \file_if_exist:nTF { physics2.sty } + { + \RequirePackage{physics2} + \usephysicsmodule{ ab, braket, ab.legacy, op.legacy, bm-um.legacy } + } { \RequirePackage{bm} } +\end{minted} + +调用 \pkg{unicode-math} 宏包,并关闭警告 \texttt{mathtools-colon} 和 \texttt{mathtools-overbracket} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage + [ warnings-off = { mathtools-colon, mathtools-overbracket } ] {unicode-math} +\end{minted} + +设置数学环境的间距 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \AtBeginDocument + { + \dim_set:Nn \abovedisplayskip {3pt} + \dim_set:Nn \belowdisplayskip {3pt} + } +\end{minted} + +设置数学字体 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \tl_if_empty:NF \g__hduthesis_math_font + { \setmathfont { \g__hduthesis_math_font } } +\end{minted} + +设置中文字体,保留全局选项键值中的扩号以对应 \pkg{xeCJK} 宏包的接口. +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \tl_if_empty:NF \g__hduthesis_main_CJK_font + { \exp_last_unbraced:No \setCJKmainfont \g__hduthesis_main_CJK_font } + \tl_if_empty:NF \g__hduthesis_sans_CJK_font + { \exp_last_unbraced:No \setCJKsansfont \g__hduthesis_sans_CJK_font } + \tl_if_empty:NF \g__hduthesis_mono_CJK_font + { \exp_last_unbraced:No \setCJKmonofont \g__hduthesis_mono_CJK_font } +\end{minted} + +结束 \file{hduthesis-typeset-module.code} 文件 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \endinput +\end{minted} diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a3.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a3.tex new file mode 100644 index 0000000000..979f48225f --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a3.tex @@ -0,0 +1,231 @@ +\subsection{\file{hduthesis-layout-module.code} 的实现} + +提供模块 \file{layout} 文件 +\begin{minted} [ linenos, bgcolor = bg, breaklines ] {tex} + \hduthesis_provide_module:n {layout} +\end{minted} + +调用 \pkg{geometry}、\pkg{array}、\pkg{setspace}、\pkg{fancyhdr}、\pkg{enumitem}、\pkg{cleveref} 宏包 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage{geometry, array, setspace, fancyhdr, enumitem, cleveref} +\end{minted} + +调用并配置 \pkg{caption} 宏包 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage[skip = 1.75ex, labelsep = quad, font = small]{caption} +\end{minted} + +清空页眉页脚,设置页面样式为 \cmd{fancy} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \fancyhf{} + \pagestyle{fancy} +\end{minted} + +设置页眉线宽为 \cmd{.8pt} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \renewcommand*\headrulewidth{.8pt} +\end{minted} + +设置图表编号格式为 \texttt{\meta{chapter}-\meta{figure/table}} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \renewcommand*\thefigure {\arabic{chapter}-\arabic{figure}} + \renewcommand*\thetable {\arabic{chapter}-\arabic{table}} +\end{minted} + +设置公式编号格式为 \texttt{\meta{chapter}-\meta{equation}} +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \renewcommand*\theequation {\arabic{chapter}-\arabic{equation}} +\end{minted} + +减小图表后方与正文的间距 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \AddToHook{env/figure/after}{\vspace*{-2.3ex}} + \AddToHook{env/table/after}{\vskip-1.9ex} +\end{minted} + +设置 \cmd{enumerate} 环境的编号格式和缩进 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \setlist[enumerate,1] + { + label = (\,\arabic*\,), itemindent = 4em, leftmargin = 0em, + labelsep = 1ex, topsep = 0pt, itemsep = 0pt, partopsep = 0pt, + parsep = 0em, listparindent = 2\ccwd + } +\end{minted} + +设置引用格式 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \crefformat{figure}{图#2#1#3} + \crefformat{table}{表#2#1#3} +\end{minted} + +定义命令 \cs{__hduthesis_cover_spread_box:nn} 和 \cs{__hduthesis_cover_center_box:nn},用于生成封面中的分散与下划线居中对齐盒子. +\footnote + { \color{black!10} + 下划线居中对齐盒子的实现参考自 \href{https://tex.stackexchange.com/users/4427/egreg}{@egreg} 在 + \href{https://tex.stackexchange.com/questions/727960/how-to-center-a-series-of-text-width-a-fixed-width-that-can-automatically-linebr}{tex.stackexchange.com} 的解答. + } + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected:Npn \__hduthesis_cover_spread_box:nn #1#2 + { + \mode_leave_vertical: + \hbox_to_wd:nn {#1} + { \exp_args:Nee \tl_map_inline:nn {#2} { ##1 \hfil } \unskip } + } + \cs_new_protected:Npn \__hduthesis_cover_center_box:nn #1#2 + { % by @egreg on tex.stackexchange.com + \mode_leave_vertical: + \dim_set:Nn \l_tmpa_dim {#1} + \global\setbox1 = \box\voidb@x + \group_begin: + \setbox0 = \vbox + { + \dim_set:Nn \hsize {#1}\relax + \dim_set:Nn \parindent {0pt} + \skip_set:Nn \leftskip {0pt plus 1fil} + \skip_set:Nn \rightskip {0pt plus -1fil} + \skip_set:Nn \parfillskip {0pt plus 2fil} + #2 \par + \loop + \setbox2 = \lastbox + \unless\ifvoid2 + \global\setbox1 = \vtop + { \hbox to\hsize{\strut\unhbox2} + \vskip-4pt \hrule height .5pt + \vskip9.6pt \unvbox1 + } + \unskip\unpenalty + \repeat + } + \group_end: + \box1 + } +\end{minted} + +定义命令 \cs{__hduthesis_process_array:NnnN},用于处理一维或二维数组. 其中一级分隔符为 \texttt{:},二级分隔符为 \texttt{/}. +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected_nopar:Npn \__hduthesis_process_array:NnnN #1#2#3#4 + { + \seq_set_split:Nee \l__hduthesis_process_array_seq { / } {#1} + \seq_set_split:Nee \l__hduthesis_process_array_row_seq { \c_colon_str } + { \seq_item:Nn \l__hduthesis_process_array_seq {#2} } + \tl_if_eq:nnTF {#3} {:} + { \tl_gset:Ne #4 { \seq_use:Nn \l__hduthesis_process_array_row_seq {} } } + { + \tl_gset:Ne #4 { \seq_item:Nn \l__hduthesis_process_array_row_seq {#3} } + } + \seq_clear:N \l__hduthesis_process_array_seq + \seq_clear:N \l__hduthesis_process_array_row_seq + } +\end{minted} + +将十二个 \meta{month} 的英文名称存入 \cs{g_system_month_clist} 中 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \clist_set:Nn \g_system_month_clist + { + January, February, March, April, May, June, July, + August, September, October, November, December + } +\end{minted} + +定义文档信息的键 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \keys_define:nn { hduthesis / docinfo } + { + title .clist_set:N = \l__docinfo_title_tl, + department .tl_set:N = \l__docinfo_department_tl, + major .tl_set:N = \l__docinfo_major_tl, + class .tl_set:N = \l__docinfo_class_tl, + stdntid .tl_set:N = \l__docinfo_stdntid_tl, + author .clist_set:N = \l__docinfo_author_tl, + supervisor .tl_set:N = \l__docinfo_supervisor_tl, + bibsource .tl_set:N = \l__docinfo_bibsource_tl, + } +\end{minted} + +定义用户端文档信息的输入命令 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \NewDocumentCommand \DocInfo { m } + { + \keys_set:nn { hduthesis / docinfo } {#1} + \__hduthesis_docinfo_process_aux: + \__hduthesis_docinfo_degree_if_aux: + } +\end{minted} + +定义处理文档信息的辅助命令. 其中论文标题与作者信息为一维数组,指导教师信息为二维数组. +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_set_protected_nopar:Nn \__hduthesis_docinfo_process_aux: + { + \__hduthesis_process_array:NnnN \l__docinfo_title_tl {1} {:} \@title + \__hduthesis_process_array:NnnN \l__docinfo_title_tl {2} {:} + \l__docinfo_entitle_tl + \__hduthesis_process_array:NnnN \l__docinfo_author_tl {1} {:} \@author + \__hduthesis_process_array:NnnN \l__docinfo_author_tl {2} {:} + \l__docinfo_enauthor_tl + \__hduthesis_process_array:NnnN \l__docinfo_supervisor_tl {1} {1} + \l__docinfo_cnrole_tl + \__hduthesis_process_array:NnnN \l__docinfo_supervisor_tl {1} {2} + \l__docinfo_cnsupervisor_tl + \__hduthesis_process_array:NnnN \l__docinfo_supervisor_tl {2} {1} + \l__docinfo_enrole_tl + \__hduthesis_process_array:NnnN \l__docinfo_supervisor_tl {2} {2} + \l__docinfo_ensupervisor_tl + \bool_if:NF \g__hduthesis_agreement_bool + { \tl_clear:N \l__docinfo_bibsource_tl } + \tl_if_empty:NTF \l__docinfo_bibsource_tl + { + \newcommand*\printbibliography{\chapter*{参考文献}} + \renewcommand*\cite[1]{\textsuperscript{[##1]}} + } + { + \RequirePackage[sort&compress]{gbt7714} + \bibliographystyle{gbt7714-numerical} + \dim_set:Nn \bibsep {.35ex} + \newcommand*\printbibliography + { + \nocite{*} \bibliography { \l__docinfo_bibsource_tl } + \addcontentsline{toc}{chapter}{参考文献} + } + } + } +\end{minted} + +定义处理承诺书签名数组的辅助命令. 其中签名文件名需要展开后存入 \cs{g__hduthesis_signature_file_tl} 中. +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \cs_new_protected_nopar:Npn \__hduthesis_signature_process_aux:nnn #1#2#3 + { + \clist_set:Nn \l__hduthesis_signature_process_clist {#1} + \seq_set_split:Nne \l__hduthesis_signature_figure_seq {/} + { \clist_item:Nn \l__hduthesis_signature_process_clist {#2} } + \int_compare:nNnTF {#3} = {0} + { + \tl_set:Ne \l__hduthesis_signature_figure_tl + { \seq_item:Nn \l__hduthesis_signature_figure_seq { #3 + 1 } } + \seq_clear:N \l__hduthesis_signature_figure_seq + } + { + \seq_set_split:Nne \l__hduthesis_signature_date_seq {-} + { \seq_item:Nn \l__hduthesis_signature_figure_seq {2} } + \seq_item:Nn \l__hduthesis_signature_date_seq {#3} + \seq_clear:N \l__hduthesis_signature_date_seq + } + \clist_clear:N \l__hduthesis_signature_process_clist + } +\end{minted} + +定义插入签名图片的命令 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \NewDocumentCommand \signature { m } + { + \leavevmode@ifvmode + \lower \dimexpr \f@size\p@ * 9/16 + \hbox { \includegraphics [ height = { \fp_eval:n {2*\f@size}\p@ } ] {#1} } + } +\end{minted} + +结束模块 \file{hduthesis-layout-module.code} 文件 +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \endinput +\end{minted} diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a4.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a4.tex new file mode 100644 index 0000000000..e6f25c28e8 --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a4.tex @@ -0,0 +1,4 @@ +\subsection{\file{hduthesis-bc.config-module.code} 的实现} + +\cmd{bc.config} 模块实现的过程略,主要是对前面定义的命令进行调用,并通过 \cs{ctexset} +或对标准文档类 \cls{report} 中的命令进行重定义.
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a5.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a5.tex new file mode 100644 index 0000000000..a23e800966 --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a5.tex @@ -0,0 +1,4 @@ +\subsection{\file{hduthesis-pg.config-module.code} 的实现} + +\cmd{pg.config} 模块实现的过程略,主要是对前面定义的命令进行调用,并通过 \cs{ctexset} +或对标准文档类 \cls{report} 中的命令进行重定义.
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a6.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a6.tex new file mode 100644 index 0000000000..7efec03fbb --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a6.tex @@ -0,0 +1,28 @@ +\subsection{\file{hduthesis-hdu.l3doc-module.code} 的实现} + +模块 \file{hdu.l3doc} 的代码实现与之前类似,唯独不同的是添加了两个 \cs{hologo}: + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \def \HoLogo@hduThesiS #1 + { + \raisebox{-.5pt} + { + \HOLOGO@mbox + { + \tikz [ baseline = (hduthesis.base) ] + { + \node [ inner~sep = 0pt ] (hduthesis) + {\scshape \sffamily hduThesi\scalebox{1.2}[1.2]{S}}; + \draw let \p1 = (hduthesis.west), \p2 = (hduthesis.east) + in (\x1,\y1) (\x2,\y2) [ line~width = {.028pt * (\x2 - \x1)} ] + ([yshift = -.5ex]hduthesis.north~west) to[ bend~right = 5 ] + ([yshift = .25ex]hduthesis.north~east); + } + } + } + } + \def \HoLogo@hduthesis #1 + { \raisebox{-.5pt} { \HOLOGO@mbox { \scshape \cls{hduThesiS} } } } +\end{minted} + +前者 \hologo{hduThesiS} 使用在本用户手册封面中,将字母 \textsf{S} 放大 1.2 倍,并使用 \pkg{tikz} 绘制一条搭在字母 \textsf{T} 上的曲线. 后者 \hologo{hduthesis} 则单纯地使用无衬线且缩小的大写字体.
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/doc/cha/source/a7.tex b/macros/xetex/latex/hduthesis/doc/cha/source/a7.tex new file mode 100644 index 0000000000..a1d38534b2 --- /dev/null +++ b/macros/xetex/latex/hduthesis/doc/cha/source/a7.tex @@ -0,0 +1,35 @@ +\subsection{\file{hduthesis-hdu.stationery-module.code} 的实现} + +模块 \file{stationery} 的代码实现与之前类似. 不同的部分有使用钩子 \cmd{shipout} 来实现水印的添加 + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \DeclareHookRule { shipout / background } { hduthesis / stationery } + { before } { pgfrcs } + \AddToHook { shipout / background } [ hduthesis / stationery ] + { + \bool_if:NT \g__docinfo_watermark_bool + { + \tikz [ remember~picture, overlay ] + \node [ opacity = .2 ] at (current~page) + { \includegraphics [ width = .4\linewidth ] {hdulogo} }; + } + } +\end{minted} + +调用 \pkg{tikzpagenodes} 宏包用于定位版心的边缘,用循环句柄 \cs{int_step_inline:nn} 与 \cs{draw} 命令来实现横线的绘制. + +\begin{minted} [ linenos, firstnumber = last, bgcolor = bg, breaklines ] {tex} + \RequirePackage{tikzpagenodes} + \NewDocumentCommand \notelines {O{20}} + { + \tikz [ remember~picture, overlay ] + { + \int_step_inline:nn { #1 - 1 } + { + \draw [ hdu, very~thick, opacity = .6 ] + ([yshift = -##1 * (\textheight + .6in - 15.87pt ) / #1 + .3in] + current~page~text~area.north~west) --++ (\linewidth, 0); + } + } + } +\end{minted} diff --git a/macros/xetex/latex/hduthesis/doc/hduthesis.pdf b/macros/xetex/latex/hduthesis/doc/hduthesis.pdf Binary files differindex acfdd8e07c..c60ae766c7 100644 --- a/macros/xetex/latex/hduthesis/doc/hduthesis.pdf +++ b/macros/xetex/latex/hduthesis/doc/hduthesis.pdf diff --git a/macros/xetex/latex/hduthesis/doc/hduthesis.tex b/macros/xetex/latex/hduthesis/doc/hduthesis.tex index ee4c074375..cc62600e43 100644 --- a/macros/xetex/latex/hduthesis/doc/hduthesis.tex +++ b/macros/xetex/latex/hduthesis/doc/hduthesis.tex @@ -1,251 +1,33 @@ \documentclass[l3doc]{hduthesis} +\usepackage{minted} + \DocInfo { - title = The \hologo{hduthesis} Class\\ - \hologo{LaTeX} Thesis Template for - Hangzhou Dianzi University, - author = Mingyu Xia \mailto{xiamyphys@hdu.edu.cn} - \footnote{Physics Department, Graduate in 06/2025}, + title = \hologo{hduThesiS} 文档类\\ + 杭州电子科技大学学位论文 \hologo{LaTeX} 模板 + \footnote + { + 在 杭州电子科技大学非毕业生 / 教师 中寻找模板的继承维护者, + 要求熟悉 \pkg{expl3}. 欢迎有意愿者邮件联系作者. + }, + author = Mingyu Xia \mailto{xiamyphys@gmail.com} + \footnote{Physics Department, Graduate in 06/2025}, CJKmain-font = {[AutoFakeSlant]{Songti SC}}, CJKsans-font = {[BoldFont = Hei, AutoFakeSlant]{Heiti SC}}, - CJKmono-font = {[AutoFakeSlant]{LXGW WenKai Mono}} + CJKmono-font = {[AutoFakeSlant]{Kaiti SC}} } \begin{document} \maketitle -\begin{abstract} - \hologo{hduthesis} 是杭州电子科技大学学位论文 \hologo{LaTeX} 模板,支持学士、硕士学位论文排版. -\end{abstract} - -\begin{center} - \small\bfseries User Agreement -\end{center} -\begin{enumerate}\small - \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件. - \item 本模板根据杭州电子科技大学教务处颁发的 \href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm}{杭电理工类毕业论文写作规范} 编写而成,作者不对使用本模板产生的格式审查问题负责. \emph{如果您所在的学院因论文查重、收录等原因要求提交 \file{.docx} 格式,不接收 \file{.pdf} 论文稿件,请勿执意使用本模板,避免因格式转换带来不必要的麻烦.} 使用本模板时,请按编译错误提示操作来勾选同意用户协议. - \item 欢迎前往 GitHub 提交反馈意见,为推动学校认证与规范化 \hologo{hduthesis} 贡献力量. -\end{enumerate} -\endtitlepage -\restoregeometry - -\section{Introduction \& Loading \hologo{hduthesis}} - -本模板为杭州电子科技大学学位论文 \underline{非官方} \hologo{LaTeX} 模板, -以 \hologo{LaTeX3} 构建,支持学士和硕士学位论文排版. -加载 \hologo{hduthesis} 时遇到``编译受阻''报错,请认真阅读上页的用户协议. -键入全局选项 \cmd{agreed} 后,方可顺利进行编译,并默认您已同意用户协议. - -\begin{framed} - \begin{verbatim} - \documentclass [ agreed, ... ] { hduthesis } - \end{verbatim} -\end{framed} - -\section{Generate the Cover} - -\begin{function}{\DocInfo} - \begin{syntax} - \cs{DocInfo}\marg{keyvals} - \end{syntax} - - 此命令接收键值,用于设置文档信息. 键 \keys{\cmdmac~title} 用于设置论文标题,键 \keys{\cmdmac~department} 用于设置学院,键 \keys{\cmdmac~major} 用于设置专业,键 \keys{\cmdmac~class} 用于设置班级,键 \keys{\cmdmac~stdntid} 用于设置学号,键 \keys{\cmdmac~author} 用于设置作者,键 \keys{\cmdmac~supervisor} 用于设置导师,键 \keys{\cmdmac~bibsource} 用于设置插入参考文献文件源. 命令会根据输入的学号自动判断使用者为本科生/研究生. - - 命令 \cs{DocInfo} 需在导言区中执行. 完成文档信息输入后,在 \verb|\begin{document}| 后执行命令 \cs{maketitle} 会调用所设置的键值自动生成 \emph{论文封面} 和 \emph{诚信承诺书}. -\end{function} - -本科生输入样例如下. 需要使用键 \keys{\cmdmac~title} 设置类型为毕业设计/毕业论文,使用斜线 (/) 分隔,如 \cmd{title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/毕业论文}. - -\begin{framed} - \begin{verbatim} - \DocInfo - { - title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/毕业论文, - department = 理学院, major = 物理学, stdntid = 21668668, - author = 申智能, supervisor = 李智能, bibsource = reference - } - \end{verbatim} -\end{framed} - -下页的缩略图为本科毕业论文文档样例 \cmd{hduthesis-bc} 中的封面、扉页和承诺书. - -\includepdfmerge - [ angle = -90, nup = 1x2, frame, linktodoc, scale = 0.96, delta = 0 .25in ] - { /Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf, 1-2 } - -研究生输入样例如下. 硕士学位论文扉页需同时有英文版,因此需要在键 \keys{\cmdmac~title} \keys{\cmdmac~author} \keys{\cmdmac~supervisor} 中分别输入中文和英文信息,中英信息使用斜线 (\cmd/) 分隔. 如作者中文姓名为 \cmd{申智能},英文姓名为 \cmd{SAN Chi Nan},则键值输入格式为 \cmd{author = 申智能/SAN Chi Nan}. 指导教师职称和姓名之间用半角冒号 (\cmd:) 分隔. - -\begin{framed} - \begin{verbatim} - \documentclass { hduthesis } - \DocInfo - { - title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/ - \hologo{LaTeX} Template for Thesis at - Hangzhou Dianzi University, - major = 物理学, stdntid = 216686680, - author = 申智能/SAN Chi Nan, bibsource = reference - supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, - } - \begin{document} \maketitle ... \end{document} - \end{verbatim} -\end{framed} - -\DescribeMacro{\l__hduthesis_grade_int} -论文完成日期和学生毕业年份会根据当前系统时间自动生成. 如果当前月份在8月及以前,毕业年份会显示今年;如果当前月份在9月及以后,毕业年份会显示次年. 在 \cs{DocInfo} 后对整型 \cs{l__hduthesis_grade_int} 重新赋值可手动更改毕业年份. - -\begin{verbatim} - \ExplSyntaxOn \int_set:Nn \l__hduthesis_grade_int <Year> \ExplSyntaxOff -\end{verbatim} - -下页包含所生成的硕士学位论文封面、扉页和承诺书缩略图. 此文档样例可在终端执行 \cmd{texdoc hduthesis-pg} 获取. - -文档类同时提供了校徽 (\file{hdulogo.pdf})、校名 (\file{hdutitle.pdf}) 、校训 (\file{hdumotto.pdf})和校牌 (\file{hdubadge.pdf}) 的矢量素材,可直接使用. 以上文件均由 \href{https://www.hdu.edu.cn/666/list.htm}{校情纵览/校标规范} 所提供素材裁切制成,均支持在 \hologo{XeLaTeX} 和 \hologo{pdfLaTeX} 编译器下使用 \pkg{Ti\textit k\/Z} 等方式设置透明度. - -\includepdfmerge - [ nup = 2x2, frame, linktodoc, scale = 0.96, delta = .25in .25in ] - { /Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-pg.pdf, 1-8 } - -\section{Enter Abstract in EN / CN} - -\DescribeEnv{abstract} -环境 \env{abstract} 用于生成摘要,其可选参数可设置语言格式. - -\DescribeMacro{\keywords} -命令 \cs{keywords} 需在 \env{abstract} 环境内执行,其会根据 \env{abstract} 环境所选择的语言,自动生成英文 / 中文格式的关键词. - -\begin{framed} - \begin{verbatim} - \begin{abstract}[en]...\keywords{keyword1, keyword2} \end{abstract} - \begin{abstract}[cn]...\keywords{关键词1, 关键词2} \end{abstract} - \end{verbatim} -\end{framed} - -通过命令 \cs{keywords} 以半角逗号 (,) 为分隔输入关键词列表,输出时会根据所处 \env{abstract} 环境选择的语言不同,自动以半 / 全角分号分隔. 下图为生成的中/英摘要样例,可在终端执行 \cmd{texdoc hduthesis-bc} 获取此样例文件. - -\begin{figure}[htbp] - \centering - \fbox - { - \includegraphics[page = 3, width = .42\linewidth] - {/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf} } - \hfill - \fbox - { - \includegraphics[page = 4, width = .42\linewidth] - {/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf} } - \caption{样例文件 \file{hduthesis-bc.pdf}, Page 3 -- 4} -\end{figure} - -\section{Input Text} - -\hologo{hduthesis} 的 {chapter}、\cs{section}、\cs{subsection}、\cs{enumerate} 等段落级次均已按``\href{https://jwc.hdu.edu.cn/2022/0428/c4528a153813/page.htm}{杭电理工类毕业论文写作规范}''定制,可直接使用. - -如需插入参考文献,通过命令 \cs{DocInfo} 指定 \file{.bib} 文件后在要插入参考文献等地方输入 \cs{printbiblography} 即可输出参考文献列表. 参考文献格式已设置为 \cmd{gb7714-2015}. 若未指定参考文献 \file{.bib} 文件,为加速编译,\pkg{gbt7714} 宏包将不会加载. 同时,模板额外预置了以下宏包 - -\begin{table}[htbp] - \centering - \begin{tabular}{*{8}{>{\small}p{.096\linewidth}}} - \toprule - \pkg{amsmath} & \pkg{amssymb} & \pkg{bm} & \pkg{booktabs} & - \pkg{cancel} & \pkg{circuitikz}& \pkg{cleveref} & \pkg{derivative} \\ - \midrule - \pkg{extarrows} & \pkg{fixdif} & \pkg{listings} & \pkg{mathtools} & \pkg{multicol} & \pkg{pgfplots} & \pkg{physics2} & \pkg{siunitx}\\ - \bottomrule - \end{tabular} -\end{table} - -\begin{figure}[htbp] - \begin{subfigure}{.32\linewidth} - \centering - \fbox - { - \includegraphics[page = 5, width = .9\linewidth] - {/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf} - } - \caption{Table of Contents} - \end{subfigure} - \hfill - \begin{subfigure}{.32\linewidth} - \centering - \fbox - { - \includegraphics[page = 11, width = .9\linewidth] - {/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf} - } - \caption{Text} - \end{subfigure} - \hfill - \begin{subfigure}{.32\linewidth} - \centering - \fbox - { - \includegraphics[page = 12, width = .9\linewidth] - {/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-bc.pdf} - } - \caption{Text with figures} - \end{subfigure} -\end{figure} - -\hrule - -\begin{center} - \fbox - { \parbox[c][1.5em]{34ex}{\centering\file{hduthesis-pg.config-module}} } - \fbox { \parbox[c][1.5em]{32ex}{\centering\file{hduthesis-typeset-module}} } - \fbox { \parbox[c][1.5em]{15ex}{\centering\file{hdulogo.pdf}} }\\[2ex] - \fbox { \parbox[c][1.5em]{33ex}{\centering\file{hduthesis-bc.config-module}} } - \qquad \fbox { \parbox[c][1.5em]{16ex}{\centering\file{hdubadge.pdf}} } \qquad - \fbox { \parbox[c][1.5em]{16ex}{\centering\file{hdumotto.pdf}} }\\[2ex] - \fbox { \parbox[c][1.5em]{30ex}{\centering\file{hduthesis-layout-module}} }~ - \fbox { \parbox[c][1.5em]{16ex}{\centering\file{hdutitle.pdf}} } - \fbox - { \parbox[c][1.5em]{34ex}{\centering\file{hduthesis-stationery-module}} }~ -\end{center} - -\hrule - -\section{杭州电子科技大学信纸} - -加载全局选项 \pkg{stationery},并进行文档信息设置,即可生成信纸. 可用于推荐信撰写. -此模块无需 \pkg{agreed} 选项. - -\begin{framed} - \begin{verbatim} - \documentclass [ stationery ] { hduthesis } - \end{verbatim} -\end{framed} - -与学士 / 硕士学位论文文档信息设置类型,使用 \cs{DocInfo} 命令,对信件标题、发件人、机构、日期、电话和邮件信息进行设置. 此时 \cs{DocInfo} 命令接受键 -\keys{\cmdmac~title} \keys{\cmdmac~author} \keys{\cmdmac~affliction} -\keys{\cmdmac~date} \keys{\cmdmac~tel} \keys{\cmdmac~mail}. 下页为生成信纸的样例. - -\begin{framed} - \begin{verbatim} - \DocInfo - { - title = Recommendation Letter for SAN Chi Nan, - author = YIP Tsz Ching, - affliction = {Physics Department, Hangzhou Dianzi University}, - date = {25\textsuperscript{th} November, 2024}, - tel = (852) 3141-5926, - mail = xiamyphys@gmail.com - } - \end{verbatim} -\end{framed} - -\section{For Developers} +\input{cha/abstract.tex} -本手册为 \cls{hduthesis} 加载选项 \pkg{l3doc} 后生成,基于 \cls{l3doc} 文档类. +\setcounter{tocdepth}{2} \tableofcontents -\begin{framed} - \begin{verbatim} - \documentclass [ l3doc ] { hduthesis } - \end{verbatim} -\end{framed} +\input{cha/contents.tex} -\includepdf{/Users/xiamyphys/Desktop/LaTeXer/hduthesis/examples/hduthesis-stationery} +\input{cha/source.tex} \end{document} diff --git a/macros/xetex/latex/hduthesis/examples/cha/abstract.tex b/macros/xetex/latex/hduthesis/example/cha/abstract.tex index 6b78b6d13a..6b78b6d13a 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/abstract.tex +++ b/macros/xetex/latex/hduthesis/example/cha/abstract.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha1.tex b/macros/xetex/latex/hduthesis/example/cha/cha1.tex index 864fd1b3db..864fd1b3db 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha1.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha1.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha2.tex b/macros/xetex/latex/hduthesis/example/cha/cha2.tex index d7d50c5455..d7d50c5455 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha2.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha2.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha3.tex b/macros/xetex/latex/hduthesis/example/cha/cha3.tex index bfa795380f..bfa795380f 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha3.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha3.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha4.tex b/macros/xetex/latex/hduthesis/example/cha/cha4.tex index 697b58bcc9..68cd5a048f 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha4.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha4.tex @@ -74,9 +74,9 @@ $R_3$和$R_7$为输入匹配电阻。 \end{equation} 因而,放大器的增益: \begin{equation} - A_{Vf}=\frac{v_o}{v_s}=\frac{R_1+R_f}{R_1}=1+\frac{R_f}{R_1} + A_{V_f}=\frac{v_o}{v_s}=\frac{R_1+R_f}{R_1}=1+\frac{R_f}{R_1} \end{equation} - $\because A_{Vf}>0$,所以$v_o$与$v_s$同相。 + $\because A_{V_f}>0$,所以$v_o$与$v_s$同相。 \begin{figure}[htbp] \centering diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha5.tex b/macros/xetex/latex/hduthesis/example/cha/cha5.tex index 9d2e255e86..9d2e255e86 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha5.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha5.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha6.tex b/macros/xetex/latex/hduthesis/example/cha/cha6.tex index 1c5c628ad6..1c5c628ad6 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha6.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha6.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/cha7.tex b/macros/xetex/latex/hduthesis/example/cha/cha7.tex index 17d113c0f7..17d113c0f7 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/cha7.tex +++ b/macros/xetex/latex/hduthesis/example/cha/cha7.tex diff --git a/macros/xetex/latex/hduthesis/examples/cha/thanks.tex b/macros/xetex/latex/hduthesis/example/cha/thanks.tex index 303f13d429..303f13d429 100644 --- a/macros/xetex/latex/hduthesis/examples/cha/thanks.tex +++ b/macros/xetex/latex/hduthesis/example/cha/thanks.tex diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0145.png b/macros/xetex/latex/hduthesis/example/figures/image-0145.png Binary files differindex 7d390d38de..7d390d38de 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0145.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0145.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0162.png b/macros/xetex/latex/hduthesis/example/figures/image-0162.png Binary files differindex 75ed76eafc..75ed76eafc 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0162.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0162.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0163.png b/macros/xetex/latex/hduthesis/example/figures/image-0163.png Binary files differindex 9be35b5e63..9be35b5e63 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0163.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0163.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0236.png b/macros/xetex/latex/hduthesis/example/figures/image-0236.png Binary files differindex 5bed2083f9..5bed2083f9 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0236.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0236.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0284.png b/macros/xetex/latex/hduthesis/example/figures/image-0284.png Binary files differindex 59bca2a597..59bca2a597 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0284.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0284.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0285.png b/macros/xetex/latex/hduthesis/example/figures/image-0285.png Binary files differindex c1aae56755..c1aae56755 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0285.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0285.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0289.png b/macros/xetex/latex/hduthesis/example/figures/image-0289.png Binary files differindex 5860708d8f..5860708d8f 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0289.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0289.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0419.png b/macros/xetex/latex/hduthesis/example/figures/image-0419.png Binary files differindex 2af2fefab6..2af2fefab6 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0419.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0419.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0439.png b/macros/xetex/latex/hduthesis/example/figures/image-0439.png Binary files differindex de4cc1538b..de4cc1538b 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0439.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0439.png diff --git a/macros/xetex/latex/hduthesis/examples/figures/image-0440.png b/macros/xetex/latex/hduthesis/example/figures/image-0440.png Binary files differindex 4ccc02ea57..4ccc02ea57 100644 --- a/macros/xetex/latex/hduthesis/examples/figures/image-0440.png +++ b/macros/xetex/latex/hduthesis/example/figures/image-0440.png diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-bc.pdf b/macros/xetex/latex/hduthesis/example/hduthesis-bc.pdf Binary files differindex 7a87591efa..8d6248c1ff 100644 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-bc.pdf +++ b/macros/xetex/latex/hduthesis/example/hduthesis-bc.pdf diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-bc.tex b/macros/xetex/latex/hduthesis/example/hduthesis-bc.tex index 1c36b498a4..b25278428b 100644 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-bc.tex +++ b/macros/xetex/latex/hduthesis/example/hduthesis-bc.tex @@ -1,7 +1,7 @@ \documentclass [ math-font = STIX Two Math, agreed, - CJKmain-font = { {Songti SC}[AutoFakeSlant, AutoFakeBold = 2.5] }, + CJKmain-font = { {Songti SC}[AutoFakeBold = 2.5, AutoFakeSlant] }, CJKsans-font = { {STHeiti}[AutoFakeBold = 2] } ] {hduthesis} \tikzset{ > = stealth } @@ -9,7 +9,7 @@ \DocInfo { - title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/本科毕业设计~ (论文), + title = 杭州电子科技大学学位论文 \hologo{LaTeX} 模板/本科毕业设计, department = 理学院, major = 物理学, class = 英才班, @@ -22,6 +22,7 @@ \begin{document} \maketitle +\commitment [ example-image-a/2024-05-31 ] \input{cha/abstract.tex} diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-pg.pdf b/macros/xetex/latex/hduthesis/example/hduthesis-pg.pdf Binary files differindex 9b24ba3585..fb725211b9 100644 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-pg.pdf +++ b/macros/xetex/latex/hduthesis/example/hduthesis-pg.pdf diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-pg.tex b/macros/xetex/latex/hduthesis/example/hduthesis-pg.tex index dcf27d155a..4fe8063e98 100644 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-pg.tex +++ b/macros/xetex/latex/hduthesis/example/hduthesis-pg.tex @@ -17,12 +17,17 @@ stdntid = C668668E0, author = 申智能/SAN Chi Nan, supervisor = 教授:葉芷晴/Prof.:YIP Tsz Ching, - bibsource = reference + % bibsource = reference } \begin{document} \maketitle +\commitment + [ + example-image-a/2025-05-31, example-image-a/2025-05-31, + example-image-b/2025-06-01 + ] \begin{abstract}[cn] diff --git a/macros/xetex/latex/hduthesis/example/hduthesis-stationery.pdf b/macros/xetex/latex/hduthesis/example/hduthesis-stationery.pdf Binary files differnew file mode 100644 index 0000000000..b84ec14d24 --- /dev/null +++ b/macros/xetex/latex/hduthesis/example/hduthesis-stationery.pdf diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-stationery.tex b/macros/xetex/latex/hduthesis/example/hduthesis-stationery.tex index 71e7bd7cd8..4bc21e0f41 100644 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-stationery.tex +++ b/macros/xetex/latex/hduthesis/example/hduthesis-stationery.tex @@ -6,26 +6,29 @@ \DocInfo { title = Recommendation Letter for SAN Chi Nan, - author = YIP Tsz Ching, - affliction = {Physics Department, Hangzhou Dianzi University}, - date = {25\textsuperscript{th} November, 2024}, - tel = (852) 3141-5926, - mail = xiamyphys@gmail.com + author = YIP Tsz Ching, + mail = email@server.domain, + date = {23\textsuperscript{th} December, 2024}, + watermark = true } \begin{document} \maketitle -To whom it may concern: +Dear Prof. Wong, \lipsum[1-2] \vspace{\baselineskip} \raggedleft -Sincerely yours ,\\[2ex] +Sincerely yours,\\[4ex] \includegraphics[ height = 2em ]{hdutitle}\\[2ex] Professor of Department of Physics\\ Room \meta{int}, Building \meta{int}, Hangzhou Dianzi University +\clearpage + +\notelines[25] + \end{document}
\ No newline at end of file diff --git a/macros/xetex/latex/hduthesis/examples/reference.bib b/macros/xetex/latex/hduthesis/example/reference.bib index 5775cc077f..5775cc077f 100644 --- a/macros/xetex/latex/hduthesis/examples/reference.bib +++ b/macros/xetex/latex/hduthesis/example/reference.bib diff --git a/macros/xetex/latex/hduthesis/examples/hduthesis-stationery.pdf b/macros/xetex/latex/hduthesis/examples/hduthesis-stationery.pdf Binary files differdeleted file mode 100644 index 18c98062ca..0000000000 --- a/macros/xetex/latex/hduthesis/examples/hduthesis-stationery.pdf +++ /dev/null diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-bc.config-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-bc.config-module.code.tex index fa36d01ca6..c404557382 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-bc.config-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-bc.config-module.code.tex @@ -22,9 +22,6 @@ \begin{titlepage} \__hduthesis_cover_bc_aux: \end{titlepage} - \titlepage - \__hduthesis_promise_bc_aux: - \endtitlepage \restoregeometry } @@ -44,7 +41,7 @@ { \textbf { - \exp_args:Nne \__hduthesis_cover_spread_box:nn + \__hduthesis_cover_spread_box:nn { .205\paperwidth } { \l__docinfo_entitle_tl } } } @@ -57,8 +54,7 @@ >{\large\centering\arraybackslash\kaishu}p{.65\linewidth}@{} } \__hduthesis_cover_spread_box:nn { 4\ccwd } { 题目 } & - \__hduthesis_cover_center_box:nn { .95\linewidth } - { \l__docinfo_cntitle_tl }\\[5.2ex] + \__hduthesis_cover_center_box:nn { .95\linewidth } { \@title }\\[5.2ex] \__hduthesis_cover_spread_box:nn { 4\ccwd } { 学院 } & \__hduthesis_cover_center_box:nn { .95\linewidth } { \l__docinfo_department_tl }\\[5.2ex] @@ -72,8 +68,7 @@ \__hduthesis_cover_center_box:nn { .95\linewidth } { \l__docinfo_stdntid_tl }\\[5.2ex] \__hduthesis_cover_spread_box:nn { 4\ccwd } { 学生姓名 } & - \__hduthesis_cover_center_box:nn { .95\linewidth } - { \l__docinfo_cnauthor_tl }\\[5.2ex] + \__hduthesis_cover_center_box:nn { .95\linewidth } { \@author }\\[5.2ex] \__hduthesis_cover_spread_box:nn { 4\ccwd } { 指导教师 } & \__hduthesis_cover_center_box:nn { .95\linewidth } { \l__docinfo_cnsupervisor_tl \quad \l__docinfo_cnrole_tl }\\[5.2ex] @@ -87,23 +82,44 @@ \end{center} } -\cs_new_protected_nopar:Nn \__hduthesis_promise_bc_aux: +\NewDocumentCommand \commitment { O{} } + { + \newgeometry{ margin = 3cm } + \titlepage + \__hduthesis_commitment_bc_aux:n {#1} + \endtitlepage + \restoregeometry + } +\cs_new_protected_nopar:Npn \__hduthesis_commitment_bc_aux:n #1 { \vspace*{65\p@} \begin{center} \@beginparpenalty \@lowpenalty - \Large \textsf{\bfseries \__hduthesis_cover_spread_box:nn {6\ccwd}{诚信承诺}} + \Large \textsf + { \bfseries \__hduthesis_cover_spread_box:nn { 6\ccwd }{ 诚信承诺 } } \@endparpenalty \@M \end{center} \vspace*{.4\baselineskip} \par \linespread{2.1} - {\semilarge - 我谨在此承诺:本人所写的毕业论文《\l__docinfo_cntitle_tl》均系本人独立完成, + { \semilarge + 我谨在此承诺:本人所写的毕业论文《\@title 》均系本人独立完成, 没有抄袭行为,凡涉及其他作者的观点和材料,均作了注释,若有不实,后果由本人承担。 \par\vspace*{\baselineskip} \bfseries\sffamily \hskip.48\linewidth 承诺人(签名): - \vspace*{.5\baselineskip}\par - \hskip \dim_eval:n{ .48\linewidth + 2em } 年\qquad 月\qquad 日 + \__hduthesis_signature_process_aux:nnn {#1}{1}{0} + \tl_if_empty:NF \l__hduthesis_signature_figure_tl + { + \signature { \l__hduthesis_signature_figure_tl } + \tl_clear:N \l__hduthesis_signature_figure_tl + } + \par \vspace*{.5\baselineskip} + \hskip \dim_eval:n { .48\linewidth - 1em } + \makebox [ 3em ] + { \__hduthesis_signature_process_aux:nnn {#1}{1}{1} } 年 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{1}{2} } 月 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{1}{3} } 日 } } @@ -113,15 +129,16 @@ { \tl_set:Nn \l__keywords_name_tl {Keywords:~} \tl_set:Nn \l__keywords_sep_tl {;~} + \@beginparpenalty\@lowpenalty + \chapter*{\normalfont\bfseries ABSTRACT} } \str_if_eq:nnT {#1} {cn} { \tl_set:Nn \l__keywords_name_tl {\textsf{关键词:}} \tl_set:Nn \l__keywords_sep_tl {;} + \@beginparpenalty\@lowpenalty + \chapter*{摘\qquad 要} } - \@beginparpenalty\@lowpenalty - \str_if_eq:nnT {#1} {en} {\chapter*{\normalfont\bfseries ABSTRACT}} - \str_if_eq:nnT {#1} {cn} {\chapter*{摘\qquad 要}} } { \tl_clear:N \l__abstract_name_tl @@ -157,11 +174,8 @@ { chapter = { - name = {}, fixskip = true, - beforeskip = 21pt, afterskip = 34pt, - number = \arabic{chapter}, - format+ = \sffamily\large, - pagestyle = fancy + fixskip = true, name = {}, beforeskip = 21pt, format+ = \sffamily\large, + pagestyle = fancy, afterskip = 34pt, number = \arabic{chapter}, }, section = { diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.l3doc-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.l3doc-module.code.tex index ffe1dbeac3..d0d70b9267 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.l3doc-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.l3doc-module.code.tex @@ -8,7 +8,6 @@ CJKsans-font .tl_set:N = \g__docinfo_sans_CJK_font, CJKmono-font .tl_set:N = \g__docinfo_mono_CJK_font } - \NewDocumentCommand \DocInfo { m } { \keys_set:nn { hdu.l3doc / docinfo } {#1} @@ -17,8 +16,11 @@ \date { v\hduthesis@version - \footnote{\url{https://github.com/xiamyphys/hduthesis}}~ - (\hduthesis@date) + \footnote + { + \url{https://github.com/\hduthesis@maintainerid/hduthesis},~ + \url{https://gitee.com/\hduthesis@maintainerid/hduthesis} + }~ (\hduthesis@date) } \tl_if_empty:NF \g__docinfo_main_CJK_font { \exp_last_unbraced:No \setCJKmainfont \g__docinfo_main_CJK_font } @@ -28,29 +30,42 @@ { \exp_last_unbraced:No \setCJKmonofont \g__docinfo_mono_CJK_font } } -\hypersetup{urlcolor = teal, filecolor = violet} -\hologoFontSetup{general = \sffamily} -\RequirePackage[mono = false]{libertine} -\RequirePackage{geometry,framed,xeCJKfntef,tikz,pdfpages,subcaption} -\setlength{\oddsidemargin}{.9in} \setlength{\evensidemargin}{.1in} -\FrameSep = 0pt +\RequirePackage{ hyperref } +\RequirePackage [ svgnames ] { xcolor } +\hypersetup + { filecolor = DarkGreen, urlcolor = MidnightBlue, linkcolor = FireBrick } +\ExplSyntaxOff +\RenewDocumentCommand \pkg {m} { \href{https://ctan.org/pkg/#1}{\textsf{#1}} } +\RenewDocumentCommand \cls {m} { \href{https://ctan.org/pkg/#1}{\textsf{#1}} } +\NewDocumentCommand \mailto {m} { \texttt{<\href{mailto:#1}{#1}>} } +\pdfstringdefDisableCommands + { \def \file#1{<#1>} \def\pkg#1{<#1>} \def\cls#1{<#1>} \def\mailto#1{<#1>} } +\ExplSyntaxOn +\hologoFontSetup { general = \sffamily } +\RequirePackage [ mono = false ] { libertine } +\RequirePackage [ pass, verbose ] { geometry } +\RequirePackage + { fancyhdr, enumitem, tasks, tabularx, dirtree, framed, + xeCJKfntef, tikz, pdfpages, subcaption, datetime } +\pagestyle{plain} +\FrameSep = 0pt \yyyymmdddate \RequirePackage[os = mac]{menukeys} -\RequirePackage{datetime} \yyyymmdddate -\RequirePackage[fontset = none, scheme = plain]{ctex}\linespread{1.5} -\renewcommand \emph[1] - {\CJKsout*[thickness = 2.5ex, format = \color{blue!15}]{#1}} +\RequirePackage[fontset = none]{ctex} \linespread{1.4} +\def \@emph#1 { \CJKsout*[thickness = 2.5ex, format = \color{blue!15}]{#1} } +\def \s@emph#1 { \CJKunderwave*{#1} } +\renewcommand \emph { \@ifstar \s@emph \@emph } \hook_gput_code:nnn { env/function/before } { . } { \vspace{-2ex} } -\def\HoLogo@hduthesis#1 +\def \HoLogo@hduThesiS #1 { \raisebox{-.5pt} { \HOLOGO@mbox { - \tikz[baseline = (hduthesis.base)] + \tikz [ baseline = (hduthesis.base) ] { \node [ inner~sep = 0pt ] (hduthesis) - {\textsc{\cls{hduThesi\scalebox{1.2}[1.2]{S}}}}; + {\scshape \sffamily hduThesi\scalebox{1.2}[1.2]{S}}; \draw let \p1 = (hduthesis.west), \p2 = (hduthesis.east) in (\x1,\y1) (\x2,\y2) [ line~width = {.028pt * (\x2 - \x1)} ] ([yshift = -.5ex]hduthesis.north~west) to[ bend~right = 5 ] @@ -59,28 +74,28 @@ } } } +\def \HoLogo@hduthesis #1 + { \raisebox{-.5pt} { \HOLOGO@mbox { \scshape \cls{hduThesiS} } } } \let \legacy@maketitle \maketitle \RenewDocumentCommand \maketitle {} { + \newgeometry { margin = 1.2in } \titlepage - \newgeometry{margin = 1in} \legacy@maketitle \begin{center} \tikz { \node [ opacity = .8 ] - { \includegraphics[width = .15\paperwidth]{hdumotto.pdf} }; + { \includegraphics [ width = .14\paperwidth ] { hdumotto.pdf } }; \node [ opacity = .3 ] - { \includegraphics[width = .21\paperwidth]{hdulogo.pdf} }; + { \includegraphics [ width = .21\paperwidth ] { hdulogo.pdf } }; } \end{center} \thispagestyle{empty} } - -\NewDocumentCommand \mailto {m} - { \texttt{<\href{mailto:#1}{#1}>} } -\pdfstringdefDisableCommands - { \def\mailto#1{<#1>} } +\hook_gput_code:nnn { cmd/tableofcontents/before } { . } { \clearpage } +\hook_gput_code:nnn { cmd/tableofcontents/after } { . } + { \endtitlepage \restoregeometry } \endinput diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.stationery-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.stationery-module.code.tex index 1c13c626b3..43fbe1d81a 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.stationery-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-hdu.stationery-module.code.tex @@ -2,76 +2,107 @@ \keys_define:nn { hdu.stationery / docinfo } { - title .tl_set:N = \l__docinfo_title_tl, - author .tl_set:N = \l__docinfo_author_tl, - affliction .tl_set:N = \l__docinfo_affliction_tl, - date .tl_set:N = \l__docinfo_date_tl, - tel .tl_set:N = \l__docinfo_tel_tl, - mail .tl_set:N = \l__docinfo_mail_tl, + watermark .bool_set:N = \g__docinfo_watermark_bool, + watermark .initial:n = false, + watermark .default:n = true, + title .tl_set:N = \@title, + author .tl_set:N = \@author, + mail .tl_set:N = \l__docinfo_mail_tl, + date .tl_set:N = \@date } \RequirePackage{ hyperref, geometry, tikz, twemojis, fancyhdr } \NewDocumentCommand \DocInfo { m } { \keys_set:nn { hdu.stationery / docinfo } {#1} - \hypersetup { hidelinks, pdfauthor = \l__docinfo_author_tl } + \hypersetup { hidelinks, pdftitle = \@title, pdfauthor = \@author } } \geometry - { hmargin = .8in, bottom = 1.05in, top = 2.1in, + { hmargin = .8in, bottom = .75in, top = 1.95in, footskip = 15.87pt, headheight = 1.2in, headsep = .3in, footskip = .3in } \linespread{1.25} \RequirePackage [ skip = \baselineskip ] { parskip } \renewcommand* \familydefault { \sfdefault } -\tikzset{ every~node/.append~style = { opacity = .8 } } \definecolor{hdu}{HTML}{214395} -\renewcommand* \headrulewidth {1pt} -\renewcommand* \footrulewidth {1pt} +\renewcommand* \headrulewidth {2pt} +\renewcommand* \footrulewidth {2pt} \hook_gput_code:nnn { cmd/headrule/before } { . } { \color{hdu!80} } \hook_gput_code:nnn { cmd/footrule/before } { . } { \color{hdu!80} } \lhead - { - {}~ - \minipage{.64\linewidth} - \tikz [ baseline = -.6in ] - { \node { \includegraphics [ height = .75in ] { hdubadge } } } - \endminipage \hfill - \minipage{.32\linewidth} - \vbox - { - \raggedright \small - Date:~ - \tl_if_empty:NTF \l__docinfo_date_tl - { \today \par } - { \l__docinfo_date_tl \par } - \tl_if_empty:NF \l__docinfo_author_tl - { Name:~ \l__docinfo_author_tl \par } - \tl_if_empty:NF \l__docinfo_tel_tl - { Phone:~ \l__docinfo_tel_tl \par } - \tl_if_empty:NF \l__docinfo_mail_tl - { - Email:~ \href { mailto:\l__docinfo_mail_tl } - { \ttfamily \l__docinfo_mail_tl } - } - }\medskip + { {}~ + \minipage{.6\linewidth} + \medskip \leavevmode \lower -.111in + \hbox { \includegraphics [ height = .75in ] {hdubadge} } + \endminipage \medskip \hfill + \minipage{.36\linewidth} + \medskip \vbox + { \linespread{1.2} + \raggedright \small \color{hdu} + \texttwemoji{1f4cd}~ 1158~No.2~St.,~ Hangzhou,~ 310018\\ + \texttwemoji{1f4de}~ (86)~0571-86915072\\ + \texttwemoji{1f310}~ \url{www.hdu.edu.cn} + } \medskip \endminipage } -\cfoot - { \small \texttwemoji{1f4cd}~ +\lfoot + { + \small{}~ \texttwemoji{1f4cd}~ 1158~No.2~Street,~ Qiantang~District,~ - Hangzhou,~ Zhejiang~Province,~ 310018,~ China \qquad - \texttwemoji{1f310}~ www.hdu.edu.cn + Hangzhou,~ Zhejiang~Province,~ 310018,~ P.R.China } +\cfoot {} +\rfoot { \small \texttwemoji{1f310}~ www.hdu.edu.cn~ } \pagestyle{fancy} \renewcommand* \maketitle { - \l__docinfo_author_tl\\ - \l__docinfo_affliction_tl\\ - \textbf{\l__docinfo_title_tl} \par \vspace{.5\baselineskip} + \group_begin: \small + \bool_if:nF + { \tl_if_empty_p:N \@author && \tl_if_empty_p:N \l__docinfo_mail_tl } + { \makebox [ 4em ] [ l ] { \scshape From } } + \tl_if_empty:NTF \@author + { \@latex@warning@no@line {No \noexpand \author given} } { \@author{}~ } + \tl_if_empty:NF \l__docinfo_mail_tl + { \texttt { <\l__docinfo_mail_tl> } } + \bool_if:nT + { !\tl_if_empty_p:N \@author || !\tl_if_empty_p:N \l__docinfo_mail_tl } + { \\ } + \makebox [ 4em ] [ l ] { \scshape Date } + \tl_if_empty:NTF \@date \today \@date \\ + \tl_if_empty:NTF \@title + { \@latex@error {No \noexpand \title given}\@ehc } + { \makebox [ 4em ] [ l ] { \scshape Subject } \@title } + \par \vspace{.5\baselineskip} + \group_end: } \AtBeginDocument { \color_select:n {black!80} } +\DeclareHookRule { shipout / background } { hduthesis / stationery } + { before } { pgfrcs } +\AddToHook { shipout / background } [ hduthesis / stationery ] + { + \bool_if:NT \g__docinfo_watermark_bool + { + \tikz [ remember~picture, overlay ] + \node [ opacity = .2 ] at (current~page) + { \includegraphics [ width = .4\linewidth ] {hdulogo} }; + } + } + +\RequirePackage{tikzpagenodes} +\NewDocumentCommand \notelines {O{20}} + { + \tikz [ remember~picture, overlay ] + { + \int_step_inline:nn { #1 - 1 } + { + \draw [ hdu, very~thick, opacity = .6 ] + ([yshift = -##1 * (\textheight + .6in - 15.87pt ) / #1 + .3in] + current~page~text~area.north~west) --++ (\linewidth, 0); + } + } + } \newcommand \meta[1] { diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-layout-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-layout-module.code.tex index 8ff3467350..cfd2e72690 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-layout-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-layout-module.code.tex @@ -23,7 +23,7 @@ { \mode_leave_vertical: \hbox_to_wd:nn {#1} - { \exp_args:Nee \tl_map_inline:Nn {#2} { ##1 \hfil } \unskip } + { \exp_args:Nee \tl_map_inline:nn {#2} { ##1 \hfil } \unskip } } \cs_new_protected:Npn \__hduthesis_cover_center_box:nn #1#2 { % by @egreg on tex.stackexchange.com @@ -59,14 +59,10 @@ \seq_set_split:Nee \l__hduthesis_process_array_seq { / } {#1} \seq_set_split:Nee \l__hduthesis_process_array_row_seq { \c_colon_str } { \seq_item:Nn \l__hduthesis_process_array_seq {#2} } - \tl_if_eq:nnTF {#3} {~} + \tl_if_eq:nnTF {#3} {:} + { \tl_gset:Ne #4 { \seq_use:Nn \l__hduthesis_process_array_row_seq {} } } { - \tl_set:Ne #4 - { \seq_use:Nn \l__hduthesis_process_array_row_seq {} } - } - { - \tl_set:Ne #4 - { \seq_item:Nn \l__hduthesis_process_array_row_seq {#3} } + \tl_gset:Ne #4 { \seq_item:Nn \l__hduthesis_process_array_row_seq {#3} } } \seq_clear:N \l__hduthesis_process_array_seq \seq_clear:N \l__hduthesis_process_array_row_seq @@ -78,12 +74,12 @@ } \keys_define:nn { hduthesis / docinfo } { - title .clist_set:N = \l__docinfo_title_clist, + title .clist_set:N = \l__docinfo_title_tl, department .tl_set:N = \l__docinfo_department_tl, major .tl_set:N = \l__docinfo_major_tl, class .tl_set:N = \l__docinfo_class_tl, stdntid .tl_set:N = \l__docinfo_stdntid_tl, - author .clist_set:N = \l__docinfo_author_clist, + author .clist_set:N = \l__docinfo_author_tl, supervisor .tl_set:N = \l__docinfo_supervisor_tl, bibsource .tl_set:N = \l__docinfo_bibsource_tl, } @@ -95,13 +91,11 @@ } \cs_set_protected_nopar:Nn \__hduthesis_docinfo_process_aux: { - \__hduthesis_process_array:NnnN \l__docinfo_title_clist {1} {~} - \l__docinfo_cntitle_tl - \__hduthesis_process_array:NnnN \l__docinfo_title_clist {2} {~} + \__hduthesis_process_array:NnnN \l__docinfo_title_tl {1} {:} \@title + \__hduthesis_process_array:NnnN \l__docinfo_title_tl {2} {:} \l__docinfo_entitle_tl - \__hduthesis_process_array:NnnN \l__docinfo_author_clist {1} {~} - \l__docinfo_cnauthor_tl - \__hduthesis_process_array:NnnN \l__docinfo_author_clist {2} {~} + \__hduthesis_process_array:NnnN \l__docinfo_author_tl {1} {:} \@author + \__hduthesis_process_array:NnnN \l__docinfo_author_tl {2} {:} \l__docinfo_enauthor_tl \__hduthesis_process_array:NnnN \l__docinfo_supervisor_tl {1} {1} \l__docinfo_cnrole_tl @@ -130,4 +124,31 @@ } } +\cs_new_protected_nopar:Npn \__hduthesis_signature_process_aux:nnn #1#2#3 + { + \clist_set:Nn \l__hduthesis_signature_process_clist {#1} + \seq_set_split:Nne \l__hduthesis_signature_figure_seq {/} + { \clist_item:Nn \l__hduthesis_signature_process_clist {#2} } + \int_compare:nNnTF {#3} = {0} + { + \tl_set:Ne \l__hduthesis_signature_figure_tl + { \seq_item:Nn \l__hduthesis_signature_figure_seq { #3 + 1 } } + \seq_clear:N \l__hduthesis_signature_figure_seq + } + { + \seq_set_split:Nne \l__hduthesis_signature_date_seq {-} + { \seq_item:Nn \l__hduthesis_signature_figure_seq {2} } + \seq_item:Nn \l__hduthesis_signature_date_seq {#3} + \seq_clear:N \l__hduthesis_signature_date_seq + } + \clist_clear:N \l__hduthesis_signature_process_clist + } + +\NewDocumentCommand \signature { m } + { + \leavevmode@ifvmode + \lower \dimexpr \f@size\p@ * 9/16 + \hbox { \includegraphics [ height = { \fp_eval:n {2*\f@size}\p@ } ] {#1} } + } + \endinput diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-pg.config-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-pg.config-module.code.tex index 291f6a8b99..3d48d98931 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-pg.config-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-pg.config-module.code.tex @@ -24,9 +24,6 @@ \titlepage \__hduthesis_enoverleaf_pg_aux: \endtitlepage - \titlepage - \__hduthesis_promise_pg_aux: - \endtitlepage \restoregeometry \pagenumbering{Roman} \cfoot {\small \thepage} @@ -40,15 +37,13 @@ { \LARGE\__hduthesis_cover_spread_box:nn {.575\linewidth} {硕士学位论文} } \par\vspace*{100\p@} \semiLarge 题 \qquad 目: - \__hduthesis_cover_center_box:nn { .75\linewidth } - { \kaishu \l__docinfo_cntitle_tl } + \__hduthesis_cover_center_box:nn { .75\linewidth } { \kaishu \@title } \vspace*{24\p@}\par \begin{tabular} { >{\semiLarge\centering\arraybackslash}p{4\ccwd}@{} >{\semiLarge\centering\arraybackslash\kaishu}p{.65\linewidth}@{} } \__hduthesis_cover_spread_box:nn { 4\ccwd } { 研究生 } & - \__hduthesis_cover_center_box:nn { .96\linewidth } - { \l__docinfo_cnauthor_tl }\\ + \__hduthesis_cover_center_box:nn { .96\linewidth } { \@author }\\ \__hduthesis_cover_spread_box:nn { 4\ccwd } { 专业 } & \__hduthesis_cover_center_box:nn { .96\linewidth } { \l__docinfo_major_tl }\\ @@ -74,18 +69,15 @@ { \LARGE 杭州电子科技大学硕士学位论文 } \vspace*{140\p@} \par \begin{spacing}{1.15} - \huge\textsf{\l__docinfo_cntitle_tl} + \huge\textsf{ \@title } \end{spacing} \vspace*{128\p@} \par \begin{tabular}{>{\semiLarge}p{6.25\ccwd}>{\semiLarge\kaishu}l} \__hduthesis_cover_spread_box:nn { 4\ccwd } {研究生}:& - \__hduthesis_cover_spread_box:nn { 4\ccwd } - { \l__docinfo_cnauthor_tl }\\[2ex] + \__hduthesis_cover_spread_box:nn { 4\ccwd } { \@author }\\[2ex] \__hduthesis_cover_spread_box:nn { 4\ccwd } {指导教师}:& - % \exp_args:Nne \__hduthesis_cover_spread_box:nn { 4\ccwd } - { \l__docinfo_cnsupervisor_tl } \hskip1.5em - \l__docinfo_cnrole_tl + { \l__docinfo_cnsupervisor_tl } \hskip1.5em \l__docinfo_cnrole_tl \end{tabular} \par \vspace{60\p@} \semilarge \textsf{\int_use:N \c_sys_year_int} \kaishu 年 @@ -121,8 +113,17 @@ \int_use:N \c_sys_year_int \end{center} } - -\cs_new_protected_nopar:Nn \__hduthesis_promise_pg_aux: +\NewDocumentCommand \commitment { O{} } + { + \cfoot {} + \newgeometry{margin = 2.75cm} + \titlepage + \__hduthesis_commitment_pg_aux:n {#1} + \endtitlepage + \restoregeometry + \cfoot {\small \thepage} + } +\cs_new_protected_nopar:Npn \__hduthesis_commitment_pg_aux:n #1 { \vspace*{-12\p@} \begin{center} @@ -140,8 +141,21 @@ 对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。\par \noindent 申请学位论文与资料若有不实之处,本人承担一切相关责任。 \par \vspace*{1.25\baselineskip} - \noindent \makebox[.45\linewidth][l]{论文作者签名:} - 日期:\qquad 年\qquad 月\qquad 日 + \noindent \makebox[.45\linewidth][l] + { + 论文作者签名: + \__hduthesis_signature_process_aux:nnn {#1}{1}{0} + \tl_if_empty:NF \l__hduthesis_signature_figure_tl + { + \signature { \l__hduthesis_signature_figure_tl } + \tl_clear:N \l__hduthesis_signature_figure_tl + } + } + 日期: + \makebox [ 2.5em ] [ l ] + { \__hduthesis_signature_process_aux:nnn {#1}{1}{1} } 年 + \makebox [ 2em ] { \__hduthesis_signature_process_aux:nnn {#1}{1}{2} } 月 + \makebox [ 2em ] { \__hduthesis_signature_process_aux:nnn {#1}{1}{3} } 日 \par\vspace*{20\p@} \begin{center} \semilarge 学位论文使用授权说明 @@ -154,11 +168,41 @@ 学校有权保留送交论文的复印件,允许查阅和借阅论文;学校可以公布论文的全部或部分内容, 可以允许采用影印、缩印或其它复制手段保存论文。(保密论文在解密后遵守此规定) \par \vspace*{1.25\baselineskip} - \noindent \makebox[.45\linewidth][l]{论文作者签名:} - 日期:\qquad 年\qquad 月\qquad 日 + \noindent \makebox[.45\linewidth][l] + { + 论文作者签名: + \__hduthesis_signature_process_aux:nnn {#1}{2}{0} + \tl_if_empty:NF \l__hduthesis_signature_figure_tl + { + \signature { \l__hduthesis_signature_figure_tl } + \tl_clear:N \l__hduthesis_signature_figure_tl + } + } + 日期: + \makebox [ 2.5em ] [ l ] + { \__hduthesis_signature_process_aux:nnn {#1}{2}{1} } 年 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{2}{2} } 月 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{2}{3} } 日 \par \vspace*{\baselineskip} - \noindent \makebox[.45\linewidth][l]{指导教师签名:} - 日期:\qquad 年\qquad 月\qquad 日 + \noindent \makebox[.45\linewidth][l] + { + 指导教师签名: + \__hduthesis_signature_process_aux:nnn {#1}{3}{0} + \tl_if_empty:NF \l__hduthesis_signature_figure_tl + { + \signature { \l__hduthesis_signature_figure_tl } + \tl_clear:N \l__hduthesis_signature_figure_tl + } + } + 日期: + \makebox [ 2.5em ] [ l ] + { \__hduthesis_signature_process_aux:nnn {#1}{3}{1} } 年 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{3}{2} } 月 + \makebox [ 2em ] + { \__hduthesis_signature_process_aux:nnn {#1}{3}{3} } 日 \end{spacing} \end{spacing} } @@ -169,23 +213,18 @@ { \tl_set:Nn \l__keywords_name_tl {Keywords:~} \tl_set:Nn \l__keywords_sep_tl {,~} + \@beginparpenalty\@lowpenalty + \chapter*{\normalfont\bfseries Abstract} + \addcontentsline{toc}{chapter}{\bfseries Abstract} } \str_if_eq:nnT {#1} {cn} { \tl_set:Nn \l__keywords_name_tl {\textsf{关键词:}} \tl_set:Nn \l__keywords_sep_tl {,} - } - \@beginparpenalty\@lowpenalty - \str_if_eq:nnT {#1} {cn} - { + \@beginparpenalty\@lowpenalty \chapter*{摘要} \addcontentsline{toc}{chapter}{摘要} } - \str_if_eq:nnT {#1} {en} - { - \chapter*{\normalfont\bfseries Abstract} - \addcontentsline{toc}{chapter}{\bfseries Abstract} - } } { \tl_clear:N \l__abstract_name_tl diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis-typeset-module.code.tex b/macros/xetex/latex/hduthesis/tex/hduthesis-typeset-module.code.tex index 24b069a646..ed0878b025 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis-typeset-module.code.tex +++ b/macros/xetex/latex/hduthesis/tex/hduthesis-typeset-module.code.tex @@ -7,20 +7,24 @@ \setmainfont{texgyretermes} [ - Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic + Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, + ItalicFont = *-italic, BoldItalicFont = *-bolditalic ] \setsansfont{texgyreheros} [ Extension = .otf, BoldItalicFont = *-bolditalic, UprightFont = *-regular, BoldFont = *-bold, - ItalicFont = *-italic, scale = .9, + ItalicFont = *-italic, Scale = .9, ] -\RequirePackage { amssymb, extarrows, mathtools, - cancel, physics2, fixdif, derivative } +\RequirePackage { amssymb, mathtools, cancel, fixdif, derivative } +\file_if_exist:nTF { physics2.sty } + { + \RequirePackage{physics2} + \usephysicsmodule{ ab, braket, ab.legacy, op.legacy, bm-um.legacy } + } { \RequirePackage{bm} } \RequirePackage [ warnings-off = { mathtools-colon, mathtools-overbracket } ] {unicode-math} -\usephysicsmodule{ ab, braket, ab.legacy, op.legacy, bm-um.legacy } \AtBeginDocument { \dim_set:Nn \abovedisplayskip {3pt} diff --git a/macros/xetex/latex/hduthesis/tex/hduthesis.cls b/macros/xetex/latex/hduthesis/tex/hduthesis.cls index 048f8afc6d..1a3b42ed5b 100644 --- a/macros/xetex/latex/hduthesis/tex/hduthesis.cls +++ b/macros/xetex/latex/hduthesis/tex/hduthesis.cls @@ -20,15 +20,26 @@ %% hduthesis-hdu.l3doc-module.code, * %% hduthesis-hdu.stationery-module.code, * %% and README.md. * -%% available at https://github.com/xiamyphys/hduthesis * +%% available at https://github.com/myhsia/hduthesis * %% ***************************************************************************** -\def\hduthesis@date{2024/11/25} -\def\hduthesis@version{0.4.0} +\def\hduthesis@date{2024/12/23} +\def\hduthesis@version{0.5.0} +\def\hduthesis@maintainerid{myhsia} \RequirePackage{etoolbox} \ProvidesExplClass{hduthesis} {\hduthesis@date} {\hduthesis@version} {LaTeX Class for Thesis at Hangzhou Dianzi University} +% Module for TeX Live 2022 and (or) later +\cs_if_exist:NF \seq_set_split:Nne + { \cs_generate_variant:Nn \seq_set_split:Nnn { Nne } } +\cs_if_exist:NF \seq_set_split:Nee + { \cs_generate_variant:Nn \seq_set_split:Nnn { Nee } } +\cs_if_exist:NF \tl_set:Ne + { \cs_generate_variant:Nn \tl_set:Nn { Ne } } +\cs_if_exist:NF \tl_gset:Ne + { \cs_generate_variant:Nn \tl_gset:Nn { Ne } } + \cs_new_protected:Npn \hduthesis_msg_new:nn #1#2 { \msg_new:nnn { hduthesis } {#1} {#2} } \cs_new_protected:Npn \hduthesis_msg_error:nn #1#2 @@ -81,7 +92,7 @@ CJKmain-font .tl_set:N = \g__hduthesis_main_CJK_font, CJKsans-font .tl_set:N = \g__hduthesis_sans_CJK_font, CJKmono-font .tl_set:N = \g__hduthesis_mono_CJK_font, - unknown .code:n = \__hduthesis_unknown_option:n { #1 }, + unknown .code:n = \__hduthesis_unknown_option:n {#1}, } \cs_new_protected_nopar:Npn \__hduthesis_unknown_option:n #1 { @@ -98,7 +109,7 @@ \bool_if:NT \g__hduthesis_doc_bool { - \PassOptionsToClass{ 11pt, letterpaper } { l3doc } + \PassOptionsToClass { 11pt, letterpaper, kernel } { l3doc } \exp_args:NNV \LoadClass [ \g__hdu_base_class_options_clist ] { l3doc } \hduthesis_load_module:n { hdu.l3doc } \endinput @@ -106,7 +117,7 @@ \bool_if:NT \g__hduthesis_stationery_bool { - \PassOptionsToClass{ 12pt } { letter } + \PassOptionsToClass { 12pt } { letter } \exp_args:NNV \LoadClass [ \g__hdu_base_class_options_clist ] { letter } \hduthesis_load_module:n { hdu.stationery } \endinput @@ -120,8 +131,8 @@ \RequirePackage{hyperref} \pdfstringdefDisableCommands { - \def\cite#1{<#1>} - \def\hologoRobust#1{<#1>} + \def \cite#1 {<#1>} + \def \hologoRobust#1 {<#1>} } \AtBeginDocument { \hypersetup { hidelinks, pdfproducer = hduThesiS~by~Mingyu~Xia } } @@ -130,7 +141,7 @@ \RequirePackage { siunitx, circuitikz, pgfplots, listings, hologo, lipsum, zhlipsum, booktabs, multicol } \pgfplotsset { compat = newest } -\hologoFontSetup{general = \sffamily} +\hologoFontSetup { general = \sffamily } \graphicspath { {./figure/}{./figures/}{./image/}{./images/} @@ -146,5 +157,4 @@ } \endinput - % End of file hduthesis.cls |