texlive[74352] Master: hustthesis (28feb25)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 28 23:12:14 CET 2025


Revision: 74352
          https://tug.org/svn/texlive?view=revision&revision=74352
Author:   karl
Date:     2025-02-28 23:12:14 +0100 (Fri, 28 Feb 2025)
Log Message:
-----------
hustthesis (28feb25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/hustthesis/README.md
    trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis.pdf
    trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.dtx
    trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.ins
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cls
    trunk/Master/tlpkg/libexec/ctan2tds

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/hustthesis/README.zh-cn.md
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-d.def
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-doc.sty
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-m.def
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.bbx
    trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cbx

Removed Paths:
-------------
    trunk/Master/texmf-dist/bibtex/bst/hustthesis/
    trunk/Master/texmf-dist/doc/latex/hustthesis/fig-example.pdf
    trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis-en-example.pdf
    trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis-zh-example.pdf
    trunk/Master/texmf-dist/doc/latex/hustthesis/ref-example.bib
    trunk/Master/texmf-dist/tex/latex/hustthesis/hust-title.eps

Modified: trunk/Master/texmf-dist/doc/latex/hustthesis/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hustthesis/README.md	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/texmf-dist/doc/latex/hustthesis/README.md	2025-02-28 22:12:14 UTC (rev 74352)
@@ -1,49 +1,65 @@
 hustthesis
 ==========
 
-An Unofficial Thesis Template in LaTeX for [Huazhong University of Science and Technology](http://www.hust.edu.cn). See other templates in <http://hust-latex.github.io>.
+[![Latest Document](https://img.shields.io/github/v/release/hust-latex/hustthesis?label=Docs)](https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf)
+[![GitHub Release](https://img.shields.io/github/v/release/hust-latex/hustthesis?label=Release)](https://github.com/hust-latex/hustthesis/releases/latest)
+[![CTAN](https://img.shields.io/ctan/v/hustthesis?label=CTAN)](https://www.ctan.org/pkg/hustthesis)
+![GitHub repo size](https://img.shields.io/github/repo-size/hust-latex/hustthesis)
 
+>   中文版[点击这里](https://github.com/hust-latex/hustthesis/blob/master/README.zh-cn.md)。
+
+An Unofficial Thesis Template in LaTeX for [Huazhong University of Science and Technology](http://www.hust.edu.cn).
+Before using, please read the [user manual](https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf), which describes how to use the document class and its precautions.
+
 ## Requirement
 
-* Install the latest version of [TeXLive](http://www.tug.org/texlive/)(Recommend) or [MiKTeX](http://miktex.org/). Please ensure that all the packages are up-to-date.
-* Install following Chinese fonts:
-    * `AdobeSongStd-Light`
-    * `AdobeKaitiStd-Regular`
-    * `AdobeHeitiStd-Regular`
-    * `AdobeFangsongStd-Regular`
+For the best experience, please use the [TeX Live 2024](https://www.tug.org/texlive/) or later.
+Compiling the document requires either XeLaTeX or LuaLaTeX.
 
-## Usage
+## Installation
 
-**Important : This template can only be compiled by XeLaTeX or LuaLaTeX[Recommend].**
+The following methods are available for installing and updating the package.
+Choose the method that best suits your needs.
 
-* Manual: See [hustthesis.pdf](https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis.pdf).
-* Example: See [hustthesis-zh-example.pdf](https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-zh-example.pdf) and [hustthesis-en-example.pdf](https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-en-example.pdf).
+You can download the package from the [GitHub Release](https://github.com/hust-latex/hustthesis/releases/latest) page and unpack it to a suitable directory.
 
+
+For a full installation of the package, you can use a TeX repository manager such as TeX Live.
+This method will download the package from CTAN and install all required files to TeX Directory Structure (TDS).
+For command-line users, the following commands can be used:
+
+```bash
+tlmgr [--usermode] install hustthesis
+tlmgr [--usermode] update hustthesis
+```
+
+If you're a developer interested in contributing to the project's development, or simply want to try the latest features before they are officially released, you can clone the repository from GitHub and use either `l3build` or `make` to install the package.
+
+
 ## Disclaimer
 
 This template is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 ## License
-
-Original works are done by [Xu Cheng](https://github.com/xu-cheng). LPPL v1.3 is chosen to be the license of the project. Use as you desire.
+The Original v1.x works were created by [Xu Cheng](https://github.com/xu-cheng).
+Subsequent v2.x.x works were created by [Huang Yuxi](https://github.com/huangyxi).
+The project is licensed under the LPPL v1.3c. Feel free to use it as you wish.
 ```
 Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
-              2014-2016 by hust-latex <https://github.com/hust-latex>
+              2014-     by hust-latex <https://github.com/hust-latex>
+              2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
 
 This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
-of this license or (at your option) any later version.
-The latest version of this license is in
-  http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
+conditions of the LaTeX Project Public License, either
+version 1.3c of this license or (at your option) any later
+version. This version of this license is in
+   https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+   https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
 
-This work has the LPPL maintenance status `maintained'.
+This work has the LPPL maintenance status "maintained".
 
-The Current Maintainer of this work is hust-latex Organization.
-
-This work consists of the files hustthesis.bst, hustthesis.dtx,
-hustthesis.ins and the derived file hustthesis.cls
-along with its document and example files.
+The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
 ```
-

Added: trunk/Master/texmf-dist/doc/latex/hustthesis/README.zh-cn.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hustthesis/README.zh-cn.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hustthesis/README.zh-cn.md	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,62 @@
+hustthesis
+==========
+
+[![Latest Document](https://img.shields.io/github/v/release/hust-latex/hustthesis?label=Docs)](https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf)
+[![GitHub Release](https://img.shields.io/github/v/release/hust-latex/hustthesis?label=Release)](https://github.com/hust-latex/hustthesis/releases/latest)
+[![CTAN](https://img.shields.io/ctan/v/hustthesis?label=CTAN)](https://www.ctan.org/pkg/hustthesis)
+![GitHub repo size](https://img.shields.io/github/repo-size/hust-latex/hustthesis)
+
+>   To see English version, [click me](https://github.com/hust-latex/hustthesis/blob/master/README.md).
+
+非官方[华中科技大学](http://www.hust.edu.cn) LaTeX 学位论文文档类(模板)。
+使用前请阅读[使用手册](https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf),其中阐述了文档类的使用方法和注意事项。
+
+## 要求
+
+为了获得最佳体验,请使用 [TeX Live 2024](https://www.tug.org/texlive/) 或更高版本。
+编译文档需要使用 XeLaTeX 或 LuaLaTeX。
+
+## 安装
+
+有以下几种方式可以安装和更新该模板。请选择最适合您的方法。
+
+您可以从 [GitHub 发布页面](https://github.com/hust-latex/hustthesis/releases/latest) 下载该包,并将其解压到合适的目录。
+
+如果您希望完整安装该模板,可以使用 TeX Live 等 TeX 仓库管理工具。
+这种方式将从 CTAN 下载该模板并将所有必需的文件安装到 TeX 目录结构(TDS)中。
+命令行用户可以使用以下命令:
+```bash
+tlmgr [--usermode] install hustthesis
+tlmgr [--usermode] update hustthesis
+```
+
+如果您是开发者,想要参与项目开发,或者希望在正式发布之前体验最新功能,可以从 GitHub 克隆该仓库,并使用 `l3build` 或 `make` 安装模板。
+
+## 免责声明
+
+此模板为个人开发,如果因为使用这份模板蒙受了任何包括但不限于经济、学术上的损失,作者将不承担任何责任。
+
+## 开源协议
+
+模板 v1.x 原作者为 [许铖](https://github.com/xu-cheng)。
+后续 v2.x.x 版本由 [黄宇希](https://github.com/huangyxi) 制作和维护。
+该项目采用 LPPL v1.3c 许可证。请随意使用。
+```
+Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+              2014-     by hust-latex <https://github.com/hust-latex>
+              2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3c of this license or (at your option) any later
+version. This version of this license is in
+   https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+   https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+```


Property changes on: trunk/Master/texmf-dist/doc/latex/hustthesis/README.zh-cn.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/hustthesis/fig-example.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis-en-example.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis-zh-example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/hustthesis/hustthesis.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/hustthesis/ref-example.bib
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hustthesis/ref-example.bib	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/texmf-dist/doc/latex/hustthesis/ref-example.bib	2025-02-28 22:12:14 UTC (rev 74352)
@@ -1,13 +0,0 @@
- at BOOK{TEXGURU99,
-  AUTHOR        = "{\TeX}Guru",
-  TITLE         = "{\LaTeXe} Manual",
-  YEAR          = "1999"
-}
-
- at BOOK{knuth,
-  AUTHOR        = "{Donald E. Knuth}",
-  TITLE         = "The \TeX{}book",
-  publisher     = "Addison–Wesley Pub. Co.",
-  address       = "MA",
-  YEAR          = "1984"
-}

Modified: trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.dtx	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.dtx	2025-02-28 22:12:14 UTC (rev 74352)
@@ -1,4218 +1,5086 @@
 % \iffalse meta-comment
-% !TEX program  = LuaLaTeX
+% !TEX program = XeLaTeX
 %
-% hustthesis.dtx
+% DO NOT REMOVE THE MARK MANUALLY (used in l3build) -> %
 %
-% Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
-%               2014-2016 by hust-latex <https://github.com/hust-latex>
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-%   http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is hust-latex Organization.
-%
-% This work consists of the files hustthesis.bst, hustthesis.dtx,
-% hustthesis.ins and the derived file hustthesis.cls
-% along with its document and example files.
-%
-% \fi
-%
-% \iffalse
-%<*driver>
-\ProvidesFile{hustthesis.dtx}
-%</driver>
-%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{hustthesis}
-%<*class>
-[2016/11/17 v1.4 A Thesis Template for Huazhong University of Science and Technology]
-%</class>
-%
-%<*driver>
-\documentclass[12pt,a4paper,numbered,full]{l3doc}
+%<*internal>
+\iffalse
+%</internal>
+%<*internal>
+\fi
+\begingroup
+  \def\nameofLaTeXe{LaTeX2e}
+\expandafter\endgroup\ifx\fmtname\nameofLaTeXe\else
+\csname fi\endcsname
+%</internal>
+%<*install>
+\input docstrip
+\keepsilent
+\askforoverwritefalse
+\preamble
 
-\usepackage{fontspec}
-\setmainfont[Ligatures={Common,TeX}]{Tex Gyre Pagella}
-\setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-\setmonofont{CMU Typewriter Text}
-\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+    Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+                  2014-     by hust-latex <https://github.com/hust-latex>
+                  2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
 
-\usepackage{luatexja-fontspec}
-\setmainjfont[BoldFont={AdobeHeitiStd-Regular},ItalicFont={AdobeKaitiStd-Regular}]{AdobeSongStd-Light}
-\setsansjfont{AdobeKaitiStd-Regular}
-\defaultjfontfeatures{JFM=kaiming}
-\newjfontfamily\KAI{AdobeKaitiStd-Regular}
-\newjfontfamily\FANGSONG{AdobeFangsongStd-Regular}
+    This work may be distributed and/or modified under the
+    conditions of the LaTeX Project Public License, either
+    version 1.3c of this license or (at your option) any later
+    version. This version of this license is in
+       https://www.latex-project.org/lppl/lppl-1-3c.txt
+    and the latest version of this license is in
+       https://www.latex-project.org/lppl.txt
+    and version 1.3c or later is part of all distributions of LaTeX
+    version 2008 or later.
 
-\linespread{1.2}\selectfont
+    This work has the LPPL maintenance status "maintained".
 
-\usepackage[top=1.2in,bottom=1.2in,left=1.5in,right=1in]{geometry}
-\pagewidth=\paperwidth
-\pageheight=\paperheight
+    The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
 
-\usepackage{color}
-\usepackage[table]{xcolor}
+\endpreamble
+\postamble
 
-\definecolor{hyperreflinkred}{RGB}{128,23,31}
-\hypersetup{
-  unicode,
-  bookmarksnumbered=true,
-  bookmarksopen=true,
-  bookmarksopenlevel=0,
-  breaklinks=true,
-  colorlinks=true,
-  allcolors=hyperreflinkred,
-  linktoc=page,
-  plainpages=false,
-  pdfpagelabels=true,
-  pdfstartview={XYZ null null 1}
-}
-\usepackage{indentfirst}
-\setlength{\parindent}{2em}
+    This work consists of the files \jobname.dtx
+              and the derived files \jobname.ins,
+                                    \jobname.cls,
+                                    \jobname-doc.sty,
+                                    \jobname-m.def,
+                                    \jobname-d.def,
+                                    \jobname.cbx,
+                                    \jobname.bbx.
 
-\usepackage{titlesec,titletoc}
-\usepackage[titles]{tocloft}
-\setcounter{tocdepth}{2}
-\setcounter{secnumdepth}{3}
+\endpostamble
 
-\usepackage{enumitem}
-\setlist{noitemsep,partopsep=0pt,topsep=.8ex}
-\setlist[1]{labelindent=\parindent}
-\setlist[enumerate,1]{label=\arabic*.,ref=\arabic*}
-\setlist[enumerate,2]{label*=\arabic*,ref=\theenumi.\arabic*}
-\setlist[enumerate,3]{label=\emph{\alph*}),ref=\theenumii\emph{\alph*}}
-
-\usepackage{listings}
-\definecolor{lstgreen}{rgb}{0,0.6,0}
-\definecolor{lstgray}{rgb}{0.5,0.5,0.5}
-\definecolor{lstmauve}{rgb}{0.58,0,0.82}
-\lstset{
-  basicstyle=\footnotesize\ttfamily\FANGSONG,
-  keywordstyle=\color{blue}\bfseries,
-  commentstyle=\color{lstgreen}\itshape\KAI,
-  stringstyle=\color{lstmauve},
-  showspaces=false,
-  showstringspaces=false,
-  showtabs=false,
-  numbers=left,
-  numberstyle=\tiny\color{lstgray},
-  frame=lines,
-  rulecolor=\color{black},
-  breaklines=true
-}
-
-\AtBeginEnvironment{verbatim}{\small}
-\let\AltMacroFont\MacroFont
-
-\usepackage{metalogo}
-\usepackage{notes}
-\usepackage{tabularx}
-
-\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
-\setlength{\cftsecindent}{2em}
-\setlength{\cftsubsecindent}{4em}
-\makeatletter
-\newskip\HUST at oldcftbeforepartskip
-\HUST at oldcftbeforepartskip=\cftbeforepartskip
-\newskip\HUST at oldcftbeforesecskip
-\HUST at oldcftbeforesecskip=\cftbeforesecskip
-\let\HUST at oldl@part\l at part
-\let\HUST at oldl@section\l at section
-\let\HUST at oldl@subsection\l at subsection
-\def\l at part#1#2{\HUST at oldl@part{#1}{#2}\cftbeforepartskip=3pt}
-\def\l at section#1#2{\HUST at oldl@section{#1}{#2}\cftbeforepartskip=\HUST at oldcftbeforepartskip\cftbeforesecskip=3pt}
-\def\l at subsection#1#2{\HUST at oldl@subsection{#1}{#2}\cftbeforesecskip=\HUST at oldcftbeforesecskip}
-\makeatother
-
-\titleformat{\part}
+\generate
   {
-    \bfseries
-    \centering
-    \fontsize{18pt}{23.4pt}\selectfont
+%</install>
+%<*internal>
+    \usedir{source/latex/\jobname}
+    \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+%</internal>
+%<*install>
+    \usedir{tex/latex/\jobname}
+    \file{\jobname.cls}{\from{\jobname.dtx}{class}}
+    \file{\jobname-doc.sty}{\from{\jobname.dtx}{doc-sty}}
+    \file{\jobname-m.def}{\from{\jobname.dtx}{def-m}}
+    \file{\jobname-d.def}{\from{\jobname.dtx}{def-d}}
+    \file{\jobname.cbx}{\from{\jobname.dtx}{cbx}}
+    \file{\jobname.bbx}{\from{\jobname.dtx}{bbx}}
   }
-  {\thepart}
-  {1em}
-  {}
-\let\oldpart\part
-\def\part#1{\newpage\oldpart{#1}}
 
-\def\orvar{\textnormal{|}}
+\Msg{*********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the}
+\Msg{* following file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space \jobname.cls}
+\Msg{* \space\space \jobname.cbx}
+\Msg{* \space\space \jobname.bbx}
+\Msg{* \space\space \jobname-m.def}
+\Msg{* \space\space \jobname-d.def}
+\Msg{* \space\space hust-title.pdf}
+\Msg{*}
+\Msg{* To produce the documentation run the file \jobname.dtx}
+\Msg{* through LuaLaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{*********************************************************}
 
-\IndexPrologue
- {
-  \part{Index}
-  The~italic~numbers~denote~the~pages~where~the~
-  corresponding~entry~is~described,~
-  numbers~underlined~point~to~the~definition,~
-  all~others~indicate~the~places~where~it~is~used.
- }
+\endbatchfile
+%</install>
+%<*internal>
+\fi
+%</internal>
 
-\GlossaryPrologue
- {
-  \part{Change History}
- }
-
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-
-\def\email#1{
-  \href{mailto:#1}{\texttt{#1}}
+%<class>\NeedsTeXFormat{LaTeX2e}[2024-11-01]
+%<class>\ProvidesExplClass{hustthesis}
+%<doc-sty>\ProvidesExplClass{hustthesis-doc}
+%<def-m>\ProvidesExplFile{hustthesis-m.def}
+%<def-d>\ProvidesExplFile{hustthesis-d.def}
+%<cbx>\ProvidesFile{hustthesis.cbx}[Citation style for the hustthesis class]
+%<bbx>\ProvidesFile{hustthesis.bbx}[Bibliography style for the hustthesis class]
+%<class|doc-sty|def-m|def-d>  {2025-02-27}{2.0.0} %
+%<class>  {Thesis Template for Huazhong University of Science and Technology}
+%<doc-sty>  {Documentation for the hustthesis class}
+%<def-m>  {Definition file for the hustthesis class in master thesis}
+%<def-d>  {Definition file for the hustthesis class in doctoral thesis}
+%<*driver>
+\documentclass[]{\jobname}
+\usepackage{useclass}
+% Protect \maketitile from the redefinition in \cls{article} in \cls{l3doc}.
+\let\maketitleold=\maketitle
+\useclass*[full]{l3doc}
+\let\maketitle=\maketitleold
+\usepackage{\jobname-doc}
+\usepackage{mdframed}
+\begin{filecontents}[overwrite]{\jobname.bib}
+ at online{huang2024useclass,
+  title = {The useclass.sty Package: Load Classes as Packages},
+  author = {Huang, Yuxi},
+  year = {2024},
+  month = {mar},
+  day = {06},
+  url = {https://github.com/huangyxi/useclass},
 }
-
-\usepackage{xparse}
-\ExplSyntaxOn
-\DeclareDocumentCommand\pkgurl{o m}
-{
-    \IfNoValueTF{#1}
-    {
-        \href
-        {
-        http://mirrors.ctan.org/help/Catalogue/entries/
-        \str_fold_case:n {#2} .html
-        }
-        { \textsf{#2} }
-    }
-    {
-        \href
-        {
-        http://mirrors.ctan.org/help/Catalogue/entries/
-        \str_fold_case:n {#1} .html
-        }
-        { \textsf{#2} }
-    }
+ at online{zeng2023fduthesis,
+  title = {\cls{fduthesis}: 复旦大学论文模板},
+  author = {曾, 祥东},
+  year = {2023},
+  month = {may},
+  day = {27},
+  url = {https://github.com/stone-zeng/fduthesis},
 }
-\ExplSyntaxOff
+ at online{sjtug2024SJTUTeX,
+  title = {\cls{SJTU\TeX}: 上海交通大学文档类集},
+  author = {SJTUG},
+  year = {2024},
+  month = {feb},
+  day = {18},
+  url = {https://github.com/sjtug/SJTUTeX},
+}
+ at online{njulug2023njuthesis,
+  title = {南京大学学位论文模板},
+  author = {南京大学~Linux~用户组},
+  year = {2023},
+  month = {dec},
+  day = {05},
+  url = {https://github.com/nju-lug/NJUThesis},
+}
+ at online{hu2024bib,
+  title = {符合 GB/T 7714-2015 标准的 biblatex 参考文献样式},
+  author = {胡振震},
+  year = {2024},
+  month = {nov},
+  day = {15},
+  url = {https://github.com/hushidong/biblatex-gb7714-2015},
+}
+\end{filecontents}
+\begin{filecontents}[overwrite]{\jobname-fmt.bib}
+ at book{YanMingLi2006CFGZhuang,
+  title = {CFG桩复合地基技术及工程实践},
+  author = {{闫明礼} and {张东刚}},
+  date = {2006},
+  edition = {2},
+  publisher = {中国水利水电出版社},
+  location = {北京}
+}
+ at book{chalfi1998GreenFluo,
+  title = {Green fluorescent protein: properties, applications, and protocols},
+  editor = {Chalfie, Martin and {Steven R. Kain}},
+  date = {1998},
+  publisher = {Wiley-interscience},
+  location = {Hoboken, New Jersey},
+  pagetotal = {385}
+}
+ at article{ZhanXiangHong2004ZhongYiY,
+  title = {中医药防治阿尔茨海默病实验研究述要},
+  author = {{詹向红} and {李德新}},
+  date = {2004},
+  journaltitle = {中医药学刊},
+  volume = {22},
+  number = {11},
+  pages = {2094--2096}
+}
+ at article{lein2007Genomewide,
+  title = {Genome-wide atlas of gene expression in the adult mouse brain},
+  author = {Lein, Ed S. and Hawrylycz, Michael J. and Ao, Nancy and Ayres, Mikael and Bensinger, Amy and Bernard, Amy and Boe, Andrew F., et al.},
+  date = {2007-01},
+  journaltitle = {Nature},
+  volume = {445},
+  number = {7124},
+  pages = {168--176},
+  publisher = {Nature Publishing Group}
+}
+ at article{bouxse2010Guidelines,
+  title = {Guidelines for Assessment of bone microstructure in rodents using micro--computed tomography},
+  author = {Bouxsein, Mary L and Boyd, Stephen K and Christiansen, Blaine A and Guldberg, Robert E and Jepsen, Karl J and M\"uller, Ralph},
+  date = {2010},
+  journaltitle = {Journal of Bone and Mineral Research},
+  volume = {25},
+  number = {7},
+  pages = {1468--1486}
+}
+ at inproceedings{yamaki2018Performanc,
+  title = {Performance evaluation of phase-only correlation functions from the viewpoint of correlation {{Filters}}},
+  booktitle = {2018 {{Asia-Pacific Signal}} and {{Information Processing Association Annual Summit}} and {{Conference}} ({{APSIPA ASC}})},
+  author = {Yamaki, Shunsuke and Abet, Masahide and Kawamata, Masayuki and Yoshizawa, Makoto},
+  date = {2019},
+  pages = {1361--1364},
+  publisher = {Proceedings of the IEEE},
+  location = {Honolulu, HI, USA, 12-15 Nov. 2018}
+}
+ at article{yao2017BuildingE,
+  title = {Building efficient key-value stores via a lightweight compaction tree},
+  author = {Yao, Ting and Wan, Jiguang and Huang, Ping and He, Xubin and Wu, Fei and Xie, Changsheng},
+  date = {2017-11-24},
+  journaltitle = {ACM Trans. Storage},
+  volume = {13},
+  number = {4},
+  pages = {1--28}
+}
+ at patent{LiuJiaLin1993DuoGongN,
+  type = {patent},
+  title = {多功能一次性压舌板},
+  author = {刘加林},
+  holder = {{Individual}},
+  date = {1993-04-14},
+  number = {ZL92214985. 2},
+  location = {中国}
+}
+ at thesis{LiQingQuan1998JiYuHun,
+  type = {博士学位论文},
+  title = {基于混合结构的三维GIS数据模型与空间分析研究},
+  author = {{李清泉}},
+  namea = {{李德仁}},
+  nameatype = {collaborator},
+  date = {1998},
+  location = {武汉},
+  institution = {武汉大学武汉测绘科技大学}
+}
+\end{filecontents}
+\addbibresource{\jobname-fmt.bib}
+\addbibresource{\jobname.bib}
 
-\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
+\providecommand{\name}{\jobname}
+\providecommand{\clsname}{\cls{\name}}
 
 \begin{document}
-\DocInput{hustthesis.dtx}
+  \DocInput{\jobname.dtx}
+  \PrintChanges
+  \PrintIndex
 \end{document}
 %</driver>
 % \fi
 %
-% \CheckSum{1568}
+% \changes{v2.0.0}{2024-10-01}{使用 \LaTeX3 语法重构}
+% \changes{v2.0.0}{2024-10-01}{使用 \cls{useclass} 实现文档类“自举”}
 %
-% \iffalse
-%<*!(example-bib)>
-% \fi
-%% \CharacterTable
-%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%%  Digits        \0\1\2\3\4\5\6\7\8\9
-%%  Exclamation   \!     Double quote  \"     Hash (number) \#
-%%  Dollar        \$     Percent       \%     Ampersand     \&
-%%  Acute accent  \'     Left paren    \(     Right paren   \)
-%%  Asterisk      \*     Plus          \+     Comma         \,
-%%  Minus         \-     Point         \.     Solidus       \/
-%%  Colon         \:     Semicolon     \;     Less than     \<
-%%  Equals        \=     Greater than  \>     Question mark \?
-%%  Commercial at \@     Left bracket  \[     Backslash     \\
-%%  Right bracket \]     Circumflex    \^     Underscore    \_
-%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
-%%  Right brace   \}     Tilde         \~}
-% \iffalse
-%</!(example-bib)>
-% \fi
+% \hustsetup {
+%   info =
+%     {
+%       title = { \clsname{} v2.0.0:华中科技大学研究生学位论文\LaTeX{}文档类使用说明 }, %
+%       title* = { \clsname{} v2.0.0: \LaTeX{} Thesis Template for Huazhong University of Science and Technology }, %
+%       degree = { academic },
+%       degree* = { Engineering },
+%       author = { 黄宇希 },
+%       author* = { HUANG Yuxi },
+%       major = { \LaTeX{} 文档类设计 },
+%       major* = { \LaTeX{} Template Design },
+%       supervisor = { \TeX{}Book\quad{} 教授 },
+%       supervisor* = { Prof.~ \TeX{}Book },
+%date={2025-02-27},
+%     },
+% }
 %
-% \changes{v1.0}{2013/06/01}{Initial version}
-% \changes{v1.1}{2013/07/01}{Pack template using dtx and ins file}
-% \changes{v1.1}{2013/07/01}{Add language option}
-% \changes{v1.2}{2016/06/01}{Fix for TeXLive 2016. Remove \texttt{interfaces} and other problematic package}
-% \changes{v1.3}{2016/07/05}{Fix for \XeLaTeX}
-% \changes{v1.4}{2016/11/17}{Minor update to fulfill school requirement.}
-% \changes{v1.4}{2016/11/17}{Add command to custom apply name field.}
+% \maketitle
+% \frontmatter
+% \begin{abstract}
+%   \clsname{} 是华中科技大学研究生学位论文\LaTeX{}\emph{非官方}文档类。
+%   2.0.0 起版使用 \LaTeX3 语法重构,并且不再兼容之前的版本。
+%   目前仅支持\emph{中文硕士和博士}学位论文。
 %
-% \GetFileInfo{hustthesis.dtx}
+%   本文档类遵循 \LaTeX{} 项目公共许可证 1.3c(\LaTeX Project Public License 1.3c 版)的相关规定进行分发和修改。
+%   使用本文档类即表示您已知悉并同意该许可证的条款。
+%   本文档类按“原样”提供,不附带任何明示或暗示的保证,包括但不限于适销性或特定用途的适用性。
+%   作者不对因使用本文档类导致的任何直接或间接损失承担责任。
+%   请在修改和分发本文档类时遵循许可证的相关要求,以确保其完整性和可维护性。
 %
-% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ ,\,}
-% \DoNotIndex{\def,\if,\else,\fi,\gdef,\long,\let}
-% \DoNotIndex{\@ne,\@nil}
-% \DoNotIndex{\begingroup,\endgroup,\advance}
-% \DoNotIndex{\newcommand,\renewcommand}
-% \DoNotIndex{\newenvironment,\renewenvironment}
-% \DoNotIndex{\RequirePackage}
+%   本项目代码托管在 GitHub \url{https://github.com/hust-latex/hustthesis},
+%   最新版的 \clsname{} 文档类手册请访问
+%   \url{https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf}。
 %
-% \title{A Thesis Template for Huazhong University of Science and Technology: the \textsf{hustthesis} class
-% \thanks{This document corresponds to \textsf{hustthesis.cls}~\fileversion, dated \filedate.}}
-% \author{Xu Cheng \\ \email{xucheng at me.com}}
-% \date{\today}
+%   \keywords 华中科技大学;学位论文文档类;\LaTeX;\LaTeX3
+% \end{abstract}
 %
-% \begingroup
-% \hypersetup{allcolors=black}
-% \maketitle
-% \endgroup
-% \tableofcontents
+% \begin{abstract*}
+%   \clsname{} is an Unofficial \LaTeX{} thesis template for Huazhong University of Science and Technology.
+%   Version 2.0.0 and later are written in \LaTeX3 and are not compatible with previous versions.
+%   Currently, it only supports Science and Engineering master's and doctoral theses in Chinese.
 %
-% \part{Introduction}
+%   This template is distributed and modified under the terms of the \LaTeX Project Public License 1.3c.
+%   By using this template, you acknowledge and agree to the terms of this license.
+%   This template is provided ``as is'' without any express or implied warranty, including but not limited to
+%   merchantability or fitness for a particular purpose.
+%   The author is not responsible for any direct or indirect losses arising from the use of this template.
+%   Please follow the relevant requirements of the license when modifying and distributing this template
+%   to ensure its integrity and maintainability.
 %
-% This is a thesis template for \href{http://www.hust.edu.cn/}{Huazhong University of Science \& Technology}. This template is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+%   This project is hosted on GitHub
+%   \url{github.com/hust-latex/hustthesis},
+%   and the latest version of the \clsname{} documentation can be found at
+%   \url{github.com/hust-latex/hustthesis/releases/latest/download/hustthesis.pdf}.
 %
-% The whole project is published under LPPL v1.3 License at \href{https://github.com/hust-latex/hustthesis}{GitHub}.
+%   \keywords* Huazhong University of Science and Technology, Dissertation Template, \LaTeX, \LaTeX3
+% \end{abstract*}
 %
-% 中文使用说明见\autoref{part:中文使用说明}。
+% \tableofcontents
+% \mainmatter
 %
-% English version instruction is in \autoref{part:English Version Instruction}.
+% \begin{documentation}
 %
-% \part{中文使用说明}\label{part:中文使用说明}
+% \chapter{\clsname{} 介绍}
 %
-% \section{使用必要条件}
+% \clsname{} 是华中科技大学研究生学位论文\LaTeX{}文档类,
+% 旨在为华科学生提供一个简单上手,易于使用的学位论文文档类。
 %
-% \begin{enumerate}
-%     \item 安装最新版本的\href{http://www.tug.org/texlive/}{\texttt{TeXLive}}(推荐)或\href{http://miktex.org/}{\texttt{MiKTeX}}。因为未及时更新的宏包可能存在未修复的bug,请确保所有宏包都更新至最新。
-%     \item 安装如下中文字体\footnote{本模板所用到的英文字体\textsf{Tex Gyre Termes},\textsf{Droid Sans}和\textsf{CMU Typewriter Text}均默认安装于\textsf{TeXLive}和\textsf{MiKTeX}中。}:
-%     \begin{enumerate}[label=\emph{\alph*})]
-%         \item \textsf{AdobeSongStd-Light}
-%         \item \textsf{AdobeKaitiStd-Regular}
-%         \item \textsf{AdobeHeitiStd-Regular}
-%         \item \textsf{AdobeFangsongStd-Regular}
-%     \end{enumerate}
-%     \begin{informationnote}
-%     如果使用\textnormal{\LuaTeX},安装字体之后需运行命令\verb+mkluatexfontdb+生成字体索引。
-%     \end{informationnote}
-% \end{enumerate}
+% \section{\clsname{} 历史}
 %
-% \section{安装}
+% 本文档类 |v1.x| 版本由华中科技大学电子信息学院2014届本科生许铖博士
+% \footnote{\url{https://github.com/xu-cheng}}开发并维护,
+% 支持中英文的本科、硕士和博士学位论文撰写。
+% 作为一个设计精良的 \LaTeXe{} 文档类,自2013年6月1日 |v1.0| 初版
+% 以 \LaTeX 项目公共许可证 1.3c(\LaTeX{} Project Public License 1.3c 版)发布以来,
+% 该文档类已为无数华科学子提供了优质的服务。
 %
-% \subsection{安装到本地}
+% 然而,随着学校学位论文格式要求的不断更新,
+% 原有的文档类逐渐难以满足新的格式要求。
+% 加之原作者移居海外,难以及时响应日益增多的用户需求。
+% 同时,随着 \LaTeX3 技术和 C\TeX{} 宏集的逐渐成熟与普及,
+% 与之相比的 \LaTeXe{} 语法显得难以维护。
+% 因此,自2024年文档类 |v2.x.x| 版本开始交由华中科技大学博士生黄宇希
+% \footnote{\url{https://github.com/huangyxi}}接手维护,
+% 并基于 \LaTeX3 技术和 C\TeX{} 宏集进行了全面重构。
 %
-% 使用如下命令即可安装本模板到本地:
-% \begin{verbatim}
-%     make install
-% \end{verbatim}
-% 如需卸载,则使用如下命令:
-% \begin{verbatim}
-%     make uninstall
-% \end{verbatim}
+% 此外,|v2.0.0|起,文档类说明手册使用 \pkg{useclass}\cite{huang2024useclass}
+% 以宏包的方式载入 \pkg{l3doc} 文档类中的众多命令和环境,
+% 使得 \pkg{l3doc} 文档类能够与 \clsname{} 文档类共存,
+% 实现 \clsname{} 文档类的“自举”。
 %
-% 对于没有安装\verb+Make+的Windows系统用户,可以使用如下命令安装:
-% \begin{verbatim}
-%     makewin32.bat install
-% \end{verbatim}
-% 如需卸载,则使用如下命令:
-% \begin{verbatim}
-%     makewin32.bat uninstall
-% \end{verbatim}
-% 虽然\verb+makewin32.bat+表现与\verb+Makefile+极其相似,但是还是强烈建议你安装\verb+Make+,对于Windows用户可以在\href{http://gnuwin32.sourceforge.net/packages/make.htm}{这里}下载。
+% 当前\clsname{} 代码在 GitHub
+% \url{https://github.com/hust-latex/hustthesis} 上托管,
+% 欢迎各位同学提出意见和建议。
 %
-% \subsection{免安装使用}
+% \section{学位论文格式规范}
 %
-% 如果你希望临时使用本模板,而非安装到本地供长期使用。使用如下命令解压模板文件:
-% \begin{verbatim}
-%     make unpack
-% \end{verbatim}
-% 对于没有安装\verb+Make+的Windows系统用户,则使用如下命令解压:
-% \begin{verbatim}
-%     makewin32.bat unpack
-% \end{verbatim}
+% 目前华中科技大学对于硕士和博士的学位论文格式主要由以下文件规范:
+% \begin{itemize}
+%   \item \href{http://gs.hust.edu.cn/content.jsp?urltype=news.NewsContentUrl&wbtreeid=1022&wbnewsid=1027}{华中科技大学博士、硕士学位论文撰写规定, 校研〔2009〕39号}
+%   \item \href{http://gs.hust.edu.cn/info/1041/5462.htm}{学位申请相关文档下载},
+%     发布时间2023-02-10
+% \end{itemize}
 %
-% 再将\verb+hustthesis+目录下的如下文件拷贝到你\TeX{}工程根目录下即可:
+% 由于其中如“参考文献著录作者最多数量”等部分规范尚未统一,
+% 文档类作者在此仅根据过往已通过的学位论文的格式择取其一实现,
+% 供同学们参考。
+% 具体的格式要求请以学校最新的通知为准。
+%
+% \section{\clsname{} 发行版本号\label{sec:version}}
+%
+% 更新版本往往会带来新功能和修复问题,
+% 但有时也会不可避免地带来不向后兼容的修改。
+% 为了清晰地传达版本之间的变化,
+% 本文档类发行的版本号使用类似但不完全同于语义化版本控制(Semantic Versioning)规范
+% \footnote{\url{https://semver.org/}}用以标识。
+% 在本文档类中,对于版本号 |MAJOR.MINOR.PATCH|,递增相应的部分所表示的含义如下:
 % \begin{itemize}
-%     \item \verb+hustthesis.bst+
-%     \item \verb+hustthesis.cls+
-%     \item \verb+hust-title.eps+
-%     \item \verb+hust-title.pdf+
+%   \item |MAJOR|:递增大版本号,
+%     表示已在正文文档化的公开接口上存在不向后兼容(backward compatibility)的修改,
+%     一般对文档代码不经修改无法正常编译;
+%   \item |MINOR|:递增小版本号,
+%     表示已在正文文档化的非实验性公开接口上\emph{不}存在不向后兼容编译的修改,
+%     但在实验性公开接口上存在不向后兼容的修改;
+%     或者文档样式发生比较明显的变化。
+%     一般对文档代码不作修改或者只需小幅修改就可以正常编译;
+%   \item |PATCH|:递增补丁版本号,
+%     表示新版本含有向后兼容的 bug 修复,新功能,或者文档样式的细微变化,
+%     其中未文档化的私有接口可能会发生变化。
 % \end{itemize}
+% 用户在更新文档类时,可以根据版本号的变化以及更新日志来判断是否需要修改自己的文档。
 %
-% \section{基本用法}
 %
-% \begin{importantnote}
-% 本文档只能使用\textnormal{\XeLaTeX}或\textnormal{\LuaLaTeX}(推荐)编译。
-% \end{importantnote}
+% \chapter{获取途径}
 %
-% 在源文件开头处选择加载本文档类型,即可使用本模板,如下所示:
-% \begin{verbatim}
-%     \documentclass{hustthesis}
-% \end{verbatim}
+% 获取最新版本的 \clsname{} 文档类主要有两种途径:
+% 从 CTAN 上下载,或者从 GitHub Releases 页面下载。
 %
-% \subsection{文档类型选项}
+% \section{CTAN}
 %
-% 加载本文档类型时,有如下三个选项提供选择。
+% CTAN \url{https://ctan.org/pkg/hustthesis}
+% 上的 \clsname{} 文档类是经过打包的版本,
+% 其中包含了文档类、和文档类手册。
 %
-% \begin{function}{format}
-%     \begin{syntax}
-%         format = \meta{draft\orvar{}\textbf{final}}
-%     \end{syntax}
-%     提交草稿选择\verb+draft+选项,提交最终版选\verb+final+选项。其中草稿正文页包括页眉(“华中科技大学\verb+xx+学位论文”)、页眉修饰线(双线)、页脚(页码)和页脚修饰线(单线)。而最终版正文页不包括页眉、页眉修饰线和页脚修饰线,仅包含页脚(页码)。如果不指定,默认设置为\verb+final+。
+% \section{GitHub Release}
+%
+% \cls{hustthesis} 的源码托管在 GitHub
+% \url{https://github.com/hust-latex/hustthesis} 上,
+% 其中包含了最新的开发版本。
+% 由于源码是以 Doc\TeX{} 格式编写,
+% 对于初学者来说,安装和使用都比较麻烦。
+% 因此,建议初学者可以直接从 Releases 页面下载打包好的版本,解压后直接使用。
+% \url{https://github.com/hust-latex/hustthesis/releases/latest/download/hustthesis-user.zip}
+%
+% \chapter{使用说明}
+%
+% \section{太长不读(TL;DR)}
+%
+% 本节将展示两段简化程度不一的代码示例,
+% 可用于快速了解本文档类的使用方法,
+% 或者在编译失败的调试阶段作为参考。
+%
+% \subsection{最小可用示例}
+%
+% 以下代码包含了本文档类的最小可用示例(Minimal Working Example),
+% 用于展现文档类使用的主体结构。
+% \begin{latexcode}
+%   \documentclass{hustthesis}
+%   % \hustsetup{} % 设置
+%   \begin{document}
+%     \maketitle
+%     \frontmatter
+%     摘要部分
+%     \tableofcontents
+%     \mainmatter
+%     正文部分
+%     \backmatter
+%     致谢以及参考文献
+%     \appendix
+%     附录部分
+%   \end{document}
+% \end{latexcode}
+%
+% \subsection{核心示例}
+%
+% 本示例包含了较长的一段文档类核心命令和环境,
+% 更多进阶用法请参考后续小节。
+% \begin{latexcode}[emph={[1]hustsetup}]
+%   \documentclass[type=doctor]{hustthesis} % 博士学位论文: doctor, 硕士学位论文: master
+%   \hustsetup { % 设置之间一定不能有空行
+%     info =
+%       {
+%         title = { 中文标题 },
+%         title* = { English Title },
+%         degree = { academic }, % 学术型: academic, 专业型: professional
+%         degree* = { Engineering }, % 英文学科
+%         author = { 姓名 },
+%         author* = { Author },
+%         student-id = { D201234567 },
+%         major = { 专业 },
+%         major* = { Major },
+%         supervisor = { 指导老师\quad{} 教授 },
+%         supervisor* = { Prof.~ Supervisor },
+%         date = { 2025-02-26 }, % 不写这行的话会自动生成,写的话一定要按照这个格式
+%       },
+%   }
+%   \addbibresource{references.bib} % % biblatex 参考文献文件名
+%   \begin{document}
+%     \maketitle
+%     \frontmatter
+%     \begin{abstract}
+%       中文摘要
+%       \keywords 关键词1;关键词2;关键词3
+%     \end{abstract}
+%     \begin{abstract*}
+%       English Abstract
+%       \keywords* keyword1, keyword2, keyword3
+%     \end{abstract*}
+%     \tableofcontents
+%     \mainmatter
+%     \chapter{第一章}
+%     \section{第一节}
+%     ...
+%     \backmatter
+%     \begin{acknowledgements} % 致谢
+%       感谢 hustthesis 文档类。
+%     \end{acknowledgements}
+%     \printbibliography
+%     \appendix
+%     \chapter{附录}
+%   \end{document}
+% \end{latexcode}
+%
+% \section{编译说明}
+%
+% 本文档类仅可使用 \XeLaTeX{} 或者 \LuaLaTeX{} 编译。
+%
+% \section{如何阅读本章使用说明}
+%
+% 是的,说明文档本身也需要说明文档来说明如何阅读说明文档。
+%
+% \subsection{实验性内容}
+%
+% 本文档类说明部分的名字含有 “\rexpstar{}” 的键值对选项,设置,命令或环境,
+% 表示该内容为实验性内容。
+% 关于实验性内容的更新带来潜在不向后兼容修改的说明,
+% 请参考 \ref{sec:version} 节。
+%
+% \subsection{单选键值对设置}
+%
+% \key{key} = <\opt{option},\opt*{default}>,
+%
+% 其等号右边的选项 \opt{option},和 \opt*{default} 均表示可选的单选项,
+% 其中加粗选项 \opt*{default} 表示默认选项。
+%
+% 最后的逗号是为了提醒读者,
+% 如果存在多个键值对,其之间需由半角(英文)逗号分隔。(以下如未特殊说明,逗号均指半角逗号)
+%
+% \subsection{自定义键值对设置}
+%
+% \key{key} = \marg{value},
+%
+% 其等号右边的值 \marg{value} 表示可以自定义的值。
+%
+% \section{文档类选项\label{sec:option}}
+%
+% 本节介绍的选项仅可在如下文档类选项(中括号中|type=doctor|)中使用。
+% 多个选项之间也是由逗号分隔。
+% \begin{latexcode}
+%   \documentclass[type=doctor]{hustthesis}
+% \end{latexcode}
+%
+% \begin{function}[module=option/]{type}
+%   \begin{syntax}
+%     \key{type} = <\opt*{doctor},\opt{master}>,
+%   \end{syntax}
+%   \begin{arguments}
+%     \item[\opt*{doctor}] 博士学位论文
+%     \item[\opt{master}] 硕士学位论文
+%   \end{arguments}
+%   \key{type} 选项用于设置学位论文类型。
 % \end{function}
 %
-% \begin{function}{degree}
-%     \begin{syntax}
-%         degree = \meta{\textbf{none}\orvar{}fyp\orvar{}bachelor\orvar{}master\orvar{}phd}
-%     \end{syntax}
-%     指定论文种类,它将通过设置字段\verb+\HUST at zhapplyname+和\verb+\HUST at enapplyname+来影响中英文封面处的标题和正文处的页眉(如果\verb+format+设为\verb+draft+)。各个不同的选项产生的效果见表\ref{tab:optdegree-zh}。如果不指定,默认设置为\verb+none+。如有需要,这两个字段可以通过\href{doc/function//applyname}{\texttt{\textbackslash{}zhapplyname},\texttt{\textbackslash{}enapplyname},\texttt{\textbackslash{}applyname}}命令进一步修改。
+% \begin{function}[rEXP, module=option/]{anonymous}
+%   \begin{syntax}
+%     \key{anonymous} = <\opt*{false},\opt{true}>,
+%   \end{syntax}
+%   \begin{arguments}
+%     \item[\opt*{false}] 关闭盲审模式
+%     \item[\opt{true}] 开启盲审模式
+%   \end{arguments}
+%   \key{anonymous} 选项用于设置是否开启盲审模式。
+%   盲审模式下,\key{anonymous-list} 中的所有信息均会被隐藏。
 % \end{function}
 %
-% \begin{function}[updated=2013-07-01]{language}
-%     \begin{syntax}
-%         language = \meta{\textbf{chinese}\orvar{}english\orvar{}english-draft}
-%     \end{syntax}
-%     指定论文语言。特别的,如果设定为\verb+english-draft+,将会剔除论文中的所有中文内容,这有利于在未安装中文字体的环境中使用。如果不指定,默认设置为\verb+chinese+。
+% \begin{function}[rEXP, module=option/]{anonymous-list}
+%   \begin{syntax}
+%     \key{anonymous-list} = \marg{盲审模式隐藏条目列表},
+%   \end{syntax}
+%  \key{anonymous-list} 选项用于设置在开启盲审模式下需要隐藏的条目。
+%  \marg{匿名条目列表} 是一组由半角(英文)逗号隔开的选项列表。
+%  |info/| 下键值对键名的连接符(|-|)需手动替换为下划线(|_|),
+%  星号(|*|)需手动替换为|_en|。
+%  默认值为 \texttt{\{author, student_id, supervisor, author_en, supervisor_en\}}。
 % \end{function}
 %
-% \begin{table}[ht]
-%     \centering
-%     \caption{\texttt{degree}选项的作用}\label{tab:optdegree-zh}
-%     \begin{tabularx}{\textwidth}{|c|X|X|}
-%     \hline
-%     \textbf{选项} & \tabincell{c}{\textbf{中文标题}\\(字段\verb+\HUST+\verb+ at zhapplyname+)} & \tabincell{c}{\textbf{英文标题}\\(字段\verb+\HUST+\verb+ at enapplyname+)} \\
-%     \hline
-%     \verb+none+ & 学位论文 & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree \\ \hline
-%     \verb+fyp+ & 毕业论文 & A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project \\ \hline
-%     \verb+bachelor+ & 学士学位论文 & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor \\ \hline
-%     \verb+master+ & 硕士学位论文 & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master \\ \hline
-%     \verb+phd+ & 博士学位论文 & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy \\ \hline
-%     \end{tabularx}
-% \end{table}
+% \section{文档信息设置}
 %
-% \subsection{基本字段设置}
+% 本节介绍的文档信息设置选项只可在 \tn{hustsetup} 命令的\marg{键值列表}中使用,
+% 主要用于封面和扉页的标题、作者等信息的输出。
 %
-% 模板中定义一些命令用于设置文档中的字段。其中一部分命令是以\verb+\zhX{<Chinese var>}+,\verb+\enX{<English var>}+和\verb+\X{<Chinese var>}{<English var>}+的形式出现,他们分别意味着设置字段\verb+X+的中文部分,英文部分及一同设定。
-%
-% \begin{function}{\zhtitle,\entitle,\title}
-%     \begin{syntax}
-%     \cs{zhtitle}\Arg{Chinese title}
-%     \cs{entitle}\Arg{English title}
-%     \cs{title}\Arg{Chinese title}\Arg{English title}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文标题。
+% \begin{function}{\hustsetup}
+%   \begin{syntax}
+%      \tn{hustsetup}\marg{键值列表}
+%   \end{syntax}
+%   \tn{hustsetup} 的参数是一组由半角(英文)逗号隔开的选项列表,
+%   列表中的选项通常是
+%   \meta{key}|=|\meta{value}的形式。
+%   对于相同键,后面的值会覆盖前面的值。
+%   “|=|”左右的空格不影响实际设置,
+%   但需注意,参数列表中不能有空行。
 % \end{function}
 %
-% \begin{function}{\zhauthor,\enauthor,\author}
-%     \begin{syntax}
-%     \cs{zhauthor}\Arg{Chinese author}
-%     \cs{enauthor}\Arg{English author}
-%     \cs{author}\Arg{Chinese author}\Arg{English author}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文作者名。
+% \begin{function}[module=info/]{info/degree}
+%   \begin{syntax}
+%     \key[info]{degree} = <\opt*{academic},\opt{professional}>,
+%   \end{syntax}
+%    设置中文学位类型,仅可选学术型或专业型。
+%   \begin{arguments}
+%     \item[\opt*{academic}] 学术型
+%     \item[\opt{professional}] 专业型
+%   \end{arguments}
 % \end{function}
 %
-% \begin{function}{\date}
-%     \begin{syntax}
-%     \cs{date}\Arg{Year}\Arg{Month}\Arg{Day}
-%     \end{syntax}
-%     该命令用于设定论文的答辩日期。如果不设定,则会选择当前编译日期作为答辩日期。
+% \begin{function}[module=info/]{info/degree*}
+%   \begin{syntax}
+%     \key[info]{degree*} = <\opt{Arts},\opt{Science},\opt{Education},\opt*{Engineering},\opt{Law},\opt{Medicine},...>,
+%   \end{syntax}
+%   设置英文学科门类,
+%   可选项有:
+%   \begin{arguments}
+%     \item[\opt{Arts}] 文学学位
+%     \item[\opt{Science}] 理学学位
+%     \item[\opt{Education}] 教育学学位
+%     \item[\opt*{Engineering}] 工学学位
+%     \item[\opt{Law}] 法学学位
+%     \item[\opt{Medicine}] 医学学位
+%     \item[...] 其他学科可自行设置
+%   \end{arguments}
 % \end{function}
 %
-% \begin{function}{\zhschoolname,\enschoolname,\schoolname}
-%     \begin{syntax}
-%     \cs{zhschoolname}\Arg{Chinese school name}
-%     \cs{enschoolname}\Arg{English school name}
-%     \cs{schoolname}\Arg{Chinese school name}\Arg{English school name}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文学校名。该字段在模板中已默认设置为\verb+\schoolname{华中科技大学}{Huazhong University of Science \& Technology}+。所以除非需更改学校名,无需使用该命令。
+% \begin{function}[module=info/]{info/title, info/title*}
+%   \begin{syntax}
+%     \key[info]{title} = \marg{中文标题},
+%     \key[info]{title*} = \marg{英文标题},
+%   \end{syntax}
+%   设置论文标题。
 % \end{function}
 %
-% \begin{function}{\zhaddress,\enaddress,\address}
-%     \begin{syntax}
-%     \cs{zhaddress}\Arg{Chinese address}
-%     \cs{enaddress}\Arg{English address}
-%     \cs{address}\Arg{Chinese address}\Arg{English address}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文学校地址。该字段在模板中已默认设置为\verb+\address{中国,武汉,430074}{Wuhan~430074, P.~R.~China}+。所以除非需更改学校地址,无需使用该命令。
+% \begin{function}[module=info/]{info/author, info/author*}
+%   \begin{syntax}
+%     \key[info]{author} = \marg{姓名中文},
+%     \key[info]{author*} = \marg{姓名英文},
+%   \end{syntax}
+%   设置学位申请人姓名。
+%   根据学校要求,英文姓名应该按照中文习惯,
+%   为姓在前名在后,且姓全部大写。
 % \end{function}
 %
-% \begin{function}[updated=2016-11-17]{\zhapplyname,\enapplyname,\applyname}
-%     \begin{syntax}
-%     \cs{zhapplyname}\Arg{Chinese apply name}
-%     \cs{enapplyname}\Arg{English apply name}
-%     \cs{applyname}\Arg{Chinese apply name}\Arg{English apply name}
-%     \end{syntax}
-%     这一组命令用于自定义中英文封面处的标题和正文处的页眉。详情见~\href{doc/function//degree}{\texttt{degree} 文档类型选项}。
+% \begin{function}[module=info/]{info/major, info/major*}
+%   \begin{syntax}
+%     \key[info]{major} = \marg{专业名称中文},
+%     \key[info]{major*} = \marg{专业名称英文},
+%   \end{syntax}
+%   设置专业名称。
 % \end{function}
 %
-% \begin{function}{\zhmajor,\enmajor,\major}
-%     \begin{syntax}
-%     \cs{zhmajor}\Arg{Chinese major}
-%     \cs{enmajor}\Arg{English major}
-%     \cs{major}\Arg{Chinese major}\Arg{English major}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文专业名。
+% \begin{function}[module=info/]{info/supervisor, info/supervisor*}
+%   \begin{syntax}
+%     \key[info]{supervisor} = \marg{指导老师中文姓名},
+%     \key[info]{supervisor*} = \marg{指导老师英文姓名},
+%   \end{syntax}
+%   设置指导老师姓名。
 % \end{function}
 %
-% \begin{function}{\zhsupervisor,\ensupervisor,\supervisor}
-%     \begin{syntax}
-%     \cs{zhsupervisor}\Arg{Chinese supervisor}
-%     \cs{ensupervisor}\Arg{English supervisor}
-%     \cs{supervisor}\Arg{Chinese supervisor}\Arg{English supervisor}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文指导老师名(含职称)。
+% \begin{function}[module=info/]{info/date}
+%   \begin{syntax}
+%     \key[info]{date} = \marg{日期},
+%   \end{syntax}
+%   设置论文提交日期。
+%   日期格式为 |YYYY-MM-DD|。
+%   如果不设置该选项,文档类会自动生成日期。
 % \end{function}
 %
-% \begin{function}{\zhasssupervisor,\enasssupervisor,\asssupervisor}
-%     \begin{syntax}
-%     \cs{zhasssupervisor}\Arg{Chinese asssupervisor}
-%     \cs{enasssupervisor}\Arg{English asssupervisor}
-%     \cs{asssupervisor}\Arg{Chinese asssupervisor}\Arg{English asssupervisor}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文副指导老师名(含职称)。该命令是可选的,如果不加以设定,封面处不会显示相应项。
+% \begin{function}[module=info/]{info/clc}
+%   \begin{syntax}
+%     \key[info]{clc} = \marg{中图分类号},
+%   \end{syntax}
+%   设置中图分类号。
 % \end{function}
+
+% \begin{function}[module=info/]{info/student-id}
+%   \begin{syntax}
+%     \key[info]{student-id} = \marg{学号},
+%   \end{syntax}
+%   设置学号。
+% \end{function}
 %
-% \begin{function}{\schoolcode}
-%     \begin{syntax}
-%     \cs{schoolcode}\Arg{school code}
-%     \end{syntax}
-%     用于设置学校代码。
+% \begin{function}[rEXP, module=info/]{info/secret}
+%   \begin{syntax}
+%     \key[info]{secret} = \marg{密级},
+%   \end{syntax}
+%   实验性内容,设置密级。当前仅影响中文封面的显示,默认为空。
 % \end{function}
 %
-% \begin{function}{\stuno}
-%     \begin{syntax}
-%     \cs{stuno}\Arg{student number}
-%     \end{syntax}
-%     用于设置学号。
+% \begin{function}[module=info/]{info/committee}
+%   \begin{syntax}
+%     \key[info]{committee} = \marg{答辩委员会成员},
+%   \end{syntax}
+%   设置答辩委员会成员。
+%   该选项的值是一个逗号分隔委员会成员的列表,
+%   其中每个成员的姓名,职称和单位之间用 |&| 分割。
+%   第一个成员为主席,其余成员为委员。
+%   由于文档类内部实现原因,如果设置该选项,请至少设置3名成员。
+%   例如:
+%   \begin{latexcode}
+%   \hustsetup {
+%     info/committee =
+%       { 张三 & 教授 & 华中科技大学 , 李四 & 教授 & 武汉大学 , 王五 & 教授 & 武汉理工大学 },
+%   }
+%   \end{latexcode}
+%   如果不设置该选项,文档类会自动生成7行空白的答辩委员会成员。
+%
+%   另外,该选项所对应的页面仅在博士学位论文中会自动生成。
+%   如果需要手动生成页面,可以使用命令 \tn{makecommittee}。
 % \end{function}
 %
-% \begin{function}{\classno}
-%     \begin{syntax}
-%     \cs{classno}\Arg{classify number}
-%     \end{syntax}
-%     用于设置分类号。
+% \section{内容编写}
+%
+% 以下内容须在 |\begin{document}| 和 |\end{document}| 之间编写。
+%
+% \subsection{封面扉页}
+%
+% \begin{function}{\maketitle}
+%   \begin{syntax}
+%     \tn{maketitle}
+%   \end{syntax}
+%   \tn{maketitle} 命令用于生成中英文封面。
+%   仅当文档类类型为博士学位论文时,
+%   在中文和英文封面之间会自动插入答辩委员会成员。
 % \end{function}
 %
-% \begin{function}{\secretlevel}
-%     \begin{syntax}
-%     \cs{secretlevel}\Arg{secret level}
-%     \end{syntax}
-%     用于设置密级。
+% \begin{function}[rEXP]{\makezhtitle, \makeentitle}
+%   \begin{syntax}
+%     \tn{makezhtitle}
+%     \tn{makeentitle}
+%   \end{syntax}
+%   \tn{makezhtitle} 和 \tn{makeentitle} 命令分别用于生成中文和英文封面。
+%   一般不需要手动调用这两个命令。
 % \end{function}
 %
-% \begin{function}{\zhabstract,\enabstract,\abstract}
-%     \begin{syntax}
-%     \cs{zhabstract}\Arg{Chinese abstract}
-%     \cs{enabstract}\Arg{English abstract}
-%     \cs{abstract}\Arg{Chinese abstract}\Arg{English abstract}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文摘要。
+% \begin{function}[rEXP]{\makecommittee}
+%   \begin{syntax}
+%     \tn{makecommittee}
+%   \end{syntax}
+%   \tn{makecommittee} 命令用于生成答辩委员会成员。
+%   一般也不需要手动调用该命令。
 % \end{function}
 %
-% \begin{function}{\zhkeywords,\enkeywords,\keywords}
-%     \begin{syntax}
-%     \cs{zhkeywords}\Arg{Chinese keywords}
-%     \cs{enkeywords}\Arg{English keywords}
-%     \cs{keywords}\Arg{Chinese keywords}\Arg{English keywords}
-%     \end{syntax}
-%     这一组命令用于设定论文的中英文关键字。
+% \subsection{前文}
+%
+% \begin{function}{\frontmatter}
+%   \begin{syntax}
+%     \tn{frontmatter}
+%   \end{syntax}
+%   \tn{frontmatter} 命令用于修改页码格式为罗马数字,
+%   增加页眉和页脚,
+%   以及设置目录中虚线样式。
+%   该命令一般需要在 \tn{maketitle} 命令之后,摘要之前调用。
 % \end{function}
 %
-% \subsection{其它基本命令}
+% \begin{environment}{abstract, abstract*}
+%   \begin{latexcode}
+%   \begin{abstract}
+%     中文摘要
+%     \keywords 关键词1;关键词2;关键词3
+%   \end{abstract}
 %
-% 下面来介绍其它基本命令。
+%   \begin{abstract*}
+%     English abstract
+%     \keywords* keyword1, keyword2, keyword3
+%   \end{abstract*}
+%   \end{latexcode}
+%   |abstract| 和 |abstract*| 环境分别用于生成中文和英文摘要。
+% \end{environment}
 %
-% \begin{function}{\frontmatter,\mainmatter,\backmatter}
-%     这一组命令用于设定论文的状态、改变样式,其具体使用见\nameref{sec:简单示例}。\verb+\frontmatter+用在文档最开始,表明文档的前言部分(如封面,摘要,目录等)的开始。\verb+\mainmatter+表示论文正文的开始。\verb+\backmatter+表示论文正文的结束。
+% \begin{function}{keywords, keywords*}
+%   \begin{syntax}
+%     \tn{keywords} 关键词1;关键词2;关键词3
+%     \tn{keywords*} Keyword1, Keyword2, Keyword3
+%   \end{syntax}
+%   \tn{keywords} 和 \tn{keywords*} 命令分别用于生成中文和英文关键词。
+%   一般需要在相应的 |abstract| 和 |abstract*| 环境中的最后一行调用。
 % \end{function}
 %
-% \begin{function}{\maketitle,\makecover}
-%     \verb+\maketitle+和\verb+\makecover+作用相同,用于生成封面和版权页面。
+% \begin{function}{\tableofcontents}
+%   \begin{syntax}
+%     \tn{tableofcontents}
+%   \end{syntax}
+%   \tn{tableofcontents} 命令用于生成目录。
 % \end{function}
 %
-% \begin{function}{\makeabstract}
-%     用于生成中英文摘要页面。
+% \subsection{正文}
+%
+% \begin{function}{\mainmatter}
+%   \begin{syntax}
+%     \tn{mainmatter}
+%   \end{syntax}
+%   \tn{mainmatter} 命令用于修改页码格式为阿拉伯数字,
+%   以及设置目录中虚线样式。
+%   该命令一般需要在目录之后,正文之前调用。
 % \end{function}
 %
-% \begin{function}{\tableofcontents}
-%     用于生成目录。
+% \begin{function}{\chapter, \chapter*, \chapter**}
+%   \begin{syntax}
+%     \tn{chapter}\marg{标题名}
+%     \tn{chapter*}\marg{标题名}
+%     \tn{chapter**}\marg{标题名}
+%   \end{syntax}
+%   \tn{chapter} 和 \tn{chapter*} 命令与标准 \LaTeXe-\pkg{book} 文档类中的命令功能相同,
+%   用于生成章标题。
+%   前者为有编号的章标题,会在目录中生成对应的条目;
+%   后者为无编号的章标题,不会在目录中生成对应的条目。
+%
+%   \tn{chapter**} 命令是本文档类新增的章节标题生成的命令,
+%   用于生成无编号章节标题,但会在目录中生成对应的条目。
+%   一般可用于在附录中生成无编号的章节标题。
 % \end{function}
 %
-% \begin{function}{\zhdateformat,\endateformat}
-%     用于打印中英文日期。
+% \subsection{后文}
+%
+% \begin{function}{\backmatter}
+%   \begin{syntax}
+%     \tn{backmatter}
+%   \end{syntax}
+%   \tn{backmatter} 命令用于修改目录中虚线样式。
+%   该命令一般需要在正文之后,致谢之前调用。
 % \end{function}
 %
-% \vskip 1ex\DescribeEnv{ack}
-%     \verb+ack+环境用于致谢页面。使用方法如下:
-%     \begin{verbatim}
-%     \begin{ack}
-%         <content>
-%     \end{ack}
-%     \end{verbatim}
+% \begin{environment}{acknowledgements}
+%   \begin{syntax}
+%     |\begin{acknowledgements}|
+%       致谢
+%     |\end{acknowledgements}|
+%   \end{syntax}
+%   |acknowledgements| 环境用于生成致谢。
+% \end{environment}
 %
-% \begin{function}{\bibliography}
-%     \begin{syntax}
-%     \cs{bibliography}\Arg{.bib file}
-%     \end{syntax}
-%     用于生成参考文献。
+% \begin{function}{\printbibliography}
+%   \begin{syntax}
+%     \tn{printbibliography}
+%   \end{syntax}
+%   \tn{printbibliography} 命令用于生成 \pkg{biblatex} 宏包的参考文献。
 % \end{function}
 %
-% \vskip 1ex\DescribeEnv{appendix}
-%     \verb+appendix+环境用于附录环境。你可以将附录置于\verb+appendix+环境中,如:
-%     \begin{verbatim}
-%     \begin{appendix}
-%         <content>
-%     \end{appendix}
-%     \end{verbatim}
+% \subsection{附录}
+%
 % \begin{function}{\appendix}
-%     或者使用\verb+\appendix+代表后文均为附录,如:
-%     \begin{verbatim}
-%     \appendix
-%     <content>
-%     \end{verbatim}
+%   \begin{syntax}
+%     \tn{appendix}
+%   \end{syntax}
+%   \tn{appendix} 命令用于修改章节标题格式,
+%   该命令一般需要在参考文献之后调用。
 % \end{function}
 %
-% \begin{function}{\listoffigures,\listoftables}
-%     这两个命令分别用于生成图片和表格索引,可以根据要求在论文前言中使用或附录中使用。
-% \end{function}
+% 附录的章节如答辩委员会决议等,可以根据需要使用 \tn{chapter} 命令生成有编号的标题,
+% 也可以使用 \tn{chapter**} 命令生成无编号的标题。
 %
-% \vskip 1ex\DescribeEnv{publications}
-%     \verb+publications+环境用于已发表论文页面。一般用于附录中。使用上同\verb+enumerate+环境。如下:
-%     \begin{verbatim}
-%     \begin{publications}
-%         \item <thesis>
-%         <...>
-%     \end{publications}
-%     \end{verbatim}
+% \section{参考文献说明}
 %
-% \begin{function}{\TurnOffTabFontSetting,\TurnOnTabFontSetting}
-%     因为模板中设定了表格的行距和字号,使得使用中无法临时自定义表格的行距和字号。故提供两个命令用于关闭和开启默认表格的行距和字号设置。比如你如果需要输出一个自己定义字号的表格,可以使用如下示例:
-%     \begin{verbatim}
-%     \begingroup
-%     \TurnOffTabFontSetting
-%     \footnotesize % 设置字号
-%     \begin{tabular}{...}
-%         <content>
-%     \end{tabular}
-%     \TurnOnTabFontSetting
-%     \endgroup
-%     \end{verbatim}
-% \end{function}
+% 这里列举了在学位论文规范文档中的参考文献。
+% 可以在正文后参考文献列表中查看生成的样式。
+% \citeauthor{YanMingLi2006CFGZhuang}
+% \cite{chalfi1998GreenFluo, ZhanXiangHong2004ZhongYiY}
+% \parencite{lein2007Genomewide,bouxse2010Guidelines,yamaki2018Performanc,yao2017BuildingE,LiuJiaLin1993DuoGongN,LiQingQuan1998JiYuHun}
 %
-% \begin{function}{\email}
-%     \begin{syntax}
-%     \cs{email}\Arg{Email Address}
-%     \end{syntax}
-%     用于生成邮箱地址。如\verb+\email{name at example.com}+会生成如下效果的地址:\email{name at example.com}。
-% \end{function}
+% \backmatter
+% \begin{acknowledgements}
+%   感谢 \cls{fduthesis} 文档类\cite{zeng2023fduthesis},
+%   \cls{SJTU\TeX} 文档类集\cite{sjtug2024SJTUTeX},
+%   和 \cls{njuthesis} 文档类\cite{njulug2023njuthesis},
+%   本文档类的许多设计和实现都是参考了上述代码。
+%   并且特别感谢 \pkg{biblatex-gb7714-2015} 宏包\cite{hu2024bib}及其作者胡振震,
+%   本人在之前的文档类设计中得到了其很多热情的帮助,
+%   收获的经验也为本文档类的设计奠定了基础。
 %
-% \section{简单示例}\label{sec:简单示例}
-% 如下为一个使用本模板的简单示例。更完整的例子请见\texttt{hustthesis-zh-example.tex}文件,其效果见\href{https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-zh-example.pdf}{\texttt{hustthesis-zh-example.pdf}}。
+%   此外本人开发的宏包 \pkg{useclass}\cite{huang2024useclass}
+%   也让本文档类手册的文档类“自举”实现可能。
+% \end{acknowledgements}
 %
-% \iffalse
-%<*driver>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-\documentclass[degree=phd,language=chinese]{hustthesis}
-
-\stuno{你的学号}
-\schoolcode{10487}
-\title{中文标题}{英文标题}
-\author{作者名}{作者名拼音}
-\major{专业中文}{专业英文}
-\supervisor{指导老师中文}{指导老师英文}
-\date{2013}{7}{1} % 答辩日期
-
-\zhabstract{中文摘要}
-\zhkeywords{中文关键字}
-\enabstract{英文摘要}
-\enkeywords{英文关键字}
-
-\begin{document}
-
-\frontmatter
-\maketitle
-\makeabstract
-\tableofcontents
-\listoffigures
-\listoftables
-\mainmatter
-
-%% 正文
-
-\backmatter
-
-\begin{ack}
-%% 致谢
-\end{ack}
-\bibliography{参考文献.bib文件}
-
-\appendix
-
-\begin{publications}
-%% 发表过的论文列表
-\end{publications}
-
-%% 附录剩余部分
-
-\end{document}
-\end{lstlisting}
-% \iffalse
-%</driver>
-% \fi
+% \printbibliography
 %
-% \section{预设宏包介绍}
+% \end{documentation}
 %
-% 本模板中预设了一些宏包,下面对其进行简单介绍。
+% \begin{implementation}
 %
-% \begin{itemize}
-%     \item \pkgurl{algorithm2e} 算法环境。
-%     \item \pkgurl{enumitem} 自定义列表环境的式样。
-%     \item \pkgurl{fancynum} 用于将大数每三位断开。
-%     \item \pkgurl{listings} 代码环境。如需更好的代码高亮可以使用\pkgurl{minted}宏包。
-%     \item \pkgurl{longtable} 跨页的超长表格环境。
-%     \item \pkgurl{ltxtable} \textsf{longtable}环境和\textsf{tabularx}环境的合并。
-%     \item \pkgurl{multirow} 用于表格中合并行。
-%     \item \pkgurl{overpic} 用于在图片上层叠其他内容。
-%     \item \pkgurl{tabularx} 扩展到表格环境。
-%     \item \pkgurl{zhnumber} 用于生成中文数字。
-% \end{itemize}
+% \appendix
+% \newgeometry{
+%   marginpar = 2.8 cm,
+% }
 %
-% \section{高级设置}
+% \chapter{\clsname{} 代码实现}
+% 本文档类使用 \LaTeX3 语法编写,依赖 \pkg{expl3} 环境。
 %
-% \subsection{切换字体}
+%    \begin{macrocode}
+%<@@=hust>
+%<*class>
+%    \end{macrocode}
 %
-% 模板正文字体为宋体(\textsf{AdobeSongStd-Light}),同时我们提供如下命令切换中文字体:
+% \section{文档类预处理}
 %
-% \begin{function}{\HEI,\hei}
-%     \begin{syntax}
-%     \{\cs{HEI} \meta{content}\}
-%     \cs{hei}\Arg{content}
-%     \end{syntax}
-%     切换字体为黑体(\textsf{AdobeHeitiStd-Regular})。
-% \end{function}
+% 本文档类隐式依赖已整合进 \LaTeX--\pkg{base} 的 \pkg{ltkeys} (原 \pkg{l3keys2e}) 和 \pkg{lttemplates}(原 \pkg{xtemplate})。
 %
-% \begin{function}{\KAI,\kai}
-%     \begin{syntax}
-%     \{\cs{KAI} \meta{content}\}
-%     \cs{kai}\Arg{content}
-%     \end{syntax}
-%     切换字体为楷体(\textsf{AdobeKaitiStd-Regular})。
-% \end{function}
+%    \begin{macrocode}
+ \RequirePackage { }
+%    \end{macrocode}
 %
-% \begin{function}{\FANGSONG,\fangsong}
-%     \begin{syntax}
-%     \{\cs{FANGSONG} \meta{content}\}
-%     \cs{fangsong}\Arg{content}
-%     \end{syntax}
-%     切换字体为仿宋(\textsf{AdobeFangsongStd-Regular})。
-% \end{function}
+% \subsection{变量声明}
 %
-% 如果需要加载其他字体,请参阅宏包\pkgurl{fontspec},宏包\pkgurl{xeCJK}(对于\XeLaTeX{})和宏包\pkgurl[luatexja]{luatex-ja}(对于\LuaLaTeX{})的文档。
+% \begin{variable}{
+%   \l_@@_tmpa_box,
+%   \l_@@_tmpa_clist,
+%   \l_@@_tmpa_dim,
+%   \l_@@_tmpa_skip,
+%   \l_@@_tmpa_tl, \l_@@_tmpb_tl,
+% }
+% 临时变量。
+%    \begin{macrocode}
+\box_new:N \l_@@_tmpa_box
+\clist_new:N \l_@@_tmpa_clist
+\dim_new:N \l_@@_tmpa_dim
+\skip_new:N \l_@@_tmpa_skip
+\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
+%    \end{macrocode}
+% \end{variable}
 %
-% \subsection{内部字段设置}
+% \begin{variable}{\g_@@_degree_type_tl}
+% 论文类型。
+%    \begin{macrocode}
+\tl_new:N \g_@@_degree_type_tl
+%    \end{macrocode}
+% \end{variable}
 %
-% 本模板定义了很多内部字段,其具体内容见\autoref{sec:Localization}。通过更改这些字段,可以对论文格式进行自定义。
+% \begin{variable}{\g_@@_to_ctex_class_clist, \g_@@_to_hyperref_clist}
+% 分别保存由 \clsname{} 传入 \cls{ctexbook} 文档类和 \pkg{hyperref} 宏包的选项列表。
+%    \begin{macrocode}
+\clist_new:N \g_@@_to_ctex_class_clist
+\clist_new:N \g_@@_to_hyperref_clist
+%    \end{macrocode}
+% \end{variable}
 %
-% \part{English Version Instruction}\label{part:English Version Instruction}
+% \begin{variable}{\g_@@_draft_bool}
+% 草稿模式。
+%    \begin{macrocode}
+\bool_new:N \g_@@_draft_bool
+%    \end{macrocode}
+% \end{variable}
 %
-% \section{Requirement}
-% Install the latest version of \href{http://www.tug.org/texlive/}{\texttt{TeXLive}}(Recommend) or \href{http://miktex.org/}{\texttt{MiKTeX}}. Please ensure that all the packages are up-to-date.
+% \begin{variable}{\g_@@_anonymous_bool}
+% 盲审模式。
+%    \begin{macrocode}
+\bool_new:N \g_@@_anonymous_bool
+%    \end{macrocode}
+% \end{variable}
 %
-% If you need to produce the final format of thesis (see \autoref{subsec:Option} for more details), you should also need to install following Chinese fonts:
-% \begin{itemize}
-%   \item \textsf{AdobeSongStd-Light}
-%   \item \textsf{AdobeKaitiStd-Regular}
-%   \item \textsf{AdobeHeitiStd-Regular}
-%   \item \textsf{AdobeFangsongStd-Regular}
-% \end{itemize}
-% \begin{informationnote}
-% If you use \textnormal{\LuaTeX}, you need to run the command \verb+mkluatexfontdb+ to refresh font database index after installing the fonts.
-% \end{informationnote}
+% \begin{variable}{\g_@@_anonymous_clist}
+% 盲审模式需要隐藏的内容。
+%    \begin{macrocode}
+\clist_new:N \g_@@_anonymous_clist
+%    \end{macrocode}
+% \end{variable}
 %
-% \section{Installation}
+% \begin{variable}{
+%   \g_@@_font_set_tl,
+%   \g_@@_font_latin_tl,
+%   \g_@@_font_cjk_tl,
+%   \g_@@_font_math_tl}
+% 存储所使用字体名称的全局变量。
+%    \begin{macrocode}
+\tl_new:N \g_@@_font_set_tl
+\tl_new:N \g_@@_font_latin_tl
+\tl_new:N \g_@@_font_cjk_tl
+\tl_new:N \g_@@_font_math_tl
+%    \end{macrocode}
+% \end{variable}
 %
-% \subsection{Install into local}
+% \begin{variable}{\g_@@_font_dir_tl}
+% 存储字体路径的全局变量。
+%    \begin{macrocode}
+\tl_new:N \g_@@_font_dir_tl
+%    \end{macrocode}
+% \end{variable}
 %
-% Use the command below to install this template into local.
-% \begin{verbatim}
-%    make install
-% \end{verbatim}
-% If you need uninstall it, use the command below.
-% \begin{verbatim}
-%    make uninstall
-% \end{verbatim}
+% \begin{variable}{\g_@@_font_dir_bool}
+% 是否使用独立的字体文件。
+%    \begin{macrocode}
+\bool_new:N \g_@@_font_dir_bool
+%    \end{macrocode}
+% \end{variable}
 %
-% For Windows User who don't install \texttt{Make}, use the command below to install.
-% \begin{verbatim}
-%     makewin32.bat install
-% \end{verbatim}
-% If you need uninstall it, use the command below.
-% \begin{verbatim}
-%     makewin32.bat uninstall
-% \end{verbatim}
-% Although \texttt{makewin32.bat} behaves much like \texttt{Makefile}, I still
-% recommend you install \texttt{Make} into your Windows. You can download
-% it from \href{http://gnuwin32.sourceforge.net/packages/make.htm}{here}.
+% \begin{variable}{\g_@@_config_tl}
+% 保存配置文件名称。默认为空。
+%    \begin{macrocode}
+\tl_new:N \g_@@_config_tl
+%    \end{macrocode}
+% \end{variable}
 %
-% \subsection{Use without installation}
+% \subsection{内部函数}
 %
-% If you want to use this template temporary rather than installing it into local for long term use. Run below command to unpack the package.
-% \begin{verbatim}
-%     make unpack
-% \end{verbatim}
-% For Windows User who don't install \texttt{Make}, use the command below to unpack the package.
-% \begin{verbatim}
-%     makewin32.bat unpack
-% \end{verbatim}
-% Then copy the following files from directory \texttt{hustthesis} into your \TeX{} project root directory.
-% \begin{itemize}
-%     \item \verb+hustthesis.bst+
-%     \item \verb+hustthesis.cls+
-%     \item \verb+hust-title.eps+
-%     \item \verb+hust-title.pdf+
-% \end{itemize}
 %
-% \section{Usage}
-% \begin{importantnote}
-% This template can only be compiled by \\
-% \hskip 10pt \textnormal{\XeLaTeX} or\textnormal{\LuaLaTeX}(Recommend).
-% \end{importantnote}
+% \subsubsection{辅助函数}
+% \begin{macro}{\@@_patch_cmd:Nnn, \@@_appto_cmd:Nn}
+% 补丁工具,来自 \pkg{ctexpatch} 宏包。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_cmd:Nnn #1#2#3
+  {
+    \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\cs_new_protected:Npn \@@_appto_cmd:Nn #1#2
+  {
+    \ctex_appto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% Insert below code in the top of source code to use this template:
-% \begin{verbatim}
-%     \documentclass[language=english]{hustthesis}
-% \end{verbatim}
+% \begin{macro}{\@@_define_fn_style:nn,
+%   \@@_define_punct:nn,
+%   \@@_define_name:nn,
+%   \@@_define_name:nnn}
+% 用来定义脚注样式、标点、默认名称的辅助函数。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_define_fn_style:nn #1#2
+  { \tl_const:cn { c_@@_fn_style_ #1 _tl } {#2} }
+\cs_new_protected:Npn \@@_define_punct:nn #1#2
+  { \tl_const:cn { c_@@_ #1 _tl } {#2} }
+\cs_new_protected:Npn \@@_define_name:nn #1#2
+  { \tl_const:cn { c_@@_name_ #1 _tl } {#2} }
+\cs_new_protected:Npn \@@_define_name:nnn #1#2#3
+  {
+    \tl_const:cn { c_@@_name_ #1 _en_tl } {#2}
+    \tl_const:cn { c_@@_name_ #1 _zh_tl } {#3}
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Option} \label{subsec:Option}
 %
-% There're three options available when use this template.
+% \begin{macro}{\@@_msg_new:nn,
+%   \@@_error:n, \@@_error:nn, \@@_error:nx, \@@_error:nnn, \@@_error:nnnn,
+%   \@@_warning:n, \@@_warning:nn, \@@_warning:nxx,
+%   \@@_info:nx
+%}
+% 各种信息函数的缩略形式。
+%    \begin{macrocode}
+\cs_new:Npn \@@_msg_new:nn { \msg_new:nnn { hustthesis } }
+\cs_new:Npn \@@_error:n { \msg_error:nn { hustthesis } }
+\cs_new:Npn \@@_error:nn { \msg_error:nnn { hustthesis } }
+\cs_new:Npn \@@_error:nx { \msg_error:nnx { hustthesis } }
+\cs_new:Npn \@@_error:nnn { \msg_error:nnnn { hustthesis } }
+\cs_new:Npn \@@_error:nnnn { \msg_error:nnnnn { hustthesis } }
+\cs_new:Npn \@@_warning:n { \msg_warning:nn { hustthesis } }
+\cs_new:Npn \@@_warning:nn { \msg_warning:nnn { hustthesis } }
+\cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx { hustthesis } }
+\cs_new:Npn \@@_info:nx { \msg_info:nnx { hustthesis } }
+%    \end{macrocode}
+% \end{macro}
 %
-% % \begin{function}{format}
-%     \begin{syntax}
-%         format = \meta{draft\orvar{}\textbf{final}}
-%     \end{syntax}
-%     If \verb+format+ is set to \verb+final+, the header will be removed. This option is only valid if \verb+language+ is not set to \verb+english-draft+. The default value is \verb+final+.
-% \end{function}
+% \subsubsection{\LaTeXe{} 封装}
 %
-% \begin{function}[updated=2013-07-01]{language}
-%     \begin{syntax}
-%         language = \meta{\textbf{chinese}\orvar{}english\orvar{}english-draft}
-%     \end{syntax}
-%     Set what language is used in the document. Specially, if it's set to \verb+english-draft+, all the Chinese characters will be removed in the document. This is extremely helpful when you don't install Chinese fonts. The default value is \verb+chinese+.
-% \end{function}
+% \begin{macro}[deprecated]{\@@_vspace:N, \@@_vspace:n, \@@_vspace:c}
+% 类似 \LaTeXe{} 中的 \tn{vspace*}。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_vspace:N #1
+  {
+    \dim_set_eq:NN \l_@@_tmpa_dim \tex_prevdepth:D
+    \tex_hrule:D height \c_zero_dim
+    \nobreak
+    \skip_vertical:N #1
+    \skip_vertical:N \c_zero_skip
+    \dim_set_eq:NN \tex_prevdepth:D \l_@@_tmpa_dim
+  }
+\cs_new_protected:Npn \@@_vspace:n #1
+  {
+    \skip_set:Nn \l_@@_tmpa_skip {#1}
+    \@@_vspace:N \l_@@_tmpa_skip
+  }
+\cs_generate_variant:Nn \@@_vspace:N { c }
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{degree}
-%     \begin{syntax}
-%         degree = \meta{\textbf{none}\orvar{}fyp\orvar{}bachelor\orvar{}master\orvar{}phd}
-%     \end{syntax}
-%     Set the category of thesis. It will influence the title of document, see Table~\ref{tab:optdegree-en}. The default value is \verb+none+. Noted that the apply name field in the title page can be further customized through \href{doc/function//applyname}{\texttt{\textbackslash{}applyname}} command.
-% \end{function}
+% \begin{macro}[deprecated]{\@@_hrule:nn}
+% 不改变位置的 \tn{hrule}。
+% \begin{arguments}
+%    \item 线段粗细(高度)
+%    \item 线段长度(宽度)
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_hrule:nn #1#2
+  {
+    \rule [ -0.5 ex ] { #2 } { #1 }
+    \skip_horizontal:n { -#2 }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{table}[ht]
-%     \centering
-%     \caption{Title under different \texttt{degree}}\label{tab:optdegree-en}
-%     \begin{tabularx}{\textwidth}{|c|X|}
-%     \hline
-%     \textbf{Option} & \textbf{Title}\\
-%     \hline
-%     \verb+none+  & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree \\ \hline
-%     \verb+fyp+ & A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project \\ \hline
-%     \verb+bachelor+ & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor \\ \hline
-%     \verb+master+ & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master \\ \hline
-%     \verb+phd+ & A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy \\ \hline
-%     \end{tabularx}
-% \end{table}
+% \begin{macro}{\@@_ul_to_wd:nnn}
+  % \begin{arguments}
+  %    \item 下划线粗细
+  %    \item 下划线长度
+  %    \item 内容
+  % \end{arguments}
+%    \begin{macrocode}
+\dim_new:N \l_@@_ul_dim
+\cs_new_protected:Npn \@@_ul_to_wd:nnn #1#2#3
+  {
+    \hbox_overlap_right:n { \rule [ - 0.5 ex ] { #2 } { #1 } }
+    \hbox_to_wd:nn { #2 } { \tex_hfil:D #3 \tex_hfil:D }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Variables setting}
+% \begin{macro}{\@@_line_spread:N, \@@_line_spread:n}
+% 设置行距。
+% \begin{arguments}
+%   \item 行距倍数, |fp| 变量
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_line_spread:N #1
+  {
+    \tl_set:Nn \baselinestretch { \fp_use:N #1 }
+    \selectfont
+  }
+\cs_new:Npn \@@_line_spread:n #1
+  {
+    \tl_set:Nn \baselinestretch { #1 }
+    \selectfont
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% There're some commands which are used to set the variables for the thesis.
+% \begin{macro}[deprecated]{\@@_arabic:n}
+% 等价于 \LaTeXe{} 中的 \tn{arabic}。
+%    \begin{macrocode}
+\cs_new:Npn \@@_arabic:n #1
+  { \int_to_arabic:v { c@ #1 } }
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\title}
-%     \begin{syntax}
-%     \cs{title}\Arg{title}
-%     \end{syntax}
-%     Set title.
-% \end{function}
+% \subsection{选项处理}
 %
-% \begin{function}{\author}
-%     \begin{syntax}
-%     \cs{author}\Arg{author}
-%     \end{syntax}
-%     Set author.
-% \end{function}
+% 定义 | hust / option | 键值类,该键值类仅可在文档类选项中使用。
+%    \begin{macrocode}
+\keys_define:nn { hust / option }
+  {
+%    \end{macrocode}
 %
-% \begin{function}{\date}
-%     \begin{syntax}
-%     \cs{date}\Arg{Year}\Arg{Month}\Arg{Day}
-%     \end{syntax}
-%     Set date. If you don't set it, template will use current date.
-% \end{function}
+% \begin{macro}[module=option/]{type}
+% 论文类型。目前分为硕士学位论文~\opt{master} 和博士学位论文~\opt{doctor},默认为博士学位论文。
+%    \begin{macrocode}
+    type .choices:nn =
+      { master, doctor }
+      { \tl_gset_eq:NN \g_@@_degree_type_tl \l_keys_choice_tl },
+    type .value_required:n = true,
+    type .initial:n = { doctor },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\schoolname}
-%     \begin{syntax}
-%     \cs{schoolname}\Arg{school name}
-%     \end{syntax}
-%     Set the name of school which has been set as \\*\hbox{\verb+\schoolname{Huazhong University of Science \& Technology}+} by default. So unless you want to change the name, you don't need to use this command.
-% \end{function}
+% \begin{macro}[module=option/]{draft}
+% 是否启用草稿模式。默认为 \opt{false}。
+%    \begin{macrocode}
+    draft .choice:,
+    draft / true .code:n =
+      {
+        \bool_gset_true:N \g_@@_draft_bool
+        \clist_gput_right:Nn \g_@@_to_ctex_class_clist { draft }
+      },
+    draft / false .code:n =
+      {
+        \bool_gset_false:N \g_@@_draft_bool
+      },
+    draft .default:n = { true },
+    draft .initial:n = { false },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\address}
-%     \begin{syntax}
-%     \cs{address}\Arg{address}
-%     \end{syntax}
-%     Set the address of school which has been set as \\*\hbox{\verb+\address{Wuhan~430074, P.~R.~China}+} by default. So unless you want to change the address, you don't need to use this command.
-% \end{function}
+% \begin{macro}[module=option/]{anonymous}
+% \changes{v2.0.0}{2025-02-18}{支持盲审模式}
+% 是否启用盲审模式。默认为 \opt{false},即显示作者信息。\key[option]{anonymous}
+%    \begin{macrocode}
+    anonymous .choice:,
+    anonymous / true .code:n =
+      {
+        \bool_gset_true:N \g_@@_anonymous_bool
+      },
+    anonymous / false .code:n =
+      {
+        \bool_gset_false:N \g_@@_anonymous_bool
+      },
+    anonymous .default:n = { true },
+    anonymous .initial:n = { false },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}[updated=2016-11-17]{\applyname}
-%     \begin{syntax}
-%     \cs{applyname}\Arg{apply name}
-%     \end{syntax}
-%     Custom the apply name which affects English title page. See more detail at~\href{doc/function//degree}{\texttt{degree} option}.
-% \end{function}
+% \begin{macro}[module=option/]{anonymous-list}
+% 在开启盲审模式下需要隐藏的内容。其中连接符(|-|)需替换为下划线(|_|),星号(|*|)需替换为|_en|。
+%    \begin{macrocode}
+    anonymous-list .clist_gset:N = \g_@@_anonymous_clist,
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\major}
-%     \begin{syntax}
-%     \cs{major}\Arg{major}
-%     \end{syntax}
-%     Set your major.
-% \end{function}
+% \begin{macro}[module=option/]{latin-font, cjk-font}
+% 中英文字体选项。\opt{fandol} 和 \opt{gyre} 是等价的。
+%    \begin{macrocode}
+    latin-font .choices:nn =
+      { fandol, gyre, mac, macoffice, win, none, }
+      { \tl_gset:Nn \g_@@_font_latin_tl {#1} },
+    cjk-font .choices:nn =
+      { fandol, founder, mac, macoffice, noto, source, win, none, }
+      { \tl_gset:Nn \g_@@_font_cjk_tl {#1} },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\supervisor}
-%     \begin{syntax}
-%     \cs{supervisor}\Arg{supervisor}
-%     \end{syntax}
-%     Set your supervisor.
-% \end{function}
+% \begin{macro}[module=option/]{fontset}
+% 中英文字体选项。\opt{fontset} 这个名称和 \pkg{ctex} 中的是一致的。
+%    \begin{macrocode}
+    fontset .choices:nn =
+      { fandol, mac, macoffice, win, none, }
+      { \keys_set:nn { hust / option } { latin-font = #1, cjk-font = #1 } },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\asssupervisor}
-%     \begin{syntax}
-%     \cs{asssupervisor}\Arg{ass-supervisor}
-%     \end{syntax}
-%     Set your ass-supervisor if you have.
-% \end{function}
+% \begin{macro}[module=option/]{math-font}
+% 数学字体选项。
+% 由 \pkg{unicode-math} 指定 \XeTeX 和 \LuaTeX 下使用的数学字体。
+%    \begin{macrocode}
+    math-font .choices:nn =
+      {
+        asana, cambria, fira, garamond, lm, libertinus, newcm,
+        stix, bonum, dejavu, pagella, schola, termes, xits, none,
+      }
+      { \tl_gset_eq:NN \g_@@_font_math_tl \l_keys_choice_tl },
+    math-font .initial:n = xits,
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\abstract}
-%     \begin{syntax}
-%     \cs{abstract}\Arg{abstract}
-%     \end{syntax}
-%     Put your abstract.
-% \end{function}
+% \begin{macro}[module=option/]{font-dir}
+% 独立字体文件的路径。
+%    \begin{macrocode}
+    font-dir .code:n =
+      {
+        \bool_gset_true:N \g_@@_font_dir_bool
+        \tl_gset_eq:NN \g_@@_font_dir_tl \l_keys_value_tl
+      },
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\keywords}
-%     \begin{syntax}
-%     \cs{keywords}\Arg{keywords}
-%     \end{syntax}
-%     Put your keywords.
-% \end{function}
+% \begin{macro}[module=option/]{config}
+% 自定义配置文件名。
+%    \begin{macrocode}
+    config .tl_gset:N = \g_@@_config_tl,
+%    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Other commands}
+% 将未知选项传给 \cls{ctexbook} 文档类。
+%    \begin{macrocode}
+    unknown .code:n =
+      { \clist_gput_right:No \g_@@_to_ctex_class_clist { \CurrentOption } }
+  }
+%    \end{macrocode}
 %
-% \begin{function}{\frontmatter,\mainmatter,\backmatter}
-%     Used to determine the different part of document. You can see the example at \autoref{sec:simple-example}.
-% \end{function}
+% \begin{macro}[module=option/, int]{option/}
+% 将文档类选项传给 |hust / option|。
+%    \begin{macrocode}
+\ProcessKeyOptions [ hust / option ]
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{function}{\maketitle,\makecover}
-%     \verb+\maketitle+ and \verb+\makecover+ are the same. Used to create the title page.
-% \end{function}
+% \subsection{常量载入}
 %
-% \begin{function}{\makeabstract}
-%     Used to create abstract page.
-% \end{function}
+% 载入常量定义文件。
+%    \begin{macrocode}
+\tl_if_empty:NTF \g_@@_config_tl
+  {
+    \tl_if_eq:NnT \g_@@_degree_type_tl { master }
+      { \file_input:n { hustthesis-m.def } }
+    \tl_if_eq:NnT \g_@@_degree_type_tl { doctor }
+      { \file_input:n { hustthesis-d.def } }
+  }
+  {
+    \@@_msg_new:nn { load-config-file }
+      { You~ are~ loading~ config~ file~ "#1". }
+    \@@_info:n { load-config-file }
+    \file_input:V { \g_@@_config_tl }
+  }
+%    \end{macrocode}
 %
-% \begin{function}{\tableofcontents}
-%     Used to create table of contents.
-% \end{function}
+% \subsection{宏包载入}
 %
-% \begin{function}{\endateformat}
-%     Used to print the date.
-% \end{function}
+% \sout{对不支持粗体斜体的字体进行兼容处理,仅限于 \XeTeX{} 引擎。}\\
+% \sout{参考自 \url{https://ask.latexstudio.net/ask/question/17464.html}。}
+%    \begin{macrocode}
+%\sys_if_engine_xetex:T
+%  {
+%    \PassOptionsToPackage { AutoFakeBold=4.0 } { xeCJK }
+%    \AddToHook { package / ctex / before }
+%      {
+%        \AddToHook { package / xeCJK / after }
+%          {
+%            \keys_define:nn { xeCJK / features }
+%              {
+%                BoldFont .code:n = ,
+%                ItalicFont .code:n =,
+%              }
+%          }
+%      }
+%    \AddToHook { package / ctex / after }
+%      {
+%        \keys_define:nn { xeCJK / features }
+%          {
+%            BoldFont .tl_set:N = \l__xeCJK_font_name_bf_tl ,
+%            ItalicFont .tl_set:N = \l__xeCJK_font_name_it_tl,
+%          }
+%      }
+%  }
+%    \end{macrocode}
 %
-% \vskip 1ex\DescribeEnv{ack}
-%     The \verb+ack+ environment is used to create acknowledge page.
-%     \begin{verbatim}
-%     \begin{ack}
-%         <content>
-%     \end{ack}
-%     \end{verbatim}
+% 将选项传入 \cls{ctexbook} 文档类。
+%    \begin{macrocode}
+\PassOptionsToClass
+  {
+    a4paper,
+    UTF8,
+    scheme = chinese,
+    fontset = none,
+    oneside,
+    heading = true,
+    zihao = -4,
+    linespread = \c_@@_line_spread_fp,
+    \g_@@_to_ctex_class_clist,
+  }
+  { ctexbook }
+\LoadClass { ctexbook }
+%    \end{macrocode}
 %
-% \begin{function}{\bibliography}
-%     \begin{syntax}
-%     \cs{bibliography}\Arg{.bib file}
-%     \end{syntax}
-%     Used to create bibliography page.
-% \end{function}
+% 其中 \pkg{utfsym} 宏包不依赖外部字体,使用 \TikZ{} 宏包绘制 |U+2610|:~☐,|U+2611|:~☑,|U+1F5F9|:~\usym{1F5F9} 等符号。
+%    \begin{macrocode}
+\RequirePackage
+  {
+    amsmath,
+    geometry,
+    fancyhdr,
+    titletoc,
+    graphicx,
+    multirow,
+    longtable,
+    caption,
+    utfsym,
+  }
+%    \end{macrocode}
 %
-% \vskip 1ex\DescribeEnv{appendix}
-%     The \verb+appendix+ environment is for appendix of course. Used like this:
-%     \begin{verbatim}
-%     \begin{appendix}
-%         <content>
-%     \end{appendix}
-%     \end{verbatim}
-% \begin{function}{\appendix}
-%     Or simple use \verb+\appendix+ to indicate that the rest of document are all in appendix, like this:
-%     \begin{verbatim}
-%     \appendix
-%     <content>
-%     \end{verbatim}
-% \end{function}
+% 载入基于 \clsname{} 样式的 \pkg{biblatex} 宏包。
+%    \begin{macrocode}
+\RequirePackage[style=hustthesis]{biblatex}
+%    \end{macrocode}
 %
-% \begin{function}{\listoffigures,\listoftables}
-%     Create the index for all the figures and tables separately.
-% \end{function}
 %
-% \vskip 1ex\DescribeEnv{publications}
-%     The \verb+publications+ environment is where you list all of your published thesises. It's usually putted in appendix.
-%     \begin{verbatim}
-%     \begin{publications}
-%         \item <thesis>
-%         <...>
-%     \end{publications}
-%     \end{verbatim}
+% \section{全局样式}
 %
-% \begin{function}{\TurnOffTabFontSetting,\TurnOnTabFontSetting}
-%     This template has set the font size and line spread for all the tables which makes it's impossible to change font format temporary in one table.  So it provides these to command to temporary disable or enable default font setting in table. For example, if you want to change table font size, you can use the code like this:
-%     \begin{verbatim}
-%     \begingroup
-%     \TurnOffTabFontSetting
-%     \footnotesize % Set your font format as you like.
-%     \begin{tabular}{...}
-%         <content>
-%     \end{tabular}
-%     \TurnOnTabFontSetting
-%     \endgroup
-%     \end{verbatim}
-% \end{function}
+% 隐藏盲审模式下需要隐藏的内容。
+%    \begin{macrocode}
+\clist_map_inline:Nn \g_@@_anonymous_clist
+  {
+    \tl_gset_eq:cN { g_@@_name_ #1 _tl } \c_empty_tl
+  }
+%    \end{macrocode}
 %
-% \begin{function}{\email}
-%     \begin{syntax}
-%     \cs{email}\Arg{Email Address}
-%     \end{syntax}
-%     A command to display email address. For example, \verb+\email{name at example.com}+ would look like this: \email{name at example.com}.
-% \end{function}
+% \subsection{页面布局}
+% 利用 \pkg{geometry} 宏包设置纸张大小、页面边距以及页眉高度。
+%    \begin{macrocode}
+\geometry
+  {
+    top = 4.5 cm,
+    bottom = 2.8 cm,
+    left = 2.8 cm,
+    right = 2.8 cm,
+    headheight = 30 pt,
+  }
+%    \end{macrocode}
 %
-% \section{Simple example}\label{sec:simple-example}
-% Below is a simple example of using this template. For a complete example see \texttt{hustthesis-en-example.tex} which will generate \href{https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-en-example.pdf}{\texttt{hustthesis-en-example.pdf}}.
+% \subsection{字体设置}
 %
-% \iffalse
-%<*driver>
-% \fi
-\begin{lstlisting}[language={[LaTeX]TeX}]
-\documentclass[degree=phd,language=english]{hustthesis}
-
-\title{your title}
-\author{your name}
-\major{your major}
-\supervisor{your supervisor}
-\date{2013}{7}{1}
-
-\abstract{the abstract}
-\keywords{the keywords}
-
-\begin{document}
-
-\frontmatter
-\maketitle
-\makeabstract
-\tableofcontents
-\listoffigures
-\listoftables
-\mainmatter
-
-%% main body
-
-\backmatter
-
-\begin{ack}
-%% acknowledge
-\end{ack}
-\bibliography{.bib file}
-
-\appendix
-
-\begin{publications}
-%% your publications
-\end{publications}
-
-%% rest of appendix
-
-\end{document}
-\end{lstlisting}
-% \iffalse
-%</driver>
-% \fi
+% ^^A 本小节初版实现主要来自 \pkg{njuthesis} 文档类。
 %
+% \pkg{fontspec} 包含于 \pkg{ctex} 宏集,无需另行载入。
 %
-% \section{Introduction to some packages used in the template}
+% \subsubsection{操作系统检测}
 %
-% Here's a list of some packages used in the template.
+% \begin{variable}{\c_@@_path_macoffice_tl}
+% mac Office 字体路径。
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_path_macoffice_tl
+  { /Applications/Microsoft~ Word.app/Contents/Resources/DFonts/ }
+%    \end{macrocode}
+% \end{variable}
 %
-% \begin{itemize}
-%     \item \pkgurl{algorithm2e} For display algorithm.
-%     \item \pkgurl{enumitem} For set the style of enumerate, itemize and description environment.
-%     \item \pkgurl{fancynum} Display the really big number.
-%     \item \pkgurl{listings} For display the highlighted code. If you need better quality, use the package \pkgurl{minted}.
-%     \item \pkgurl{longtable} Create a very long table.
-%     \item \pkgurl{ltxtable} Combine the features of \textsf{longtable} anb \textsf{tabularx}.
-%     \item \pkgurl{multirow} Combine multi-rows in table.
-%     \item \pkgurl{overpic} Put something over a picture,
-%     \item \pkgurl{tabularx} A better table environment.
-% \end{itemize}
+% 操作系统检测。相较于 \pkg{ctex} 提供的 \cs{ctex_detect_platform:},
+% 额外增加了对 macOS 上 MS Office 的检测。
+%    \begin{macrocode}
+\sys_if_platform_windows:TF
+  { \tl_gset:Nn \g_@@_font_set_tl { win } }
+  {
+    \ctex_if_platform_macos:TF
+      {
+        \file_if_exist:nTF { \c_@@_path_macoffice_tl times.ttf }
+          { \tl_gset:Nn \g_@@_font_set_tl { macoffice } }
+          { \tl_gset:Nn \g_@@_font_set_tl { mac } }
+      }
+      { \tl_gset:Nn \g_@@_font_set_tl { fandol } }
+  }
+%    \end{macrocode}
+% 判断用户是否自定义了中英文字体。如果其中任意一种未被定义,
+% 则使用系统预装字体覆盖字体选项。
+% Windows 或 macOS 外的系统被判断为 Linux,一律使用自由字体。
+%    \begin{macrocode}
+\tl_if_empty:NT \g_@@_font_latin_tl
+  { \tl_gset_eq:NN \g_@@_font_latin_tl \g_@@_font_set_tl }
+\tl_if_empty:NT \g_@@_font_cjk_tl
+  { \tl_gset_eq:NN \g_@@_font_cjk_tl \g_@@_font_set_tl }
+%    \end{macrocode}
 %
-% \StopEventually{
-%  \PrintIndex
-%  \PrintChanges
+%
+% \subsubsection{定义英文字库}
+%
+% 接下来逐个定义所需要使用的字库。
+%
+% \begin{macro}{
+%   \@@_loadfont_latin:n,
+%   \@@_loadfont_latin_win:,
+%   \@@_loadfont_latin_mac:,
 % }
+% Windows 与 macOS 西文字体的区别主要在于默认等宽字体。
+%    \begin{macrocode}
+\cs_new:Npn \@@_loadfont_latin:n #1
+  {
+    \__fontspec_main_setmainfont:nn { } { Times~New~Roman }
+    \__fontspec_main_setsansfont:nn { } { Arial }
+    \__fontspec_main_setmonofont:nn { Scale = MatchLowercase } {#1}
+  }
+\cs_new_protected:Npn \@@_loadfont_latin_win:
+  { \@@_loadfont_latin:n { Courier~New } }
+\cs_new_protected:Npn \@@_loadfont_latin_mac:
+  {
+    \@@_loadfont_latin:n { Menlo }
+%    \end{macrocode}
+% 检测 Times New Roman 是否具有小型大写字母(small caps)字型。
+% 这是 macOS 预装的字体版本较旧导致的。
+%    \begin{macrocode}
+    \fontspec_if_small_caps:F
+      {
+        \@@_warning:n { no-small-caps }
+        \__fontspec_main_setmainfont:nn
+          { \c_@@_name_gyrefeature_clist } { texgyretermes }
+      }
+  }
+\@@_msg_new:nn { no-small-caps }
+  {
+    I~ am~ using~ TeX~ Gyre~ Termes~ as~ default~ Roman~ font.\\
+    This~ is~ because~ the~ "Times~ New~ Roman"~ font~ in~ your~
+    system~ does~ not~ embed~ glyphs~ for~ small~ capitals.~
+    You~ can~ ignore~ this~ warning~ if~ you~ do~ not~ need~
+    \string\textsc.~ For~ more~ information,~
+    please~ refer~ to~ section~ 3.2.6~ of~ the~ documentation.
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% \part{Implementation}\label{part:Implementation}
+% \begin{macro}{\@@_loadfont_latin_macoffice:}
+% mac Office 西文字体。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_loadfont_latin_macoffice:
+  {
+    \__fontspec_main_setmainfont:nn
+      { \c_@@_name_macofficefeature_clist } { times }
+    \__fontspec_main_setsansfont:nn
+      { \c_@@_name_macofficefeature_clist } { arial }
+    \__fontspec_main_setmonofont:nn
+      { Scale = MatchLowercase } { Menlo }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
+% \begin{variable}{\c_@@_name_macofficefeature_clist}
+% 用于 \pkg{fontspec} 的 mac Office 字体特性列表。
 %    \begin{macrocode}
-%<*class>
-\RequirePackage{ifthen}
+\clist_const:Nn \c_@@_name_macofficefeature_clist
+  {
+    Path = \c_@@_path_macoffice_tl,
+    Extension = .ttf,
+    UprightFont = *,
+    BoldFont = *bd,
+    ItalicFont = *i,
+    BoldItalicFont = *bi,
+  }
 %    \end{macrocode}
+% \end{variable}
 %
-% \section{Process Options}
-% Use \pkgurl{xkeyval} to process options.
+% \begin{macro}{\@@_loadfont_latin_gyre:}
+% 开源的 \TeX Gyre 西文字体。
 %    \begin{macrocode}
-\RequirePackage{xkeyval}
+\cs_new_protected:Npn \@@_loadfont_latin_gyre:
+  {
+    \__fontspec_main_setmainfont:nn
+      { \c_@@_name_gyrefeature_clist } { texgyretermes }
+    \__fontspec_main_setsansfont:nn
+      { \c_@@_name_gyrefeature_clist } { texgyreheros }
+    \__fontspec_main_setmonofont:nn
+      {
+        \c_@@_name_gyrefeature_clist,
+        Scale = MatchLowercase,
+        Ligatures = CommonOff,
+      }
+      { texgyrecursor }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Option |format|.
+% \begin{macro}{\@@_loadfont_latin_fandol:}
+% 为兼容 \pkg{ctex} 做出的名称改变。
 %    \begin{macrocode}
-\newif\ifHUST at finalformat
-\HUST at finalformattrue
-\DeclareOptionX{format}[final]{
-  \ifthenelse{\equal{#1}{final}}{
-    \HUST at finalformattrue
-  }{
-    \ifthenelse{\equal{#1}{draft}}{
-      \HUST at finalformatfalse
-    }{
-      \ClassError{hustthesis}
-      {Option format can only be 'final' or 'draft'}
-      {Try to remove option format^^J}
-    }
+\cs_new_eq:NN \@@_loadfont_latin_fandol: \@@_loadfont_latin_gyre:
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\c_@@_name_gyrefeature_clist}
+% 用于 \pkg{fontspec} 的 \TeX Gyre 字体特性列表。
+%    \begin{macrocode}
+\clist_const:Nn \c_@@_name_gyrefeature_clist
+  {
+    Extension = .otf,
+    UprightFont = *-regular,
+    BoldFont = *-bold,
+    ItalicFont = *-italic,
+    BoldItalicFont = *-bolditalic,
   }
-}
 %    \end{macrocode}
+% \end{variable}
 %
-% Option |language|.
+%
+% \subsubsection{定义中文字库}
+%
+% \begin{macro}{\@@_hide_no_script_msg:}
+% 隐藏 |does not contain script "CJK"| 警告。
 %    \begin{macrocode}
-\gdef\HUST at language{chinese}
-\DeclareOptionX{language}[chinese]{
-  \ifthenelse{\equal{#1}{chinese} \OR \equal{#1}{english} \OR \equal{#1}{english-draft}}{
-    \gdef\HUST at language{#1}
-  }{
-    \ClassError{hustthesis}
-    {Option language can only be 'chinese', 'english' or 'english-draft'}
-    {Try to remove option language^^J}
+\cs_new:Npn \@@_hide_no_script_msg:
+  { \msg_redirect_name:nnn { fontspec } { no-script } { info } }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_loadfont_cjk_win:N, \@@_loadfont_cjk_win:}
+% Windows 中文字体。
+%    \begin{macrocode}
+\cs_new:Npn \@@_loadfont_cjk_win:N #1
+  {
+    \setCJKmainfont { SimSun } [ #1, ItalicFont = KaiTi ]
+    \setCJKsansfont { SimHei } [#1]
+    \setCJKmonofont { FangSong } [#1]
+    \setCJKfamilyfont { zhsong } { SimSun } [#1]
+    \setCJKfamilyfont { zhhei } { SimHei } [#1]
+    \setCJKfamilyfont { zhfs } { FangSong } [#1]
+    \setCJKfamilyfont { zhkai } { KaiTi } [#1]
+    \@@_define_stzhongs:nn { STZhongsong } {#1}
   }
-}
+\cs_new:Npn \@@_loadfont_cjk_win:
+  { \@@_loadfont_cjk_win:N \c_@@_name_fakebold_tl }
 %    \end{macrocode}
+% \end{macro}
 %
-% Option |degree|.
+% \begin{macro}{\@@_loadfont_cjk_mac:}
+% macOS 字体。
+% ^^A TODO: 修复 macOS 字体支持,实现开箱即用。
 %    \begin{macrocode}
-\gdef\HUST at degree{none}
-\DeclareOptionX{degree}[none]{
-  \ifthenelse{\equal{#1}{none} \OR \equal{#1}{fyp} \OR \equal{#1}{bachelor} \OR \equal{#1}{master} \OR \equal{#1}{phd}}{
-    \gdef\HUST at degree{#1}
-  }{
-     \ClassError{hustthesis}
-      {Option degree can only be 'none', 'fyp', 'bachelor', 'master' or 'phd'}
-      {Try to remove option degree^^J}
+\cs_new_protected:Npn \@@_loadfont_cjk_mac:
+  {
+    \@@_hide_no_script_msg:
+    \setCJKmainfont { Songti~SC~Light }
+      [
+        BoldFont = Songti~SC~Bold,
+        ItalicFont = Kaiti~SC,
+        BoldItalicFont = Kaiti~SC~Bold,
+      ]
+    \setCJKsansfont { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+    \setCJKmonofont { STFangsong }
+    \setCJKfamilyfont { zhsong } { Songti~SC~Light } [ BoldFont = Songti~SC~Bold ]
+    \setCJKfamilyfont { zhhei } { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+    \setCJKfamilyfont { zhfs } { STFangsong }
+    \setCJKfamilyfont { zhkai } { Kaiti~SC } [ BoldFont = Kaiti~SC~Bold ]
   }
-}
 %    \end{macrocode}
+% \end{macro}
 %
-% Process options and load class |book|.
+% \begin{macro}{\@@_loadfont_cjk_macoffice:n, \@@_loadfont_cjk_macoffice:}
+% mac Office 中文字体。
 %    \begin{macrocode}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
-\ProcessOptionsX
-\LoadClass[12pt, a4paper, openany]{book}
+\cs_new:Npn \@@_loadfont_cjk_macoffice:n #1
+  {
+    \setCJKmainfont { Simsun.ttc } [ ItalicFont = Kaiti.ttf, #1 ]
+    \setCJKsansfont { SimHei.ttf } [#1]
+    \setCJKmonofont { Fangsong.ttf } [#1]
+    \setCJKfamilyfont { zhsong } { Simsun.ttc } [#1]
+    \setCJKfamilyfont { zhhei } { SimHei.ttf } [#1]
+    \setCJKfamilyfont { zhfs } { Fangsong.ttf } [#1]
+    \setCJKfamilyfont { zhkai } { Kaiti.ttf } [#1]
+    \@@_define_stzhongs:nn { \c__hust_path_macoffice_tl STZHONGS.ttf } {#1}
+  }
+\cs_new:Npn \@@_loadfont_cjk_macoffice:
+  {
+    \@@_loadfont_cjk_macoffice:n
+      { Path = \c_@@_path_macoffice_tl, \c_@@_name_fakebold_tl }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Check Engine}
-% Check engine, only \XeLaTeX{} and \LuaLaTeX{} are supported.
+% \begin{macro}{\@@_loadfont_cjk_fandol:}
+% Fandol 字体。
 %    \begin{macrocode}
-\RequirePackage{iftex}
-\ifXeTeX\else
-  \ifLuaTeX\else
-    \begingroup
-      \errorcontextlines=-1\relax
-      \newlinechar=10\relax
-      \errmessage{^^J
-      *******************************************************^^J
-      * XeTeX or LuaTeX is required to compile this document.^^J
-      * Sorry!^^J
-      *******************************************************^^J
-      }%
-    \endgroup
-  \fi
-\fi
+\cs_new_protected:Npn \@@_loadfont_cjk_fandol:
+  {
+    \@@_hide_no_script_msg:
+    \setCJKmainfont { FandolSong-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolSong-Bold,
+        ItalicFont = FandolKai-Regular,
+      ]
+    \setCJKsansfont { FandolHei-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolHei-Bold,
+      ]
+    \setCJKmonofont { FandolFang-Regular }
+      [ Extension = .otf ]
+    \setCJKfamilyfont { zhsong } { FandolSong-Regular }
+      [
+        Extension = .otf,
+        BoldFont  = FandolSong-Bold
+      ]
+    \setCJKfamilyfont { zhhei } { FandolHei-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolHei-Bold,
+      ]
+    \setCJKfamilyfont { zhfs } { FandolFang-Regular }
+      [ Extension = .otf ]
+    \setCJKfamilyfont { zhkai } { FandolKai-Regular }
+      [ Extension = .otf, \c_@@_name_fakebold_tl ]
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Font Setting}
-% Set font used in document. Firstly, it's font setting for English font under |english-draft| mode. We use \pkgurl{fontspec} package to handle font. We choose \textsf{Tex Gyre Termes}, \textsf{Droid Sans} and \textsf{CMU Typewriter Text} as document main font, sans font and mono font.
+% \begin{macro}{\@@_loadfont_cjk_founder:}
+% 方正字库(简繁扩展)
 %    \begin{macrocode}
-\ifthenelse{\equal{\HUST at language}{english-draft}}{
-    \RequirePackage{fontspec}
-    \setmainfont[
-      Ligatures={Common,TeX},
-      Extension=.otf,
-      UprightFont=*-regular,
-      BoldFont=*-bold,
-      ItalicFont=*-italic,
-      BoldItalicFont=*-bolditalic]{texgyretermes}
-    \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-    \setmonofont{CMU Typewriter Text}
-    \defaultfontfeatures{Mapping=tex-text}
+\cs_new_protected:Npn \@@_loadfont_cjk_founder:
+  {
 %    \end{macrocode}
+% 调整方正字体括号位置。
+% \footnote{\XeTeX 的调整方法来自 \url{https://www.zhihu.com/question/46241367/answer/101660183}。}
+%    \begin{macrocode}
+    \sys_if_engine_xetex:T
+      { \xeCJKEditPunctStyle { quanjiao } { optimize-kerning = true } }
+    \sys_if_engine_luatex:T
+      { \defaultCJKfontfeatures { JFM = { zh_CN / { quanjiao, fzpr } } } }
+    \setCJKmainfont { FZShuSong-Z01 }
+      [ BoldFont = FZXiaoBiaoSong-B05, ItalicFont = FZKai-Z03 ]
+    \setCJKsansfont { FZXiHeiI-Z08 } [ BoldFont = FZHei-B01 ]
+    \setCJKmonofont { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhsong } { FZShuSong-Z01 }
+      [ BoldFont = FZXiaoBiaoSong-B05 ]
+    \setCJKfamilyfont { zhhei } { FZHei-B01 }
+      [ \c_@@_name_fakebold_tl ]
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c_@@_name_fakebold_tl ]
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \defaultCJKfontfeatures { }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% Now let's set the Chinese font commands into empty, when document is under |english-draft| mode.
+% \begin{macro}{\@@_loadfont_cjk_noto:}
+% Noto 思源字体。
 %    \begin{macrocode}
-    \let\HEI\relax
-    \let\KAI\relax
-    \let\FANGSONG\relax
-    \newcommand{\hei}[1]{#1}
-    \newcommand{\kai}[1]{#1}
-    \newcommand{\fangsong}[1]{#1}
-}{}
+\cs_new_protected:Npn \@@_loadfont_cjk_noto:
+  {
+    \setCJKmainfont [ \c_@@_name_notofeature_clist ]
+      { NotoSerifCJKsc }
+    \setCJKsansfont [ \c_@@_name_notofeature_clist ]
+      { NotoSansCJKsc  }
+    \setCJKmonofont { Noto~Sans~Mono~CJK~SC }
+    \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC }
+    \setCJKfamilyfont { zhhei } { Noto~Sans~CJK~SC }
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c_@@_name_fakebold_tl ]
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Below is the font setting under |chinese| or |english| mode. We chooses the same English font as under |english-draft| mode. We use \pkgurl{xecjk} package (for \XeLaTeX) or \pkgurl[luatexja]{luatex-ja} package (for \LuaLaTeX, recommend) to handle Chinese font. We will use font: \textsf{AdobeSongStd-Light}, \textsf{AdobeKaitiStd-Regular}, \textsf{AdobeHeitiStd-Regular} and \textsf{AdobeFangsongStd-Regular}.
+% \begin{macro}{\@@_loadfont_cjk_source:}
 %    \begin{macrocode}
-\ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \ifXeTeX  % XeTeX下使用fontspec + xeCJK处理字体
-      % 英文字体
-      \RequirePackage{fontspec}
-      \RequirePackage{xunicode}
-      \setmainfont[
-        Ligatures={Common,TeX},
-        Extension=.otf,
-        UprightFont=*-regular,
-        BoldFont=*-bold,
-        ItalicFont=*-italic,
-        BoldItalicFont=*-bolditalic]{texgyretermes}
-      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-      \setmonofont{CMU Typewriter Text}
-      \defaultfontfeatures{Mapping=tex-text}
-      % 中文字体
-      \RequirePackage[CJKmath]{xeCJK}
-      \setCJKmainfont[
-       BoldFont={Adobe Heiti Std},
-       ItalicFont={Adobe Kaiti Std}]{Adobe Song Std}
-      \setCJKsansfont{Adobe Kaiti Std}
-      \setCJKmonofont{Adobe Fangsong Std}
-      \xeCJKsetup{PunctStyle=kaiming}
-
-      \newcommand\ziju[2]{{\renewcommand{\CJKglue}{\hskip #1} #2}}
+\cs_new_protected:Npn \@@_loadfont_cjk_source:
+  {
+    \setCJKmainfont [ \c_@@_name_notofeature_clist ]
+      { SourceHanSerifSC }
+    \setCJKsansfont [ \c_@@_name_notofeature_clist ]
+      { SourceHanSansSC  }
+    \setCJKmonofont { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhsong } { Source~Han~Serif~SC }
+    \setCJKfamilyfont { zhhei } { Source~Han~Sans~SC }
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c_@@_name_fakebold_tl ]
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\HEI}
+% \begin{variable}{\c_@@_name_fakebold_tl}
 %    \begin{macrocode}
-      \newCJKfontfamily\HEI{Adobe Heiti Std}
+\tl_const:Nn \c_@@_name_fakebold_tl { AutoFakeBold = 2.17 }
 %    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_name_notofeature_clist}
+% 用于 \pkg{fontspec} 的思源字体特性列表。
+%    \begin{macrocode}
+\clist_const:Nn \c_@@_name_notofeature_clist
+  {
+    Extension = .otf,
+    UprightFont = *-Regular,
+    BoldFont = *-Bold,
+    ItalicFont = *-Regular,
+    BoldItalicFont = *-Bold,
+    ItalicFeatures = FakeSlant,
+    BoldItalicFeatures = FakeSlant,
+  }
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_name_stzhongsopts_tl}
+% 华文中宋的字体特性列表,默认为仅使用伪粗体。
+%    \begin{macrocode}
+\tl_new:N \l_@@_name_stzhongsopts_tl
+\tl_set_eq:NN \l_@@_name_stzhongsopts_tl \c_@@_name_fakebold_tl
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_define_stzhongs:nn}
+% 中文封面额外需要的华文中宋。
+%    \begin{macrocode}
+\tl_new:N \l_@@_name_stzhongsfile_tl
+\cs_new:Npn \@@_define_stzhongs:nn #1#2
+  {
+    \tl_set:Nn \l_@@_name_stzhongsfile_tl {#1}
+    \tl_set:Nn \l_@@_name_stzhongsopts_tl {#2}
+  }
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\KAI}
+% \begin{macro}{\@@_loadfont_stzhongs:n}
+% \begin{macro}{\@@_loadfont_stzhongs:V, \@@_loadfont_stzhongs:, \@@_stzhongs:}
+% 研究生封面额外需要的华文中宋。
 %    \begin{macrocode}
-      \newCJKfontfamily\KAI{Adobe Kaiti Std}
+\cs_new:Npn \@@_loadfont_stzhongs:
+  {
+    \@@_loadfont_stzhongs:V \l_@@_name_stzhongsfile_tl
+  }
+\cs_new_protected:Npn \@@_loadfont_stzhongs:n #1
+  {
+    \fontspec_font_if_exist:nTF { #1 }
+      {
+        \newCJKfontfamily \@@_stzhongs: { #1 }
+          [ \l_@@_name_stzhongsopts_tl ]
+      }
+      {
+        \bool_if:NTF \g_@@_font_dir_bool
+          {
+            \newCJKfontfamily \@@_stzhongs: { #1 }
+              [ Path = \g_@@_font_dir_tl, \c_@@_name_fakebold_tl ]
+          }
+          {
+            \cs_set_eq:NN \@@_stzhongs: \rmfamily
+            \@@_warning:n { missing-stzhongs }
+          }
+      }
+  }
+\@@_msg_new:nn { missing-stzhongs }
+  {
+    "STZHONGS.TTF"~ is~ not~ found~ in~ your~ system.\\
+    The~ font~ is~ normally~ distributed~ with~ MS~ Windows.~
+    I~ have~ used~ songti~ for~ substitution.
+  }
+\cs_generate_variant:Nn \@@_loadfont_stzhongs:n { V }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
-% \begin{macro}{\FANGSONG}
+%
+% \subsubsection{定义数学字库}
+%
+% \begin{macro}{\@@_define_math_font:nn}
+% 批量定义数学字体配置。
 %    \begin{macrocode}
-      \newCJKfontfamily\FANGSONG{Adobe Fangsong Std}
+\cs_new:Npn \@@_define_math_font:nn #1#2
+  {
+    \cs_new:cpn { @@_loadfont_math_ #1 : }
+      { \__um_setmathfont:nn { } {#2} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\hei}
+% \begin{macro}
+% {
+%   \@@_loadfont_math_asana:,
+%   \@@_loadfont_math_fira:,
+%   \@@_loadfont_math_garamond:,
+%   \@@_loadfont_math_lm:,
+%   \@@_loadfont_math_libertinus:,
+%   \@@_loadfont_math_stix:,
+%   \@@_loadfont_math_bonum:,
+%   \@@_loadfont_math_dejavu:,
+%   \@@_loadfont_math_pagella:,
+%   \@@_loadfont_math_schola:,
+%   \@@_loadfont_math_termes:,
+% }
+% 批量定义若干数学字体的载入命令。
 %    \begin{macrocode}
-      \newcommand{\hei}[1]{{\HEI #1}}
+\clist_map_inline:nn
+  {
+    { asana } { Asana-Math.otf },
+    { fira } { FiraMath-Regular.otf },
+    { garamond } { Garamond-Math.otf },
+    { lm } { latinmodern-math.otf },
+    { libertinus } { LibertinusMath-Regular.otf },
+    { stix } { STIXMath-Regular.otf },
+    { bonum } { texgyrebonum-math.otf },
+    { dejavu } { texgyredejavu-math.otf },
+    { pagella } { texgyrepagella-math.otf },
+    { schola } { texgyreschola-math.otf },
+    { termes } { texgyretermes-math.otf },
+  }
+  { \@@_define_math_font:nn #1 }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\kai}
+% \begin{macro}{\@@_loadfont_math_cambria:}
+% Cambria Math 字体配置。
 %    \begin{macrocode}
-      \newcommand{\kai}[1]{{\KAI #1}}
+\cs_new:Npn \@@_loadfont_math_cambria:
+  {
+    \bool_if:NTF \g_@@_font_dir_bool
+      {
+        \__um_setmathfont:nn
+          { Path = \g_@@_font_dir_tl/, FontIndex = 1 }
+          { cambria.ttc }
+      }
+      { \__um_setmathfont:nn { } { Cambria~Math } }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\fangsong}
+% \begin{macro}{\@@_loadfont_math_xits:}
+% XITS Math 字体。
 %    \begin{macrocode}
-      \newcommand{\fangsong}[1]{{\FANGSONG #1}}
+\cs_new:Npn \@@_loadfont_math_xits:
+  {
+    \bool_if:NTF \g_@@_opt_math_int_bool
+      { \tl_set:Nn \l_@@_tmpa_tl { 8 } }
+      { \tl_clear:N \l_@@_tmpa_tl }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = \l_@@_tmpa_tl,
+        BoldFont = XITSMath-Bold,
+      }
+      { XITSMath-Regular }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = 1,
+        range = {cal, bfcal},
+      }
+      { XITSMath-Regular }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_loadfont_math_newcm:}
+% New Computer Modern Math 字体。
 %    \begin{macrocode}
-    \else\fi
-    \ifLuaTeX  % LuaTeX下使用luatex-ja处理字体 [推荐]
-      \RequirePackage{luatexja-fontspec}
-      % 英文字体
-      \setmainfont[Ligatures={Common,TeX}]{Tex Gyre Termes}
-      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-      \setmonofont{CMU Typewriter Text}
-      \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
-      % 中文字体
-      \setmainjfont[
-       BoldFont={AdobeHeitiStd-Regular},
-       ItalicFont={AdobeKaitiStd-Regular}]{AdobeSongStd-Light}
-      \setsansjfont{AdobeKaitiStd-Regular}
-      \defaultjfontfeatures{JFM=kaiming}
-
-      \newcommand\ziju[2]{\vbox{\ltjsetparameter{kanjiskip=#1} #2}}
+\cs_new:Npn \@@_loadfont_math_newcm:
+  {
+    \bool_if:NTF \g_@@_opt_math_int_bool
+      { \tl_set:Nn \l_@@_tmpa_tl { 2 } }
+      { \tl_clear:N \l_@@_tmpa_tl }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = \l_@@_tmpa_tl,
+      }
+      { NewCMMath-Book }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = 1,
+        range = {scr,bfscr},
+      }
+      { NewCMMath-Book }
+    \__fontspec_main_setmathrm:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        BoldFont = *-Bold,
+        ItalicFont = *-BookItalic,
+        BoldItalicFont = *-BoldItalic,
+      }
+      { NewCM10 }
+    \__fontspec_main_setmathsf:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        BoldFont = *-Bold,
+        ItalicFont = *-BookOblique,
+        BoldItalicFont = *-BoldOblique,
+      }
+      { NewCMSans10 }
+    \__fontspec_main_setmathtt:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        ItalicFont = *-BookItalic,
+        BoldFont = *-Bold,
+        BoldItalicFont = *-BoldOblique,
+      }
+      { NewCMMono10 }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\HEI}
+% \begin{macro}{\@@_loadfont_math_none:}
+% 不进行数学字体配置。
 %    \begin{macrocode}
-      \newjfontfamily\HEI{AdobeHeitiStd-Regular}
+\cs_set_eq:NN \@@_loadfont_math_none: \tex_relax:D
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\KAI}
+%
+% \subsubsection{载入指定字库}
+%
+% \begin{macro}{\@@_loadfont:}
+% 载入字体命令。
 %    \begin{macrocode}
-      \newjfontfamily\KAI{AdobeKaitiStd-Regular}
+\cs_new_protected:Npn \@@_loadfont:
+  {
+    \use:c { @@_loadfont_latin_ \g_@@_font_latin_tl : }
+    \use:c { @@_loadfont_cjk_ \g_@@_font_cjk_tl : }
 %    \end{macrocode}
+% 自行定义 \pkg{ctex} 中的四类字体命令。
+%    \begin{macrocode}
+    \NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+    \NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+    \NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+    \NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+  }
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\FANGSONG}
+% 载入设置的字体。^^A 为了吸收导言区的设置,放在其后载入。
 %    \begin{macrocode}
-      \newjfontfamily\FANGSONG{AdobeFangsongStd-Regular}
+% \BeforeBeginEnvironment { document } { \@@_loadfont: }
+\@@_loadfont:
 %    \end{macrocode}
+%
+% 将华文中宋放在文档类最后载入。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n { \@@_loadfont_stzhongs: }
+%    \end{macrocode}
+%
+% \subsection{页眉页脚}
+%
+% 清除默认页眉页脚格式。
+%    \begin{macrocode}
+\fancyhf {}
+%    \end{macrocode}
+%
+% 设置页眉页脚颜色。
+% \changes{v2.0.0}{2025-02-21}{使用 \pkg{l3color},不再依赖 \pkg{xcolor}}
+%    \begin{macrocode}
+\color_set:nn { headfoot } { red }
+% \providecolor { headfoot } { rgb } { 1, 0, 0 }
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_draw_hf_hline:n}
+% 绘制页眉页脚横线。
+% \begin{arguments}
+%   \item 页眉页脚线的高度(粗细)
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_draw_hf_hline:n #1
+  {
+    { \color_select:n { headfoot } \tex_hrule:D height #1 }
+  }
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\hei}
+% \sout{设置页眉格式。仅在非盲审模式~\key{anonymous} 下显示学校名称。}
 %    \begin{macrocode}
-      \newcommand{\hei}[1]{{\jfontspec{AdobeHeitiStd-Regular} #1}}
+%\bool_if:NF \g_@@_anonymous_bool
+%  {
+    \chead
+      {
+        \zihao{3} \ziju{0.75} \bfseries \kaishu
+        \color_group_begin:
+        \color_select:n { headfoot }
+        \c_@@_header_tl
+        \color_group_end:
+      }
+%  }
+\tl_set:Nn { \headrulewidth } { 1 pt }
+\tl_set:Nn { \headrule }
+  {
+    \skip_vertical:n { 3 pt }
+    \@@_draw_hf_hline:n \headrulewidth
+    \skip_vertical:n \headrulewidth
+    \@@_draw_hf_hline:n \headrulewidth
+  }
 %    \end{macrocode}
+%
+% 设置页脚格式。
+%    \begin{macrocode}
+\cfoot { \zihao{-5} \thepage }
+\tl_set:Nn { \footrulewidth } { 0.5 pt }
+\tl_set:Nn { \footrule }
+  {
+    \@@_draw_hf_hline:n \footrulewidth
+    \skip_vertical:n { 3 pt }
+  }
+%    \end{macrocode}
+%
+% \pkg{ctex} 宏包使用 |heading| 选项后,会把页面格式设置为 |headings|。
+% 因此必须在 \pkg{ctex} 调用之后重新设置 \tn{pagestyle} 为 |fancy|。
+%    \begin{macrocode}
+\pagestyle { fancy }
+%    \end{macrocode}
+%
+%
+% \section{封面扉页样式}
+%
+% 定义中英文封面,答辩委员会页,声明页样式,即在正文前不含有页眉页脚的特殊页面样式。
+%
+% \subsection{信息录入}
+%
+% \begin{variable}{
+%   \g_@@_info_title_tl,
+%   \g_@@_info_degree_tl,
+%   \g_@@_info_author_tl,
+%   \g_@@_info_major_tl,
+%   \g_@@_info_supervisor_tl,
+%   \g_@@_info_date_tl,
+%   \g_@@_info_clc_tl,
+%   \g_@@_info_student_id_tl,
+%   \g_@@_info_school_id_tl,
+%   \g_@@_info_secret_tl,
+% }
+% 声明中文封面信息。
+%    \begin{macrocode}
+\tl_new:N \g_@@_info_title_tl
+\tl_new:N \g_@@_info_degree_type_tl
+\tl_new:N \g_@@_info_author_tl
+\tl_new:N \g_@@_info_major_tl
+\tl_new:N \g_@@_info_supervisor_tl
+\tl_new:N \g_@@_info_date_tl
+\tl_new:N \g_@@_info_clc_tl
+\tl_new:N \g_@@_info_student_id_tl
+\tl_new:N \g_@@_info_school_id_tl
+\tl_new:N \g_@@_info_secret_tl
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{
+%   \g_@@_info_title_en_tl,
+%   \g_@@_info_author_en_tl,
+%   \g_@@_info_major_en_tl,
+%   \g_@@_info_supervisor_en_tl,
+%   \g_@@_info_date_en_tl,
+%   \g_@@_info_degree_en_tl,
+% }
+% 声明英文封面信息。
+%    \begin{macrocode}
+\tl_new:N \g_@@_info_title_en_tl
+\tl_new:N \g_@@_info_author_en_tl
+\tl_new:N \g_@@_info_major_en_tl
+\tl_new:N \g_@@_info_supervisor_en_tl
+\tl_new:N \g_@@_info_date_en_tl
+\tl_new:N \g_@@_info_degree_en_tl
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\g_@@_info_committee_seq}
+% 声明答辩委员会成员列表。
+%    \begin{macrocode}
+\seq_new:N \g_@@_info_committee_seq
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\kai}
+% \begin{variable}{\l_@@_info_title_sanitized_tl,\l_@@_info_title_en_sanitized_tl}
+% 处理后的论文标题。
 %    \begin{macrocode}
-      \newcommand{\kai}[1]{{\jfontspec{AdobeKaitiStd-Regular} #1}}
+\tl_new:N \l_@@_info_title_sanitized_tl
+\tl_new:N \l_@@_info_title_en_sanitized_tl
 %    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[do-not-index={\1, \2}]{\@@_set_title:nn}
+% 设置论文标题,并删除其中的 |\\| 和汉字间的空格。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_set_title:nn #1#2
+  {
+    \tl_gset:cn { g_@@_info_ #1 _tl } { #2 }
+    \tl_set:cn { l_@@_info_ #1 _sanitized_tl } { #2 }
+    \tl_replace_all:cnn { l_@@_info_ #1 _sanitized_tl } { \\ } { ~ }
+    \regex_replace_all:nnc
+      { \s+ } { \ }
+      { l_@@_info_ #1 _sanitized_tl }
+    \regex_replace_all:nnc
+      { ([\x{4e00}-\x{9fff}]) \s+ ([\x{4e00}-\x{9fff}]) } { \1 \2 }
+      { l_@@_info_ #1 _sanitized_tl }
+  }
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\fangsong}
+% \begin{macro}{\@@_set_date:n}
+% 设置论文提交日期。
 %    \begin{macrocode}
-      \newcommand{\fangsong}[1]{{\jfontspec{AdobeFangsongStd-Regular} #1}}
+\cs_new:Npn \@@_set_date:n #1
+  {
+    \@@_set_date_aux:w #1 \q_stop
+  }
+\cs_new_protected:Npn \@@_set_date_aux:w #1 - #2 - #3 \q_stop
+  {
+    \tl_gset:Nn \g_@@_info_date_tl { {#1} 年 {#2} 月 {#3} 日 }
+    \tl_gset:Nn \g_@@_info_date_en_tl
+      { \clist_item:Nn \c_@@_month_clist {#2},~ {#1} }
+  }
+\clist_const:Nn \c_@@_month_clist
+  {
+    January, February, March, April, May, June,
+    July, August, September, October, November, December,
+  }
 %    \end{macrocode}
 % \end{macro}
 %
+% 定义 |hust/info| 键值类。
 %    \begin{macrocode}
-    \else\fi
+\keys_define:nn { hust / info }
+  {
 %    \end{macrocode}
 %
-% Generate Chinese number using \pkgurl{zhnumber}.
+% \begin{macro}[module=info/]{info/title, info/title*}
+% 论文题目。以下带星号的项目均表示相应的英文字段。
 %    \begin{macrocode}
-    \RequirePackage{zhnumber}
-    \def\CJKnumber#1{\zhnumber{#1}} % 兼容CJKnumb
-}
+    title .tl_gset:N = \g_@@_info_title_tl,
+    title* .tl_gset:N = \g_@@_info_title_en_tl,
+%    title .code:n = { \@@_set_title:nn { title } { #1 } },
+%    title* .code:n = { \@@_set_title:nn { title_en } { #1 } },
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Basic Format}
-% We set global line spread to 1.3.
+% \begin{macro}[module=info/]{info/degree, info/degree*}
+% 学位类型(中文)或学科(英文)。
+% 中文类型~\key[info]{degree} 分为学术型~\opt{academic},和专业型~\opt{professional};
+% 英文学科~\key[info]{degree*}\footnote{为保持命名一致性,学科 degree discipline 在此处仍使用键名 |degree*|} 包括文学~\opt{Arts},理学~\opt{Science},教育学~\opt{Education},工学~\opt{Engineering},法学~\opt{Laws},医学~\opt{Medicine},以及其他~\opt{XXX}。
 %    \begin{macrocode}
-\linespread{1.3}\selectfont
+    degree .choices:nn =
+      { academic, professional }
+      {
+        \tl_gset_eq:NN \g_@@_info_degree_tl \l_keys_choice_tl
+      },
+    degree .default:n = { academic },
+    degree* .tl_gset:N = \g_@@_info_degree_en_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Use \pkgurl{geometry} package to handle paper page.
+% \begin{macro}[module=info/]{info/author, info/author*}
+% 学位申请人姓名。
 %    \begin{macrocode}
-\RequirePackage{geometry}
-\geometry{
-  top=1.77in,
-  bottom=0.8in,
-  left=1.1in,
-  right=1.1in,
-  includefoot
-}
-\ifthenelse{\isundefined{\pagewidth}}{
-  \pdfpagewidth=\paperwidth
-  \pdfpageheight=\paperheight
-}{
-  \pagewidth=\paperwidth
-  \pageheight=\paperheight
-}
+    author .tl_gset:N = \g_@@_info_author_tl,
+    author* .tl_gset:N = \g_@@_info_author_en_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Indent of paragraph and skip between paragraphs.
+% \begin{macro}[module=info/]{info/major, info/major*}
+% 专业名称。
 %    \begin{macrocode}
-\RequirePackage{indentfirst}
-\setlength{\parindent}{2em}
-\setlength{\parskip}{0pt plus 2pt minus 1pt}
+    major .tl_gset:N = \g_@@_info_major_tl,
+    major* .tl_gset:N = \g_@@_info_major_en_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Packages to handle color.
+% \begin{macro}[module=info/]{info/supervisor, info/supervisor*}
+% 指导老师。
 %    \begin{macrocode}
-\RequirePackage{color}
-\RequirePackage[table]{xcolor}
+    supervisor .tl_gset:N = \g_@@_info_supervisor_tl,
+    supervisor* .tl_gset:N = \g_@@_info_supervisor_en_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Use \pkgurl{hyperref} package to generate cross-reference link.
+% \begin{macro}[module=info/]{info/date}
+% 论文提交日期。
 %    \begin{macrocode}
-\RequirePackage[unicode]{hyperref}
-\hypersetup{
-  bookmarksnumbered=true,
-  bookmarksopen=true,
-  bookmarksopenlevel=1,
-  breaklinks=true,
-  colorlinks=true,
-  allcolors=black,
-  linktoc=all,
-  plainpages=false,
-  pdfpagelabels=true,
-  pdfstartview={XYZ null null 1},
-  pdfinfo={Template.Info={hustthesis.cls v1.1 2013/07/01, Copyright (C) 2013-2014 by Xu Cheng 2014 by hust-latex, https://github.com/hust-latex/hustthesis}}
-}
+    date .code:n = { \@@_set_date:n { #1 } },
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Load Packages}
-% Load packages for math.
+% \begin{macro}[module=info/]{info/clc}
+% 中图分类号。
 %    \begin{macrocode}
-\RequirePackage{amsmath,amssymb,amsfonts}
-\RequirePackage[amsmath,amsthm,thmmarks,hyperref,thref]{ntheorem}
-\RequirePackage{fancynum}
-\setfnumgsym{\,}
-\RequirePackage[lined,boxed,linesnumbered,ruled,vlined,algochapter]{algorithm2e}
+    clc .tl_gset:N = \g_@@_info_clc_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Load packages for picture.
+% \begin{macro}[module=info/]{info/student-id, info/school-id}
+% 学号和学校代码。
 %    \begin{macrocode}
-\RequirePackage{overpic}
-\RequirePackage{graphicx,caption,subcaption}
+    student-id .tl_gset:N = \g_@@_info_student_id_tl,
+    school-id .tl_gset:N = \g_@@_info_school_id_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Load packages for table.
+% \begin{macro}[module=info/]{info/secret}
+% 密级。
 %    \begin{macrocode}
-\RequirePackage{array}
-\RequirePackage{multirow,tabularx,ltxtable}
+    secret .tl_gset:N = \g_@@_info_secret_tl,
 %    \end{macrocode}
+% \end{macro}
 %
-% Load package for code highlight. Here we use \pkgurl{listings} to highlight the code. But if you need more features, use \pkgurl{minted}.
+% \begin{macro}[module=info/]{info/committee}
+% 答辩委员会成员列表。
 %    \begin{macrocode}
-\RequirePackage{listings}
+    committee .code:n =
+      {
+        \seq_gset_from_clist:Nn \g_@@_info_committee_seq { #1 }
+      },
 %    \end{macrocode}
+% \end{macro}
 %
-% Load package for bibliography cite style.
 %    \begin{macrocode}
-\RequirePackage[numbers,square,comma,super,sort&compress]{natbib}
+  }
 %    \end{macrocode}
 %
-% Other packages for style setting.
+% \subsubsection{定义内部函数}
+%
+% \begin{macro}{\@@_spread_box:nn, \@@_spread_box:no}
+% 分散对齐的水平盒子。
+% \begin{arguments}
+%   \item 宽度
+%   \item 内容
+% \end{arguments}
+% 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip}
+% 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。
 %    \begin{macrocode}
-\RequirePackage{titlesec}
-\RequirePackage{titletoc}
-\RequirePackage{tocvsec2}
-\RequirePackage[inline]{enumitem}
-\RequirePackage{fancyhdr}
-\RequirePackage{afterpage}
-\RequirePackage{datenumber}
-\RequirePackage{etoolbox}
-\RequirePackage{appendix}
-\RequirePackage[titles]{tocloft}
-\RequirePackage{xstring}
-\RequirePackage{perpage}
+\cs_new_protected:Npn \@@_spread_box:nn #1#2
+  {
+    \mode_leave_vertical:
+    \hbox_to_wd:nn {#1} { \tl_map_inline:nn {#2} { ##1 \hfil } \unskip }
+  }
+\cs_generate_variant:Nn \@@_spread_box:nn { no }
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Variables Setting}
-% \begin{macro}{\zhtitle,\entitle,\title}
-% Commands to set the title.
+% \begin{macro}{\@@_center_box:nn, \@@_center_box:Vn}
+% 居中对齐的水平盒子。
 %    \begin{macrocode}
-\def\zhtitle#1{\gdef\HUST at zhtitle{#1}\hypersetup{pdftitle={#1}}}
-\def\entitle#1{\gdef\HUST at entitle{#1}}
-\DeclareDocumentCommand\title{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhtitle{#1}\entitle{#1}
-  }{
-    \zhtitle{#1}\entitle{#2}
+\cs_new_protected:Npn \@@_center_box:nn #1#2
+  {
+    \mode_leave_vertical:
+    \hbox_to_wd:nn {#1} { \tex_hfil:D #2 \tex_hfil:D }
   }
-}
-\title{}{}
+\cs_generate_variant:Nn \@@_center_box:nn { Vn }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhauthor,\enauthor,\author}
-% Commands to set the author.
+% \begin{macro}{\@@_fixed_width_box:nn}
+% 限宽盒子(允许换行)。
 %    \begin{macrocode}
-\def\zhauthor#1{\gdef\HUST at zhauthor{#1}\hypersetup{pdfauthor={#1}}}
-\def\enauthor#1{\gdef\HUST at enauthor{#1}}
-\DeclareDocumentCommand\author{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhauthor{#1}\enauthor{#1}
-  }{
-    \zhauthor{#1}\enauthor{#2}
+\cs_new:Npn \@@_fixed_width_box:nn #1#2
+  { \parbox {#1} {#2} }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_fixed_width_center_box:nn}
+% 居中对齐的限宽盒子(允许换行)。
+%    \begin{macrocode}
+\cs_new:Npn \@@_fixed_width_center_box:nn #1#2
+  { \parbox {#1} { \centering #2 } }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_text_width:Nn, \@@_get_text_width:NV}
+% 获取文本宽度,并存入 |dim| 型变量。
+% \begin{arguments}
+%   \item |dim| 型变量
+%   \item 内容
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_get_text_width:Nn #1#2
+  {
+    \hbox_set:Nn \l_@@_tmpa_box {#2}
+    \dim_set:Nn #1 { \box_wd:N \l_@@_tmpa_box }
   }
-}
-\author{}{}
+\cs_generate_variant:Nn \@@_get_text_width:Nn { NV }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\date,\zhdateformat,\endateformat,\dateformat}
-% A command to set the date and several commands to display date.
+% \begin{macro}[deprecated]{\@@_blank_underline:n}
+% 下划线占位符。|#1|: 长度。
 %    \begin{macrocode}
-\def\date#1#2#3{
-  \setdate{#1}{#2}{#3}
-}
-\setdatetoday
-\def\zhdateformat{~\thedateyear~年~\thedatemonth~月~\thedateday~日}
-\def\endateformat{\datedate}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \let\dateformat\zhdateformat
-}{
-  \let\dateformat\endateformat
-}
+\cs_new:Npn \@@_blank_underline:n #1
+  { \rule [ -0.5 ex ] {#1} { 0.4 pt } }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhschoolname,\enschoolname,\schoolname}
-% Commands to set the school name.
+% \subsection{封面模板}
+%
+% \begin{macro}[int, module=component/]{component/}
+% 封面组件。
+% \begin{arguments}
+%   \item[\opt{content}] 组件主体内容
+%   \item[\opt{format}] 组件字体/段落格式
+%   \item[\opt{height}] 组件固定高度,不设置则自动计算。主要用于行数不确定,需要固定高度的情况
+%   \item[\opt{top-lines}] 顶部空出的行数,按照设定的段落格式计算
+%   \item[\opt{top-skip}] 顶部间距(建议优先配置底部间距,顶部间距仅在特殊情况使用)
+%   \item[\opt{bottom-skip}] 底部间距
+%   \item[\opt{bottom-lines}] 底部空出的行数,按照设定的段落格式计算
+%   \item[\opt{align}] 对齐方式,可选值为靠左对齐~\opt{left},靠右对齐~\opt{right},居中对齐~\opt{center},以及两端对齐~\opt{justify}。默认为居中对齐
+% \end{arguments}
 %    \begin{macrocode}
-\def\zhschoolname#1{\gdef\HUST at zhschoolname{#1}}
-\def\enschoolname#1{\gdef\HUST at enschoolname{#1}}
-\DeclareDocumentCommand\schoolname{m g}
+\NewTemplateType { hust / component } { 0 }
+\DeclareTemplateInterface { hust / component } { plain } { 0 }
 {
-  \IfNoValueTF{#2}{
-    \zhschoolname{#1}\enschoolname{#1}
-  }{
-    \zhschoolname{#1}\enschoolname{#2}
-  }
+  content : tokenlist = \c_empty_tl,
+  format : tokenlist = \c_empty_tl,
+  width: skip = \c_zero_skip,
+  height: skip = \c_zero_skip,
+  top-lines : integer = \c_zero_int,
+  top-skip : skip = \c_zero_skip,
+  bottom-skip : skip = \c_zero_skip,
+  bottom-lines : integer = \c_zero_int,
+  align : choice { left, right, center, justify } = center,
 }
-\schoolname{华中科技大学}{Huazhong University of Science~\char38~Technology}
+\DeclareTemplateCode { hust / component } { plain } { 0 }
+{
+  content = \l_@@_component_content_tl,
+  format = \l_@@_component_format_tl,
+  width = \l_@@_component_width_skip,
+  height = \l_@@_component_height_skip,
+  top-lines = \l_@@_component_top_lines_int,
+  top-skip = \l_@@_component_top_skip,
+  bottom-skip = \l_@@_component_bottom_skip,
+  bottom-lines = \l_@@_component_bottom_lines_int,
+  align =
+    {
+      left =
+        \cs_set_eq:NN \l_@@_component_align: \raggedright,
+      right =
+        \cs_set_eq:NN \l_@@_component_align: \raggedleft,
+      center =
+        \cs_set_eq:NN \l_@@_component_align: \centering,
+      justify =
+        \cs_set_eq:NN \l_@@_component_align: \prg_do_nothing:,
+    }
+}
+{
+  \AssignTemplateKeys
+  \l_@@_component_format_tl
+  \int_step_inline:nn { \l_@@_component_top_lines_int }
+    {
+      \mode_leave_vertical:
+      \tex_par:D
+    }
+  \dim_compare:nNnTF { \l_@@_component_height_skip } > { \c_zero_skip }
+    {
+      \box_clear_new:N \l_@@_component_box
+      \vbox_set_to_ht:Nnn \l_@@_component_box { \l_@@_component_height_skip }
+        {
+          \skip_vertical:N \l_@@_component_top_skip
+          \l_@@_component_align:
+          \l_@@_component_content_tl
+          \tex_vfill:D
+        }
+      \box_use:N \l_@@_component_box
+    }
+    {
+      \skip_vertical:N \l_@@_component_top_skip
+      \l_@@_component_align:
+      \l_@@_component_content_tl
+      \tex_par:D
+    }
+  \int_step_inline:nn { \l_@@_component_bottom_lines_int }
+    {
+      \mode_leave_vertical:
+      \tex_par:D
+    }
+  \skip_vertical:N \l_@@_component_bottom_skip
+  \skip_vertical:N \c_zero_skip
+}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhaddress,\enaddress,\address}
-% Commands to set the address.
+% \begin{macro}[int, module=hust/page]{page/}
+% 页面模板。
+% \begin{arguments}
+%   \item[\opt{prefix}] 组件共用前缀
+%   \item[\opt{components}] 组件列表
+%   \item[\opt{style}] 页面样式 (可使用 \tn{thispagestyle} 配置)
+%   \item[\opt{format}] 页面字体/段落格式
+%   \item[\opt{top-skip}] 顶部间距
+% \end{arguments}
 %    \begin{macrocode}
-\def\zhaddress#1{\gdef\HUST at zhaddress{#1}}
-\def\enaddress#1{\gdef\HUST at enaddress{#1}}
-\DeclareDocumentCommand\address{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhaddress{#1}\enaddress{#1}
-  }{
-    \zhaddress{#1}\enaddress{#2}
+\NewTemplateType { hust / page } { 0 }
+\DeclareTemplateInterface { hust / page } { title } { 0 }
+  {
+    prefix : tokenlist,
+    components : commalist,
+    style : tokenlist = empty,
+    format : tokenlist = \linespread { } \selectfont,
+    top-skip : skip = \c_zero_skip,
   }
-}
-\address{中国,武汉,430074}{Wuhan~430074, P.~R.~China}
+\DeclareTemplateCode { hust / page } { title } { 0 }
+  {
+    prefix = \l_@@_page_prefix_tl,
+    components = \l_@@_page_components_clist,
+    style = \l_@@_page_style_tl,
+    format = \l_@@_page_format_tl,
+    top-skip = \l_@@_page_top_skip,
+  }
+  {
+    \AssignTemplateKeys
+    \skip_vertical:N \l_@@_page_top_skip
+    \group_begin:
+      \exp_args:No \thispagestyle { \l_@@_page_style_tl }
+      \l_@@_page_format_tl
+      \clist_map_inline:Nn \l_@@_page_components_clist
+        {
+          \group_begin:
+          \UseInstance { hust / component } { \l_@@_page_prefix_tl / ##1 }
+          \group_end:
+        }
+    \group_end:
+    \clearpage
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhapplyname,\enapplyname,\applyname}
-% Commands to custom apply name.
+% \begin{macro}{
+%   \@@_declare_component_instance:nnn,
+%   \@@_declare_page_instance:nn,
+% }
+% 声明模板实例的辅助函数。
 %    \begin{macrocode}
-\def\zhapplyname#1{\def\HUST at zhapplyname{#1}}
-\def\enapplyname#1{\def\HUST at enapplyname{#1}}
-\DeclareDocumentCommand\applyname{m g}
-{
-  \IfNoValueTF{#2}{
-    \enapplyname{#1}
-  }{
-    \zhapplyname{#1}\enapplyname{#2}
+\cs_new_protected:Npn \@@_declare_component_instance:nnn #1#2#3
+  { \DeclareInstance { hust / component } { #1/#2 } { plain } {#3} }
+\cs_new_protected:Npn \@@_declare_page_instance:nn #1#2
+  {
+    \DeclareInstance { hust / page } {#1} { title }
+    {
+      prefix = #1,
+      #2,
+    }
   }
-}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhmajor,\enmajor,\major}
-% Commands to set the major.
+% \subsection{封面组件}
+%
+% \subsubsection{中文封面}
+%
+% \begin{macro}[int, module=component/]{title zh/identifiers}
+% 分类号,学号,学校代码,密级。
 %    \begin{macrocode}
-\def\zhmajor#1{\gdef\HUST at zhmajor{#1}}
-\def\enmajor#1{\gdef\HUST at enmajor{#1}}
-\DeclareDocumentCommand\major{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhmajor{#1}\enmajor{#1}
-  }{
-    \zhmajor{#1}\enmajor{#2}
+\@@_declare_component_instance:nnn { title zh } { identifiers }
+  {
+    content =
+      {
+        \@@_title_zh_ids_aux:nn { 6em } { clc } % 3 em
+        \skip_horizontal:n { \linewidth - 19em }
+        \@@_title_zh_ids_aux:nn { 8em } { student_id } % 4 em
+        \tex_par:D
+        \@@_title_zh_ids_aux:nn { 5em } { school_id } % 4 em
+        \skip_horizontal:n { \linewidth - 19em }
+        \@@_title_zh_ids_aux:nn { 8em } { secret } % 4 em
+      },
+    format =
+      {
+        \zihao{-4} \bfseries \rmfamily \songti
+        \@@_line_spread:n { 1.5 }
+      },
+    bottom-skip = 2 cm,
   }
-}
-\major{}{}
+\cs_new:Npn \@@_title_zh_ids_aux:nn #1#2
+  {
+    \tl_use:c { c_@@_name_ #2 _tl }
+    \@@_ul_to_wd:nnn { 1 pt } { #1 }
+      { \tl_use:c { g_@@_info_ #2 _tl } }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhsupervisor,\ensupervisor,\supervisor}
-% Commands to set the supervisor.
+% \begin{macro}[int, module=hust/component/]{title zh/logo}
+% 校名图片。
 %    \begin{macrocode}
-\def\zhsupervisor#1{\gdef\HUST at zhsupervisor{#1}}
-\def\ensupervisor#1{\gdef\HUST at ensupervisor{#1}}
-\DeclareDocumentCommand\supervisor{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhsupervisor{#1}\ensupervisor{#1}
-  }{
-    \zhsupervisor{#1}\ensupervisor{#2}
+\@@_declare_component_instance:nnn { title zh } { logo }
+  {
+    content =
+      {
+        \includegraphics [ height = 1.4 cm ] { hust-title.pdf }
+      },
+    bottom-skip = 0.5 cm,
   }
-}
-\supervisor{}{}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhasssupervisor,\enasssupervisor,\asssupervisor}
-% Commands to set the asssupervisor.
+% \begin{macro}[int, module=hust/component/]{title zh/type}
+% 学位级别。
 %    \begin{macrocode}
-\def\zhasssupervisor#1{\gdef\HUST at zhasssupervisor{#1}}
-\def\enasssupervisor#1{\gdef\HUST at enasssupervisor{#1}}
-\DeclareDocumentCommand\asssupervisor{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhasssupervisor{#1}\enasssupervisor{#1}
-  }{
-    \zhasssupervisor{#1}\enasssupervisor{#2}
+\__ctex_save_font_size:nn { a } { 45 bp } % 大初号
+\@@_declare_component_instance:nnn { title zh } { type }
+  {
+    content = { \c_@@_name_type_zh_tl },
+    format = { \zihao { a } \bfseries \songti \ziju { 0.1 } },
+    bottom-skip = 0.5 cm,
   }
-}
-\asssupervisor{}{}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\schoolcode}
-% A command to set school code.
+% \begin{macro}[int, module=hust/component/]{title zh/degree}
+% 学位类型。
 %    \begin{macrocode}
-\def\schoolcode#1{\gdef\HUST at schoolcode{#1}}
-\schoolcode{}
+\@@_declare_component_instance:nnn { title zh } { degree }
+  {
+    content =
+      {
+        (
+        \c_@@_name_academic_zh_tl
+        \tl_if_eq:NnTF \g_@@_info_degree_tl { academic }
+          { \c_@@_checkbox_tl }
+          { \c_@@_emptybox_tl }
+        \skip_horizontal:n { 2.5 em }
+        \c_@@_name_professional_zh_tl
+        \tl_if_eq:NnTF \g_@@_info_degree_tl { professional }
+          { \c_@@_checkbox_tl }
+          { \c_@@_emptybox_tl }
+        )
+      },
+    format = { \zihao { -3 } \c_@@_name_degree_font_tl },
+    bottom-skip = 1.5 cm,
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\stuno}
-% A command to set student number.
+% \begin{macro}[int, module=hust/component/]{title zh/title}
+% 论文题目。
 %    \begin{macrocode}
-\def\stuno#1{\gdef\HUST at stuno{#1}}
-\stuno{}
+\@@_declare_component_instance:nnn { title zh } { title }
+  {
+    content = { \g_@@_info_title_tl },
+    format =
+      {
+        \zihao { 1 } \bfseries \songti
+        \@@_line_spread:n { 1.5 }
+      },
+    height = 4.8 cm,
+    bottom-skip = 1 cm,
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\classno}
-% A command to set classification number.
+% \begin{macro}[int, module=hust/component/]{title zh/info}
+% 信息表格。
 %    \begin{macrocode}
-\def\classno#1{\gdef\HUST at classno{#1}}
-\classno{}
+\@@_declare_component_instance:nnn { title zh } { info }
+  {
+    content =
+      {
+        \tl_set:Nn \arraystretch { 2 }
+        \begin{tabular}{p{5em}@{:\hspace{1em}}l}
+          \c_@@_name_author_zh_tl & \g_@@_info_author_tl \\
+          \c_@@_name_major_zh_tl & \g_@@_info_major_tl \\
+          \c_@@_name_supervisor_zh_tl & \g_@@_info_supervisor_tl \\
+          \c_@@_name_date_tl & \g_@@_info_date_tl \\
+        \end{tabular}
+      },
+    format = { \zihao { -3 } \bfseries \rmfamily \songti },
+    bottom-skip = 30 pt,
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\secretlevel}
-% A command to set secret level.
+% \subsubsection{英文封面}
+%
+% \begin{macro}[int, module=hust/component/]{title en/degree}
+% 学位级别和学科。
 %    \begin{macrocode}
-\def\secretlevel#1{\gdef\HUST at secretlevel{#1}}
-\secretlevel{}
+\@@_declare_component_instance:nnn { title en } { degree }
+  {
+    content =
+      {
+        \c_@@_name_type_en_tl
+        \tl_if_eq:NnTF \g_@@_info_degree_tl { academic }
+          { \c_@@_name_academic_en_tl }
+          { \c_@@_name_professional_en_tl }
+        \g_@@_info_degree_en_tl
+      },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \@@_line_spread:n { 1.5 }
+      },
+    bottom-skip = 5.5 cm,
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhabstract,\enabstract,\abstract}
-% Commands to set the abstract.
+% \begin{macro}[int, module=hust/component/]{title en/title}
+% 论文题目。
 %    \begin{macrocode}
-\long\def\zhabstract#1{\long\gdef\HUST at zhabstract{#1}}
-\long\def\enabstract#1{\long\gdef\HUST at enabstract{#1}}
-\DeclareDocumentCommand\abstract{+m +g}
-{
-  \IfNoValueTF{#2}{
-    \zhabstract{#1}\enabstract{#1}
-  }{
-    \zhabstract{#1}\enabstract{#2}
+\@@_declare_component_instance:nnn { title en } { title }
+  {
+    content = { \g_@@_info_title_en_tl },
+    format =
+      {
+        \zihao { -2 } \bfseries \rmfamily
+        \@@_line_spread:n { 1.5 }
+      },
+    height = 3 cm,
+    bottom-skip = 3 cm,
   }
-}
-\abstract{}{}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\zhkeywords,\enkeywords,\keywords}
-% Commands to set the keywords.
+% \begin{macro}[int, module=hust/component/]{title en/info}
+% 信息表格。
 %    \begin{macrocode}
-\def\zhkeywords#1{\gdef\HUST at zhkeywords{#1}\hypersetup{pdfkeywords={#1}}}
-\def\enkeywords#1{\gdef\HUST at enkeywords{#1}}
-\DeclareDocumentCommand\keywords{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhkeywords{#1}\enkeywords{#1}
-  }{
-    \zhkeywords{#1}\enkeywords{#2}
+\@@_declare_component_instance:nnn { title en } { info }
+  {
+    content =
+      {
+        \begin{tabular}{l@{\hspace{0.5em}:\hspace{0.5em}}l}
+          \c_@@_name_author_en_tl & \g_@@_info_author_en_tl \\
+          \c_@@_name_major_en_tl & \g_@@_info_major_en_tl \\
+          \c_@@_name_supervisor_en_tl & \g_@@_info_supervisor_en_tl \\
+        \end{tabular}
+      },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \@@_line_spread:n { 1.5 }
+      },
+    bottom-skip = 4 cm,
   }
-}
-\keywords{}{}
 %    \end{macrocode}
 % \end{macro}
 %
-% \section{Localization}\label{sec:Localization}
-% Chinese localization.
-% \footnote{The |autorefname| Reference:\url{http://tex.stackexchange.com/questions/52410/how-to-use-the-command-autoref-to-implement-the-same-effect-when-use-the-comman}}
+% \begin{macro}[int, module=hust/component/]{title en/address}
+% 学校名称和地址。
 %    \begin{macrocode}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-    \def\indexname{索引}
-    \def\figurename{图}
-    \def\tablename{表}
-    \AtBeginDocument{\def\listingscaption{代码}}
-    \def\bibname{参考文献}
-    \def\contentsname{目\hspace{1em}录}
-    \def\contentsnamenospace{目录}
-    \def\appendixname{附录}
-    \def\HUST at listfigurename{插图索引}
-    \def\HUST at listtablename{表格索引}
-    \def\equationautorefname{公式}
-    \def\footnoteautorefname{脚注}
-    \def\itemautorefname~#1\null{第~#1~项\null}
-    \def\figureautorefname{图}
-    \def\tableautorefname{表}
-    \def\appendixautorefname{附录}
-    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
-    \def\chapterautorefname~#1\null{第\zhnumber{#1}章\null}
-    \def\sectionautorefname~#1\null{#1~小节\null}
-    \def\subsectionautorefname~#1\null{#1~小节\null}
-    \def\subsubsectionautorefname~#1\null{#1~小节\null}
-    \def\FancyVerbLineautorefname~#1\null{第~#1~行\null}
-    \def\pageautorefname~#1\null{第~#1~页\null}
-    \def\lstlistingautorefname{代码}
-    \def\definitionautorefname{定义}
-    \def\propositionautorefname{命题}
-    \def\lemmaautorefname{引理}
-    \def\theoremautorefname{定理}
-    \def\axiomautorefname{公理}
-    \def\corollaryautorefname{推论}
-    \def\exerciseautorefname{练习}
-    \def\exampleautorefname{例}
-    \def\proofautorefname{证明}
-    \SetAlgorithmName{算法}{算法}{算法索引}
-    \SetAlgoProcName{过程}{过程}
-    \SetAlgoFuncName{函数}{函数}
-    \def\AlgoLineautorefname~#1\null{第~#1~行\null}
-}{}
+\@@_declare_component_instance:nnn { title en } { address }
+  {
+    content = { \c_@@_address_tl },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \@@_line_spread:n { 1.5 }
+      },
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% English localization.
+% \begin{macro}[int, module=hust/component/]{title en/date}
 %    \begin{macrocode}
-\ifthenelse{\equal{\HUST at language}{chinese}}{}{
-    \def\HUST at listfigurename{List of Figures}
-    \def\HUST at listtablename{List of Tables}
-    \def\equationautorefname{Equation}
-    \def\footnoteautorefname{Footnote}
-    \def\itemautorefname{Item}
-    \def\figureautorefname{Figure}
-    \def\tableautorefname{Table}
-    \def\appendixautorefname{Appendix}
-    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
-    \def\chapterautorefname{Chapter}
-    \def\sectionautorefname{Section}
-    \def\subsectionautorefname{Subsection}
-    \def\subsubsectionautorefname{Sub-subsection}
-    \def\FancyVerbLineautorefname{Line}
-    \def\pageautorefname{Page}
-    \def\lstlistingautorefname{Code Fragment}
-    \def\definitionautorefname{Definition}
-    \def\propositionautorefname{Proposition}
-    \def\lemmaautorefname{Lemma}
-    \def\theoremautorefname{Theorem}
-    \def\axiomautorefname{Axiom}
-    \def\corollaryautorefname{Corollary}
-    \def\exerciseautorefname{Exercise}
-    \def\exampleautorefname{Example}
-    \def\proofautorefname{Proof}
-    \SetAlgorithmName{Algorithm}{Algorithm}{List of Algorithms}
-    \SetAlgoProcName{Procedure}{Procedure}
-    \SetAlgoFuncName{Function}{Function}
-    \def\AlgoLineautorefname{Line}
-}
+\@@_declare_component_instance:nnn { title en } { date }
+  {
+    content = { \tl_use:N \g_@@_info_date_en_tl },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \@@_line_spread:n { 1.5 }
+      },
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Internal variables.
+% \subsubsection{答辩委员会页}
+%
+% \begin{macro}[int, module=hust/component/]{committee/title}
+% 答辩委员会标题。
 %    \begin{macrocode}
-\def\HUST at classnotitle{{分}\hfill{类}\hfill{号}}
-\def\HUST at stunotitle{学号}
-\def\HUST at schoolcodetitle{学校代码}
-\def\HUST at secrettile{密级}
-\def\HUST at zhauthortitle{{学}\hfill{位}\hfill{申}\hfill{请}\hfill{人}}
-\def\HUST at zhmajortitle{{学}\hfill{科}\hfill{专}\hfill{业}}
-\def\HUST at zhsupervisortitle{{指}\hfill{导}\hfill{教}\hfill{师}}
-\def\HUST at zhasssupervisortitle{{副}\hfill{指}\hfill{导}\hfill{教}\hfill{师}}
-\def\HUST at zhdatetitle{{答}\hfill{辩}\hfill{日}\hfill{期}}
-
-\def\HUST at enauthortitle{Student}
-\def\HUST at enmajortitle{Major}
-\def\HUST at ensupervisortitle{Supervisor}
-\def\HUST at enasssupervisortitle{Co-Supervisor}
-
-\def\HUST at originaldeclare{独创性声明}
-\long\def\HUST at originaldeclaretext{
-  本人声明所呈交的学位论文是我个人在导师的指导下进行的研究工作及取得的研究成果。尽我所知,除文中已标明引用的内容外,本论文不包含任何其他人或集体已经发表或撰写过的研究成果。对本文的研究做出贡献的个人和集体,均已在文中以明确方式标明。本人完全意识到本声明的法律结果由本人承担。
-}
-\def\HUST at zhauthorsig{学位论文作者签名:}
-\def\HUST at zhdatefield{日期:\hspace{2em}年\hspace{2em}月\hspace{2em}日}
-
-\def\HUST at authtitle{学位论文版权使用授权书}
-\long\def\HUST at authorizationtext{
-  本学位论文作者完全了解学校有关保留、使用学位论文的规定,即:学校有权保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。本人授权华中科技大学可以将本学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
-}
-\long\def\HUST at authorizationaddon{
- 本论文属于
- \tabincell{l}{
-  保密$\square$,在~\makebox[2em]{\hrulefill} 年解密后适用本授权书。\\
-  不保密~$\square$。
- }
-}
-\def\HUST at authorizationcheck{(请在以上方框内打“$\surd$”)}
-\def\HUST at zhteachersig{指导教师签名:}
-
-\def\HUST at zhabstractname{摘\hspace{1em}要}
-\def\HUST at zhabstractnamenospace{摘要}
-\def\HUST at zhkeywordstitle{关键词:}
-\def\HUST at enabstractname{Abstract}
-\def\HUST at enkeywordstitle{Key words:}
-
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \def\HUST at ackname{致\hspace{1em}谢}
-  \def\HUST at acknamenospace{致谢}
-  \def\HUST at publicationtitle{攻读学位期间发表的学术论文}
-}{
-  \def\HUST at ackname{Acknowledge}
-  \def\HUST at acknamenospace{Acknowledge}
-  \def\HUST at publicationtitle{Publication}
-}
-
-\ifthenelse{\equal{\HUST at degree}{none}}{
-  \def\HUST at zhapplyname{学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{fyp}}{
-  \def\HUST at zhapplyname{毕业设计论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{bachelor}}{
-  \def\HUST at zhapplyname{学士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{master}}{
-  \def\HUST at zhapplyname{硕士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{phd}}{
-  \def\HUST at zhapplyname{博士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy}
-}{}
-
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \hypersetup{pdfsubject={\HUST at zhschoolname\HUST at zhapplyname}}
-}{
-  \hypersetup{pdfsubject={\HUST at enapplyname}}
-}
+\@@_declare_component_instance:nnn { committee } { title }
+  {
+    content = { \c_@@_name_committee_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \sffamily
+        \@@_line_spread:n { 1.5 }
+      },
+    bottom-lines = 1,
+  }
+\tl_const:Nn \c_@@_name_committee_tl { 答辩委员会 }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set |\listfigurename| and |\listtablename|.
+% \begin{macro}[int, module=hust/component/]{committee/members}
+% 答辩委员会成员列表。
 %    \begin{macrocode}
-\def\listfigurename{\HUST at listfigurename}
-\def\listtablename{\HUST at listtablename}
+\@@_declare_component_instance:nnn { committee } { members }
+  {
+    content =
+      {
+        \tl_set:Nn \arraystretch { 1.5 }
+        \begin{tabular}
+          { |c|c|c|c| }
+          \hline
+          \c_@@_committee_header_tl \\
+          \hline
+          \int_const:Nn \l_@@_info_committee_count_int
+            { \seq_count:N \g_@@_info_committee_seq }
+          \seq_map_indexed_inline:Nn \g_@@_info_committee_seq
+            {
+              \int_case:nnF { #1 }
+                {
+                  { 1 }
+                    {
+                      \clist_item:Nn \c_@@_committee_role_clist { 1 }
+                      & #2 \\ \hline
+                    }
+                  { 2 }
+                    {
+                      \multirow
+                        { \int_eval:n { \l_@@_info_committee_count_int - 1 } }
+                        { * }
+                        { \clist_item:Nn \c_@@_committee_role_clist { 2 } }
+                      & #2 \\ \cline{2-4}
+                    }
+                  { \l_@@_info_committee_count_int }
+                    { & #2 }
+                }
+                { & #2 \\ \cline{2-4} }
+            }
+            \\ \hline
+        \end{tabular}
+      },
+    format =
+      {
+        \zihao { 4 } \sffamily
+        \@@_line_spread:n { 1.5 }
+      },
+    top-lines = 1,
+  }
+\tl_const:Nn \c_@@_committee_header_tl
+  { \makebox[3em]{} & \makebox[4em][c]{姓名} & \makebox[4em][c]{职称} & \makebox[12em][c]{单位} }
+\clist_const:Nn \c_@@_committee_role_clist
+  { 主席, 委员, }
+\tl_new:N \l_@@_committee_member_tl
 %    \end{macrocode}
+% \end{macro}
 %
-% \section{Style Setting}
-% \subsection{Equation Style}
-% Allow long equation breaking between lines or pages.
+% \subsubsection{声明页}
+%
+% \begin{macro}[int, module=hust/component/]{decl/orig title}
+% 独创性声明标题。
 %    \begin{macrocode}
-\allowdisplaybreaks[4]
+\@@_declare_component_instance:nnn { decl } { orig title }
+  {
+    content = { \c_@@_orig_decl_title_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \heiti
+      },
+      bottom-lines = 1,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set skip between equation and context.
+% \begin{macro}[int, module=hust/component/]{decl/orig text}
+% 独创性声明正文。
 %    \begin{macrocode}
-\abovedisplayskip=10bp plus 2bp minus 2bp
-\abovedisplayshortskip=10bp plus 2bp minus 2bp
-\belowdisplayskip=\abovedisplayskip
-\belowdisplayshortskip=\abovedisplayshortskip
+\@@_declare_component_instance:nnn { decl } { orig text }
+  {
+    content = { \c_@@_orig_decl_text_tl },
+    align = justify,
+    bottom-lines = 1,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set equation numbering style.
+% \begin{macro}[int, module=hust/component/]{decl/orig sign}
+% 独创性声明签名。
 %    \begin{macrocode}
-\numberwithin{equation}{chapter}
+\@@_declare_component_instance:nnn { decl } { orig sign }
+  {
+    content =
+      {
+        \clist_map_inline:Nn \c_@@_orig_decl_sign_clist
+          {
+            #1 \\
+          }
+      },
+    align = right,
+    bottom-lines = 3,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Theorem Style}
-% We use \pkgurl{amsthm} to handle the proof environment and use \pkgurl{ntheorem} to handle other theorem environments.
+% \begin{macro}[int, module=hust/component/]{decl/auth title}
+% 学位论文版权使用授权书标题。
 %    \begin{macrocode}
-\theoremnumbering{arabic}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \theoremseparator{:}
-}{
-  \theoremseparator{:}
-}
-\theorempreskip{1.2ex plus 0ex minus 1ex}
-\theorempostskip{1.2ex plus 0ex minus 1ex}
-\theoremheaderfont{\normalfont\bfseries\HEI}
-\theoremsymbol{}
-
-\theoremstyle{definition}
-\theorembodyfont{\normalfont}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \newtheorem{definition}{定义}[chapter]
-}{
-  \newtheorem{definition}{Definition}[chapter]
-}
-
-\theoremstyle{plain}
-\theorembodyfont{\itshape}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \newtheorem{proposition}{命题}[chapter]
-  \newtheorem{lemma}{引理}[chapter]
-  \newtheorem{theorem}{定理}[chapter]
-  \newtheorem{axiom}{公理}[chapter]
-  \newtheorem{corollary}{推论}[chapter]
-  \newtheorem{exercise}{练习}[chapter]
-  \newtheorem{example}{例}[chapter]
-  \def\proofname{\hei{证明}}
-}{
-  \newtheorem{proposition}{Proposition}[chapter]
-  \newtheorem{lemma}{Lemma}[chapter]
-  \newtheorem{theorem}{Theorem}[chapter]
-  \newtheorem{axiom}{Axiom}[chapter]
-  \newtheorem{corollary}{Corollary}[chapter]
-  \newtheorem{exercise}{Exercise}[chapter]
-  \newtheorem{example}{Example}[chapter]
-  \def\proofname{\textbf{Proof}}
-}
+\@@_declare_component_instance:nnn { decl } { auth title }
+  {
+    content = { \c_@@_auth_decl_title_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \heiti
+      },
+    top-lines = 1,
+    bottom-lines = 1,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Floating Objects Style}
-% Set the skip to the context for floating object with argument `h'.
+% \begin{macro}[int, module=hust/component/]{decl/auth text}
+% 学位论文版权使用授权书正文。
 %    \begin{macrocode}
-\setlength{\intextsep}{0.7\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}
+\@@_declare_component_instance:nnn { decl } { auth text }
+  {
+    content = { \c_@@_auth_decl_text_tl },
+    align = justify,
+    bottom-skip = 0.5 cm,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set the skip to the context for top or bottom floating object.
+% \begin{macro}[int, module=hust/component/]{decl/auth secr}
+% 学位论文保密使用保密选项。
 %    \begin{macrocode}
-\setlength{\textfloatsep}{0.8\baselineskip plus 0.1\baselineskip minus 0.2\baselineskip}
+\@@_declare_component_instance:nnn { decl } { auth secr }
+  {
+    content =
+      {
+        \mode_leave_vertical:
+        \hbox_overlap_right:n
+          { \clist_item:Nn \c_@@_auth_decl_secr_clist { 1 } }
+        \skip_vertical:n { -1.2 cm }
+        \skip_horizontal:n { 6 em }
+        \clist_item:Nn \c_@@_auth_decl_secr_clist { 2 }
+        \tex_par:D
+        \skip_horizontal:n { 6 em }
+        \clist_item:Nn \c_@@_auth_decl_secr_clist { 3 }
+        \tex_par:D
+        \clist_item:Nn \c_@@_auth_decl_secr_clist { 4 }
+      },
+    align = justify,
+    bottom-lines = 1,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set the fraction of floating object. Make the fraction less crowded than default value to prevent floating object occupying too much space.
+% \begin{macro}[int, module=hust/component/]{decl/auth sign}
 %    \begin{macrocode}
-\renewcommand{\textfraction}{0.15}
-\renewcommand{\topfraction}{0.85}
-\renewcommand{\bottomfraction}{0.65}
-\renewcommand{\floatpagefraction}{0.60}
+\@@_declare_component_instance:nnn { decl } { auth sign }
+  {
+    content =
+      {
+        \clist_map_inline:Nn \c_@@_auth_decl_sign_clist
+          {
+            #1
+            \tex_par:D
+          }
+      },
+    align = justify,
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Table Style}
+% \subsection{绘制封面}
 %
-% \begin{macro}{\tabincell}
-% A command make it easier to insert a new table into an existing cell.
+% \begin{macro}{\makezhtitle}
+% 中文标题页。
 %    \begin{macrocode}
-\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
+\@@_declare_page_instance:nn { title zh }
+  {
+    components = { identifiers, logo, type, degree, title, info, },
+  }
+\DeclareDocumentCommand \makezhtitle { }
+  {
+    \UseInstance { hust / page } { title zh }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% To prevent |\cline| breaking page in \pkgurl{longtable} environment, use in this way:
-% \meta{table content} |\\* \nopagebreak \cline{i-j}|
-% \footnote{Reference:\url{http://tex.stackexchange.com/questions/52100/longtable-multirow-problem-with-cline-and-nopagebreak}}
+
+% \begin{macro}{\makeentitle}
+% 英文标题页。
 %    \begin{macrocode}
-\def\@cline#1-#2\@nil{%
-  \omit
-  \@multicnt#1%
-  \advance\@multispan\m at ne
-  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
-  \@multicnt#2%
-  \advance\@multicnt-#1%
-  \advance\@multispan\@ne
-  \leaders\hrule\@height\arrayrulewidth\hfill
-  \cr
-  \noalign{\nobreak\vskip-\arrayrulewidth}}
+\@@_declare_page_instance:nn { title en }
+  {
+    components = { degree, title, info, address, date, },
+  }
+\DeclareDocumentCommand \makeentitle { }
+  {
+    \UseInstance { hust / page } { title en }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Here we set the global font setting (font size: 11pt and line spread: 1.4) for tables. But first we will declare a variable to determine whether table global font setting is activated.
+% \begin{macro}{\makecommittee}
+% 答辩委员会页。
 %    \begin{macrocode}
-\newif\ifHUST at useoldtabular
-\HUST at useoldtabularfalse
+\@@_declare_page_instance:nn { committee }
+  {
+    components = { title, members, },
+  }
+\DeclareDocumentCommand \makecommittee { }
+  {
+    \UseInstance { hust / page } { committee }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\TurnOffTabFontSetting}
-% Use |\TurnOffTabFontSetting| to deactivate global font setting.
+% \begin{macro}{\makedecl}
+% 声明页。
 %    \begin{macrocode}
-\def\TurnOffTabFontSetting{\HUST at useoldtabulartrue}
+\@@_declare_page_instance:nn { decl }
+  {
+    components =
+      {
+        orig title, orig text, orig sign,
+        auth title, auth text, auth secr, auth sign,
+      },
+    format =
+      {
+        \zihao { -4 } \rmfamily
+        \@@_line_spread:n { 1.5 }
+      }
+  }
+\DeclareDocumentCommand \makedecl { }
+  {
+    \UseInstance { hust / page } { decl }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\TurnOnTabFontSetting}
-% Use |\TurnOnTabFontSetting| to activate global font setting.
+% \begin{macro}{\maketitle}
+% 封面。
 %    \begin{macrocode}
-\def\TurnOnTabFontSetting{\HUST at useoldtabularfalse}
+\DeclareDocumentCommand \maketitle { }
+  {
+    \makezhtitle
+    \tl_if_eq:NnT \g_@@_degree_type_tl { doctor }
+      { \makecommittee }
+    \makeentitle
+    \makedecl
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% Hook the \pkgurl{tabular}, \pkgurl{tabularx} and \pkgurl{longtable} environment to imply the global font setting.
+%
+% \section{前文样式}
+%
+% 定义从摘要到目录的样式,即有页眉页脚,含有大写罗马数字页码页的样式。
+%
+% \begin{macro}{\frontmatter}
 %    \begin{macrocode}
-\AtBeginEnvironment{tabular}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
-\AtBeginEnvironment{tabularx}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
-\AtBeginEnvironment{longtable}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
+\@@_appto_cmd:Nn \frontmatter
+  {
+    \pagestyle { fancy }
+    \pagenumbering { Roman }
+    \@@_toc_chapter_frontmatter:
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Caption Style}
-% Set caption font size as 11pt, use hang format, remove `:' after number and set the skip between context as 12pt.
+% \subsection{摘要样式}
+%
+% \begin{environment}{abstract, abstract*}
+% 摘要环境。
 %    \begin{macrocode}
-\DeclareCaptionFont{HUST at captionfont}{\fontsize{11pt}{14.3pt}\selectfont}
-\DeclareCaptionLabelFormat{HUST at caplabel}{#1~#2}
-\captionsetup{
-  font=HUST at captionfont,
-  labelformat=HUST at caplabel,
-  format=hang,
-  labelsep=quad,
-  skip=12pt
-}
+\NewDocumentEnvironment { abstract } { }
+  {
+    \chapter**{\c_@@_name_abstract_zh_tl}
+  }
+  { }
+\NewDocumentEnvironment { abstract* } { }
+  {
+    \chapter**{\c_@@_name_abstract_en_tl}
+  }
+  { }
 %    \end{macrocode}
+% \end{environment}
 %
-% Set figure and table numbering style.
+% \begin{macro}{\keywords, \keywords*}
+% 关键词命令。
 %    \begin{macrocode}
-\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
-\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}}
+\NewDocumentCommand \keywords { s }
+  {
+    \IfBooleanTF { #1 }
+      { \@@_keywords:nw { en } }
+      { \@@_keywords:nw { zh } }
+  }
+\cs_new_nopar:Npn \@@_keywords:nw #1 #2
+  {
+    \zihao{-4} \rmfamily
+    \tex_par:D
+    \skip_horizontal:n \c_zero_skip
+    \tex_par:D
+    \tex_noindent:D
+    \group_begin:
+      \bfseries \heiti
+      \tl_use:c { c_@@_name_keywords_ #1 _tl }
+    \group_end:
+    \c_space_tl
+    #2
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{Code Highlight Style}
+% \subsection{目录样式}
+%
 %    \begin{macrocode}
-\definecolor{HUST at lstgreen}{rgb}{0,0.6,0}
-\definecolor{HUST at lstmauve}{rgb}{0.58,0,0.82}
-
-\lstset{
-  basicstyle=\footnotesize\ttfamily\linespread{1}\selectfont\FANGSONG,
-  keywordstyle=\color{blue}\bfseries,
-  commentstyle=\color{HUST at lstgreen}\itshape\KAI,
-  stringstyle=\color{HUST at lstmauve},
-  showspaces=false,
-  showstringspaces=false,
-  showtabs=false,
-  numbers=left,
-  numberstyle=\tiny\color{black},
-  frame=lines,
-  rulecolor=\color{black},
-  breaklines=true
-}
+\tl_set:Nn \contentsname { 目\hspace{1em}录 }
 %    \end{macrocode}
 %
-% \subsection{Section Title Style}
-% Set the numbering depth for section.
+% 设置目录章节显示深度。
 %    \begin{macrocode}
-\setcounter{secnumdepth}{3}
+\keys_set:nn { ctex }
+  {
+    tocdepth = section,
+  }
 %    \end{macrocode}
 %
-% Chapter tilte format and spacing setting.
+% 设置目录项右边距。
 %    \begin{macrocode}
-\titleformat{\chapter}
+\contentsmargin { 0 pt }
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_toc_format:nnnn}
+% 设置目录项格式。
+% \begin{arguments}
+%   \item 章节类型
+%   \item 编号与章节名称间距
+%   \item 章节名称样式
+%   \item 章节页码格式(|\thecontentspage|表示页码)
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_toc_format:nnnn #1#2#3#4
   {
-    \bfseries
-    \HEI
-    \centering
-    \fontsize{18pt}{23.4pt}\selectfont
+    \titlecontents
+      { #1 }
+      [ 0 pt ]
+      { #3 }
+      { \thecontentslabel \hspace{#2} #3 }
+      { #3 }
+      { #4 }
   }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ddotfill}
+% 实现更密的虚线。该命令仅可使用 \LaTeXe 命令实现。
+%    \begin{macrocode}
+\cs_new:Npn \ddotfill
   {
-    \ifthenelse{\equal{\HUST at language}{chinese}}
-    {\zhnumber{\thechapter}}
-    {Chapter~\thechapter}
+    \leavevmode \leaders \hbox to .22em {\hss .\hss } \hfill \kern 0pt
   }
-  {1em}
-  {}
-\titlespacing*{\chapter}{0pt}{0pt}{20pt}
 %    \end{macrocode}
+% \end{macro}
 %
-% Section tilte format and spacing setting.
+% \begin{macro}{
+%  \@@_toc_chapter_frontmatter:
+%  \@@_toc_chapter_mainmatter:
+%  \@@_toc_chapter_backmatter:
+% }
+% 设置章的三种样式,分别是在前文部分有虚线,不带括号页码的格式;
+% 正文无虚线,带括号页码的格式;
+% 以及附录部分有虚线,带括号页码的格式。
 %    \begin{macrocode}
-\titleformat*{\section}{\bfseries\HEI\fontsize{16pt}{20.8pt}\selectfont}
-\titlespacing*{\section}{0pt}{18pt}{6pt}
+\cs_new_protected:Npn \@@_toc_chapter_frontmatter:
+  {
+    \@@_toc_format:nnnn
+      { chapter }
+      { 1 em}
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \ddotfill \thecontentspage }
+    }
+\cs_new_protected:Npn \@@_toc_chapter_mainmatter:
+  {
+    \@@_toc_format:nnnn
+      { chapter }
+      { 1 em }
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \hfill (\thecontentspage) }
+  }
+\cs_new_protected:Npn \@@_toc_chapter_backmatter:
+  {
+    \@@_toc_format:nnnn
+      { chapter }
+      { 1 em }
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \ddotfill (\thecontentspage) }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Subsection tilte format and spacing setting.
+% 设置节的样式。
 %    \begin{macrocode}
-\titleformat*{\subsection}{\bfseries\HEI\fontsize{14pt}{18.2pt}\selectfont}
-\titlespacing*{\subsection}{0pt}{12pt}{6pt}
+\@@_toc_format:nnnn
+  { section }
+  { 2 em }
+  { \zihao{4} \rmfamily }
+  { \ddotfill (\thecontentspage) }
 %    \end{macrocode}
 %
-% Subsubsection tilte format and spacing setting.
+% \section{正文样式}
+%
 %    \begin{macrocode}
-\titleformat*{\subsubsection}{\bfseries\HEI\fontsize{13pt}{16.9pt}\selectfont}
-\titlespacing*{\subsubsection}{0pt}{12pt}{6pt}
+\@@_appto_cmd:Nn \mainmatter
+  {
+    \pagestyle { fancy }
+    \pagenumbering { arabic }
+    \@@_toc_chapter_mainmatter:
+  }
 %    \end{macrocode}
 %
-% \subsection{TOC Style}
-% TOC depth.
+% \subsection{章节样式}
+%
 %    \begin{macrocode}
-\setcounter{tocdepth}{1}
+\keys_set:nn { ctex }
+  {
 %    \end{macrocode}
+% 设置章(chapter)、节(section)与小节(sub-section)标题样式。
+
+%    \begin{macrocode}
+    chapter =
+      {
+        format = \zihao{3} \bfseries \rmfamily \heiti \centering \linespread{1.5},
+        name = {},
+        beforeskip = 15.5 bp,
+        afterskip = 14 bp + \CTEX at chapter@lofskip,
+        number = \arabic{ chapter },
+        pagestyle = fancy,
+        fixskip = true,
+      },
+    section =
+      {
+        format = \zihao{4} \bfseries \rmfamily \heiti \raggedright,
+        numberformat = \rmfamily,
+        beforeskip = 10 bp,
+        afterskip = 7 bp,
+      },
+    subsection =
+      {
+        format = \zihao{-4} \bfseries \rmfamily \heiti \raggedright,
+        numberformat = \rmfamily,
+        beforeskip = 7 bp,
+        afterskip = 4 bp,
+      }
+  }
+%    \end{macrocode}
 %
-% TOC right margin.
+% \begin{macro}{\chapter, \chapter*, \chapter**}
+% 对带有星号的章节指令补丁,使得其能够在目录中显示。
 %    \begin{macrocode}
-\contentsmargin{2.0em}
+\cs_set_eq:NN \@@_chapter:D \chapter
+\RenewDocumentCommand \chapter { s s o m }
+  {
+    \IfNoValueTF{#3}
+      {
+        \IfBooleanTF{#1}
+          {
+            \@@_chapter:D*{#4}
+            \IfBooleanT{#2}
+              {  \CTEX at addtocline{chapter}{#4} }
+          }
+          { \@@_chapter:D{#4} }
+      }
+      {
+        \IfBooleanTF{#1}
+          {
+            \@@_chapter:D*{#4}
+            \IfBooleanT{#2}
+              {  \CTEX at addtocline{chapter}{#3} }
+          }
+          { \@@_chapter:D[#3]{#4} }
+
+      }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Remove vertical space between two continues chapter entries.
-% \footnote{Reference:\url{http://tex.stackexchange.com/questions/89103/remove-vertical-space-between-two-chapters-in-table-of-contents-in-latex}}
+% \section{后文样式}
+%
+% \begin{macro}{\backmatter}
 %    \begin{macrocode}
-\newskip\HUST at oldcftbeforechapskip
-\HUST at oldcftbeforechapskip=\cftbeforechapskip
-\newskip\HUST at oldcftbeforesecskip
-\HUST at oldcftbeforesecskip=\cftbeforesecskip
-\let\HUST at oldl@chapter\l at chapter
-\let\HUST at oldl@section\l at section
-\let\HUST at oldl@subsection\l at subsection
-\def\l at chapter#1#2{\HUST at oldl@chapter{#1}{#2}\cftbeforechapskip=3pt}
-\def\l at section#1#2{\HUST at oldl@section{#1}{#2}\cftbeforechapskip=\HUST at oldcftbeforechapskip\cftbeforesecskip=3pt}
-\def\l at subsection#1#2{\HUST at oldl@subsection{#1}{#2}\cftbeforesecskip=\HUST at oldcftbeforesecskip}
+\@@_appto_cmd:Nn \backmatter
+  {
+    \@@_toc_chapter_backmatter:
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% Set LOF LOT style.
-% \footnote{Reference:\url{http://www.latex-community.org/viewtopic.php?f=5&t=1838}}
+%
+% \subsection{致谢页}
+%
+% \begin{environment}{acknowledgements}
 %    \begin{macrocode}
-\renewcommand*\cftfigpresnum{\figurename~}
-\newlength{\HUST at cftfignumwidth@tmp}
-\settowidth{\HUST at cftfignumwidth@tmp}{\cftfigpresnum}
-\addtolength{\cftfignumwidth}{\HUST at cftfignumwidth@tmp}
-\renewcommand{\cftfigaftersnumb}{\quad~}
-\renewcommand*\cfttabpresnum{\tablename~}
-\newlength{\HUST at cfttabnumwidth@tmp}
-\settowidth{\HUST at cfttabnumwidth@tmp}{\cfttabpresnum}
-\addtolength{\cfttabnumwidth}{\HUST at cfttabnumwidth@tmp}
-\renewcommand{\cfttabaftersnumb}{\quad~}
+\NewDocumentEnvironment { acknowledgements } { }
+  {
+    \chapter**{致\hspace{1em}谢}
+  }
+  { }
 %    \end{macrocode}
+% \end{environment}
 %
-% \subsection{Head \& Foot Style}
+% \subsection{参考文献}
+%
+% \begin{macro}{\printbibliography}
+% 在使用 \tn{printbibliography} 的同时添加目录项。
 %    \begin{macrocode}
-\let\ps at plain\ps at fancy
-\pagestyle{fancy}
-\fancyhf{}
-\renewcommand{\headrulewidth}{0pt}
-\renewcommand{\footrulewidth}{0pt}
-
-\ifthenelse{\equal{\HUST at degree}{fyp}}{
-  \fancyfoot[R]{\thepage}
-}{
-  \fancyfoot[C]{\thepage}
-}
-
-\ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-  \ifHUST at finalformat\else
-    \fancyhead[C]{
-      \ziju{1em}{\kai{\fontsize{14pt}{18.2pt}\selectfont\HUST at zhschoolname\HUST at zhapplyname}}
-      \vskip -5pt
-      \vbox{
-        \hrule width \textwidth height 2pt
-      }
+\cs_if_exist:NT \printbibliography
+  {
+    \defbibheading{bibliography}[\refname]{%
+      \chapter**{#1}%
     }
-  \fi
 }
 %    \end{macrocode}
+% \end{macro}
 %
-% \subsection{List Environment Style}
+% \section{附录样式}
+%
 %    \begin{macrocode}
-\setlist{noitemsep,partopsep=0pt,topsep=.8ex}
-\setlist[1]{labelindent=\parindent}
-\setlist[enumerate,1]{label=\arabic*.,ref=\arabic*}
-\setlist[enumerate,2]{label*=\arabic*,ref=\theenumi.\arabic*}
-\setlist[enumerate,3]{label=\emph{\alph*}),ref=\theenumii\emph{\alph*}}
-\setlist[description]{font=\bfseries\HEI}
+\@@_appto_cmd:Nn \appendix
+  {
+  }
 %    \end{macrocode}
 %
-% \subsection{Footnote Style}
 %    \begin{macrocode}
-\MakePerPage{footnote}
+\keys_set:nn { ctex / appendix }
+  {
+    number = \arabic{chapter},
+  }
 %    \end{macrocode}
 %
-% \section{Specical Page}
-% \begin{macro}{\frontmatter,\mainmatter,\backmatter}
+% \subsection{答辩委员会决议}
+%
+% \subsection{成果论文对应关系}
+%
+% \subsection{中英文缩写对照表}
+%
+% \subsection{程序代码样式}
+%
+% \section{文档类后处理}
+%
+% \section{用户接口}
+%
+% \begin{macro}[module=info/]{info/}
+% \begin{macro}[module=style/]{style/}
+% 定义元(meta)键值对。
 %    \begin{macrocode}
-\def\frontmatter{
-  \clearpage
-  \@mainmatterfalse
-  \pagenumbering{Roman}
-}
-\def\mainmatter{
-  \clearpage
-  \@mainmattertrue
-  \pagenumbering{arabic}
-}
-\def\backmatter{
-  \clearpage
-  \@mainmatterfalse
-  \settocdepth{chapter}
-  \hypersetup{bookmarksopenlevel=0}
-}
+\keys_define:nn { hust }
+  {
+    info .meta:nn = { hust / info } {#1},
+    style .meta:nn = { hust / style } {#1}
+  }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
-% Chinese title page.
+% 文档类初始设置。学校代码默认为 \opt{10487}。
 %    \begin{macrocode}
-\def\HUST at zhtitlepage{
-  \begin{center}
-  \vspace*{-1.0cm}
-  \parbox[t][2.2cm][t]{\textwidth}{
-    \begin{center}
-      \setlength{\tabcolsep}{0pt}
-      \setlength{\extrarowheight}{12pt}
-      \TurnOffTabFontSetting
-      \fontsize{14pt}{16.8pt}\selectfont
-      \begin{tabularx}{\textwidth}{p{4em}p{5em}Xp{2em}p{12em}}
-        \HUST at classnotitle    & \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST at classno}\hfill} & &
-        \HUST at stunotitle      & \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST at stuno}\hfill} \\
-        \HUST at schoolcodetitle & \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST at schoolcode}\hfill} & &
-        \HUST at secrettile      & \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST at secretlevel}\hfill}
-      \end{tabularx}
-      \TurnOnTabFontSetting
-    \end{center}
-    }
-  \parbox[t][6cm][t]{\textwidth}{
-    \vspace{1.0cm}
-    \begin{center}
-    \includegraphics[scale=1.1]{hust-title.pdf}\\[0.8cm]
-    \ziju{10bp}{\fontsize{42pt}{54.6pt}\selectfont\HEI\HUST at zhapplyname}
-    \end{center}
+\keys_set_known:nn { hust }
+  {
+    info =
+      {
+        degree = { academic },
+        secret = ,
+        school-id = { 10487 },
+        date =
+          {
+            \int_use:N \c_sys_year_int -
+            \int_use:N \c_sys_month_int -
+            \int_use:N \c_sys_day_int
+          },
+        anonymous-list =
+          {
+            author, student_id, supervisor,
+            author_en, supervisor_en,
+          },
+        committee =
+          {
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+          }
+      }
   }
-  \parbox[t][4.8cm][t]{.8\textwidth}{
-    \vspace{1.4cm}
-    \begin{center}
-    \fontsize{22pt}{35.2pt}\selectfont\hei{\HUST at zhtitle}
-    \end{center}
+%    \end{macrocode}
+%
+% \begin{macro}{\hustsetup}
+% 用户设置接口。
+% \changes{v2.0.0}{2025-02-11}{实现统一用户接口配置选项}
+%    \begin{macrocode}
+\NewDocumentCommand \hustsetup { m }
+  { \keys_set:nn { hust } {#1} }
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</class>
+%    \end{macrocode}
+%
+% \section{常量定义}
+%
+%    \begin{macrocode}
+%<*def-m|def-d>
+%    \end{macrocode}
+%
+% \subsection{全局常量}
+%
+% \begin{variable}{\c_@@_name_school_zh_tl, \c_@@_name_school_en_tl}
+% 学校名称。
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_name_school_zh_tl { 华中科技大学 }
+\tl_const:Nn \c_@@_name_school_en_tl { Huazhong~ University~ of~ Science~
+  and~ Technology }
+%    \end{macrocode}
+% \end{variable}
+%
+% 常用标点符号,见表~\ref{tab:punctuations},定义为 |\c_@@_ #1 _tl|。
+%    \begin{macrocode}
+\clist_map_inline:nn
+  {
+    { ideo_comma       } { ^^^^3001 },
+    { ideo_full_stop   } { ^^^^3002 },
+    { fwid_comma       } { ^^^^ff0c },
+    { fwid_full_stop   } { ^^^^ff0e },
+    { fwid_colon       } { ^^^^ff1a },
+    { fwid_semicolon   } { ^^^^ff1b },
+    { fwid_left_paren  } { ^^^^ff08 },
+    { fwid_right_paren } { ^^^^ff09 }
   }
-  \parbox[t][7.4cm][t]{\textwidth}{
-    \vspace{1.2cm}
-    \begin{center}
-    \fontsize{18pt}{27.0pt}\selectfont
-    \setlength{\extrarowheight}{0pt}
-    \TurnOffTabFontSetting
-    \begin{tabular}{p{5em}@{{:\hspace{1em}}}l}
-    \HUST at zhauthortitle       & {\HUST at zhauthor} \\
-    \HUST at zhmajortitle      & {\HUST at zhmajor} \\
-    \HUST at zhsupervisortitle & {\HUST at zhsupervisor} \\
-    \ifthenelse{\equal{\HUST at zhasssupervisor}{}}{}{
-      \HUST at zhasssupervisortitle & {\HUST at zhasssupervisor} \\
-    }
-    \HUST at zhdatetitle & \zhdateformat
-    \end{tabular}
-    \TurnOnTabFontSetting
-    \end{center}
+  { \@@_define_punct:nn #1 }
+%    \end{macrocode}
+%
+% \begin{table}[ht]
+%   \caption{常用标点符号}
+%   \label{tab:punctuations}
+%   \centering
+%   \begin{tabular}{cccc}
+%     \toprule
+%       \textbf{中文名称} &
+%       \textbf{英文名称} &
+%       \textbf{符号} &
+%       \textbf{Unicode 码位} \\
+%     \midrule
+%       中文顿号     & Ideographic comma           & ^^^^3001 & U+3001 \\
+%       中文句号     & Ideographic full stop       & ^^^^3002 & U+3002 \\
+%       中文逗号     & Fullwidth comma             & ^^^^ff0c & U+FF0C \\
+%       全角西文句点 & Fullwidth full stop         & ^^^^ff0e & U+FF0E \\
+%       中文冒号     & Fullwidth colon             & ^^^^ff1a & U+FF1A \\
+%       中文分号     & Fullwidth semicolon         & ^^^^ff1b & U+FF1B \\
+%       中文左圆括号 & Fullwidth left parenthesis  & ^^^^ff08 & U+FF08 \\
+%       中文右圆括号 & Fullwidth right parenthesis & ^^^^ff09 & U+FF09 \\
+%     \bottomrule
+%   \end{tabular}
+% \end{table}
+%
+% \begin{variable}{\c_@@_line_spread_fp}
+% 设置行距倍数1.5倍。
+%    \begin{macrocode}
+\fp_const:Nn \c_@@_line_spread_fp { 1.5 }
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_emptybox_tl, \c_@@_checkbox_tl}
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_emptybox_tl { \usym{2610} }
+\tl_const:Nn \c_@@_checkbox_tl { \usym{2611} }
+%    \end{macrocode}
+% \end{variable}
+%
+% \subsection{封面页常量}
+% \begin{variable}{
+%   \c_@@_name_degree_font_tl,
+%   \c_@@_name_professional_tl,
+%   \c_@@_name_date_tl,
+%   \c_@@_name_clc_tl,
+%   \c_@@_name_student_id_tl,
+%   \c_@@_name_school_id_tl,
+%   \c_@@_name_secret_tl,
+%   \c_@@_school_id_tl,
+% }
+% 中文封面页常量。
+%    \begin{macrocode}
+\clist_map_inline:nn
+  {
+%<def-m>    { degree_font } { \bfseries \songti },
+%<def-d>    { degree_font } { \heiti },
+    { date } { 答\hfill 辩\hfill 日\hfill 期 },
+    { clc } { 分类号 },
+    { student_id } { 学号 },
+    { school_id } { 学校代码 },
+    { secret } { 密级 },
   }
-  \end{center}
-}
+  { \@@_define_name:nn #1 }
+\tl_const:Nn \c_@@_school_id_tl { 10487 }
 %    \end{macrocode}
+% \end{variable}
 %
-% English title page.
+% \begin{variable}{
+%   \c_@@_address_tl
+% }
+% 英文封面页常量。
 %    \begin{macrocode}
-\def\HUST at entitlepage{
-  \begin{center}
-    \parbox[t][4.5cm][t]{.9\textwidth}{
-      \begin{center}
-        \fontsize{16pt}{17.6pt}\selectfont
-        \HUST at enapplyname
-      \end{center}
-    }
-    \parbox[t][5.7cm][t]{\textwidth}{
-      \begin{center}
-        \fontsize{18pt}{23.4pt}\selectfont
-        \textbf{\textsf{\HUST at entitle}}
-      \end{center}
-    }
-    \parbox[t][5cm][t]{.8\textwidth}{
-      \begin{center}
-      \setlength{\extrarowheight}{5pt}
-      \fontsize{16pt}{24.0pt}\selectfont
-      \TurnOffTabFontSetting
-      \begin{tabular}{l@{~:~}p{18em}}
-        \HUST at enauthortitle     & {\HUST at enauthor} \\
-        \HUST at enmajortitle      & {\HUST at enmajor} \\
-        \HUST at ensupervisortitle & {\HUST at ensupervisor}
-        \ifthenelse{\equal{\HUST at enasssupervisor}{}}{}{
-          \\ \HUST at enasssupervisortitle & {\HUST at enasssupervisor}
-        }
-      \end{tabular}
-      \TurnOnTabFontSetting
-      \end{center}
-    }
-    \parbox[t][7cm][b]{.8\textwidth}{
-      \begin{center}
-      \bfseries
-      \fontsize{14pt}{28.0pt}\selectfont
-      \HUST at enschoolname \\
-      \HUST at enaddress \\
-      \endateformat
-    \end{center}
-    }
-  \end{center}
-}
+\tl_const:Nn \c_@@_address_tl
+  {
+    Huazhong~ University~ of~ Science~ and~ Technology\\
+    Wuhan~ 430074,~ P.~ R.~ China
+  }
 %    \end{macrocode}
+% \end{variable}
 %
-% Copyright page.
+% \begin{variable}{
+%   \c_@@_name_type_en_tl,
+%   \c_@@_name_type_zh_tl,
+%   \c_@@_name_academic_en_tl,
+%   \c_@@_name_academic_zh_tl,
+%   \c_@@_name_professional_en_tl,
+%   \c_@@_name_professional_zh_tl,
+%   \c_@@_name_author_en_tl,
+%   \c_@@_name_author_zh_tl,
+%   \c_@@_name_major_en_tl,
+%   \c_@@_name_major_zh_tl,
+%   \c_@@_name_supervisor_en_tl,
+%   \c_@@_name_supervisor_zh_tl,
+% }
+% 中英文页共用常量。
 %    \begin{macrocode}
-\def\HUST at authorization{
-  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST at originaldeclare}
-  \vspace{1cm}
+\clist_map_inline:nn
   {
-    \fontsize{12pt}{24.0pt}\selectfont
-    \indent\HUST at originaldeclaretext
+    { type }
+      { A~ Dissertation~ Submitted~ in~ Partial~ Fulfillment~ of~
+%<def-m>      the~
+%<def-d>      The~
+      Requirements~ for~ }
+%<def-m>      { 硕士学位论文 },
+%<def-d>      { 博士学位论文 },
+%<*def-m>
+    { academic } { the~ Master~ Degree~ in } { 学术型 },
+    { professional } { the~ Professional~ Master~ Degree~ in }  { 专业型 },
+    { author } { Candidate } { 学\hfill 位\hfill 申\hfill 请\hfill 人 },
+%</def-m>
+%<*def-d>
+    { academic } { The~ Degree~ of~ Doctor~ of } { 学术型 },
+    { professional } { The~ Degree~ of~ Doctor~ of } { 专业型 }, % no diff in English
+    { author } { Ph.D.~ Candidate } { 学\hfill 位\hfill 申\hfill 请\hfill 人 },
+%</def-d>
+    { major } { Major } { 学\hfill 科\hfill 专\hfill 业 },
+    { supervisor } { Supervisor } { 指\hfill 导\hfill 老\hfill 师 },
   }
-  \\[1.9cm]
-  \parbox[t]{\textwidth}{
-    \fontsize{12pt}{18.0pt}\selectfont
-    \TurnOffTabFontSetting
-    \hfill\begin{tabular}{ll}
-        \HUST at zhauthorsig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \TurnOnTabFontSetting
+  { \@@_define_name:nnn #1 }
+%    \end{macrocode}
+% \end{variable}
+%
+% \subsection{声明页常量}
+%
+% \begin{variable}{\c_@@_orig_decl_title_tl, \c_@@_orig_decl_text_tl}
+% 独创性声明。
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_orig_decl_title_tl { 独创性声明 }
+\tl_const:Nn \c_@@_orig_decl_text_tl
+  {
+    本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的研
+    究成果。尽我所知,除文中已经标明引用的内容外,本论文不包含任何其他个人或
+    集体已经发表或撰写过的研究成果。对本文的研究做出贡献的个人和集体,均已在
+    文中以明确方式标明。本人完全意识到本声明的法律结果由本人承担。
   }
-  \\[1.9cm]
-  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST at authtitle}
-  \\[1cm]
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_orig_decl_sign_clist}
+% 独创性声明签名项目。
+%    \begin{macrocode}
+\clist_const:Nn \c_@@_orig_decl_sign_clist
   {
-    \fontsize{12pt}{24.0pt}\selectfont
-    \indent\HUST at authorizationtext \\
-    \indent\HUST at authorizationaddon \\
-    \indent\HUST at authorizationcheck
+    学位论文作者签名:\hspace{2em}\mbox{},
+    日期:\hspace{2em}年\hspace{1.5em}月\hspace{1.5em}日
   }
-  \\[1.9cm]
-  \hspace{2em}\parbox[t]{.9\textwidth}{
-    \fontsize{12pt}{18.0pt}\selectfont
-    \TurnOffTabFontSetting
-    \begin{tabular}{ll}
-        \HUST at zhauthorsig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \hfill
-    \begin{tabular}{ll}
-        \HUST at zhteachersig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \TurnOnTabFontSetting
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_auth_decl_title_tl, \c_@@_auth_decl_text_tl}
+% 学位论文版权使用授权书。
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_auth_decl_title_tl { 学位论文版权使用授权书 }
+\tl_const:Nn \c_@@_auth_decl_text_tl
+  {
+    本学位论文作者完全了解学校有关保留、使用学位论文的规定,即:学校有权
+    保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
+    本人授权华中科技大学可以将本学位论文的全部或部分内容编入有关数据库进行检
+    索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
   }
-  \vfill
-}
 %    \end{macrocode}
+% \end{variable}
 %
-% \begin{macro}{\maketitle,\makecover}
-% Commands to generate title page.
+% \begin{variable}{\c_@@_auth_decl_secr_clist, \c_@@_auth_decl_sign_clist}
+% 学位论文版权使用授权书填写项目:保密与签名。
 %    \begin{macrocode}
-\def\maketitle{
-  \newgeometry{
-    top=1.2in,
-    bottom=1.2in,
-    left=1in,
-    right=1in,
+\clist_const:Nn \c_@@_auth_decl_secr_clist
+  {
+    本论文属于,
+    保\hspace{1em}密□,在\underline{\hspace{3em}}年解密后适用本授权书。,
+    不保密□。,
+    (请在以上方框内打“√”)
   }
-  \let\HUST at oldthepage\thepage
-  \ifthenelse{\equal{\HUST at language}{english-draft}}
-  {\def\thepage{Titlepage}}
-  {\def\thepage{封面}}
-  \begin{titlepage}
-    \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-      \thispagestyle{empty}
-      \HUST at zhtitlepage
-      \clearpage
-    }
-    \thispagestyle{empty}
-    \HUST at entitlepage
-  \end{titlepage}
-  \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \def\thepage{版权页}
-    \thispagestyle{empty}
-    \HUST at authorization
-    \clearpage
+\clist_const:Nn \c_@@_auth_decl_sign_clist
+  {
+    学位论文作者签名:\hfill{} 指导教师签名:\hspace*{5em} \mbox{},
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日 \hfill{}
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日\hspace*{1em} \mbox{}
   }
-  \restoregeometry
-  \let\thepage\HUST at oldthepage
-  \setcounter{page}{1}
-}
-\let\makecover\maketitle
 %    \end{macrocode}
-% \end{macro}
+% \end{variable}
 %
-% Chinese abstract page.
+% \subsection{摘要页常量}
+% \begin{variable}{
+%   \c_@@_name_abstract_zh_tl,
+%   \c_@@_name_abstract_en_tl,
+%   \c_@@_name_keywords_zh_tl,
+%   \c_@@_name_keywords_en_tl,
+%   \c_@@_sep_keywords_zh_tl,
+%   \c_@@_sep_keywords_en_tl,
+% }
 %    \begin{macrocode}
-\def\HUST at zhabstractpage{
-  \chapter*{\HUST at zhabstractname}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-  \HUST at zhabstract \par
-  \vskip 1.2ex
-  \noindent\hei{\HUST at zhkeywordstitle}\hspace{.8em} \HUST at zhkeywords
-  \endgroup
-}
+\clist_map_inline:nn
+  {
+    { abstract } { Abstract } { 摘\hspace{1em}要 },
+    { keywords } { Key~ words: } { 关键词: },
+  }
+  { \@@_define_name:nnn #1 }
+\tl_const:Nn \c_@@_sep_keywords_zh_tl { ; }
+\tl_const:Nn \c_@@_sep_keywords_en_tl { , }
 %    \end{macrocode}
+% \end{variable}
 %
-% English abstract page.
+% \subsection{正文常量}
+% \begin{variable}{\c_@@_header_tl}
+% 页眉。
 %    \begin{macrocode}
-\def\HUST at enabstractpage{
-  \chapter*{\textsf{\HUST at enabstractname}}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-  \HUST at enabstract \par
-  \vskip 1.2ex
-  \noindent\textbf{\HUST at enkeywordstitle}\hspace{.8em} \HUST at enkeywords
-  \endgroup
-}
+%<def-m>\tl_const:Nn \c_@@_header_tl { 华中科技大学硕士学位论文 }
+%<def-d>\tl_const:Nn \c_@@_header_tl { 华中科技大学博士学位论文 }
 %    \end{macrocode}
+% \end{variable}
 %
-% \begin{macro}{\makeabstract}
-% A command to generate abstract page.
 %    \begin{macrocode}
-\def\makeabstract{
-  \phantomsection
-  \ifthenelse{\equal{\HUST at language}{chinese}}{
-    \addcontentsline{toc}{chapter}{\HUST at zhabstractnamenospace}
-  }{
-    \addcontentsline{toc}{chapter}{\HUST at enabstractname}
+%</def-m|def-d>
+%    \end{macrocode}
+
+% \section{文献样式}
+%
+% \changes{v2.0.0}{2025-02-26}{实现基于\pkg{biblatex}的文献样式}
+%
+% \subsection{标注样式}
+%
+%    \begin{macrocode}
+%<*cbx>
+%    \end{macrocode}
+%
+% 无须修改标注样式。
+%    \begin{macrocode}
+\RequireCitationStyle{gb7714-2015}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</cbx>
+%    \end{macrocode}
+%
+% \subsection{著录样式}
+%
+%    \begin{macrocode}
+%<*bbx>
+%    \end{macrocode}
+%
+% 基于 \pkg{biblatex-gb7714-2015} 的著录样式。
+%    \begin{macrocode}
+\RequireBibliographyStyle{gb7714-2015}
+%    \end{macrocode}
+%
+% 设置 \pkg{biblatex-gb7714-2015} 通用著录样式选项。
+%    \begin{macrocode}
+\ExecuteBibliographyOptions
+  {
+    isbn = false,
+    url = false,
+    doi = false,
+    gbnamefmt = givenahead,
+    gbtype = false,
+    gbpunctin = false,
+    maxbibnames = 6,
+    minbibnames = 6,
   }
-  \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \HUST at zhabstractpage
-    \clearpage
-  }
-  \HUST at enabstractpage
-  \clearpage
-}
 %    \end{macrocode}
-% \end{macro}
 %
-% \begin{macro}{\tableofcontents}
-% A command to generate table of contents.
+% 删除著录项末尾的标点符号。
 %    \begin{macrocode}
-\let\HUST at tableofcontents\tableofcontents
-\def\tableofcontents{
-  \ifthenelse{\equal{\HUST at language}{chinese}}{
-    \pdfbookmark{\contentsnamenospace}{\contentsnamenospace}
-  }{
-    \pdfbookmark{\contentsname}{\contentsname}
-  }
-  \HUST at tableofcontents
-  \clearpage
+\renewcommand{\finentrypunct}{}
+%    \end{macrocode}
+%
+% \subsubsection{专著}
+%
+% 设置专著版本样式,并使用 \pkg{zhnumber} 将中文专著的阿拉伯数字版本号自动转换为中文数字。
+%    \begin{macrocode}
+\newcommand\HUST at bib@zhedition[1]{(#1)}
+\newcommand\HUST at bib@enedition[1]{(#1)}
+\DeclareFieldFormat{edition}{\bibtitlefont%源来自biblatex.DEF
+    \testCJKfirst{userd}%
+    \iftoggle{ifCJKforgbt}%
+      {\ifinteger{#1}
+        {%
+          \ifnumgreater{#1}{1}{\printtext{
+            %#1\str at edition
+            \HUST at bib@zhedition{第\zhnumber{#1}版}
+          }}{}
+        }%
+        %{#1\isdot}}%
+        {\HUST at bib@zhedition{#1}}
+        \addspace
+      }%
+      {\ifinteger{#1}%
+        {\ifnumgreater{#1}{1}{
+           %\mkbibordedition{#1}~\bibstring{edition}
+           \HUST at bib@enedition{\mkbibordedition{#1}~\bibstring{edition}}
+          }{}
+        }%
+        %{#1\isdot}}%
+        {\HUST at bib@enedition{#1}\isdot}
+      }
 }
+\DeclareBibliographyDriver{book}{%源来自standard.bbx文件
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
 %    \end{macrocode}
-% \end{macro}
+% 删除版本前的标点符号。
+%    \begin{macrocode}
+  \if false
+  \usebibmacro{maintitle+title}%
+  \iftoggle{bbx:gbstrict}{}{%
+    \newunit
+    \printlist{language}%
+    \newunit\newblock%
+    \usebibmacro{byauthor}%
+    \newunit\newblock
+  }%
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \fi
+  \printfield[titlecase]{title}%
+  \printfield{edition}%
+  \newunit\newblock%%
+  \iftoggle{bbx:gbstrict}{}{%
+  \iffieldundef{maintitle}%
+  {%\printfield{volume}%
+  \printfield{part}}%
+  {}%
+  \newunit%
+  \printfield{volumes}%
+  \newunit\newblock%
+  \usebibmacro{series+number}}%
+  \newunit\newblock%
+  %\printfield{note}%
+  %\newunit\newblock%
+  \usebibmacro{publisher+location+date}%
+  %\newunit\newblock %这里标点去掉
+  \usebibmacro{chapter+pages}%
+    \iffieldundef{url}{}{%当没有网址时也不输出
+    \usebibmacro{modifydate}}%带括号的修改或更新日期,
+  \usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。
+%    \end{macrocode}
+% 删除专著的页码。
+%    \begin{macrocode}
+  \if false
+  \newunit\newblock%
+  \printfield{pagetotal}%
+  \fi
+  \newunit\newblock%
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  %\usebibmacro{doi+eprint+url}%
+  %\newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
+}
+%    \end{macrocode}
 %
-% \begin{environment}{ack}
-% A command to generate acknowledge page.
+% \subsubsection{析出文献}
+%
+% 设置包括会议论文在内的析出文献著录样式。
+% 修改 Driver: inbook $\rightarrow$ macro: |inbook:parent|
+% $\rightarrow$ |publisher+location+date|。
+% 将会议论文析出文献中的会议地址(含会议日期)后面的冒号改为逗号。
 %    \begin{macrocode}
-\newenvironment{ack}{
-  \clearpage
-  \phantomsection
-  \addcontentsline{toc}{chapter}{\HUST at acknamenospace}
-  \chapter*{\HUST at ackname}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-}{
-  \endgroup
+\newbibmacro*{HUSTinbook_publisher+location+date}{\bibpubfont%
+  \iftoggle{bbx:gbpub}%
+    {\testCJKfirst{userd}%
+      \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
+        {\iffieldequalstr{entrysubtype}{standard}{}
+          {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at noaddress}\space :\space\str at nopublisher\gbrightbracket}
+              {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}
+        }%
+        {
+          \iflistundef{location}{%\adddot
+            \iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
+            {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at noaddress\gbrightbracket}\addcolon\addspace}%
+                {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}
+          }%  \bibstring{noaddress}
+          {\printlist{location}\publocpunct}%%\addcolon\addspace%
+          \iflistundef{publisher}{%
+            \iffieldequalstr{entrysubtype}{standard}{}%
+            {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+            {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
+            {\printlist{publisher}}
+        }%
+      \pubdatadelim%\addcomma\addspace%
+      \usebibmacro{date}%%\newunit %去掉这个标点
+    }%
+    {\printlist{location}%
+      \iflistundef{publisher}
+        {\locnopubdelim}
+%    \end{macrocode}
+% 始终使用逗号。
+%    \begin{macrocode}
+        %{\setunit*{\publocpunct}}%
+        {\locnopubdelim}
+      \printlist{publisher}%
+      \pubdatadelim%
+      \usebibmacro{date}%%\newunit
+    }%
 }
+\renewbibmacro*{inbook:parent}{%
+  \usebibmacro{bybookauthor}%
+    \ifnameundef{bookauthor}{%
+    \ifnameundef{editor}{}{\newunit}%
+    }{\newunit}%替换下一句
+    %\newunit\newblock
+  \iffieldundef{series}{}
+    {\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加
+    \usebibmacro{maintitle+booktitle}%
+  \iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}%
+  \iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息
+    \newunit\newblock%
+  %  \usebibmacro{byeditor+others}%
+  %  \newunit\newblock
+    \printfield{edition}%
+    \newunit
+    \iftoggle{bbx:gbstrict}{}{%
+  %  \iffieldundef{maintitle}
+  %    {\printfield{volume}%
+  %     \printfield{part}}
+  %    {}%
+  %  \newunit
+  %  \printfield{volumes}%
+  %  \newunit\newblock
+  %  \usebibmacro{series+number}
+    }%
+    \newunit\newblock
+    %\printfield{note}%
+    %\newunit\newblock
 %    \end{macrocode}
-% \end{environment}
+% 由于 |publisher+location+date| 在不只这里使用,
+% 因此将其移植到宏 |HUSTinbook_publisher+location+date| 中。
+%    \begin{macrocode}
+    %\usebibmacro{publisher+location+date}
+    \usebibmacro{HUSTinbook_publisher+location+date}%
+}
+%    \end{macrocode}
 %
-% \begin{environment}{publications}
-% A command to generate publications page.
+% \subsubsection{期刊}
+%
+% 暂时没发现需要修改的。
+%
+% \subsubsection{专利}
+%
+% 设置专利著录样式。
 %    \begin{macrocode}
-\newenvironment{publications}{
-  \clearpage
-  \ifHUST at inappendix
-    \chapter{\HUST at publicationtitle}
-  \else
-    \phantomsection
-    \addcontentsline{toc}{chapter}{\HUST at publicationtitle}
-    \chapter*{\HUST at publicationtitle}
+\DeclareFieldFormat[book]{title}{#1}
+\renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件
+  \ifboolexpr{%
+    test{\iffieldundef{title}}%
+    and%
+    test{\iffieldundef{subtitle}}%
+  }%
+  {}%
+  { \printtext[title]{\bibtitlefont%
+      \printfield[titlecase]{title}%
+      \newunit
+      \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题
+        {}%
+        {\setunit{\subtitlepunct}\printfield[titlecase]{subtitle}}%
+      \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格
+        {\setunit{\subtitlepunct}\printfield{titleaddon}}%
+%    \end{macrocode}
+% 修改标题后面标点;将地点,专利号移植到标题中;并强制显示 GB/T 7714-2015 中的文献类型(|[P]|)。
+%    \begin{macrocode}
+      \if false
+      \setunit{\subtitlepunct}\printfield{number}%写专利号
+      \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}%
+      %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点
+      %\newunit
+      \fi
+      \iflistundef{location}
+        {}
+        %{\setunit*{\addspace}%
+        {\setunit*{\subtitlepunct}
+        \printtext{%[parens]
+          \printlist[][-\value{listtotal}]{location}}}%
+      \setunit{\addcomma\space}\printfield{number}%写专利号
+      \setunit{\addspace}\printfield[gbtypeflag]{usera}
+    }%
+  }%
+  \setunit{\subtitlepunct}%
+}
+\DeclareBibliographyDriver{patent}{%源来自standard.BBX
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+  %\usebibmacro{title}%
+  \usebibmacro{patenttitle}%给出专利专用的标题输出
+  \iftoggle{bbx:gbstrict}{}{%
+    \newunit%
+    \printlist{language}%
+    \newunit\newblock
+    \usebibmacro{byauthor}
+  }%
+  \newunit\newblock
+%    \end{macrocode}
+% 以下部分,抑或移除,抑或移至标题块 |patenttitle| 中。
+%    \begin{macrocode}
+  \if false
+  \printfield{type}%
+  \setunit*{\addspace}%
+  %\printfield{number}%已放到patenttitle中处理
+  \iflistundef{location}
+    {}
+    {\setunit*{\addspace}%
+    \printtext{%[parens]
+      \printlist[][-\value{listtotal}]{location}}}%
+  \newunit\newblock
+  \usebibmacro{byholder}%
+  \newunit\newblock
   \fi
-  \begin{enumerate}[labelindent=0pt,label={[\arabic*]},itemsep=0.5ex]
-  \fontsize{10.5pt}{10.5pt}\selectfont
-}{
-  \end{enumerate}
+  \printfield{note}%
+  \newunit\newblock
+%    \end{macrocode}
+% 日期只显示到年。
+%    \begin{macrocode}
+  %\usebibmacro{newsdate}%
+  \usebibmacro{date}%
+  %\newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+    \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
 }
 %    \end{macrocode}
-% \end{environment}
 %
-% \begin{macro}{\bibliography}
-% A command to generate bibliography page.
+% \subsubsection{学位论文}
+%
+% 覆盖原 |manual| 的别名。
 %    \begin{macrocode}
-\bibliographystyle{hustthesis}
-\let\HUST at bibliography\bibliography
-\def\bibliography#1{
-  \clearpage
-  \phantomsection
-  \addcontentsline{toc}{chapter}{\bibname}
-  \begingroup
-  \fontsize{10.5pt}{10.5pt}\selectfont
-  \setlength\bibsep{0.5ex}
-  \HUST at bibliography{#1}
-  \endgroup
+\DeclareBibliographyDriver{thesis}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+%    \end{macrocode}
+% 增加学位论文类型的显示。
+%    \begin{macrocode}
+  %\usebibmacro{title}%
+  \printfield[titlecase]{title}%
+  \printfield[gbtypeflag]{type}
+  \iftoggle{bbx:gbstrict}{}{%
+  \newunit%
+  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%增加的译者信息
+  \newunit\newblock
+  \iftoggle{bbx:gbfieldtype}{%
+    \printfield{type}%
+    \setunit*{\addspace}}{}%
+  \printfield{number}%
+  \newunit\newblock
+  \printfield{version}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  %\newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期
+    \usebibmacro{modifydate}}%修改或更新日期为带括号的时间
+  \usebibmacro{doi+eprint+url}%
+  \newunit
+  \printfield{pagetotal}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \newunit\newblock
+%  \usebibmacro{doi+eprint+url}%
+%  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
 }
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+%</bbx>
+%    \end{macrocode}
+%
+% \section{文档样式}
+%
+% ^^A 本小节初版实现主要来自 \pkg{fduthesis} 文档类。
+%
+%    \begin{macrocode}
+%<*doc-sty>
+%<@@=hustdoc>
+\RequirePackage
+  {
+    ulem,
+    xcolor-material,
+    zref-base,
+    listings,
+  }
+%    \end{macrocode}
+%
+% \subsection{内部函数}
+%
+% \begin{macro}{\@@_patch_cmd:Nnn, \@@_preto_cmd:Nn, \@@_appto_cmd:Nn}
+% 补丁工具。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_cmd:Nnn #1#2#3
+  {
+    \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\cs_new_protected:Npn \@@_preto_cmd:Nn #1#2
+  {
+    \ctex_preto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\cs_new_protected:Npn \@@_appto_cmd:Nn #1#2
+  {
+    \ctex_appto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
+  }
+%    \end{macrocode}
 % \end{macro}
 %
-% \begin{environment}{appendix}
-% The appendix environment.
+% \subsection{\cls{l3doc} 补丁}
+%
 %    \begin{macrocode}
-\newif\ifHUST at inappendix
-\HUST at inappendixfalse
-\newif\ifHUST at appendix@resetmainmatter
-\HUST at appendix@resetmainmatterfalse
-\renewenvironment{appendix}{
-  \if at mainmatter
-    \HUST at appendix@resetmainmatterfalse
-  \else
-    \HUST at appendix@resetmainmattertrue
-    \@mainmattertrue
-  \fi
-  \appendixtitletocon
-  \appendices
-  \titleformat{\chapter}
+%<@@=codedoc>
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_typeset_functions:}
+% 减少展开标记(用来表明中英文模板中的不同用法)前的空格。
+%    \begin{macrocode}
+\__hustdoc_patch_cmd:Nnn \@@_typeset_expandability:
+  { & } { & \skip_horizontal:n { -0.5em } }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_typeset_functions:, \@@_macro_init:,
+%   \@@_macro_dump:}
+% 左侧边注的函数列表采用单倍行距。
+%    \begin{macrocode}
+\__hustdoc_preto_cmd:Nn \@@_typeset_functions:
+  { \MacroFont }
+\__hustdoc_patch_cmd:Nnn \@@_macro_init:
+  { \hbox:n } { \MacroFont \hbox:n }
+\__hustdoc_patch_cmd:Nnn \@@_macro_dump:
+  { \hbox_unpack_drop:N } { \MacroFont \hbox_unpack_drop:N }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_macro_typeset_one:nN}
+% 在 \env{macro} 环境的侧边栏中,\cls{l3doc} 根据命令的长短,分别用
+% 普通字体和紧缩字体输出。然而很长的命令还是会超出页边。这里用缩放
+% 盒子的手段使得长命令也可正常显示。
+%    \begin{macrocode}
+\cs_set_protected:Npn \@@_macro_typeset_one:nN #1#2
   {
-    \bfseries\HEI
-    \centering
-    \fontsize{18pt}{23.4pt}\selectfont
+    \vbox_set:Nn \l_@@_macro_box
+      {
+        \MacroFont
+        \vbox_unpack_drop:N \l_@@_macro_box
+        \hbox_set:Nn \l_tmpa_box
+          { \@@_print_macroname:nN {#1} #2 }
+%    \end{macrocode}
+% \tn{marginparwidth} 和 \tn{marginparsep} 分别是边注的宽度及其到版心的距离,
+% \tn{labelsep} 则是编号盒子右端与条目首行文本之间的距离。
+%    \begin{macrocode}
+        \dim_set:Nn \l_tmpa_dim
+          { \marginparwidth - \labelsep - \marginparsep }
+        \dim_compare:nNnT { \box_wd:N \l_tmpa_box } > \l_tmpa_dim
+          {
+            \box_resize_to_wd_and_ht:Nnn \l_tmpa_box
+              { \l_tmpa_dim } { \box_ht:N \l_tmpa_box }
+          }
+        \hbox_overlap_left:n
+          {
+            \box_use:N \l_tmpa_box
+            \skip_horizontal:n { \marginparsep - \labelsep }
+          }
+      }
+    \int_incr:N \l_@@_macro_int
   }
-  {\appendixname\,\thechapter}
-  {1em}
-  {}
-  \HUST at inappendixtrue
-}{
-  \endappendices
-  \HUST at inappendixfalse
-  \ifHUST at appendix@resetmainmatter
-    \HUST at appendix@resetmainmatterfalse
-    \@mainmatterfalse
-  \else\fi
-}
 %    \end{macrocode}
-% \end{environment}
+% \end{macro}
 %
-% \begin{macro}{\listoffigures}
-% A command to generate list of figures.
+% \subsection{文档层命令}
+%<@@=hustdoc>
+%
+% \begin{macro}[no-user-doc]{\key}
+% 用于在文档中输出自定义索引的命令,主要用于键值对的键的索引。仅当索引项的父分类为 |option| 时,即用于文档类选项时,隐藏父分类。
+%  \begin{arguments}
+%    \item 在索引中显示项的父分类,默认为 \opt{option}。
+%    \item 命令本体。
+%  \end{arguments}
 %    \begin{macrocode}
-\let\HUST at listoffigures\listoffigures
-\def\listoffigures{
-  \clearpage
-  \ifHUST at inappendix
-    \addtocounter{chapter}{1}
-    \def\listfigurename{\appendixname\,\thechapter\hspace{1em}\HUST at listfigurename}
-  \else
-    \def\listfigurename{\HUST at listfigurename}
-  \fi
-  \phantomsection
-  \ifHUST at inappendix
-    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST at listfigurename}
-  \else
-    \addcontentsline{toc}{chapter}{\listfigurename}
-  \fi
-  \HUST at listoffigures
-  \def\listfigurename{\HUST at listfigurename}
-}
+\DeclareDocumentCommand \key { O{option} m }
+  {
+    \tl_if_eq:nnTF { #1 } { option }
+      { \cmd[module=#1/]{#2} }
+      { \cmd[module=#1/]{#1/#2} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\listoftables}
-% A command to generate list of tables.
+% \begin{macro}[no-user-doc]{\opt}
+% 输出键值对的值。
 %    \begin{macrocode}
-\let\HUST at listoftables\listoftables
-\def\listoftables{
-  \clearpage
-  \ifHUST at inappendix
-    \addtocounter{chapter}{1}
-    \def\listtablename{\appendixname\,\thechapter\hspace{1em}\HUST at listtablename}
-  \else
-    \def\listtablename{\HUST at listtablename}
-  \fi
-  \phantomsection
-  \ifHUST at inappendix
-    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST at listtablename}
-  \else
-    \addcontentsline{toc}{chapter}{\listtablename}
-  \fi
-  \HUST at listoftables
-  \def\listtablename{\HUST at listtablename}
-}
+\DeclareDocumentCommand \opt { s m }
+  { \IfBooleanTF {#1} { \texttt{\bfseries \upshape #2} } { \texttt{\upshape #2} } }
 %    \end{macrocode}
 % \end{macro}
 %
-% \section{Other Command}
-% \begin{macro}{\email}
+% \begin{macro}[no-user-doc]{\expstar, \rexpstar}
 %    \begin{macrocode}
-\def\email#1{
-  \href{mailto:#1}{\texttt{#1}}
-}
+\newcommand\expstar{$\star$}
+\newcommand\rexpstar{\ding{73}}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[int]{\TeX, \LaTeX, \LaTeXe,
+%   \pdfTeX, \pdfLaTeX, \XeTeX, \XeLaTeX, \LuaTeX, \LuaLaTeX,
+%   \AmSLaTeX, \TeXLive, \MiKTeX, \BibTeX, \biber, \TikZ
+% }
+% \TeX{} 相关标志。
 %    \begin{macrocode}
-%</class>
+\def\TeX{\hologo{TeX}}
+\def\LaTeX{\hologo{LaTeX}}
+\def\LaTeXe{\hologo{LaTeXe}}
+\def\pdfTeX{\hologo{pdfTeX}}
+\def\pdfLaTeX{\hologo{pdfLaTeX}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\XeLaTeX{\hologo{XeLaTeX}}
+\def\LuaTeX{\hologo{LuaTeX}}
+\def\LuaLaTeX{\hologo{LuaLaTeX}}
+\def\AmSLaTeX{\hologo{AmSLaTeX}}
+\def\TeXLive{\TeX\ Live}
+\def\MiKTeX{\hologo{MiKTeX}}
+\def\BibTeX{\hologo{BibTeX}}
+\def\biber{\hologo{biber}}
 %    \end{macrocode}
+% 该定义来自 \file{pgfmanual-en-macros.tex}。
+%    \begin{macrocode}
+\def\TikZ{Ti\emph{k}Z}
+%    \end{macrocode}
+% \end{macro}
 %
-% \Finale
+% \subsection{文档样式}
 %
-% ^^A Other files
-% \iffalse
+% \begin{environment}{bashecode, latexcode}
+%    \begin{macrocode}
+\lstdefinestyle{style at base}
+  {
+    basewidth = 0.5 em,
+    gobble = 3,
+    lineskip = 3 pt,
+    frame = l,
+    framerule = 1 pt,
+    framesep = 0 pt,
+    xleftmargin = 2 em,
+    xrightmargin = 3 em,
+    escapeinside = {(*}{*)},
+    breaklines = true,
+    basicstyle = \small\ttfamily,
+    keywordstyle = \bfseries\color{purple},
+    commentstyle = \itshape\color{white!50!gray},
+    stringstyle = \color{red},
+    backgroundcolor = \color{white!95!gray}
+  }
+\lstdefinestyle{style at bash}
+  {
+    style = style at base,
+    rulecolor = \color{pink},
+    language = bash,
+    alsoletter = {-},
+    emphstyle = \color{green}
+  }
+\lstdefinestyle{style at latex}
+  {
+    style = style at base,
+    rulecolor = \color{blue},
+    language = [LaTeX]TeX,
+    alsoletter = {*, -, .},
+    texcsstyle = *\color{purple},
+    emphstyle = [1]\color{orange},
+    emphstyle = [2]\color{green},
+    emphstyle = [3]\bfseries\color{yellow}
+  }
+\lstnewenvironment{bashecode}[1][]{%
+  \lstset{style=style at bash, #1}}{}
+\lstnewenvironment{latexcode}[1][]{%
+  \lstset{style=style at latex, #1}}{}
+%    \end{macrocode}
+% \end{environment}
 %
-%<*example-zh|example-en>
-%<example-zh>\documentclass[format=draft,language=chinese,degree=bachelor]{hustthesis}
-%<example-en>\documentclass[format=draft,language=english,degree=bachelor]{hustthesis}
-
-\stuno{U2009xxxxx}
-\schoolcode{10487}
-%<example-zh>\title{\LaTeX 模板使用示例}{An Example of Using hustthesis \LaTeX{} Template}
-%<example-en>\title{An Example of Using hustthesis \LaTeX{} Template}
-\author
-%<example-zh>{许铖}{Xu Cheng}
-%<example-en>{}
-\major
-%<example-zh>{电子信息工程}{Electronic and Information Engineering}
-%<example-en>{}
-\supervisor
-%<example-zh>{黑晓军\hspace{1em}副教授}{Ass. Prof. Xiaojun Hei}
-%<example-en>{}
-\date{2013}{7}{1}
-
-%<*example-zh>
-\zhabstract{
-    这这是一个\LaTeX{}模板使用实例文件,该模板用于华中科技大学毕业设计、学士论文、硕士论文和博士论文写作中。
-
-    该模板基于LPPL v1.3发行。
-
-}
-\zhkeywords{\LaTeX{},华中科技大学,论文,模板}
-%</example-zh>
-
-%<example-zh>\enabstract
-%<example-en>\abstract
-{
-    This is a \LaTeX{} template example file. This template is used in written thesis for Huazhong Univ. of Sci. \& Tech.
-
-    This template is published under LPPL v1.3 License.
-
-}
-%<example-zh>\enkeywords
-%<example-en>\keywords
-{\LaTeX{}, Huazhong Univ. of Sci. \& Tech., Thesis, Template}
-
-\begin{document}
-
-\frontmatter
-\maketitle
-\makeabstract
-\tableofcontents
-\listoffigures
-\listoftables
-\mainmatter
-
-%<*example-zh>
-\chapter{基本格式测试}\label{chapter:1}
-
-\section{第一层}\label{sec:1}
-\subsection{第二层}\label{sec:2}
-\subsubsection{第三层}\label{sec:3}
-测试测试测试测试测试测试测试测试测试测试测试测试。
-\footnote{\label{footnote:1}脚注}
-
-\section{字体}
-
-普通\textbf{粗体}\emph{斜体}
-
-\hei{黑体}\kai{楷体}\fangsong{仿宋}
-
-\section{公式}
-
-单个公式,公式引用:\autoref{eq:1}。
-\begin{equation}
- c^2 = a^2 + b^2 \label{eq:1}
-\end{equation}
-
-多个公式,公式引用:\autoref{eq:2},\autoref{eq:3}。
-
-\begin{subequations}
-\begin{equation}
-  F = ma \label{eq:2}
-\end{equation}
-\begin{equation}
-  E = mc^2 \label{eq:3}
-\end{equation}
-\end{subequations}
-
-\section{罗列环境}
-
-\begin{enumerate}
-    \item 第一层\label{item:1}
-    \item 第一层
-    \begin{enumerate}
-        \item 第二层\label{item:2}
-        \item 第二层
-        \begin{enumerate}
-            \item 第三层\label{item:3}
-            \item 第三层
-        \end{enumerate}
-    \end{enumerate}
-\end{enumerate}
-
-\begin{description}
-    \item[解释环境]  解释内容
-\end{description}
-
-\chapter{其他格式测试}
-
-\section{代码环境}
-
-\begin{lstlisting}[language=python]
-import os
-
-def main():
-    '''
-    doc here
-    '''
-    print 'hello, world' # Abc
-    print 'hello, 中文' # 中文
-\end{lstlisting}
-
-\section{定律证明环境}
-
-\begin{definition}\label{def:1}
-这是一个定义。
-\end{definition}
-\begin{proposition}\label{proposition:1}
-这是一个命题。
-\end{proposition}
-\begin{axiom}\label{axiom:1}
-这是一个公理。
-\end{axiom}
-\begin{lemma}\label{lemma:1}
-这是一个引理。
-\end{lemma}
-\begin{theorem}\label{theorem:1}
-这是一个定理。
-\end{theorem}
-\begin{proof}\label{proof:1}
-这是一个证明。
-\end{proof}
-
-\section{算法环境}
-
-\begin{algorithm}[H]
-\SetAlgoLined
-\KwData{this text}
-\KwResult{how to write algorithm with \LaTeX2e }
-initialization\;\label{alg_line:1}
-\While{not at end of this document}{
-read current\;
-\eIf{understand}{
-go to next section\;
-current section becomes this one\;
-}{
-go back to the beginning of current section\;
-}
-}
-\caption{How to write algorithms}\label{alg:1}
-\end{algorithm}
-
-\section{表格}
-表格见\autoref{tab:1}。
-
-\begin{table}[!h]
-\centering
-\caption{一个表格}\label{tab:1}
-\begin{tabular}{|c|c|}
-\hline
-a & b \\
-\hline
-c & d \\
-\hline
-\end{tabular}
-\end{table}
-\section{图片}
-图片见\autoref{fig:1}。图片格式支持eps,png,pdf等。多个图片见\autoref{fig:2},分开引用:\autoref{fig:2-1},\autoref{fig:2-2}。
-
-\begin{figure}[!h]
-\centering
-\includegraphics[width=.4\textwidth]{fig-example.pdf}
-\caption{一个图片}\label{fig:1}
-\end{figure}
-
-\begin{figure}[!h]
-\centering
-  \begin{subfigure}[b]{0.3\textwidth}
-  \includegraphics[width=\textwidth]{fig-example.pdf}
-  \caption{图片1}\label{fig:2-1}
-  \end{subfigure}
-  ~
-  \begin{subfigure}[b]{0.3\textwidth}
-  \includegraphics[width=\textwidth]{fig-example.pdf}
-  \caption{图片2}\label{fig:2-2}
-  \end{subfigure}
-\caption{多个图片}\label{fig:2}
-\end{figure}
-
-\section{参考文献示例}
-这是一篇中文参考文献\cite{TEXGURU99};这是一篇英文参考文献\cite{knuth};同时引用\cite{TEXGURU99,knuth}。
-
-\section[\textbackslash{}autoref 测试]{\texttt{\textbackslash{}autoref} 测试}
-
-\begin{description}
-  \item[公式] \autoref{eq:1}
-  \item[脚注] \autoref{footnote:1}
-  \item[项] \autoref{item:1},\autoref{item:2},\autoref{item:3}
-  \item[图] \autoref{fig:1}
-  \item[表] \autoref{tab:1}
-  \item[附录] \autoref{appendix:1}
-  \item[章] \autoref{chapter:1}
-  \item[小节] \autoref{sec:1},\autoref{sec:2},\autoref{sec:3}
-  \item[算法] \autoref{alg:1},\autoref{alg_line:1}
-  \item[证明环境] \autoref{def:1},\autoref{proposition:1},\autoref{axiom:1},\autoref{lemma:1},\autoref{theorem:1},\autoref{proof:1}
-\end{description}
-
-
-\backmatter
-
-\begin{ack}
-致谢正文。
-\end{ack}
-
-\bibliography{ref-example}
-
-\appendix
-
-\begin{publications}
-    \item 论文1
-    \item 论文2
-\end{publications}
-
-\chapter{这是一个附录}\label{appendix:1}
-附录正文。
-
-%</example-zh>
-%<*example-en>
-\chapter{Simple Test}\label{chapter:1}
-
-\section{Level 1}\label{sec:1}
-\subsection{Level 2}\label{sec:2}
-\subsubsection{Level 3}\label{sec:3}
-Content
-\footnote{\label{footnote:1}A footnote.}
-
-\section{Font}
-
-Normal \textbf{Bold} \emph{Italic} \textsf{Sans}
-
-The quick brown fox jumps over the lazy dog.
-
-\section{Equation}
-
-Single equation, see \autoref{eq:1}.
-\begin{equation}
-  c^2 = a^2 + b^2 \label{eq:1}
-\end{equation}
-
-Multi-equations, see \autoref{eq:2} and \autoref{eq:3}.
-
-\begin{subequations}
-\begin{equation}
-  F = ma \label{eq:2}
-\end{equation}
-\begin{equation}
-  E = mc^2 \label{eq:3}
-\end{equation}
-\end{subequations}
-
-\section{List Environment}
-
-\begin{enumerate}
-    \item Level 1\label{item:1}
-    \item Level 1
-    \begin{enumerate}
-        \item Level 2\label{item:2}
-        \item Level 2
-        \begin{enumerate}
-            \item Level 3\label{item:3}
-            \item Level 3
-        \end{enumerate}
-    \end{enumerate}
-\end{enumerate}
-
-\begin{description}
-    \item[Discription]  Content
-\end{description}
-
-\chapter{Other Test}
-
-\section{Code Highlight}
-
-\begin{lstlisting}[language=python]
-import os
-
-def main():
-    '''
-    doc here
-    '''
-    print 'hello, world' # Abc
-\end{lstlisting}
-
-\section{Theorem}
-
-\begin{definition}\label{def:1}
-This is a definition.
-\end{definition}
-\begin{proposition}\label{proposition:1}
-This is a proposition.
-\end{proposition}
-\begin{axiom}\label{axiom:1}
-This is an axiom.
-\end{axiom}
-\begin{lemma}\label{lemma:1}
-This is a lemma.
-\end{lemma}
-\begin{theorem}\label{theorem:1}
-This is a theorem.
-\end{theorem}
-\begin{proof}\label{proof:1}
-This is a proof.
-\end{proof}
-
-\section{Algorithm}
-
-\begin{algorithm}[H]
-\SetAlgoLined
-\KwData{this text}
-\KwResult{how to write algorithm with \LaTeX2e }
-initialization\;\label{alg_line:1}
-\While{not at end of this document}{
-read current\;
-\eIf{understand}{
-go to next section\;
-current section becomes this one\;
-}{
-go back to the beginning of current section\;
-}
-}
-\caption{How to write algorithms}\label{alg:1}
-\end{algorithm}
-
-\section{Table}
-See \autoref{tab:1}.
-
-\begin{table}[!h]
-\centering
-\caption{A table}\label{tab:1}
-\begin{tabular}{|c|c|}
-\hline
-a & b \\
-\hline
-c & d \\
-\hline
-\end{tabular}
-\end{table}
-
-\section{Figure}
-See \autoref{fig:1}.Figure supports format in eps, png, pdf and so on. Multi-figures, see \autoref{fig:2}. Reference separately: \autoref{fig:2-1}, \autoref{fig:2-2}.
-
-\begin{figure}[!h]
-\centering
-\includegraphics[width=.4\textwidth]{fig-example.pdf}
-\caption{A figure}\label{fig:1}
-\end{figure}
-
-\begin{figure}[!h]
-\centering
-  \begin{subfigure}[b]{0.3\textwidth}
-  \includegraphics[width=\textwidth]{fig-example.pdf}
-  \caption{Figure A}\label{fig:2-1}
-  \end{subfigure}
-  ~
-  \begin{subfigure}[b]{0.3\textwidth}
-  \includegraphics[width=\textwidth]{fig-example.pdf}
-  \caption{Figure B}\label{fig:2-2}
-  \end{subfigure}
-\caption{Multi-figures}\label{fig:2}
-\end{figure}
-
-\section{Bibliography}
-Cite one bib\cite{knuth}, cite two\cite{TEXGURU99,knuth}.
-
-\section[\textbackslash{}autoref Test]{\texttt{\textbackslash{}autoref} Test}
-
-\begin{description}
-  \item[Equation] \autoref{eq:1}
-  \item[Footnote] \autoref{footnote:1}
-  \item[Item] \autoref{item:1},\autoref{item:2},\autoref{item:3}
-  \item[Figure] \autoref{fig:1}
-  \item[Table] \autoref{tab:1}
-  \item[Appendix] \autoref{appendix:1}
-  \item[Chapter] \autoref{chapter:1}
-  \item[Section] \autoref{sec:1},\autoref{sec:2},\autoref{sec:3}
-  \item[Algorithm] \autoref{alg:1},\autoref{alg_line:1}
-  \item[Theorem] \autoref{def:1},\autoref{proposition:1},\autoref{axiom:1},\autoref{lemma:1},\autoref{theorem:1},\autoref{proof:1}
-\end{description}
-
-\backmatter
-
-\begin{ack}
-Acknowledge
-\end{ack}
-
-\bibliography{ref-example}
-
-\appendix
-
-\begin{publications}
-    \item Thesis 1
-    \item Thesis 2
-\end{publications}
-
-\chapter{This is an appendix}\label{appendix:1}
-Content.
-
-%</example-en>
-
-\end{document}
-
-%</example-zh|example-en>
+% \subsection{\env{macrocode}环境}
 %
-%<*example-bib>
- at BOOK{TEXGURU99,
-  AUTHOR        = "{\TeX}Guru",
-  TITLE         = "{\LaTeXe} Manual",
-  YEAR          = "1999"
-}
-
- at BOOK{knuth,
-  AUTHOR        = "{Donald E. Knuth}",
-  TITLE         = "The \TeX{}book",
-  publisher     = "Addison–Wesley Pub. Co.",
-  address       = "MA",
-  YEAR          = "1984"
-}
-%</example-bib>
+% \subsubsection{代码行处理}
 %
-%<*bst>
-%<<BSTFILE
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% PREDEFINED STRING MACROS %%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-MACRO {jan} {"January"}
-MACRO {feb} {"February"}
-MACRO {mar} {"March"}
-MACRO {apr} {"April"}
-MACRO {may} {"May"}
-MACRO {jun} {"June"}
-MACRO {jul} {"July"}
-MACRO {aug} {"August"}
-MACRO {sep} {"September"}
-MACRO {oct} {"October"}
-MACRO {nov} {"November"}
-MACRO {dec} {"December"}
-
-
-MACRO {IEEE_J_MTT} {"{IEEE} Trans. Microwave Theory Tech."}
-
-
-%%%%%%%%%%%%%%%%%%
-%% ENTRY FIELDS %%
-%%%%%%%%%%%%%%%%%%
-
-ENTRY
-  { address
-    author
-    booktitle
-    chapter
-    edition
-    editor
-    howpublished
-    institution
-    journal
-    key
-    lang
-    month
-    note
-    number
-    organization
-    pages
-    publisher
-    school
-    series
-    title
-    type
-    volume
-    year
-    url
-    nationality
+% \begin{macro}[int]{\xmacro at code,\sxmacro at code}
+% 重新实现 \env{macrocode} 与 \env{macrocode*} 环境的核心功能,将对代码逐行
+% 处理。后者会将空格显示为“\verb*| |”。
+%    \begin{macrocode}
+\cs_set_protected_nopar:Npn \xmacro at code
+  { \@@_marco_code:w }
+\cs_set_protected_nopar:Npn \sxmacro at code
+  {
+    \fontspec_print_visible_spaces:
+    \xmacro at code
   }
-  {}
-  { label }
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% INTEGER VARIABLES, STRING VARIABLES and FUNCTIONS %%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-INTEGERS { output.state before.all mid.sentence after.sentence after.block }
-
-INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames }
-
-
-
-FUNCTION {not}
-{   { #0 }
-    { #1 }
-  if$
-}
-
-FUNCTION {and}
-{   'skip$
-    { pop$ #0 }
-  if$
-}
-
-FUNCTION {or}
-{   { pop$ #1 }
-    'skip$
-  if$
-}
-
-FUNCTION {is.num}
-{ chr.to.int$
-  duplicate$ "0" chr.to.int$ < not
-  swap$ "9" chr.to.int$ > not and
-}
-
-FUNCTION {init.state.consts}
-{ #0 'before.all :=
-  #1 'mid.sentence :=
-  #2 'after.sentence :=
-  #3 'after.block :=
-}
-
-STRINGS { s t }
-
-FUNCTION {output.nonnull}
-{ 's :=
-  output.state mid.sentence =
-    { ", " * write$ }
-    { output.state after.block =
-    { add.period$ write$
-      newline$
-      "\newblock " write$
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_marco_code:w}
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_marco_code:w
+  {
+%    \end{macrocode}
+% 根据 \tn{codeline at index} 是否为 |true| 选择是否显示行号。
+%    \begin{macrocode}
+    \ifcodeline at index
+      \@@_marco_code_every_par:n { \@@_code_line_no: }
+    \else:
+      \@@_marco_code_every_par:n { }
+    \fi:
+%    \end{macrocode}
+% 设置代码段结束标记为“\verb*|%    \end{macrocode}^^M|”。
+%    \begin{macrocode}
+    \@@_make_finish_tag:x { \@currenvir }
+%    \end{macrocode}
+% 开始 \env{macrocode}。
+%    \begin{macrocode}
+    \@@_macro_code_start:w
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_marco_code_every_par:n}
+% 在每段之前插入内容。这里每段即相当于每行。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_marco_code_every_par:n #1
+  {
+    \everypar
+      {
+        \everypar {#1}
+        \if at inlabel
+          \global \@inlabelfalse \@noparlistfalse
+          \llap { \box \@labels \hskip \leftskip }
+        \fi
+        #1
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% 设置 \tn{endlinechar} 为 $-1$,表示行末不插入任何字符(实际上相当于在行尾
+% 插入注释符 |%|)。
+%    \begin{macrocode}
+\group_begin:
+  \int_set:Nn \tex_endlinechar:D { -1 }
+%    \end{macrocode}
+%
+% \begin{variable}{\c_@@_active_space_tl}
+% 活动字符类的空格(ASCII 码为 32)。
+%    \begin{macrocode}
+  \use:n
+    {
+      \char_set_catcode_active:n { 32 }
+      \tl_const:Nn \c_@@_active_space_tl
     }
-    { output.state before.all =
-        'write$
-        { add.period$ " " * write$ }
-      if$
+    { }
+\group_end:
+%    \end{macrocode}
+% \end{variable}
+%
+% ASCII 码 13 是回车符 |^^M|。将其设置为活动字符。
+%    \begin{macrocode}
+\group_begin:
+  \char_set_catcode_active:n { 13 }
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_make_finish_tag:n,\@@_make_finish_tag:x}
+% \env{macrocode} 结尾标记。展开后变成“\verb*|%    \end{#1}^^M|”。
+%    \begin{macrocode}
+  \cs_new_protected:Npx \@@_make_finish_tag:n #1
+    {
+      \tl_set:Nn \exp_not:N \l_@@_macro_code_finish_tl
+        {
+          \c_percent_str
+          \prg_replicate:nn { 4 }
+            { \exp_not:o { \c_@@_active_space_tl } }
+          \exp_not:o { \active at escape@char } end
+          \c_left_brace_str #1 \c_right_brace_str
+          \exp_not:N ^^M
+        }
     }
-      if$
-      mid.sentence 'output.state :=
+  \cs_generate_variant:Nn \@@_make_finish_tag:n { x }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_macro_code_start:w}
+% 开始代码环境。此命令主要是为了防止 |\begin{macrocode}| 后出现多余的空行。
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_macro_code_start:w #1
+    {
+      \str_if_eq:nnTF {#1} { ^^M }
+        { \@@_macro_code_read_line:w }
+        { \@@_macro_code_read_line:w #1 }
     }
-  if$
-  s
-}
-
-STRINGS {z}
-FUNCTION {remove.dots}
-{ 'z :=
-  ""
-  { z empty$ not}
-  { z #1 #1 substring$
-    z #2 global.max$ substring$ 'z :=
-    duplicate$ "." = 'pop$
-      { * }
-    if$
-  }
-  while$
-  %z
-}
-
-FUNCTION {bibinfo.check}
-{ swap$
-  duplicate$ missing$
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_macro_code_read_line:w}
+% 逐行读取代码,并连同行尾回车符一并存入 \cs{l_@@_macro_code_line_tl}。如果该行
+% 与结束标记“\verb*|%    \end{macrocode}^^M|”相同,则结束此 \env{macrocode};
+% 否则继续处理该行代码。
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_macro_code_read_line:w #1 ^^M
     {
-      pop$ pop$
-      ""
-    }
-    { duplicate$ empty$
+      \tl_set:Nn \l_@@_macro_code_line_tl { #1 ^^M }
+      \tl_if_eq:NNTF
+        \l_@@_macro_code_line_tl \l_@@_macro_code_finish_tl
+        { \exp_args:Nx \end { \@currenvir } }
         {
-          swap$ pop$
+          \@@_macro_code_process_line:
+          \@@_macro_code_read_line:w
         }
-        { swap$
-          pop$
-        }
-      if$
     }
-  if$
-}
-
-FUNCTION {bibinfo.warn}
-{ swap$
-  duplicate$ missing$
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_swap_cr:,\@@_swap_cr_aux:w}
+% 把 \cs{l_@@_macro_code_line_tl} 中的回车符 |^^M| 挪到外面。
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_swap_cr:
     {
-      swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
-      ""
+      \exp_after:wN
+        \@@_swap_cr_aux:w \l_@@_macro_code_line_tl
     }
-    { duplicate$ empty$
+  \cs_new_protected:Npn \@@_swap_cr_aux:w #1 ^^M
+    {
+      \group_insert_after:N ^^M
+      \tl_set:Nn \l_@@_macro_code_line_tl {#1}
+    }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\c_@@_active_cr_tl}
+% 活动字符类的回车符。
+%    \begin{macrocode}
+  \tl_const:Nn \c_@@_active_cr_tl { ^^M }
+\group_end:
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_macro_code_line_tl,
+%   \l_@@_macro_code_finish_tl,
+%   \g_@@_macro_code_verbatim_stop_tl}
+% 分别用来存储代码行、\env{macrocode} 结束标记以及抄录停止标记。
+%    \begin{macrocode}
+\tl_new:N \l_@@_macro_code_line_tl
+\tl_new:N \l_@@_macro_code_finish_tl
+\tl_new:N \g_@@_macro_code_verbatim_stop_tl
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_process_normal_line:}
+% 普通代码行根据开头字符分别处理。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_process_normal_line:
+  {
+    \str_case_e:nnF
+      { \str_head:N \l_@@_macro_code_line_tl }
+      {
+%    \end{macrocode}
+% 以 |%| 开头的行先由 \cs{tl_tail:N} 去掉 |%|,之后再检查 |<|。
+%    \begin{macrocode}
+        { \c_percent_str }
         {
-          swap$ "empty " swap$ * " in " * cite$ * warning$
+          \@@_check_angle:x
+            { \tl_tail:N \l_@@_macro_code_line_tl }
         }
-        { swap$
-          pop$
-        }
-      if$
-    }
-  if$
-}
-
-% IEEE separates large numbers with more than 4 digits into groups of
-% three. IEEE uses a small space to separate these number groups.
-% Typical applications include patent and page numbers.
-
-% number of consecutive digits required to trigger the group separation.
-FUNCTION {large.number.trigger}{ #5 }
-
-% For numbers longer than the trigger, this is the blocksize of the groups.
-% The blocksize must be less than the trigger threshold, and 2 * blocksize
-% must be greater than the trigger threshold (can't do more than one
-% separation on the initial trigger).
-FUNCTION {large.number.blocksize}{ #3 }
-
-% What is actually inserted between the number groups.
-FUNCTION {large.number.separator}{ "\," }
-
-% So as to save on integer variables by reusing existing ones, numnames
-% holds the current number of consecutive digits read and nameptr holds
-% the number that will trigger an inserted space.
-FUNCTION {large.number.separate}
-{ 't :=
-  ""
-  #0 'numnames :=
-  large.number.trigger 'nameptr :=
-  { t empty$ not }
-  { t #-1 #1 substring$ is.num
-      { numnames #1 + 'numnames := }
-      { #0 'numnames :=
-        large.number.trigger 'nameptr :=
+%    \end{macrocode}
+% 以 |#| 开头的行按注释的格式输出。
+%    \begin{macrocode}
+        { \c_hash_str }
+        { \@@_output_comment_line: }
       }
-    if$
-    t #-1 #1 substring$ swap$ *
-    t #-2 global.max$ substring$ 't :=
-    numnames nameptr =
-      { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$
-        nameptr large.number.blocksize - #1 + global.max$ substring$
-        large.number.separator swap$ * *
-        nameptr large.number.blocksize - 'numnames :=
-        large.number.blocksize #1 + 'nameptr :=
+%    \end{macrocode}
+% 其余正常输出。
+%    \begin{macrocode}
+      { \@@_output_line: }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_process_verbatim_line:}
+% 处理抄录代码行(不检查 |%| 与 |<|)。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_process_verbatim_line:
+  {
+%    \end{macrocode}
+% 将该行与抄录停止标记进行比较。
+%    \begin{macrocode}
+    \tl_if_eq:NNTF \l_@@_macro_code_line_tl
+        \g_@@_macro_code_verbatim_stop_tl
+%    \end{macrocode}
+% 若相同,则结束抄录环境,清空抄录停止标记,并输出该标记;
+%    \begin{macrocode}
+      {
+        \tl_gclear:N \g_@@_macro_code_verbatim_stop_tl
+        \cs_gset_eq:NN \@@_macro_code_process_line:
+          \@@_process_normal_line:
+        \@@_output_module:nn
+          { \color { verb at guard } }
+          {
+            \@@_swap_cr:
+            \@@_module_pop:n { \l_@@_macro_code_line_tl }
+          }
       }
-      { skip$ }
-    if$
+%    \end{macrocode}
+% 否则直接输出抄录代码。
+%    \begin{macrocode}
+      { \tl_use:N \l_@@_macro_code_line_tl }
   }
-  while$
-}
-
-FUNCTION {format.note}
-{
- note empty$
-    { "" }
-    { note #1 #1 substring$
-      duplicate$ "{" =
-        'skip$
-        { output.state mid.sentence =
-          { "l" }
-          { "u" }
-        if$
-        change.case$
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_macro_code_process_line:}
+% 处理代码行。该命令的作用如下:
+% \begin{itemize}
+%   \item 正常情况下,等同于 \cs{@@_process_normal_line:};
+%   \item 在 \cs{DontCheckModules} 之后,等价于 \cs{@@_output_line:},
+%     即不检查模块标记,直接输出;
+%   \item 在抄录环境中,等价于 \cs{@@_process_verbatim_line:},
+%     此时将不再特殊处理以 |%| 开头的代码行。
+% \end{itemize}
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_macro_code_process_line:
+  \@@_process_normal_line:
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{模块标记处理}
+%
+% \begin{macro}[int]{\CheckModules, \DontCheckModules}
+% 选择是否检查模块标记。这两个命令在 \pkg{doc} 宏包中已有定义,此处重新声明。
+%    \begin{macrocode}
+\DeclareDocumentCommand \CheckModules { }
+  {
+    \cs_set_eq:NN \@@_macro_code_process_line:
+      \@@_process_normal_line:
+  }
+\DeclareDocumentCommand \DontCheckModules { }
+  {
+    \cs_set_eq:NN \@@_macro_code_process_line:
+      \@@_output_line:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_check_angle:n,\@@_check_angle:x}
+% 检查第一个字符是否是 |<|。若是,则检查模块;否则立刻输出改行。
+% 该函数的参数不带 |%|。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_check_angle:n #1
+  {
+    \str_if_eq:eeTF { \str_head:n {#1} } { < }
+      { \@@_check_module:x { \tl_tail:n {#1} } }
+      { \@@_output_comment_line: }
+  }
+\cs_generate_variant:Nn \@@_check_angle:n { x }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_check_module:n,\@@_check_module:x}
+% 检查紧跟 |<| 之后的字符。共有四种情况:
+% \begin{itemize}
+%   \item |*|:模块开始(|%<*|\meta{module}|>|);
+%   \item |/|:模块结束(|%</|\meta{module}|>|);
+%   \item |@|:名字空间(|%<@@=|\meta{namespace}|>|);
+%   \item |<|:抄录环境开始(|%<<|\meta{end-tag})。
+% \end{itemize}
+% 若不是这几种情况,则为单独一行的独立模块(|%<|\meta{module}|>|)。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_check_module:n #1
+  {
+    \str_case_e:nnF { \str_head:n {#1} }
+      {
+        { * } { \@@_module_star:w }
+        { / } { \@@_module_slash:w }
+        { @ } { \@@_module_at:w }
+        { < } { \@@_module_verb:w }
+      }
+      { \@@_module_pm:w }
+%    \end{macrocode}
+% 参数 |#1| 将被上面几个 |:w| 型函数吃掉。
+%    \begin{macrocode}
+    #1 \q_stop
+  }
+\cs_generate_variant:Nn \@@_check_module:n { x }
+%    \end{macrocode}
+% \end{macro}
+%
+% 设置 |>| 为活动字符。
+%    \begin{macrocode}
+\group_begin:
+  \char_set_catcode_active:N \>
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_module_star:w}
+% 模块开始标记。
+% \begin{arguments}
+%   \item |*|\meta{module}
+%   \item 之后的代码
+% \end{arguments}
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_module_star:w #1 > #2 \q_stop
+    {
+%    \end{macrocode}
+% 临时变量 \cs{l_@@_tmpa_tl} 保存 |<*|\meta{module}|>| 之后的部分,即真实代码。
+%    \begin{macrocode}
+      \tl_set:Nn \l_@@_tmpa_tl {#2}
+%    \end{macrocode}
+% 判断该行是否为空(只含一个回车符 |^^M|)。
+%    \begin{macrocode}
+      \tl_if_eq:NNTF \l_@@_tmpa_tl \c_@@_active_cr_tl
+%    \end{macrocode}
+% 若是,则将 |<|\meta{module}|>| 放在行号的右侧;
+%    \begin{macrocode}
+        {
+          \@@_output_module:nn
+            { \@@_star_color: }
+            {
+              \@@_module_push:n
+                { \@@_module_angle:n {#1} }
+            }
         }
-      if$
-      note #2 global.max$ substring$ * "note" bibinfo.check
-    }
-  if$
-}
-
-FUNCTION {output}
-{ duplicate$ empty$
-    'pop$
-    'output.nonnull
-  if$
-}
-
-FUNCTION {output.check}
-{ 't :=
-  duplicate$ empty$
-    { pop$ "empty " t * " in " * cite$ * warning$ }
-    'output.nonnull
-  if$
-}
-
-FUNCTION {output.bibitem}
-{ newline$
-  "\bibitem{" write$
-  cite$ write$
-  "}" write$
-  newline$
-  ""
-  before.all 'output.state :=
-}
-
-FUNCTION {fin.entry}
-{ add.period$
-  write$
-  newline$
-}
-
-FUNCTION {new.block}
-{ output.state before.all =
-    'skip$
-    { after.block 'output.state := }
-  if$
-}
-
-FUNCTION {new.sentence}
-{ output.state after.block =
-    'skip$
-    { output.state before.all =
-    'skip$
-    { after.sentence 'output.state := }
-      if$
-    }
-  if$
-}
-
-
-FUNCTION {new.block.checka}
-{ empty$
-    'skip$
-    'new.block
-  if$
-}
-
-FUNCTION {new.block.checkb}
-{ empty$
-  swap$ empty$
-  and
-    'skip$
-    'new.block
-  if$
-}
-
-FUNCTION {new.sentence.checka}
-{ empty$
-    'skip$
-    'new.sentence
-  if$
-}
-
-FUNCTION {new.sentence.checkb}
-{ empty$
-  swap$ empty$
-  and
-    'skip$
-    'new.sentence
-  if$
-}
-
-FUNCTION {field.or.null}
-{ duplicate$ empty$
-    { pop$ "" }
-    'skip$
-  if$
-}
-
-FUNCTION {emphasize}
-{ duplicate$ empty$
-    { pop$ "" }
-    { "{\em " swap$ * "}" * }
-  if$
-}
-
-FUNCTION {bbl.etal}
-{ "et~al." }
-
-FUNCTION {bbl.cn.etal}
-{ "等." }
-
-FUNCTION {format.lang}
-{ lang empty$
-    'skip$
-    'skip$
-  if$
- }
-
-FUNCTION {format.names}
-{ 's :=
-  #1 'nameptr :=
-  s num.names$ 'numnames :=
-  numnames 'namesleft :=
-    { namesleft #0 > }
-    { s nameptr
-      "{ll}{ f{~}}"
-      format.name$
-      %remove.dots
-      %bibinfo bibinfo.check
-      't :=
-      nameptr #1 >
+%    \end{macrocode}
+% 否则放在左侧,并输出相应代码。
+%    \begin{macrocode}
         {
-          nameptr #3
-          #1 + =
-          numnames #3
-          > and
-            { "others" 't :=
-              #1 'namesleft := }
-            'skip$
-          if$
-          namesleft #1 >
-            { ", " * t * }
-            { numnames #2 >
-              { "" * }
-              'skip$
-              if$
-              s nameptr "{ll}" format.name$ duplicate$ "others" =
-                { 't := }
-                { pop$ }
-              if$
-              t "others" =
-                {
-                  lang empty$
-                    { ", " * bbl.etal * }
-                    { lang "chinese" =
-                       { ", " * bbl.cn.etal * }
-                       'skip$
-                      if$
-                    }
-                  if$
-                }
-                {
-                  lang empty$
-                    { ", " * t * }
-                    { lang "chinese" =
-                       { ", " * t * }
-                       'skip$
-                     if$
-                    }
-                  if$
-                }
-              if$
+          \@@_output_module_left:nn
+            { \@@_star_color: }
+            {
+              \@@_module_push:n
+                { \@@_module_angle:n {#1} }
             }
-          if$
         }
-        't
-      if$
-      nameptr #1 + 'nameptr :=
-      namesleft #1 - 'namesleft :=
+      \@@_output_line:n {#2}
     }
-  while$
-}
-
-FUNCTION {format.authors}
-{ author empty$
-    { "" }
-    { author format.names }
-  if$
-}
-
-%FUNCTION {format.editors}
-%{ editor empty$
-%    { "" }
-%    { editor format.names
-%      editor num.names$ #1 >
-%    { ", editors" * }
-%    { ", editor" * }
-%      if$
-%    }
-%  if$
-%}
-
-FUNCTION {format.editors}
-{ editor empty$
-    { "" }
-    { lang empty$
-    { editor format.names
-      editor num.names$ #1 >
-    { ", editors" * }
-    { ", editor" * }
-      if$
-    }
-    { editor format.names * ", " }
-    if$
-    }
-  if$
-}
-
-FUNCTION {format.title}
-{ title empty$
-    { "" }
-    { title }
-  if$
-}
-
-FUNCTION {n.dashify}
-{ 't :=
-  ""
-    { t empty$ not }
-    { t #1 #1 substring$ "-" =
-    { t #1 #2 substring$ "--" = not
-        { "--" *
-          t #2 global.max$ substring$ 't :=
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_slash:w}
+% 模块结束标记。结构与 \cs{@@_module_star:w} 相同。
+% \begin{arguments}
+%   \item |/|\meta{module}
+%   \item 之后的代码
+% \end{arguments}
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_module_slash:w #1 > #2 \q_stop
+    {
+      \tl_set:Nn \l_@@_tmpa_tl {#2}
+      \tl_if_eq:NNTF \l_@@_tmpa_tl \c_@@_active_cr_tl
+        {
+          \@@_output_module:nn
+            { \@@_slash_color: }
+            {
+              \@@_module_pop:n
+                { \@@_module_angle:n {#1} }
+            }
         }
-        {   { t #1 #1 substring$ "-" = }
-        { "-" *
-          t #2 global.max$ substring$ 't :=
+        {
+          \@@_output_module_left:nn
+            { \@@_slash_color: }
+            {
+              \@@_module_pop:n
+                { \@@_module_angle:n {#1} }
+            }
         }
-          while$
-        }
-      if$
+      \@@_output_line:n {#2}
     }
-    { t #1 #1 substring$ *
-      t #2 global.max$ substring$ 't :=
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_at:w}
+% 名字空间。
+% \begin{arguments}
+%   \item 名字空间的名称(不含 |@@=|)
+%   \item 之后的代码
+% \end{arguments}
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_module_at:w @ @ = #1 > #2 \q_stop
+    {
+      \@@_output_module:nn
+        { \color { at at guard } }
+        { \@@_module_angle:n { @ @ = #1 } }
+%    \end{macrocode}
+% 设置名字空间为 |#1|。\cls{l3doc} 中将名字空间称为“模块”(module),
+% 注意不要混淆。
+%    \begin{macrocode}
+      \tl_gset:Nn \g__codedoc_module_name_tl {#1}
+      \@@_output_line:n {#2}
     }
-      if$
-    }
-  while$
-}
-
-FUNCTION {format.date}
-{ year empty$
-    { month empty$
-    { "" }
-    { "there's a month but no year in " cite$ * warning$
-      month
-    }
-      if$
-    }
-    { month empty$
-    'year
-    { month ", " * year * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.btitle}
-{ edition empty$
-  { title }
-  { title empty$
-    { title }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_verb:w}
+% 抄录开始。|#1|: |<|\meta{end-tag},只有一个 |<|。\meta{end-tag} 的最后会
+% 带有一个回车符 |^^M|。
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_module_verb:w #1 \q_stop
     {
-      lang empty$
-        { " " title * ", " * edition * " ed." * }
-        { lang "chinese" =
-          { " " title * ", 第~" * edition * " 版" * }
-          'skip$
-          if$
+%    \end{macrocode}
+% 重定义 \cs{@@_macro_code_process_line:},用以输出抄录行。
+%    \begin{macrocode}
+      \cs_gset_eq:NN \@@_macro_code_process_line:
+        \@@_process_verbatim_line:
+%    \end{macrocode}
+% 设置抄录停止标记。用 \cs{tl_tail:n} 去掉开头的 |<|。
+%    \begin{macrocode}
+      \tl_gset:Nx \g_@@_macro_code_verbatim_stop_tl
+        { \c_percent_str \tl_tail:n {#1} }
+%    \end{macrocode}
+% 输出 |%<<|\meta{end-tag}。
+%    \begin{macrocode}
+      \@@_output_module:nn
+        { \color { verb at guard } }
+        {
+          \@@_swap_cr:
+          \@@_module_push:n { \l_@@_macro_code_line_tl }
         }
-      if$
     }
-    if$
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_pm:w}
+% 处理单独一行的模块。|<|\meta{module}|>| 放在行号的左侧。
+% \begin{arguments}
+%   \item \meta{module}
+%   \item 之后的代码
+% \end{arguments}
+%    \begin{macrocode}
+  \cs_new_protected:Npn \@@_module_pm:w #1 > #2 \q_stop
+    {
+      \@@_output_module_left:nn
+        { \@@_pm_color: }
+        { \@@_module_angle:n {#1} }
+      \@@_output_line:n {#2}
+    }
+\group_end:
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_output_line:n,\@@_output_line:}
+% 输出代码行。参数将被存入 \cs{l_@@_macro_code_line_tl},
+% 再由不带参数的版本调用。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_output_line:n #1
+  {
+    \tl_set:Nn \l_@@_macro_code_line_tl {#1}
+%    \end{macrocode}
+% 若为空行(只含一个 |^^M|),则直接输出(换行)。
+%    \begin{macrocode}
+    \tl_if_eq:NNTF
+      \l_@@_macro_code_line_tl \c_@@_active_cr_tl
+      { \tl_use:N \l_@@_macro_code_line_tl }
+      {
+%    \end{macrocode}
+% 检查开头是否为 |%|,据此分别处理。
+%    \begin{macrocode}
+        \str_if_eq:eeTF
+          { \str_head:N \l_@@_macro_code_line_tl } { \c_percent_str }
+          { \@@_output_comment_line: } { \@@_output_line: }
+      }
   }
-  if$
-}
-
-FUNCTION {tie.or.space.connect}
-{ duplicate$ text.length$ #3 <
-    { "~" }
-    { " " }
-  if$
-  swap$ * *
-}
-
-FUNCTION {either.or.check}
-{ empty$
-    'pop$
-    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
-  if$
-}
-
-FUNCTION {format.bvolume}
-{ volume empty$
-    { "" }
-    { "volume" volume tie.or.space.connect
-      series empty$
-    'skip$
-    { " of " * series emphasize * }
-      if$
-      "volume and number" number either.or.check
-    }
-  if$
-}
-
-FUNCTION {format.number.series}
-{ volume empty$
-    { number empty$
-    { series field.or.null }
-    { output.state mid.sentence =
-        { "number" }
-        { "Number" }
-      if$
-      number tie.or.space.connect
-      series empty$
-        { "there's a number but no series in " cite$ * warning$ }
-        { " in " * series * }
-      if$
-    }
-      if$
-    }
-    { "" }
-  if$
-}
-
-FUNCTION {format.url}
-{ url empty$
-    { "" }
-    { new.block " {\url{" url * "}}" * }
-  if$
-}
-
-
-
-FUNCTION {multi.page.check}
-{ 't :=
-  #0 'multiresult :=
-    { multiresult not
-      t empty$ not
-      and
-    }
-    { t #1 #1 substring$
-      duplicate$ "-" =
-      swap$ duplicate$ "," =
-      swap$ "+" =
-      or or
-    { #1 'multiresult := }
-    { t #2 global.max$ substring$ 't := }
-      if$
-    }
-  while$
-  multiresult
-}
-
-FUNCTION {format.pages}
-{ pages empty$
-    { "" }
-    { pages multi.page.check
-    {  lang empty$
-         {"pages" pages n.dashify tie.or.space.connect }
-         { lang "chinese" =
-         { "" pages n.dashify tie.or.space.connect }
-         'skip$
-         if$
-         }
-       if$
-    }
-       { "page" pages tie.or.space.connect }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.vol.num.pages}
-{ volume field.or.null
-  number empty$
-    'skip$
-    { "(" number * ")" * *
-      volume empty$
-    { "there's a number but no volume in " cite$ * warning$ }
-    'skip$
-      if$
-    }
-  if$
-  pages empty$
-    'skip$
-    { duplicate$ empty$
-    { pop$ format.pages }
-    { ":" * pages n.dashify * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.chapter.pages}
-{ chapter empty$
-    'format.pages
-    { type empty$
-    { "chapter" }
-    { type "l" change.case$ }
-      if$
-      chapter tie.or.space.connect
-      pages empty$
-    'skip$
-    { ", " * format.pages * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.in.ed.booktitle}
-{ booktitle empty$
-    { "" }
-    { editor empty$
-    { lang empty$
-        { "in: Proceedings of " booktitle * }
-        { "见: " booktitle * }
-      if$
-    }
-    { lang empty$
-        { "in: " format.editors * ", Proceedings of " * booktitle * }
-        { ". 见: " * format.editors * booktitle * }
-      if$
-    }
-      if$
-    }
-  if$
-}
-
-FUNCTION {empty.misc.check}
-{ author empty$ title empty$ howpublished empty$
-  month empty$ year empty$ note empty$
-  and and and and and
-    { "all relevant fields are empty in " cite$ * warning$ }
-    'skip$
-  if$
-}
-
-FUNCTION {format.thesis.type}
-{ type empty$
-    'skip$
-    { pop$
-      type "t" change.case$
-    }
-  if$
-}
-
-FUNCTION {format.tr.number}
-{ type empty$
-    { "Technical Report" }
-    'type
-  if$
-  number empty$
-    { "t" change.case$ }
-    { number tie.or.space.connect }
-  if$
-}
-
-FUNCTION {format.article.crossref}
-{ key empty$
-    { journal empty$
-    { "need key or journal for " cite$ * " to crossref " * crossref *
-      warning$
-      ""
-    }
-    { "In {\em " journal * "\/}" * }
-      if$
-    }
-    { "In " key * }
-  if$
-  " \cite{" * crossref * "}" *
-}
-
-FUNCTION {format.crossref.editor}
-{ editor #1 "{ll }{f{~}}" format.name$
-  editor num.names$ duplicate$
-  #2 >
-    { pop$ " et~al." * }
-    { #2 <
-    'skip$
-    { editor #2 "{ll }{f{~}}" format.name$ "others" =
-        { " et~al." * }
-        { " and " * editor #2 "{ll }{f{~}}" format.name$ * }
-      if$
-    }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.book.crossref}
-{ volume empty$
-    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
-      "In "
-    }
-    { "Volume" volume tie.or.space.connect
-      " of " *
-    }
-  if$
-  editor empty$
-  editor field.or.null author field.or.null =
-  or
-    { key empty$
-    { series empty$
-        { "need editor, key, or series for " cite$ * " to crossref " *
-          crossref * warning$
-          "" *
+\cs_new_protected_nopar:Npn \@@_output_line:
+  {
+    \tex_noindent:D
+%    \end{macrocode}
+% 此处将把 |@@| 替换为相应的名字空间。
+%    \begin{macrocode}
+    \@@_replace_at_at:N \l_@@_macro_code_line_tl
+    \tl_use:N \l_@@_macro_code_line_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_output_comment_line:}
+% 输出注释代码行。用灰色、斜体显示。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_output_comment_line:
+  {
+    \tex_noindent:D
+    \group_begin:
+      \__hustdoc_swap_cr:
+      \color { code at gray } \slshape \@@_output_line:
+    \group_end:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_replace_at_at:N,
+%   \@@_replace_at_at_aux:Nn,\@@_replace_at_at_aux:No}
+% 把 |@@| 替换为相应的名字空间。其名称存放在全局变量
+% \cs{g__codedoc_module_name_tl} 中。它为空时(|%<@@=>|),不做替换。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_replace_at_at:N #1
+  {
+    \tl_if_empty:NF \g__codedoc_module_name_tl
+      { \@@_replace_at_at_aux:No #1 \g__codedoc_module_name_tl }
+  }
+\cs_new_protected:Npn \@@_replace_at_at_aux:Nn #1#2
+  {
+%    \end{macrocode}
+% 以下代码分别对应两种名字空间的替换:
+% \begin{itemize}
+%   \item 内部变量:|\|\meta{type}|_@@_|\meta{name} $\to$
+%     |\|\meta{type}|__|\meta{namespace}|_|\meta{name};
+%   \item 内部函数:|\@@_|\meta{name}” $\to$
+%     |\__|\meta{namespace}|_|\meta{name}”)。
+% \end{itemize}
+%    \begin{macrocode}
+    \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
+    \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
+  }
+\cs_generate_variant:Nn \@@_replace_at_at_aux:Nn { No }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_push:n,
+%   \@@_module_push_aux:nn,\@@_module_push_aux:on}
+% 将模块名压入栈中。此处的栈主要用来处理模块名(包括抄录标记)之间的超链接。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_module_push:n
+  { \@@_module_push_aux:on { \int_use:N \c at HD@hypercount } }
+\cs_new_protected:Npn \@@_module_push_aux:nn #1
+  {
+    \seq_gpush:Nn \g_@@_module_dest_seq {#1}
+    \hypersetup { hidelinks }
+    \exp_args:Nx \hdclindex
+      { \zref at extractdefault { HD.#1 } { guard at end } { 1 } } { }
+  }
+\cs_generate_variant:Nn \@@_module_push_aux:nn { on }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_pop:n,
+%   \@@_module_pop_aux:nn,\@@_module_pop_aux:on}
+% 将模块名释放出栈。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_module_pop:n
+  {
+    \seq_gpop:NNTF \g_@@_module_dest_seq \l_@@_tmpa_tl
+      { \@@_module_pop_aux:on { \l_@@_tmpa_tl } }
+      { \BOOM \use:n }
+  }
+\cs_new_protected:Npn \@@_module_pop_aux:nn #1
+  {
+    \zref at labelbylist { HD.#1 } { hustdoc }
+    \hypersetup { hidelinks }
+    \hdclindex {#1} { }
+  }
+\cs_generate_variant:Nn \@@_module_pop_aux:nn { on }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\g_@@_module_dest_seq}
+% 存放模块名的序列(栈)。
+%    \begin{macrocode}
+\seq_new:N \g_@@_module_dest_seq
+%    \end{macrocode}
+% \end{variable}
+%
+% 处理行号超链接。使用 \pkg{zref} 宏包。
+%    \begin{macrocode}
+\zref at newlist { hustdoc }
+\zref at newprop { guard at end } [ 1 ]
+  { \int_eval:n { \c at HD@hypercount - 1 } }
+\zref at addprop { hustdoc } { guard at end }
+%    \end{macrocode}
+%
+% \subsubsection{格式处理}
+%
+% \begin{macro}[int]{\MacroFont}
+% 代码部分的字体。
+%    \begin{macrocode}
+\cs_set_protected:Npn \MacroFont
+  {
+    \linespread { 1.05 }
+    \small \ttfamily \mdseries \upshape
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_output_module:nn,\@@_output_module_left:nn}
+% 输出模块名(分行内和行号左侧两种)。
+% \begin{arguments}
+%   \item 颜色等样式
+%   \item 模块名
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_output_module:nn #1#2
+  {
+    \tex_noindent:D
+    \group_begin:
+      #1
+      \footnotesize \normalfont \sffamily #2
+    \group_end:
+  }
+\cs_new_protected:Npn \@@_output_module_left:nn #1#2
+  {
+    \tex_noindent:D
+    \hbox_overlap_left:n
+      {
+        \@@_output_module:nn {#1} {#2}
+        \skip_horizontal:n { \leftskip + \smallskipamount }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_star_color:,\@@_slash_color:,\@@_pm_color:}
+% 选择模块标记的颜色。模块标记的颜色会根据嵌套层次而改变。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_star_color:
+  {
+    \seq_gpop:NNTF \g_@@_star_color_seq \current at color
+      { \set at color }
+      { \@@_select_color: }
+    \seq_gpush:No \g_@@_slash_color_seq { \current at color }
+  }
+\cs_new_protected_nopar:Npn \@@_slash_color:
+  {
+    \seq_gpop:NNTF \g_@@_slash_color_seq \current at color
+      {
+        \set at color
+        \seq_gpush:No \g_@@_star_color_seq { \current at color }
+      }
+% TODO: 需要报错:star 与 slash 没有匹配
+      { \BOOM }
+  }
+\cs_new_protected_nopar:Npn \@@_pm_color:
+  {
+    \seq_get:NNTF \g_@@_star_color_seq \current at color
+      { \set at color }
+      {
+        \@@_select_color:
+        \seq_gpush:No \g_@@_star_color_seq { \current at color }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\g_@@_star_color_seq,\g_@@_slash_color_seq}
+% 存放模块标记颜色的序列。
+%    \begin{macrocode}
+\seq_new:N \g_@@_star_color_seq
+\seq_new:N \g_@@_slash_color_seq
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_select_color:}
+% \begin{macro}[int]{guard at series}
+% 设置模块标记的色系。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_select_color:
+  { \color { guard at series!!+ } }
+\definecolorseries { guard at series }
+  { cmyk } { last } { blue } { purple }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% 设置色系的增量大小。可选参数 |3| 意味着基色(blue)与末色(purple)之间将被
+% 等分为三份。该数字比嵌套最大深度小 1。
+%    \begin{macrocode}
+\resetcolorseries [ 3 ] { guard at series }
+%    \end{macrocode}
+%
+% \begin{macro}[int]{verb at guard,at at guard,code at gray}
+% 设置颜色。
+%    \begin{macrocode}
+\definecolor { verb at guard } { named } { MaterialLime600 }
+\definecolor { at at guard } { named } { MaterialPink }
+\definecolor { code at gray } { named } { MaterialGrey }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_module_angle:n}
+% 输出“$\langle\cdots\rangle$”。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_module_angle:n #1
+  { < #1 > }
+%   { \textlangle #1 \textrangle }
+%   { \ensuremath \langle #1 \ensuremath \rangle }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_code_line_no:}
+% 行号。设置为阿拉伯数字。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_code_line_no:
+  {
+    \int_gincr:N \c at CodelineNo
+    \hbox_overlap_left:n
+      {
+        \hbox_to_wd:nn
+          { \MacroIndent }
+          {
+            \HD at target
+            \tex_hss:D \@@_code_line_no_style:
+            \theCodelineNo \enspace
+          }
+        \tex_kern:D \@totalleftmargin
+      }
+  }
+\tl_set:Nn \theCodelineNo { \arabic { CodelineNo } }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_code_line_no_style:}
+% 行号格式。
+%    \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_code_line_no_style:
+  { \color { code at gray } \normalfont \sffamily \tiny }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\HD at SetMacroIndent}
+% 设置代码缩进(行号一栏的宽度)。该命令会写进 |.aux| 辅助文件,
+% 以便在二次编译时确定最大行号宽度。
+%    \begin{macrocode}
+\cs_set_protected:Npn \HD at SetMacroIndent #1
+  {
+    \group_begin:
+      \settowidth \MacroIndent
+        {
+          \@@_code_line_no_style:
+          \prg_replicate:nn { \tl_count:n {#1} } { 0 }
+          \enspace
         }
-        { "{\em " * series * "\/}" * }
-      if$
-    }
-    { key * }
-      if$
-    }
-    { format.crossref.editor * }
-  if$
-  " \cite{" * crossref * "}" *
-}
+      \dim_gset_eq:NN \MacroIndent \MacroIndent
+    \group_end:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 
-FUNCTION {format.incoll.inproc.crossref}
-{ editor empty$
-  editor field.or.null author field.or.null =
-  or
-    { key empty$
-    { booktitle empty$
-        { "need editor, key, or booktitle for " cite$ * " to crossref " *
-          crossref * warning$
-          ""
-        }
-        { "In {\em " booktitle * "\/}" * }
-      if$
-    }
-    { "In " key * }
-      if$
-    }
-    { "In " format.crossref.editor * }
-  if$
-  " \cite{" * crossref * "}" *
-}
-
-FUNCTION {format.patent.nationality.type.number}
-{
-  nationality duplicate$ empty$
-    { "nationality" bibinfo.warn pop$ "" }
-    { "nationality" bibinfo.check
-      duplicate$ "l" change.case$ "china" =
-        { pop$ "中国" }
-        { skip$ }
-      if$
-      " " *
-    }
-  if$
-  type empty$
-    { "Patent" "type" bibinfo.check }
-    { type "type" bibinfo.check }
-  if$
-  *
-  number duplicate$ empty$
-    { "number" bibinfo.warn pop$ }
-    { "number" bibinfo.check
-      large.number.separate
-      swap$ " " * swap$ *
-    }
-  if$
-}
-
-FUNCTION {format.address.publisher}
-{ address empty$
-    { publisher empty$
-    { "" }
-    { "there's a publisher but no address in " cite$ * warning$
-      publisher
-    }
-      if$
-    }
-    { publisher empty$
-    'address
-    { address ": " * publisher * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {format.address.school}
-{ address empty$
-    { school empty$
-    { "" }
-    { "there's a school but no address in " cite$ * warning$
-      school
-    }
-      if$
-    }
-    { school empty$
-    'address
-    { address ": " * school * }
-      if$
-    }
-  if$
-}
-
-
-FUNCTION {format.title.type}
-{ title empty$
-    { type empty$
-        { "" }
-        { "there's a type but no title in " cite$ * warning$
-          type
-        }
-      if$
-    }
-    { type empty$
-        'title
-        { title ": " * type * }
-      if$
-    }
-  if$
-}
-
-FUNCTION {book} { output.bibitem
-  author empty$
-    { format.editors "author and editor" output.check }
-    { format.authors output.nonnull
-      crossref missing$
-    { "author and editor" editor either.or.check }
-    'skip$
-      if$
-    }
-  if$
-  new.block
-  format.btitle
-  "title" output.check
-  crossref missing$
-    { format.bvolume output
-      new.block
-      format.number.series output
-      new.sentence
-    }
-    { new.block
-      format.book.crossref output.nonnull
-    }
-  if$
-  %format.edition output
-  format.address.publisher output
-  format.date "year" output.check
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {article}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    { %journal emphasize "journal" output.check
-      journal "journal" output.check
-      %format.date "year" output.check
-      %new.block
-      year output
-      format.vol.num.pages output
-    }
-    { format.article.crossref output.nonnull
-      format.pages output
-    }
-  if$
-  new.block
-  format.note output
-  fin.entry
-}
-
-FUNCTION {booklet}
-{ output.bibitem
-  format.authors output
-  new.block
-  format.title "title" output.check
-  howpublished address new.block.checkb
-  howpublished output
-  address output
-  format.date output
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {inbook} { output.bibitem
-  author empty$
-    { format.editors "author and editor" output.check }
-    { format.authors output.nonnull
-      crossref missing$
-    { "author and editor" editor either.or.check }
-    'skip$
-      if$
-    }
-  if$
-  new.block
-  format.btitle "title" output.check
-  crossref missing$
-    { format.bvolume output
-      new.block
-      format.number.series output
-      new.sentence
-    }
-    { new.block
-      format.book.crossref output.nonnull
-    }
-  if$
-  %format.edition output
-  format.address.publisher output
-  format.date "year" output.check
-  format.chapter.pages "chapter and pages" output.check
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {incollection}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    { format.in.ed.booktitle "booktitle" output.check
-      format.bvolume output
-      format.number.series output
-      format.chapter.pages output
-      new.sentence
-      publisher "publisher" output.check
-      address output
-      %format.edition output
-      format.date "year" output.check
-    }
-    { format.incoll.inproc.crossref output.nonnull
-      format.chapter.pages output
-    }
-  if$
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {inproceedings}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  crossref missing$
-    { format.in.ed.booktitle "booktitle" output.check
-      %format.bvolume output
-      %format.number.series output
-      %format.pages output
-      address empty$
-    { organization publisher new.sentence.checkb
-      organization output
-      publisher output
-      format.date "year" output.check
-      %year output
-    }
-    { %address output.nonnull
-      format.address.publisher output
-      format.date "year" output.check
-      %year output
-      %new.sentence
-      organization output
-    }
-      if$
-      %new.block
-      pages output
-      %remove.dots
-    }
-    { format.incoll.inproc.crossref output.nonnull
-      format.pages output
-    }
-  if$
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {conference} { inproceedings }
-
-FUNCTION {manual}
-{ output.bibitem
-  author empty$
-    { organization empty$
-    'skip$
-    { organization output.nonnull
-      address output
-    }
-      if$
-    }
-    { format.authors output.nonnull }
-  if$
-  new.block
-  format.btitle "title" output.check
-  author empty$
-    { organization empty$
-    { address new.block.checka
-      address output
-    }
-    'skip$
-      if$
-    }
-    { organization address new.block.checkb
-      organization output
-      address output
-    }
-  if$
-  %format.edition output
-  format.date output
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {masterthesis.type}
-{ lang empty$
-    { "[Master Thesis]" }
-    { "[硕士学位论文]" }
-  if$
-}
-
-FUNCTION {mastersthesis}
-{ output.bibitem
-  format.authors "author" add.period$ output.check
-  new.block
-  format.title remove.dots ": " * masterthesis.type * output
-  new.block
-  format.address.school output
-  %format.madd "address" output.check
-  %school "school" output.check
-  format.date "year" output.check
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {misc}
-{ output.bibitem
-  format.authors output
-  title howpublished new.block.checkb
-  format.title output
-  howpublished new.block.checka
-  howpublished output
-  format.date output
-  format.url output
-  new.block
-  note output
-  fin.entry
-  empty.misc.check
-}
-
-FUNCTION {phdthesis.type}
-{ lang empty$
-    { "[PhD Dissertation]" }
-    { "[博士学位论文]" }
-  if$
-}
-
-FUNCTION {phdthesis}
-{ output.bibitem
-  format.authors "author" add.period$ output.check
-  new.block
-  format.title remove.dots ": " * phdthesis.type * output
-  new.block
-  format.address.school output
-  %address output
-  %school "school" output.check
-  format.date "year" output.check
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {proceedings}
-{ output.bibitem
-  editor empty$
-    { organization output }
-    { format.editors output.nonnull }
-  if$
-  new.block
-  format.btitle "title" output.check
-  format.bvolume output
-  format.number.series output
-  address empty$
-    { editor empty$
-    { publisher new.sentence.checka }
-    { organization publisher new.sentence.checkb
-      organization output
-    }
-      if$
-      publisher output
-      format.date "year" output.check
-    }
-    { address output.nonnull
-      format.date "year" output.check
-      new.sentence
-      editor empty$
-    'skip$
-    { organization output }
-      if$
-      publisher output
-    }
-  if$
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {techreport}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  format.tr.number output.nonnull
-  institution "institution" output.check
-  address output
-  format.date "year" output.check
-  format.url output
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {patent} { output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  format.patent.nationality.type.number output
-  format.date "year" output.check
-  format.pages output
-  new.block
-  note output
-  fin.entry
-}
-
-FUNCTION {unpublished}
-{ output.bibitem
-  format.authors "author" output.check
-  new.block
-  format.title "title" output.check
-  new.block
-  note "note" output.check
-  format.date output
-  fin.entry
-}
-
-FUNCTION {default.type} { misc }
-
-
-%%%%%%%%%%%%%%%%%%
-%% MAIN PROGRAM %%
-%%%%%%%%%%%%%%%%%%
-
-READ
-
-STRINGS { longest.label }
-
-FUNCTION {initialize.longest.label}
-{ "" 'longest.label :=
-  #1 'number.label :=
-  #0 'longest.label.width :=
-}
-
-FUNCTION {longest.label.pass}
-{ number.label int.to.str$ 'label :=
-  number.label #1 + 'number.label :=
-  label width$ longest.label.width >
-    { label 'longest.label :=
-      label width$ 'longest.label.width :=
-    }
-    'skip$
-  if$
-}
-
-EXECUTE {initialize.longest.label}
-
-ITERATE {longest.label.pass}
-
-FUNCTION {begin.bib}
-{ preamble$ empty$
-    'skip$
-    { preamble$ write$ newline$ }
-  if$
-  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
-}
-
-EXECUTE {begin.bib}
-
-EXECUTE {init.state.consts}
-
-ITERATE {call.type$}
-
-FUNCTION {end.bib}
-{ newline$
-  "\end{thebibliography}" write$ newline$
-}
-
-EXECUTE {end.bib}
-
-%BSTFILE
-%<\bst>
+% \subsection{修订记录}
 %
-% \fi
+% \begin{macro}{\@@_ltx_changes:nnn}
+% 保存 \pkg{doc} 中 \tn{changes@} 的定义。
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_ltx_changes:nnn \changes@
+%    \end{macrocode}
+% \end{macro}
 %
-\endinput
+% \begin{macro}[int]{\changes@}
+% 重定义 \tn{changes@},在版本号一行显示修改日期。
+%    \begin{macrocode}
+\cs_set_protected:Npn \changes@ #1#2
+  {
+    \@@_save_version_date:nn {#1} {#2}
+    \@@_ltx_changes:nnn {#1} {#2}
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\g_@@_version_date_prop}
+% 存放版本号与对应的修改日期。其中键为版本号,值为 |{开始日期,结束日期}|。
+% 开始日期与结束日期可以相同。
+%    \begin{macrocode}
+\prop_new:N \g_@@_version_date_prop
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_save_version_date:nn}
+% |nn| 版本最终将被 \tn{changes@} 调用。
+% \begin{arguments}
+%   \item 版本号
+%   \item 日期
+% \end{arguments}
+% 它们分别对应 \tn{change} 的前两个参数(第三个是说明文字)。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_save_version_date:nn #1#2
+  {
+    \prop_get:NnNTF \g_@@_version_date_prop
+      {#1} \l_@@_tmpa_tl
+      {
+%    \end{macrocode}
+% \cs{l_@@_tmpa_tl} 相当于两个参数(开始日期、结束日期),因此需要提前展开。
+%    \begin{macrocode}
+        \exp_after:wN
+          \@@_save_version_date_aux:nnnn \l_@@_tmpa_tl
+        {#2} {#1}
+      }
+      { \@@_save_version_date_aux:nnn {#1} {#2} {#2} }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_save_version_date_aux:nnnn}
+% \begin{arguments}
+%   \item 原开始日期
+%   \item 原结束日期(显然应有 |#1| < |#2|)
+%   \item 新读入的日期
+%   \item 版本号
+% \end{arguments}
+% 如果 |#3| < |#1|,则读入日期 |#3|、|#2|;
+% 如果 |#3| > |#2|,则读入日期 |#1|、|#3|。
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_save_version_date_aux:nnnn #1#2#3#4
+  {
+    \@@_if_date_later:nnTF {#1} {#3}
+      { \@@_save_version_date_aux:nnn {#4} {#3} {#2} }
+      {
+        \@@_if_date_later:nnT {#3} {#2}
+          { \@@_save_version_date_aux:nnn {#4} {#1} {#3} }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_save_version_date_aux:nnn}
+% 将版本号和日期存入 \cs{g_@@_version_date_prop}。
+% \begin{arguments}
+%   \item 版本号
+%   \item 开始日期
+%   \item 结束日期
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_save_version_date_aux:nnn #1#2#3
+  { \prop_gput:Nnn \g_@@_version_date_prop {#1} { {#2} {#3} } }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[TF]{\@@_if_date_later:nn}
+% \begin{macro}{\@@_parse_date:w}
+% 比较两个日期。如果 |#1| 在 |#2| 之后,则为 |true|;反之为 |false|。
+% 日期的格式为 |YYYY-MM-DD|。比较方法是直接将日期化成 8 位数字,
+% 所以月、日前的 0 不可以省略。
+%    \begin{macrocode}
+\prg_new_conditional:Npnn \@@_if_date_later:nn #1#2 { TF, T }
+  {
+    \if_int_compare:w
+        \@@_parse_date:w #1 / / / 0 \q_stop >
+        \@@_parse_date:w #2 / / / 0 \q_stop \exp_stop_f:
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
+  }
+\cs_new:Npn \@@_parse_date:w #1-#2-#3/ #4 \q_stop
+  { #1#2#3 }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[int]{\CTEX at versionitem}
+% 版本条目标签。如果版本号不在 \cs{g_@@_version_date_prop} 里面,
+% 则利用未定义的 \cs{BOOM} 报错。
+%    \begin{macrocode}
+\cs_new_protected:Npn \CTEX at versionitem #1 \efill
+  {
+    \@idxitem
+    \prop_get:NnNTF \g_@@_version_date_prop
+      {#1} \l_@@_tmpa_tl
+      {
+        \exp_after:wN
+          \@@_print_version_date:nnn \l_@@_tmpa_tl
+        {#1}
+      }
+      { \BOOM }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_print_version_date:nnn}
+% 输出版本号和日期。如果开始日期和结束日期相同,则只输出一项。
+% \begin{arguments}
+%   \item 开始日期
+%   \item 结束日期
+%   \item 版本号
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_print_version_date:nnn #1#2#3
+  {
+    \noindent
+    \Hy at raisedlink { \belowpdfbookmark {#3} { HD.#3 } }
+    \textbf {#3} \hfill
+    \hbox:n
+      {
+        \footnotesize
+        \str_if_eq:nnTF {#1} {#2}
+          { ( #1 ) } { ( #1 \c_space_tl \c_tilde_str \c_space_tl #2 ) }
+      }
+    \par \nopagebreak
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\HDorg at theglossary}
+% 该命令由 \pkg{hypdoc} 宏包定义,用于存放标准文档类 \cls{book} 中定义的
+% \tn{theindex} 命令。此处的补丁将在版本号一行最后加上修改日期。
+%    \begin{macrocode}
+\ctex_patch_cmd:Nnn \HDorg at theglossary
+  { \let \item \@idxitem }
+  { \let \item \CTEX at versionitem }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\@wrglossary}
+% 该命令由 \LaTeXe{} 内核定义,又由 \pkg{hypdoc} 宏包作了修改。
+% 此处的补丁使得修订记录条目的页码能够指向对应行。
+%    \begin{macrocode}
+\ctex_patch_cmd:Nnn \@wrglossary
+  { hdpindex }
+  {
+    \ifnum \c at HD@hypercount = \z@
+      hdpindex
+    \else
+      hdclindex { \the \c at HD@hypercount }
+    \fi
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</doc-sty>
+%    \end{macrocode}
+%
+% \end{implementation}

Modified: trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.ins	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/texmf-dist/source/latex/hustthesis/hustthesis.ins	2025-02-28 22:12:14 UTC (rev 74352)
@@ -1,68 +1,76 @@
-% !TEX program  = LuaLaTeX
-%% hustthesis.ins
 %%
-%% Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
-%%               2014-2016 by hust-latex <https://github.com/hust-latex>
+%% This is file `hustthesis.ins',
+%% generated with the docstrip utility.
 %%
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%%   http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
+%% The original source files were:
 %%
-%% This work has the LPPL maintenance status `maintained'.
+%% hustthesis.dtx  (with options: `install')
 %% 
-%% The Current Maintainer of this work is hust-latex Organization.
-%%
-%% This work consists of the files hustthesis.bst, hustthesis.dtx,
-%% hustthesis.ins and the derived file hustthesis.cls 
-%% along with its document and example files.
-%%
-\input l3docstrip.tex
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+\input docstrip
 \keepsilent
 \askforoverwritefalse
-
 \preamble
 
-This is a generated file.
+    Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+                  2014-     by hust-latex <https://github.com/hust-latex>
+                  2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
 
-Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
-              2014-2016 by hust-latex <https://github.com/hust-latex>
+    This work may be distributed and/or modified under the
+    conditions of the LaTeX Project Public License, either
+    version 1.3c of this license or (at your option) any later
+    version. This version of this license is in
+       https://www.latex-project.org/lppl/lppl-1-3c.txt
+    and the latest version of this license is in
+       https://www.latex-project.org/lppl.txt
+    and version 1.3c or later is part of all distributions of LaTeX
+    version 2008 or later.
 
-This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
-of this license or (at your option) any later version.
-The latest version of this license is in
-  http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
+    This work has the LPPL maintenance status "maintained".
 
-This work has the LPPL maintenance status `maintained'.
+    The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
 
-The Current Maintainer of this work is hust-latex Organization.
+\endpreamble
+\postamble
 
-This work consists of the files hustthesis.bst, hustthesis.dtx,
-hustthesis.ins and the derived file hustthesis.cls 
-along with its document and example files.
+    This work consists of the files \jobname.dtx
+              and the derived files \jobname.ins,
+                                    \jobname.cls,
+                                    \jobname-doc.sty,
+                                    \jobname-m.def,
+                                    \jobname-d.def,
+                                    \jobname.cbx,
+                                    \jobname.bbx.
 
-\endpreamble
+\endpostamble
 
-
-\generate{
+\generate
+  {
     \usedir{tex/latex/\jobname}
     \file{\jobname.cls}{\from{\jobname.dtx}{class}}
-    \usedir{doc/latex/\jobname/example}
-    \file{\jobname-zh-example.tex}{\from{\jobname.dtx}{example-zh}}
-    \file{\jobname-en-example.tex}{\from{\jobname.dtx}{example-en}}
-    \usedir{bibtex/bst/\jobname}
-    \nopostamble
-    \file{\jobname.bst}{\from{\jobname.dtx}{bst}}
-    \nopreamble\nopostamble
-    \usedir{doc/latex/\jobname/example}
-    \file{ref-example.bib}{\from{\jobname.dtx}{example-bib}}
-}
+    \file{\jobname-doc.sty}{\from{\jobname.dtx}{doc-sty}}
+    \file{\jobname-m.def}{\from{\jobname.dtx}{def-m}}
+    \file{\jobname-d.def}{\from{\jobname.dtx}{def-d}}
+    \file{\jobname.cbx}{\from{\jobname.dtx}{cbx}}
+    \file{\jobname.bbx}{\from{\jobname.dtx}{bbx}}
+  }
 
 \Msg{*********************************************************}
 \Msg{*}
@@ -70,8 +78,10 @@
 \Msg{* following file into a directory searched by TeX:}
 \Msg{*}
 \Msg{* \space\space \jobname.cls}
-\Msg{* \space\space \jobname.bst}
-\Msg{* \space\space hust-title.eps}
+\Msg{* \space\space \jobname.cbx}
+\Msg{* \space\space \jobname.bbx}
+\Msg{* \space\space \jobname-m.def}
+\Msg{* \space\space \jobname-d.def}
 \Msg{* \space\space hust-title.pdf}
 \Msg{*}
 \Msg{* To produce the documentation run the file \jobname.dtx}
@@ -82,3 +92,18 @@
 \Msg{*********************************************************}
 
 \endbatchfile
+
+
+
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis.ins'.

Deleted: trunk/Master/texmf-dist/tex/latex/hustthesis/hust-title.eps
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-d.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-d.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-d.def	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,135 @@
+%%
+%% This is file `hustthesis-d.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hustthesis.dtx  (with options: `def-d')
+%% 
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+
+\ProvidesExplFile{hustthesis-d.def}
+  {2025-02-27}{2.0.0} %
+  {Definition file for the hustthesis class in doctoral thesis}
+
+\tl_const:Nn \c__hust_name_school_zh_tl { 华中科技大学 }
+\tl_const:Nn \c__hust_name_school_en_tl { Huazhong~ University~ of~ Science~
+  and~ Technology }
+\clist_map_inline:nn
+  {
+    { ideo_comma       } { ^^^^3001 },
+    { ideo_full_stop   } { ^^^^3002 },
+    { fwid_comma       } { ^^^^ff0c },
+    { fwid_full_stop   } { ^^^^ff0e },
+    { fwid_colon       } { ^^^^ff1a },
+    { fwid_semicolon   } { ^^^^ff1b },
+    { fwid_left_paren  } { ^^^^ff08 },
+    { fwid_right_paren } { ^^^^ff09 }
+  }
+  { \__hust_define_punct:nn #1 }
+\fp_const:Nn \c__hust_line_spread_fp { 1.5 }
+\tl_const:Nn \c__hust_emptybox_tl { \usym{2610} }
+\tl_const:Nn \c__hust_checkbox_tl { \usym{2611} }
+\clist_map_inline:nn
+  {
+    { degree_font } { \heiti },
+    { date } { 答\hfill 辩\hfill 日\hfill 期 },
+    { clc } { 分类号 },
+    { student_id } { 学号 },
+    { school_id } { 学校代码 },
+    { secret } { 密级 },
+  }
+  { \__hust_define_name:nn #1 }
+\tl_const:Nn \c__hust_school_id_tl { 10487 }
+\tl_const:Nn \c__hust_address_tl
+  {
+    Huazhong~ University~ of~ Science~ and~ Technology\\
+    Wuhan~ 430074,~ P.~ R.~ China
+  }
+\clist_map_inline:nn
+  {
+    { type }
+      { A~ Dissertation~ Submitted~ in~ Partial~ Fulfillment~ of~
+      The~
+      Requirements~ for~ }
+      { 博士学位论文 },
+    { academic } { The~ Degree~ of~ Doctor~ of } { 学术型 },
+    { professional } { The~ Degree~ of~ Doctor~ of } { 专业型 }, % no diff in English
+    { author } { Ph.D.~ Candidate } { 学\hfill 位\hfill 申\hfill 请\hfill 人 },
+    { major } { Major } { 学\hfill 科\hfill 专\hfill 业 },
+    { supervisor } { Supervisor } { 指\hfill 导\hfill 老\hfill 师 },
+  }
+  { \__hust_define_name:nnn #1 }
+\tl_const:Nn \c__hust_orig_decl_title_tl { 独创性声明 }
+\tl_const:Nn \c__hust_orig_decl_text_tl
+  {
+    本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的研
+    究成果。尽我所知,除文中已经标明引用的内容外,本论文不包含任何其他个人或
+    集体已经发表或撰写过的研究成果。对本文的研究做出贡献的个人和集体,均已在
+    文中以明确方式标明。本人完全意识到本声明的法律结果由本人承担。
+  }
+\clist_const:Nn \c__hust_orig_decl_sign_clist
+  {
+    学位论文作者签名:\hspace{2em}\mbox{},
+    日期:\hspace{2em}年\hspace{1.5em}月\hspace{1.5em}日
+  }
+\tl_const:Nn \c__hust_auth_decl_title_tl { 学位论文版权使用授权书 }
+\tl_const:Nn \c__hust_auth_decl_text_tl
+  {
+    本学位论文作者完全了解学校有关保留、使用学位论文的规定,即:学校有权
+    保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
+    本人授权华中科技大学可以将本学位论文的全部或部分内容编入有关数据库进行检
+    索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
+  }
+\clist_const:Nn \c__hust_auth_decl_secr_clist
+  {
+    本论文属于,
+    保\hspace{1em}密□,在\underline{\hspace{3em}}年解密后适用本授权书。,
+    不保密□。,
+    (请在以上方框内打“√”)
+  }
+\clist_const:Nn \c__hust_auth_decl_sign_clist
+  {
+    学位论文作者签名:\hfill{} 指导教师签名:\hspace*{5em} \mbox{},
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日 \hfill{}
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日\hspace*{1em} \mbox{}
+  }
+\clist_map_inline:nn
+  {
+    { abstract } { Abstract } { 摘\hspace{1em}要 },
+    { keywords } { Key~ words: } { 关键词: },
+  }
+  { \__hust_define_name:nnn #1 }
+\tl_const:Nn \c__hust_sep_keywords_zh_tl { ; }
+\tl_const:Nn \c__hust_sep_keywords_en_tl { , }
+\tl_const:Nn \c__hust_header_tl { 华中科技大学博士学位论文 }
+
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis-d.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-d.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-doc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-doc.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-doc.sty	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,620 @@
+%%
+%% This is file `hustthesis-doc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hustthesis.dtx  (with options: `doc-sty')
+%% 
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+
+\ProvidesExplClass{hustthesis-doc}
+  {2025-02-27}{2.0.0} %
+  {Documentation for the hustthesis class}
+
+
+\RequirePackage
+  {
+    ulem,
+    xcolor-material,
+    zref-base,
+    listings,
+  }
+\cs_new_protected:Npn \__hustdoc_patch_cmd:Nnn #1#2#3
+  {
+    \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\cs_new_protected:Npn \__hustdoc_preto_cmd:Nn #1#2
+  {
+    \ctex_preto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\cs_new_protected:Npn \__hustdoc_appto_cmd:Nn #1#2
+  {
+    \ctex_appto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
+  }
+\__hustdoc_patch_cmd:Nnn \__codedoc_typeset_expandability:
+  { & } { & \skip_horizontal:n { -0.5em } }
+\__hustdoc_preto_cmd:Nn \__codedoc_typeset_functions:
+  { \MacroFont }
+\__hustdoc_patch_cmd:Nnn \__codedoc_macro_init:
+  { \hbox:n } { \MacroFont \hbox:n }
+\__hustdoc_patch_cmd:Nnn \__codedoc_macro_dump:
+  { \hbox_unpack_drop:N } { \MacroFont \hbox_unpack_drop:N }
+\cs_set_protected:Npn \__codedoc_macro_typeset_one:nN #1#2
+  {
+    \vbox_set:Nn \l__codedoc_macro_box
+      {
+        \MacroFont
+        \vbox_unpack_drop:N \l__codedoc_macro_box
+        \hbox_set:Nn \l_tmpa_box
+          { \__codedoc_print_macroname:nN {#1} #2 }
+        \dim_set:Nn \l_tmpa_dim
+          { \marginparwidth - \labelsep - \marginparsep }
+        \dim_compare:nNnT { \box_wd:N \l_tmpa_box } > \l_tmpa_dim
+          {
+            \box_resize_to_wd_and_ht:Nnn \l_tmpa_box
+              { \l_tmpa_dim } { \box_ht:N \l_tmpa_box }
+          }
+        \hbox_overlap_left:n
+          {
+            \box_use:N \l_tmpa_box
+            \skip_horizontal:n { \marginparsep - \labelsep }
+          }
+      }
+    \int_incr:N \l__codedoc_macro_int
+  }
+\DeclareDocumentCommand \key { O{option} m }
+  {
+    \tl_if_eq:nnTF { #1 } { option }
+      { \cmd[module=#1/]{#2} }
+      { \cmd[module=#1/]{#1/#2} }
+  }
+\DeclareDocumentCommand \opt { s m }
+  { \IfBooleanTF {#1} { \texttt{\bfseries \upshape #2} } { \texttt{\upshape #2} } }
+\newcommand\expstar{$\star$}
+\newcommand\rexpstar{\ding{73}}
+\def\TeX{\hologo{TeX}}
+\def\LaTeX{\hologo{LaTeX}}
+\def\LaTeXe{\hologo{LaTeXe}}
+\def\pdfTeX{\hologo{pdfTeX}}
+\def\pdfLaTeX{\hologo{pdfLaTeX}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\XeLaTeX{\hologo{XeLaTeX}}
+\def\LuaTeX{\hologo{LuaTeX}}
+\def\LuaLaTeX{\hologo{LuaLaTeX}}
+\def\AmSLaTeX{\hologo{AmSLaTeX}}
+\def\TeXLive{\TeX\ Live}
+\def\MiKTeX{\hologo{MiKTeX}}
+\def\BibTeX{\hologo{BibTeX}}
+\def\biber{\hologo{biber}}
+\def\TikZ{Ti\emph{k}Z}
+\lstdefinestyle{style at base}
+  {
+    basewidth = 0.5 em,
+    gobble = 3,
+    lineskip = 3 pt,
+    frame = l,
+    framerule = 1 pt,
+    framesep = 0 pt,
+    xleftmargin = 2 em,
+    xrightmargin = 3 em,
+    escapeinside = {(*}{*)},
+    breaklines = true,
+    basicstyle = \small\ttfamily,
+    keywordstyle = \bfseries\color{purple},
+    commentstyle = \itshape\color{white!50!gray},
+    stringstyle = \color{red},
+    backgroundcolor = \color{white!95!gray}
+  }
+\lstdefinestyle{style at bash}
+  {
+    style = style at base,
+    rulecolor = \color{pink},
+    language = bash,
+    alsoletter = {-},
+    emphstyle = \color{green}
+  }
+\lstdefinestyle{style at latex}
+  {
+    style = style at base,
+    rulecolor = \color{blue},
+    language = [LaTeX]TeX,
+    alsoletter = {*, -, .},
+    texcsstyle = *\color{purple},
+    emphstyle = [1]\color{orange},
+    emphstyle = [2]\color{green},
+    emphstyle = [3]\bfseries\color{yellow}
+  }
+\lstnewenvironment{bashecode}[1][]{%
+  \lstset{style=style at bash, #1}}{}
+\lstnewenvironment{latexcode}[1][]{%
+  \lstset{style=style at latex, #1}}{}
+\cs_set_protected_nopar:Npn \xmacro at code
+  { \__hustdoc_marco_code:w }
+\cs_set_protected_nopar:Npn \sxmacro at code
+  {
+    \fontspec_print_visible_spaces:
+    \xmacro at code
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_marco_code:w
+  {
+    \ifcodeline at index
+      \__hustdoc_marco_code_every_par:n { \__hustdoc_code_line_no: }
+    \else:
+      \__hustdoc_marco_code_every_par:n { }
+    \fi:
+    \__hustdoc_make_finish_tag:x { \@currenvir }
+    \__hustdoc_macro_code_start:w
+  }
+\cs_new_protected:Npn \__hustdoc_marco_code_every_par:n #1
+  {
+    \everypar
+      {
+        \everypar {#1}
+        \if at inlabel
+          \global \@inlabelfalse \@noparlistfalse
+          \llap { \box \@labels \hskip \leftskip }
+        \fi
+        #1
+      }
+  }
+\group_begin:
+  \int_set:Nn \tex_endlinechar:D { -1 }
+  \use:n
+    {
+      \char_set_catcode_active:n { 32 }
+      \tl_const:Nn \c__hustdoc_active_space_tl
+    }
+    { }
+\group_end:
+\group_begin:
+  \char_set_catcode_active:n { 13 }
+  \cs_new_protected:Npx \__hustdoc_make_finish_tag:n #1
+    {
+      \tl_set:Nn \exp_not:N \l__hustdoc_macro_code_finish_tl
+        {
+          \c_percent_str
+          \prg_replicate:nn { 4 }
+            { \exp_not:o { \c__hustdoc_active_space_tl } }
+          \exp_not:o { \active at escape@char } end
+          \c_left_brace_str #1 \c_right_brace_str
+          \exp_not:N ^^M
+        }
+    }
+  \cs_generate_variant:Nn \__hustdoc_make_finish_tag:n { x }
+  \cs_new_protected:Npn \__hustdoc_macro_code_start:w #1
+    {
+      \str_if_eq:nnTF {#1} { ^^M }
+        { \__hustdoc_macro_code_read_line:w }
+        { \__hustdoc_macro_code_read_line:w #1 }
+    }
+  \cs_new_protected:Npn \__hustdoc_macro_code_read_line:w #1 ^^M
+    {
+      \tl_set:Nn \l__hustdoc_macro_code_line_tl { #1 ^^M }
+      \tl_if_eq:NNTF
+        \l__hustdoc_macro_code_line_tl \l__hustdoc_macro_code_finish_tl
+        { \exp_args:Nx \end { \@currenvir } }
+        {
+          \__hustdoc_macro_code_process_line:
+          \__hustdoc_macro_code_read_line:w
+        }
+    }
+  \cs_new_protected:Npn \__hustdoc_swap_cr:
+    {
+      \exp_after:wN
+        \__hustdoc_swap_cr_aux:w \l__hustdoc_macro_code_line_tl
+    }
+  \cs_new_protected:Npn \__hustdoc_swap_cr_aux:w #1 ^^M
+    {
+      \group_insert_after:N ^^M
+      \tl_set:Nn \l__hustdoc_macro_code_line_tl {#1}
+    }
+  \tl_const:Nn \c__hustdoc_active_cr_tl { ^^M }
+\group_end:
+\tl_new:N \l__hustdoc_macro_code_line_tl
+\tl_new:N \l__hustdoc_macro_code_finish_tl
+\tl_new:N \g__hustdoc_macro_code_verbatim_stop_tl
+\cs_new_protected_nopar:Npn \__hustdoc_process_normal_line:
+  {
+    \str_case_e:nnF
+      { \str_head:N \l__hustdoc_macro_code_line_tl }
+      {
+        { \c_percent_str }
+        {
+          \__hustdoc_check_angle:x
+            { \tl_tail:N \l__hustdoc_macro_code_line_tl }
+        }
+        { \c_hash_str }
+        { \__hustdoc_output_comment_line: }
+      }
+      { \__hustdoc_output_line: }
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_process_verbatim_line:
+  {
+    \tl_if_eq:NNTF \l__hustdoc_macro_code_line_tl
+        \g__hustdoc_macro_code_verbatim_stop_tl
+      {
+        \tl_gclear:N \g__hustdoc_macro_code_verbatim_stop_tl
+        \cs_gset_eq:NN \__hustdoc_macro_code_process_line:
+          \__hustdoc_process_normal_line:
+        \__hustdoc_output_module:nn
+          { \color { verb at guard } }
+          {
+            \__hustdoc_swap_cr:
+            \__hustdoc_module_pop:n { \l__hustdoc_macro_code_line_tl }
+          }
+      }
+      { \tl_use:N \l__hustdoc_macro_code_line_tl }
+  }
+\cs_new_eq:NN \__hustdoc_macro_code_process_line:
+  \__hustdoc_process_normal_line:
+\DeclareDocumentCommand \CheckModules { }
+  {
+    \cs_set_eq:NN \__hustdoc_macro_code_process_line:
+      \__hustdoc_process_normal_line:
+  }
+\DeclareDocumentCommand \DontCheckModules { }
+  {
+    \cs_set_eq:NN \__hustdoc_macro_code_process_line:
+      \__hustdoc_output_line:
+  }
+\cs_new_protected:Npn \__hustdoc_check_angle:n #1
+  {
+    \str_if_eq:eeTF { \str_head:n {#1} } { < }
+      { \__hustdoc_check_module:x { \tl_tail:n {#1} } }
+      { \__hustdoc_output_comment_line: }
+  }
+\cs_generate_variant:Nn \__hustdoc_check_angle:n { x }
+\cs_new_protected:Npn \__hustdoc_check_module:n #1
+  {
+    \str_case_e:nnF { \str_head:n {#1} }
+      {
+        { * } { \__hustdoc_module_star:w }
+        { / } { \__hustdoc_module_slash:w }
+        { @ } { \__hustdoc_module_at:w }
+        { < } { \__hustdoc_module_verb:w }
+      }
+      { \__hustdoc_module_pm:w }
+    #1 \q_stop
+  }
+\cs_generate_variant:Nn \__hustdoc_check_module:n { x }
+\group_begin:
+  \char_set_catcode_active:N \>
+  \cs_new_protected:Npn \__hustdoc_module_star:w #1 > #2 \q_stop
+    {
+      \tl_set:Nn \l__hustdoc_tmpa_tl {#2}
+      \tl_if_eq:NNTF \l__hustdoc_tmpa_tl \c__hustdoc_active_cr_tl
+        {
+          \__hustdoc_output_module:nn
+            { \__hustdoc_star_color: }
+            {
+              \__hustdoc_module_push:n
+                { \__hustdoc_module_angle:n {#1} }
+            }
+        }
+        {
+          \__hustdoc_output_module_left:nn
+            { \__hustdoc_star_color: }
+            {
+              \__hustdoc_module_push:n
+                { \__hustdoc_module_angle:n {#1} }
+            }
+        }
+      \__hustdoc_output_line:n {#2}
+    }
+  \cs_new_protected:Npn \__hustdoc_module_slash:w #1 > #2 \q_stop
+    {
+      \tl_set:Nn \l__hustdoc_tmpa_tl {#2}
+      \tl_if_eq:NNTF \l__hustdoc_tmpa_tl \c__hustdoc_active_cr_tl
+        {
+          \__hustdoc_output_module:nn
+            { \__hustdoc_slash_color: }
+            {
+              \__hustdoc_module_pop:n
+                { \__hustdoc_module_angle:n {#1} }
+            }
+        }
+        {
+          \__hustdoc_output_module_left:nn
+            { \__hustdoc_slash_color: }
+            {
+              \__hustdoc_module_pop:n
+                { \__hustdoc_module_angle:n {#1} }
+            }
+        }
+      \__hustdoc_output_line:n {#2}
+    }
+  \cs_new_protected:Npn \__hustdoc_module_at:w @ @ = #1 > #2 \q_stop
+    {
+      \__hustdoc_output_module:nn
+        { \color { at at guard } }
+        { \__hustdoc_module_angle:n { @ @ = #1 } }
+      \tl_gset:Nn \g__codedoc_module_name_tl {#1}
+      \__hustdoc_output_line:n {#2}
+    }
+  \cs_new_protected:Npn \__hustdoc_module_verb:w #1 \q_stop
+    {
+      \cs_gset_eq:NN \__hustdoc_macro_code_process_line:
+        \__hustdoc_process_verbatim_line:
+      \tl_gset:Nx \g__hustdoc_macro_code_verbatim_stop_tl
+        { \c_percent_str \tl_tail:n {#1} }
+      \__hustdoc_output_module:nn
+        { \color { verb at guard } }
+        {
+          \__hustdoc_swap_cr:
+          \__hustdoc_module_push:n { \l__hustdoc_macro_code_line_tl }
+        }
+    }
+  \cs_new_protected:Npn \__hustdoc_module_pm:w #1 > #2 \q_stop
+    {
+      \__hustdoc_output_module_left:nn
+        { \__hustdoc_pm_color: }
+        { \__hustdoc_module_angle:n {#1} }
+      \__hustdoc_output_line:n {#2}
+    }
+\group_end:
+\cs_new_protected:Npn \__hustdoc_output_line:n #1
+  {
+    \tl_set:Nn \l__hustdoc_macro_code_line_tl {#1}
+    \tl_if_eq:NNTF
+      \l__hustdoc_macro_code_line_tl \c__hustdoc_active_cr_tl
+      { \tl_use:N \l__hustdoc_macro_code_line_tl }
+      {
+        \str_if_eq:eeTF
+          { \str_head:N \l__hustdoc_macro_code_line_tl } { \c_percent_str }
+          { \__hustdoc_output_comment_line: } { \__hustdoc_output_line: }
+      }
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_output_line:
+  {
+    \tex_noindent:D
+    \__hustdoc_replace_at_at:N \l__hustdoc_macro_code_line_tl
+    \tl_use:N \l__hustdoc_macro_code_line_tl
+  }
+\cs_new_protected:Npn \__hustdoc_output_comment_line:
+  {
+    \tex_noindent:D
+    \group_begin:
+      \__hustdoc_swap_cr:
+      \color { code at gray } \slshape \__hustdoc_output_line:
+    \group_end:
+  }
+\cs_new_protected:Npn \__hustdoc_replace_at_at:N #1
+  {
+    \tl_if_empty:NF \g__codedoc_module_name_tl
+      { \__hustdoc_replace_at_at_aux:No #1 \g__codedoc_module_name_tl }
+  }
+\cs_new_protected:Npn \__hustdoc_replace_at_at_aux:Nn #1#2
+  {
+    \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
+    \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
+  }
+\cs_generate_variant:Nn \__hustdoc_replace_at_at_aux:Nn { No }
+\cs_new_protected_nopar:Npn \__hustdoc_module_push:n
+  { \__hustdoc_module_push_aux:on { \int_use:N \c at HD@hypercount } }
+\cs_new_protected:Npn \__hustdoc_module_push_aux:nn #1
+  {
+    \seq_gpush:Nn \g__hustdoc_module_dest_seq {#1}
+    \hypersetup { hidelinks }
+    \exp_args:Nx \hdclindex
+      { \zref at extractdefault { HD.#1 } { guard at end } { 1 } } { }
+  }
+\cs_generate_variant:Nn \__hustdoc_module_push_aux:nn { on }
+\cs_new_protected_nopar:Npn \__hustdoc_module_pop:n
+  {
+    \seq_gpop:NNTF \g__hustdoc_module_dest_seq \l__hustdoc_tmpa_tl
+      { \__hustdoc_module_pop_aux:on { \l__hustdoc_tmpa_tl } }
+      { \BOOM \use:n }
+  }
+\cs_new_protected:Npn \__hustdoc_module_pop_aux:nn #1
+  {
+    \zref at labelbylist { HD.#1 } { hustdoc }
+    \hypersetup { hidelinks }
+    \hdclindex {#1} { }
+  }
+\cs_generate_variant:Nn \__hustdoc_module_pop_aux:nn { on }
+\seq_new:N \g__hustdoc_module_dest_seq
+\zref at newlist { hustdoc }
+\zref at newprop { guard at end } [ 1 ]
+  { \int_eval:n { \c at HD@hypercount - 1 } }
+\zref at addprop { hustdoc } { guard at end }
+\cs_set_protected:Npn \MacroFont
+  {
+    \linespread { 1.05 }
+    \small \ttfamily \mdseries \upshape
+  }
+\cs_new_protected:Npn \__hustdoc_output_module:nn #1#2
+  {
+    \tex_noindent:D
+    \group_begin:
+      #1
+      \footnotesize \normalfont \sffamily #2
+    \group_end:
+  }
+\cs_new_protected:Npn \__hustdoc_output_module_left:nn #1#2
+  {
+    \tex_noindent:D
+    \hbox_overlap_left:n
+      {
+        \__hustdoc_output_module:nn {#1} {#2}
+        \skip_horizontal:n { \leftskip + \smallskipamount }
+      }
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_star_color:
+  {
+    \seq_gpop:NNTF \g__hustdoc_star_color_seq \current at color
+      { \set at color }
+      { \__hustdoc_select_color: }
+    \seq_gpush:No \g__hustdoc_slash_color_seq { \current at color }
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_slash_color:
+  {
+    \seq_gpop:NNTF \g__hustdoc_slash_color_seq \current at color
+      {
+        \set at color
+        \seq_gpush:No \g__hustdoc_star_color_seq { \current at color }
+      }
+      { \BOOM }
+  }
+\cs_new_protected_nopar:Npn \__hustdoc_pm_color:
+  {
+    \seq_get:NNTF \g__hustdoc_star_color_seq \current at color
+      { \set at color }
+      {
+        \__hustdoc_select_color:
+        \seq_gpush:No \g__hustdoc_star_color_seq { \current at color }
+      }
+  }
+\seq_new:N \g__hustdoc_star_color_seq
+\seq_new:N \g__hustdoc_slash_color_seq
+\cs_new_protected_nopar:Npn \__hustdoc_select_color:
+  { \color { guard at series!!+ } }
+\definecolorseries { guard at series }
+  { cmyk } { last } { blue } { purple }
+\resetcolorseries [ 3 ] { guard at series }
+\definecolor { verb at guard } { named } { MaterialLime600 }
+\definecolor { at at guard } { named } { MaterialPink }
+\definecolor { code at gray } { named } { MaterialGrey }
+\cs_new_protected:Npn \__hustdoc_module_angle:n #1
+  { < #1 > }
+\cs_new_protected_nopar:Npn \__hustdoc_code_line_no:
+  {
+    \int_gincr:N \c at CodelineNo
+    \hbox_overlap_left:n
+      {
+        \hbox_to_wd:nn
+          { \MacroIndent }
+          {
+            \HD at target
+            \tex_hss:D \__hustdoc_code_line_no_style:
+            \theCodelineNo \enspace
+          }
+        \tex_kern:D \@totalleftmargin
+      }
+  }
+\tl_set:Nn \theCodelineNo { \arabic { CodelineNo } }
+\cs_new_protected_nopar:Npn \__hustdoc_code_line_no_style:
+  { \color { code at gray } \normalfont \sffamily \tiny }
+\cs_set_protected:Npn \HD at SetMacroIndent #1
+  {
+    \group_begin:
+      \settowidth \MacroIndent
+        {
+          \__hustdoc_code_line_no_style:
+          \prg_replicate:nn { \tl_count:n {#1} } { 0 }
+          \enspace
+        }
+      \dim_gset_eq:NN \MacroIndent \MacroIndent
+    \group_end:
+  }
+
+\cs_new_eq:NN \__hustdoc_ltx_changes:nnn \changes@
+\cs_set_protected:Npn \changes@ #1#2
+  {
+    \__hustdoc_save_version_date:nn {#1} {#2}
+    \__hustdoc_ltx_changes:nnn {#1} {#2}
+  }
+\prop_new:N \g__hustdoc_version_date_prop
+\cs_new_protected:Npn \__hustdoc_save_version_date:nn #1#2
+  {
+    \prop_get:NnNTF \g__hustdoc_version_date_prop
+      {#1} \l__hustdoc_tmpa_tl
+      {
+        \exp_after:wN
+          \__hustdoc_save_version_date_aux:nnnn \l__hustdoc_tmpa_tl
+        {#2} {#1}
+      }
+      { \__hustdoc_save_version_date_aux:nnn {#1} {#2} {#2} }
+  }
+\cs_new_protected:Npn \__hustdoc_save_version_date_aux:nnnn #1#2#3#4
+  {
+    \__hustdoc_if_date_later:nnTF {#1} {#3}
+      { \__hustdoc_save_version_date_aux:nnn {#4} {#3} {#2} }
+      {
+        \__hustdoc_if_date_later:nnT {#3} {#2}
+          { \__hustdoc_save_version_date_aux:nnn {#4} {#1} {#3} }
+      }
+  }
+\cs_new_protected:Npn \__hustdoc_save_version_date_aux:nnn #1#2#3
+  { \prop_gput:Nnn \g__hustdoc_version_date_prop {#1} { {#2} {#3} } }
+\prg_new_conditional:Npnn \__hustdoc_if_date_later:nn #1#2 { TF, T }
+  {
+    \if_int_compare:w
+        \__hustdoc_parse_date:w #1 / / / 0 \q_stop >
+        \__hustdoc_parse_date:w #2 / / / 0 \q_stop \exp_stop_f:
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
+  }
+\cs_new:Npn \__hustdoc_parse_date:w #1-#2-#3/ #4 \q_stop
+  { #1#2#3 }
+\cs_new_protected:Npn \CTEX at versionitem #1 \efill
+  {
+    \@idxitem
+    \prop_get:NnNTF \g__hustdoc_version_date_prop
+      {#1} \l__hustdoc_tmpa_tl
+      {
+        \exp_after:wN
+          \__hustdoc_print_version_date:nnn \l__hustdoc_tmpa_tl
+        {#1}
+      }
+      { \BOOM }
+  }
+\cs_new_protected:Npn \__hustdoc_print_version_date:nnn #1#2#3
+  {
+    \noindent
+    \Hy at raisedlink { \belowpdfbookmark {#3} { HD.#3 } }
+    \textbf {#3} \hfill
+    \hbox:n
+      {
+        \footnotesize
+        \str_if_eq:nnTF {#1} {#2}
+          { ( #1 ) } { ( #1 \c_space_tl \c_tilde_str \c_space_tl #2 ) }
+      }
+    \par \nopagebreak
+  }
+\ctex_patch_cmd:Nnn \HDorg at theglossary
+  { \let \item \@idxitem }
+  { \let \item \CTEX at versionitem }
+\ctex_patch_cmd:Nnn \@wrglossary
+  { hdpindex }
+  {
+    \ifnum \c at HD@hypercount = \z@
+      hdpindex
+    \else
+      hdclindex { \the \c at HD@hypercount }
+    \fi
+  }
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis-doc.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-doc.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-m.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-m.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-m.def	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,135 @@
+%%
+%% This is file `hustthesis-m.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hustthesis.dtx  (with options: `def-m')
+%% 
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+
+\ProvidesExplFile{hustthesis-m.def}
+  {2025-02-27}{2.0.0} %
+  {Definition file for the hustthesis class in master thesis}
+
+\tl_const:Nn \c__hust_name_school_zh_tl { 华中科技大学 }
+\tl_const:Nn \c__hust_name_school_en_tl { Huazhong~ University~ of~ Science~
+  and~ Technology }
+\clist_map_inline:nn
+  {
+    { ideo_comma       } { ^^^^3001 },
+    { ideo_full_stop   } { ^^^^3002 },
+    { fwid_comma       } { ^^^^ff0c },
+    { fwid_full_stop   } { ^^^^ff0e },
+    { fwid_colon       } { ^^^^ff1a },
+    { fwid_semicolon   } { ^^^^ff1b },
+    { fwid_left_paren  } { ^^^^ff08 },
+    { fwid_right_paren } { ^^^^ff09 }
+  }
+  { \__hust_define_punct:nn #1 }
+\fp_const:Nn \c__hust_line_spread_fp { 1.5 }
+\tl_const:Nn \c__hust_emptybox_tl { \usym{2610} }
+\tl_const:Nn \c__hust_checkbox_tl { \usym{2611} }
+\clist_map_inline:nn
+  {
+    { degree_font } { \bfseries \songti },
+    { date } { 答\hfill 辩\hfill 日\hfill 期 },
+    { clc } { 分类号 },
+    { student_id } { 学号 },
+    { school_id } { 学校代码 },
+    { secret } { 密级 },
+  }
+  { \__hust_define_name:nn #1 }
+\tl_const:Nn \c__hust_school_id_tl { 10487 }
+\tl_const:Nn \c__hust_address_tl
+  {
+    Huazhong~ University~ of~ Science~ and~ Technology\\
+    Wuhan~ 430074,~ P.~ R.~ China
+  }
+\clist_map_inline:nn
+  {
+    { type }
+      { A~ Dissertation~ Submitted~ in~ Partial~ Fulfillment~ of~
+      the~
+      Requirements~ for~ }
+      { 硕士学位论文 },
+    { academic } { the~ Master~ Degree~ in } { 学术型 },
+    { professional } { the~ Professional~ Master~ Degree~ in }  { 专业型 },
+    { author } { Candidate } { 学\hfill 位\hfill 申\hfill 请\hfill 人 },
+    { major } { Major } { 学\hfill 科\hfill 专\hfill 业 },
+    { supervisor } { Supervisor } { 指\hfill 导\hfill 老\hfill 师 },
+  }
+  { \__hust_define_name:nnn #1 }
+\tl_const:Nn \c__hust_orig_decl_title_tl { 独创性声明 }
+\tl_const:Nn \c__hust_orig_decl_text_tl
+  {
+    本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的研
+    究成果。尽我所知,除文中已经标明引用的内容外,本论文不包含任何其他个人或
+    集体已经发表或撰写过的研究成果。对本文的研究做出贡献的个人和集体,均已在
+    文中以明确方式标明。本人完全意识到本声明的法律结果由本人承担。
+  }
+\clist_const:Nn \c__hust_orig_decl_sign_clist
+  {
+    学位论文作者签名:\hspace{2em}\mbox{},
+    日期:\hspace{2em}年\hspace{1.5em}月\hspace{1.5em}日
+  }
+\tl_const:Nn \c__hust_auth_decl_title_tl { 学位论文版权使用授权书 }
+\tl_const:Nn \c__hust_auth_decl_text_tl
+  {
+    本学位论文作者完全了解学校有关保留、使用学位论文的规定,即:学校有权
+    保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
+    本人授权华中科技大学可以将本学位论文的全部或部分内容编入有关数据库进行检
+    索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
+  }
+\clist_const:Nn \c__hust_auth_decl_secr_clist
+  {
+    本论文属于,
+    保\hspace{1em}密□,在\underline{\hspace{3em}}年解密后适用本授权书。,
+    不保密□。,
+    (请在以上方框内打“√”)
+  }
+\clist_const:Nn \c__hust_auth_decl_sign_clist
+  {
+    学位论文作者签名:\hfill{} 指导教师签名:\hspace*{5em} \mbox{},
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日 \hfill{}
+    日期:\hspace*{2em}年\hspace*{1.5em}月\hspace*{1.5em}日\hspace*{1em} \mbox{}
+  }
+\clist_map_inline:nn
+  {
+    { abstract } { Abstract } { 摘\hspace{1em}要 },
+    { keywords } { Key~ words: } { 关键词: },
+  }
+  { \__hust_define_name:nnn #1 }
+\tl_const:Nn \c__hust_sep_keywords_zh_tl { ; }
+\tl_const:Nn \c__hust_sep_keywords_en_tl { , }
+\tl_const:Nn \c__hust_header_tl { 华中科技大学硕士学位论文 }
+
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis-m.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis-m.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.bbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.bbx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.bbx	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,332 @@
+%%
+%% This is file `hustthesis.bbx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hustthesis.dtx  (with options: `bbx')
+%% 
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+
+\ProvidesFile{hustthesis.bbx}[Bibliography style for the hustthesis class]
+
+
+\RequireBibliographyStyle{gb7714-2015}
+\ExecuteBibliographyOptions
+  {
+    isbn = false,
+    url = false,
+    doi = false,
+    gbnamefmt = givenahead,
+    gbtype = false,
+    gbpunctin = false,
+    maxbibnames = 6,
+    minbibnames = 6,
+  }
+\renewcommand{\finentrypunct}{}
+\newcommand\HUST at bib@zhedition[1]{(#1)}
+\newcommand\HUST at bib@enedition[1]{(#1)}
+\DeclareFieldFormat{edition}{\bibtitlefont%源来自biblatex.DEF
+    \testCJKfirst{userd}%
+    \iftoggle{ifCJKforgbt}%
+      {\ifinteger{#1}
+        {%
+          \ifnumgreater{#1}{1}{\printtext{
+            %#1\str at edition
+            \HUST at bib@zhedition{第\zhnumber{#1}版}
+          }}{}
+        }%
+        %{#1\isdot}}%
+        {\HUST at bib@zhedition{#1}}
+        \addspace
+      }%
+      {\ifinteger{#1}%
+        {\ifnumgreater{#1}{1}{
+           %\mkbibordedition{#1}~\bibstring{edition}
+           \HUST at bib@enedition{\mkbibordedition{#1}~\bibstring{edition}}
+          }{}
+        }%
+        %{#1\isdot}}%
+        {\HUST at bib@enedition{#1}\isdot}
+      }
+}
+\DeclareBibliographyDriver{book}{%源来自standard.bbx文件
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+  \if false
+  \usebibmacro{maintitle+title}%
+  \iftoggle{bbx:gbstrict}{}{%
+    \newunit
+    \printlist{language}%
+    \newunit\newblock%
+    \usebibmacro{byauthor}%
+    \newunit\newblock
+  }%
+  \usebibmacro{byeditor+others}%
+  \newunit
+  \fi
+  \printfield[titlecase]{title}%
+  \printfield{edition}%
+  \newunit\newblock%%
+  \iftoggle{bbx:gbstrict}{}{%
+  \iffieldundef{maintitle}%
+  {%\printfield{volume}%
+  \printfield{part}}%
+  {}%
+  \newunit%
+  \printfield{volumes}%
+  \newunit\newblock%
+  \usebibmacro{series+number}}%
+  \newunit\newblock%
+  %\printfield{note}%
+  %\newunit\newblock%
+  \usebibmacro{publisher+location+date}%
+  %\newunit\newblock %这里标点去掉
+  \usebibmacro{chapter+pages}%
+    \iffieldundef{url}{}{%当没有网址时也不输出
+    \usebibmacro{modifydate}}%带括号的修改或更新日期,
+  \usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。
+  \if false
+  \newunit\newblock%
+  \printfield{pagetotal}%
+  \fi
+  \newunit\newblock%
+  \iftoggle{bbx:isbn}
+    {\printfield{isbn}}
+    {}%
+  \newunit\newblock
+  %\usebibmacro{doi+eprint+url}%
+  %\newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
+}
+\newbibmacro*{HUSTinbook_publisher+location+date}{\bibpubfont%
+  \iftoggle{bbx:gbpub}%
+    {\testCJKfirst{userd}%
+      \ifboolexpr{ test {\iflistundef{location}} and test {\iflistundef{publisher}} }%
+        {\iffieldequalstr{entrysubtype}{standard}{}
+          {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at noaddress}\space :\space\str at nopublisher\gbrightbracket}
+              {\printtext{\gbleftbracket S.l.\space :\space s.n.\adddot\gbrightbracket}}}
+        }%
+        {
+          \iflistundef{location}{%\adddot
+            \iffieldequalstr{entrysubtype}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
+            {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at noaddress\gbrightbracket}\addcolon\addspace}%
+                {\printtext{\gbleftbracket S.l.\adddot\gbrightbracket}\publocpunct}}
+          }%  \bibstring{noaddress}
+          {\printlist{location}\publocpunct}%%\addcolon\addspace%
+          \iflistundef{publisher}{%
+            \iffieldequalstr{entrysubtype}{standard}{}%
+            {\iftoggle{ifCJKforgbt}{\printtext{\gbleftbracket\str at nopublisher\gbrightbracket}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
+            {\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}%
+            {\printlist{publisher}}
+        }%
+      \pubdatadelim%\addcomma\addspace%
+      \usebibmacro{date}%%\newunit %去掉这个标点
+    }%
+    {\printlist{location}%
+      \iflistundef{publisher}
+        {\locnopubdelim}
+        %{\setunit*{\publocpunct}}%
+        {\locnopubdelim}
+      \printlist{publisher}%
+      \pubdatadelim%
+      \usebibmacro{date}%%\newunit
+    }%
+}
+\renewbibmacro*{inbook:parent}{%
+  \usebibmacro{bybookauthor}%
+    \ifnameundef{bookauthor}{%
+    \ifnameundef{editor}{}{\newunit}%
+    }{\newunit}%替换下一句
+    %\newunit\newblock
+  \iffieldundef{series}{}
+    {\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加
+    \usebibmacro{maintitle+booktitle}%
+  \iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}%
+  \iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息
+    \newunit\newblock%
+  %  \usebibmacro{byeditor+others}%
+  %  \newunit\newblock
+    \printfield{edition}%
+    \newunit
+    \iftoggle{bbx:gbstrict}{}{%
+  %  \iffieldundef{maintitle}
+  %    {\printfield{volume}%
+  %     \printfield{part}}
+  %    {}%
+  %  \newunit
+  %  \printfield{volumes}%
+  %  \newunit\newblock
+  %  \usebibmacro{series+number}
+    }%
+    \newunit\newblock
+    %\printfield{note}%
+    %\newunit\newblock
+    %\usebibmacro{publisher+location+date}
+    \usebibmacro{HUSTinbook_publisher+location+date}%
+}
+\DeclareFieldFormat[book]{title}{#1}
+\renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件
+  \ifboolexpr{%
+    test{\iffieldundef{title}}%
+    and%
+    test{\iffieldundef{subtitle}}%
+  }%
+  {}%
+  { \printtext[title]{\bibtitlefont%
+      \printfield[titlecase]{title}%
+      \newunit
+      \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题
+        {}%
+        {\setunit{\subtitlepunct}\printfield[titlecase]{subtitle}}%
+      \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格
+        {\setunit{\subtitlepunct}\printfield{titleaddon}}%
+      \if false
+      \setunit{\subtitlepunct}\printfield{number}%写专利号
+      \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}%
+      %\iffieldundef{booktitle}{\newunit}{}%当title是析出时,不要标点
+      %\newunit
+      \fi
+      \iflistundef{location}
+        {}
+        %{\setunit*{\addspace}%
+        {\setunit*{\subtitlepunct}
+        \printtext{%[parens]
+          \printlist[][-\value{listtotal}]{location}}}%
+      \setunit{\addcomma\space}\printfield{number}%写专利号
+      \setunit{\addspace}\printfield[gbtypeflag]{usera}
+    }%
+  }%
+  \setunit{\subtitlepunct}%
+}
+\DeclareBibliographyDriver{patent}{%源来自standard.BBX
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author}%
+  \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+  %\usebibmacro{title}%
+  \usebibmacro{patenttitle}%给出专利专用的标题输出
+  \iftoggle{bbx:gbstrict}{}{%
+    \newunit%
+    \printlist{language}%
+    \newunit\newblock
+    \usebibmacro{byauthor}
+  }%
+  \newunit\newblock
+  \if false
+  \printfield{type}%
+  \setunit*{\addspace}%
+  %\printfield{number}%已放到patenttitle中处理
+  \iflistundef{location}
+    {}
+    {\setunit*{\addspace}%
+    \printtext{%[parens]
+      \printlist[][-\value{listtotal}]{location}}}%
+  \newunit\newblock
+  \usebibmacro{byholder}%
+  \newunit\newblock
+  \fi
+  \printfield{note}%
+  \newunit\newblock
+  %\usebibmacro{newsdate}%
+  \usebibmacro{date}%
+  %\newunit\newblock
+  \usebibmacro{doi+eprint+url}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+    \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
+}
+\DeclareBibliographyDriver{thesis}{%
+  \usebibmacro{bibindex}%
+  \usebibmacro{begentry}%
+  \usebibmacro{author/editor+others/translator+others}%
+  \ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+  %\usebibmacro{title}%
+  \printfield[titlecase]{title}%
+  \printfield[gbtypeflag]{type}
+  \iftoggle{bbx:gbstrict}{}{%
+  \newunit%
+  \printlist{language}%
+  \newunit\newblock
+  \usebibmacro{byauthor}}%
+  \newunit\newblock
+  \usebibmacro{byeditor+others}%增加的译者信息
+  \newunit\newblock
+  \iftoggle{bbx:gbfieldtype}{%
+    \printfield{type}%
+    \setunit*{\addspace}}{}%
+  \printfield{number}%
+  \newunit\newblock
+  \printfield{version}%
+  \newunit
+  \printfield{note}%
+  \newunit\newblock
+  \usebibmacro{institution+location+date}%
+  %\newunit\newblock
+  \usebibmacro{chapter+pages}%
+  \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期
+    \usebibmacro{modifydate}}%修改或更新日期为带括号的时间
+  \usebibmacro{doi+eprint+url}%
+  \newunit
+  \printfield{pagetotal}%
+  \newunit\newblock
+  \iftoggle{bbx:isbn}
+    {\printfield{isrn}}
+    {}%
+  \newunit\newblock
+  \usebibmacro{addendum+pubstate}%
+  \setunit{\bibpagerefpunct}\newblock
+  \usebibmacro{pageref}%
+  \newunit\newblock
+  \iftoggle{bbx:related}
+    {\usebibmacro{related:init}%
+     \usebibmacro{related}}
+    {}%
+  \usebibmacro{annotation}\usebibmacro{finentry}
+}
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis.bbx'.

Added: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cbx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cbx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cbx	2025-02-28 22:12:14 UTC (rev 74352)
@@ -0,0 +1,43 @@
+%%
+%% This is file `hustthesis.cbx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hustthesis.dtx  (with options: `cbx')
+%% 
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
+%% 
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
+%% 
+%%     This work has the LPPL maintenance status "maintained".
+%% 
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
+%% 
+
+\ProvidesFile{hustthesis.cbx}[Citation style for the hustthesis class]
+
+
+\RequireCitationStyle{gb7714-2015}
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
+%%
+%% End of file `hustthesis.cbx'.

Modified: trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cls	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/texmf-dist/tex/latex/hustthesis/hustthesis.cls	2025-02-28 22:12:14 UTC (rev 74352)
@@ -6,1031 +6,1380 @@
 %%
 %% hustthesis.dtx  (with options: `class')
 %% 
-%% This is a generated file.
+%%     Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
+%%                   2014-     by hust-latex <https://github.com/hust-latex>
+%%                   2024-     by HUANG Yuxi <hustthesis at hyxi.dev>
 %% 
-%% Copyright (C) 2013-2014 by Xu Cheng <xucheng at me.com>
-%%               2014-2016 by hust-latex <https://github.com/hust-latex>
+%%     This work may be distributed and/or modified under the
+%%     conditions of the LaTeX Project Public License, either
+%%     version 1.3c of this license or (at your option) any later
+%%     version. This version of this license is in
+%%        https://www.latex-project.org/lppl/lppl-1-3c.txt
+%%     and the latest version of this license is in
+%%        https://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008 or later.
 %% 
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%%   http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
+%%     This work has the LPPL maintenance status "maintained".
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%     The Current Maintainer of this work is HUANG Yuxi <hustthesis at hyxi.dev>.
 %% 
-%% The Current Maintainer of this work is hust-latex Organization.
-%% 
-%% This work consists of the files hustthesis.bst, hustthesis.dtx,
-%% hustthesis.ins and the derived file hustthesis.cls
-%% along with its document and example files.
-%% 
-\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesClass{hustthesis}
-[2016/11/17 v1.4 A Thesis Template for Huazhong University of Science and Technology]
-%% \CharacterTable
-%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%%  Digits        \0\1\2\3\4\5\6\7\8\9
-%%  Exclamation   \!     Double quote  \"     Hash (number) \#
-%%  Dollar        \$     Percent       \%     Ampersand     \&
-%%  Acute accent  \'     Left paren    \(     Right paren   \)
-%%  Asterisk      \*     Plus          \+     Comma         \,
-%%  Minus         \-     Point         \.     Solidus       \/
-%%  Colon         \:     Semicolon     \;     Less than     \<
-%%  Equals        \=     Greater than  \>     Question mark \?
-%%  Commercial at \@     Left bracket  \[     Backslash     \\
-%%  Right bracket \]     Circumflex    \^     Underscore    \_
-%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
-%%  Right brace   \}     Tilde         \~}
-\RequirePackage{ifthen}
-\RequirePackage{xkeyval}
-\newif\ifHUST at finalformat
-\HUST at finalformattrue
-\DeclareOptionX{format}[final]{
-  \ifthenelse{\equal{#1}{final}}{
-    \HUST at finalformattrue
-  }{
-    \ifthenelse{\equal{#1}{draft}}{
-      \HUST at finalformatfalse
-    }{
-      \ClassError{hustthesis}
-      {Option format can only be 'final' or 'draft'}
-      {Try to remove option format^^J}
-    }
+
+\NeedsTeXFormat{LaTeX2e}[2024-11-01]
+\ProvidesExplClass{hustthesis}
+  {2025-02-27}{2.0.0} %
+  {Thesis Template for Huazhong University of Science and Technology}
+
+ \RequirePackage { }
+\box_new:N \l__hust_tmpa_box
+\clist_new:N \l__hust_tmpa_clist
+\dim_new:N \l__hust_tmpa_dim
+\skip_new:N \l__hust_tmpa_skip
+\tl_new:N \l__hust_tmpa_tl
+\tl_new:N \l__hust_tmpb_tl
+\tl_new:N \g__hust_degree_type_tl
+\clist_new:N \g__hust_to_ctex_class_clist
+\clist_new:N \g__hust_to_hyperref_clist
+\bool_new:N \g__hust_draft_bool
+\bool_new:N \g__hust_anonymous_bool
+\clist_new:N \g__hust_anonymous_clist
+\tl_new:N \g__hust_font_set_tl
+\tl_new:N \g__hust_font_latin_tl
+\tl_new:N \g__hust_font_cjk_tl
+\tl_new:N \g__hust_font_math_tl
+\tl_new:N \g__hust_font_dir_tl
+\bool_new:N \g__hust_font_dir_bool
+\tl_new:N \g__hust_config_tl
+\cs_new_protected:Npn \__hust_patch_cmd:Nnn #1#2#3
+  {
+    \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3}
+      { } { \ctex_patch_failure:N #1 }
   }
-}
-\gdef\HUST at language{chinese}
-\DeclareOptionX{language}[chinese]{
-  \ifthenelse{\equal{#1}{chinese} \OR \equal{#1}{english} \OR \equal{#1}{english-draft}}{
-    \gdef\HUST at language{#1}
-  }{
-    \ClassError{hustthesis}
-    {Option language can only be 'chinese', 'english' or 'english-draft'}
-    {Try to remove option language^^J}
+\cs_new_protected:Npn \__hust_appto_cmd:Nn #1#2
+  {
+    \ctex_appto_cmd:NnnTF #1 { } {#2}
+      { } { \ctex_patch_failure:N #1 }
   }
-}
-\gdef\HUST at degree{none}
-\DeclareOptionX{degree}[none]{
-  \ifthenelse{\equal{#1}{none} \OR \equal{#1}{fyp} \OR \equal{#1}{bachelor} \OR \equal{#1}{master} \OR \equal{#1}{phd}}{
-    \gdef\HUST at degree{#1}
-  }{
-     \ClassError{hustthesis}
-      {Option degree can only be 'none', 'fyp', 'bachelor', 'master' or 'phd'}
-      {Try to remove option degree^^J}
+\cs_new_protected:Npn \__hust_define_fn_style:nn #1#2
+  { \tl_const:cn { c__hust_fn_style_ #1 _tl } {#2} }
+\cs_new_protected:Npn \__hust_define_punct:nn #1#2
+  { \tl_const:cn { c__hust_ #1 _tl } {#2} }
+\cs_new_protected:Npn \__hust_define_name:nn #1#2
+  { \tl_const:cn { c__hust_name_ #1 _tl } {#2} }
+\cs_new_protected:Npn \__hust_define_name:nnn #1#2#3
+  {
+    \tl_const:cn { c__hust_name_ #1 _en_tl } {#2}
+    \tl_const:cn { c__hust_name_ #1 _zh_tl } {#3}
   }
-}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
-\ProcessOptionsX
-\LoadClass[12pt, a4paper, openany]{book}
-\RequirePackage{iftex}
-\ifXeTeX\else
-  \ifLuaTeX\else
-    \begingroup
-      \errorcontextlines=-1\relax
-      \newlinechar=10\relax
-      \errmessage{^^J
-      *******************************************************^^J
-      * XeTeX or LuaTeX is required to compile this document.^^J
-      * Sorry!^^J
-      *******************************************************^^J
-      }%
-    \endgroup
-  \fi
-\fi
-\ifthenelse{\equal{\HUST at language}{english-draft}}{
-    \RequirePackage{fontspec}
-    \setmainfont[
-      Ligatures={Common,TeX},
-      Extension=.otf,
-      UprightFont=*-regular,
-      BoldFont=*-bold,
-      ItalicFont=*-italic,
-      BoldItalicFont=*-bolditalic]{texgyretermes}
-    \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-    \setmonofont{CMU Typewriter Text}
-    \defaultfontfeatures{Mapping=tex-text}
-    \let\HEI\relax
-    \let\KAI\relax
-    \let\FANGSONG\relax
-    \newcommand{\hei}[1]{#1}
-    \newcommand{\kai}[1]{#1}
-    \newcommand{\fangsong}[1]{#1}
-}{}
-\ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \ifXeTeX  % XeTeX下使用fontspec + xeCJK处理字体
-      % 英文字体
-      \RequirePackage{fontspec}
-      \RequirePackage{xunicode}
-      \setmainfont[
-        Ligatures={Common,TeX},
-        Extension=.otf,
-        UprightFont=*-regular,
-        BoldFont=*-bold,
-        ItalicFont=*-italic,
-        BoldItalicFont=*-bolditalic]{texgyretermes}
-      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-      \setmonofont{CMU Typewriter Text}
-      \defaultfontfeatures{Mapping=tex-text}
-      % 中文字体
-      \RequirePackage[CJKmath]{xeCJK}
-      \setCJKmainfont[
-       BoldFont={Adobe Heiti Std},
-       ItalicFont={Adobe Kaiti Std}]{Adobe Song Std}
-      \setCJKsansfont{Adobe Kaiti Std}
-      \setCJKmonofont{Adobe Fangsong Std}
-      \xeCJKsetup{PunctStyle=kaiming}
-
-      \newcommand\ziju[2]{{\renewcommand{\CJKglue}{\hskip #1} #2}}
-      \newCJKfontfamily\HEI{Adobe Heiti Std}
-      \newCJKfontfamily\KAI{Adobe Kaiti Std}
-      \newCJKfontfamily\FANGSONG{Adobe Fangsong Std}
-      \newcommand{\hei}[1]{{\HEI #1}}
-      \newcommand{\kai}[1]{{\KAI #1}}
-      \newcommand{\fangsong}[1]{{\FANGSONG #1}}
-    \else\fi
-    \ifLuaTeX  % LuaTeX下使用luatex-ja处理字体 [推荐]
-      \RequirePackage{luatexja-fontspec}
-      % 英文字体
-      \setmainfont[Ligatures={Common,TeX}]{Tex Gyre Termes}
-      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
-      \setmonofont{CMU Typewriter Text}
-      \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
-      % 中文字体
-      \setmainjfont[
-       BoldFont={AdobeHeitiStd-Regular},
-       ItalicFont={AdobeKaitiStd-Regular}]{AdobeSongStd-Light}
-      \setsansjfont{AdobeKaitiStd-Regular}
-      \defaultjfontfeatures{JFM=kaiming}
-
-      \newcommand\ziju[2]{\vbox{\ltjsetparameter{kanjiskip=#1} #2}}
-      \newjfontfamily\HEI{AdobeHeitiStd-Regular}
-      \newjfontfamily\KAI{AdobeKaitiStd-Regular}
-      \newjfontfamily\FANGSONG{AdobeFangsongStd-Regular}
-      \newcommand{\hei}[1]{{\jfontspec{AdobeHeitiStd-Regular} #1}}
-      \newcommand{\kai}[1]{{\jfontspec{AdobeKaitiStd-Regular} #1}}
-      \newcommand{\fangsong}[1]{{\jfontspec{AdobeFangsongStd-Regular} #1}}
-    \else\fi
-    \RequirePackage{zhnumber}
-    \def\CJKnumber#1{\zhnumber{#1}} % 兼容CJKnumb
-}
-\linespread{1.3}\selectfont
-\RequirePackage{geometry}
-\geometry{
-  top=1.77in,
-  bottom=0.8in,
-  left=1.1in,
-  right=1.1in,
-  includefoot
-}
-\ifthenelse{\isundefined{\pagewidth}}{
-  \pdfpagewidth=\paperwidth
-  \pdfpageheight=\paperheight
-}{
-  \pagewidth=\paperwidth
-  \pageheight=\paperheight
-}
-\RequirePackage{indentfirst}
-\setlength{\parindent}{2em}
-\setlength{\parskip}{0pt plus 2pt minus 1pt}
-\RequirePackage{color}
-\RequirePackage[table]{xcolor}
-\RequirePackage[unicode]{hyperref}
-\hypersetup{
-  bookmarksnumbered=true,
-  bookmarksopen=true,
-  bookmarksopenlevel=1,
-  breaklinks=true,
-  colorlinks=true,
-  allcolors=black,
-  linktoc=all,
-  plainpages=false,
-  pdfpagelabels=true,
-  pdfstartview={XYZ null null 1},
-  pdfinfo={Template.Info={hustthesis.cls v1.1 2013/07/01, Copyright (C) 2013-2014 by Xu Cheng 2014 by hust-latex, https://github.com/hust-latex/hustthesis}}
-}
-\RequirePackage{amsmath,amssymb,amsfonts}
-\RequirePackage[amsmath,amsthm,thmmarks,hyperref,thref]{ntheorem}
-\RequirePackage{fancynum}
-\setfnumgsym{\,}
-\RequirePackage[lined,boxed,linesnumbered,ruled,vlined,algochapter]{algorithm2e}
-\RequirePackage{overpic}
-\RequirePackage{graphicx,caption,subcaption}
-\RequirePackage{array}
-\RequirePackage{multirow,tabularx,ltxtable}
-\RequirePackage{listings}
-\RequirePackage[numbers,square,comma,super,sort&compress]{natbib}
-\RequirePackage{titlesec}
-\RequirePackage{titletoc}
-\RequirePackage{tocvsec2}
-\RequirePackage[inline]{enumitem}
-\RequirePackage{fancyhdr}
-\RequirePackage{afterpage}
-\RequirePackage{datenumber}
-\RequirePackage{etoolbox}
-\RequirePackage{appendix}
-\RequirePackage[titles]{tocloft}
-\RequirePackage{xstring}
-\RequirePackage{perpage}
-\def\zhtitle#1{\gdef\HUST at zhtitle{#1}\hypersetup{pdftitle={#1}}}
-\def\entitle#1{\gdef\HUST at entitle{#1}}
-\DeclareDocumentCommand\title{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhtitle{#1}\entitle{#1}
-  }{
-    \zhtitle{#1}\entitle{#2}
+\cs_new:Npn \__hust_msg_new:nn { \msg_new:nnn { hustthesis } }
+\cs_new:Npn \__hust_error:n { \msg_error:nn { hustthesis } }
+\cs_new:Npn \__hust_error:nn { \msg_error:nnn { hustthesis } }
+\cs_new:Npn \__hust_error:nx { \msg_error:nnx { hustthesis } }
+\cs_new:Npn \__hust_error:nnn { \msg_error:nnnn { hustthesis } }
+\cs_new:Npn \__hust_error:nnnn { \msg_error:nnnnn { hustthesis } }
+\cs_new:Npn \__hust_warning:n { \msg_warning:nn { hustthesis } }
+\cs_new:Npn \__hust_warning:nn { \msg_warning:nnn { hustthesis } }
+\cs_new:Npn \__hust_warning:nxx { \msg_warning:nnxx { hustthesis } }
+\cs_new:Npn \__hust_info:nx { \msg_info:nnx { hustthesis } }
+\cs_new_protected:Npn \__hust_vspace:N #1
+  {
+    \dim_set_eq:NN \l__hust_tmpa_dim \tex_prevdepth:D
+    \tex_hrule:D height \c_zero_dim
+    \nobreak
+    \skip_vertical:N #1
+    \skip_vertical:N \c_zero_skip
+    \dim_set_eq:NN \tex_prevdepth:D \l__hust_tmpa_dim
   }
-}
-\title{}{}
-\def\zhauthor#1{\gdef\HUST at zhauthor{#1}\hypersetup{pdfauthor={#1}}}
-\def\enauthor#1{\gdef\HUST at enauthor{#1}}
-\DeclareDocumentCommand\author{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhauthor{#1}\enauthor{#1}
-  }{
-    \zhauthor{#1}\enauthor{#2}
+\cs_new_protected:Npn \__hust_vspace:n #1
+  {
+    \skip_set:Nn \l__hust_tmpa_skip {#1}
+    \__hust_vspace:N \l__hust_tmpa_skip
   }
-}
-\author{}{}
-\def\date#1#2#3{
-  \setdate{#1}{#2}{#3}
-}
-\setdatetoday
-\def\zhdateformat{~\thedateyear~年~\thedatemonth~月~\thedateday~日}
-\def\endateformat{\datedate}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \let\dateformat\zhdateformat
-}{
-  \let\dateformat\endateformat
-}
-\def\zhschoolname#1{\gdef\HUST at zhschoolname{#1}}
-\def\enschoolname#1{\gdef\HUST at enschoolname{#1}}
-\DeclareDocumentCommand\schoolname{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhschoolname{#1}\enschoolname{#1}
-  }{
-    \zhschoolname{#1}\enschoolname{#2}
+\cs_generate_variant:Nn \__hust_vspace:N { c }
+\cs_new_protected:Npn \__hust_hrule:nn #1#2
+  {
+    \rule [ -0.5 ex ] { #2 } { #1 }
+    \skip_horizontal:n { -#2 }
   }
-}
-\schoolname{华中科技大学}{Huazhong University of Science~\char38~Technology}
-\def\zhaddress#1{\gdef\HUST at zhaddress{#1}}
-\def\enaddress#1{\gdef\HUST at enaddress{#1}}
-\DeclareDocumentCommand\address{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhaddress{#1}\enaddress{#1}
-  }{
-    \zhaddress{#1}\enaddress{#2}
+  % \begin{arguments}
+  %    \item 下划线粗细
+  %    \item 下划线长度
+  %    \item 内容
+  % \end{arguments}
+\dim_new:N \l__hust_ul_dim
+\cs_new_protected:Npn \__hust_ul_to_wd:nnn #1#2#3
+  {
+    \hbox_overlap_right:n { \rule [ - 0.5 ex ] { #2 } { #1 } }
+    \hbox_to_wd:nn { #2 } { \tex_hfil:D #3 \tex_hfil:D }
   }
-}
-\address{中国,武汉,430074}{Wuhan~430074, P.~R.~China}
-\def\zhapplyname#1{\def\HUST at zhapplyname{#1}}
-\def\enapplyname#1{\def\HUST at enapplyname{#1}}
-\DeclareDocumentCommand\applyname{m g}
-{
-  \IfNoValueTF{#2}{
-    \enapplyname{#1}
-  }{
-    \zhapplyname{#1}\enapplyname{#2}
+\cs_new:Npn \__hust_line_spread:N #1
+  {
+    \tl_set:Nn \baselinestretch { \fp_use:N #1 }
+    \selectfont
   }
-}
-\def\zhmajor#1{\gdef\HUST at zhmajor{#1}}
-\def\enmajor#1{\gdef\HUST at enmajor{#1}}
-\DeclareDocumentCommand\major{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhmajor{#1}\enmajor{#1}
-  }{
-    \zhmajor{#1}\enmajor{#2}
+\cs_new:Npn \__hust_line_spread:n #1
+  {
+    \tl_set:Nn \baselinestretch { #1 }
+    \selectfont
   }
-}
-\major{}{}
-\def\zhsupervisor#1{\gdef\HUST at zhsupervisor{#1}}
-\def\ensupervisor#1{\gdef\HUST at ensupervisor{#1}}
-\DeclareDocumentCommand\supervisor{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhsupervisor{#1}\ensupervisor{#1}
-  }{
-    \zhsupervisor{#1}\ensupervisor{#2}
+\cs_new:Npn \__hust_arabic:n #1
+  { \int_to_arabic:v { c@ #1 } }
+\keys_define:nn { hust / option }
+  {
+    type .choices:nn =
+      { master, doctor }
+      { \tl_gset_eq:NN \g__hust_degree_type_tl \l_keys_choice_tl },
+    type .value_required:n = true,
+    type .initial:n = { doctor },
+    draft .choice:,
+    draft / true .code:n =
+      {
+        \bool_gset_true:N \g__hust_draft_bool
+        \clist_gput_right:Nn \g__hust_to_ctex_class_clist { draft }
+      },
+    draft / false .code:n =
+      {
+        \bool_gset_false:N \g__hust_draft_bool
+      },
+    draft .default:n = { true },
+    draft .initial:n = { false },
+    anonymous .choice:,
+    anonymous / true .code:n =
+      {
+        \bool_gset_true:N \g__hust_anonymous_bool
+      },
+    anonymous / false .code:n =
+      {
+        \bool_gset_false:N \g__hust_anonymous_bool
+      },
+    anonymous .default:n = { true },
+    anonymous .initial:n = { false },
+    anonymous-list .clist_gset:N = \g__hust_anonymous_clist,
+    latin-font .choices:nn =
+      { fandol, gyre, mac, macoffice, win, none, }
+      { \tl_gset:Nn \g__hust_font_latin_tl {#1} },
+    cjk-font .choices:nn =
+      { fandol, founder, mac, macoffice, noto, source, win, none, }
+      { \tl_gset:Nn \g__hust_font_cjk_tl {#1} },
+    fontset .choices:nn =
+      { fandol, mac, macoffice, win, none, }
+      { \keys_set:nn { hust / option } { latin-font = #1, cjk-font = #1 } },
+    math-font .choices:nn =
+      {
+        asana, cambria, fira, garamond, lm, libertinus, newcm,
+        stix, bonum, dejavu, pagella, schola, termes, xits, none,
+      }
+      { \tl_gset_eq:NN \g__hust_font_math_tl \l_keys_choice_tl },
+    math-font .initial:n = xits,
+    font-dir .code:n =
+      {
+        \bool_gset_true:N \g__hust_font_dir_bool
+        \tl_gset_eq:NN \g__hust_font_dir_tl \l_keys_value_tl
+      },
+    config .tl_gset:N = \g__hust_config_tl,
+    unknown .code:n =
+      { \clist_gput_right:No \g__hust_to_ctex_class_clist { \CurrentOption } }
   }
-}
-\supervisor{}{}
-\def\zhasssupervisor#1{\gdef\HUST at zhasssupervisor{#1}}
-\def\enasssupervisor#1{\gdef\HUST at enasssupervisor{#1}}
-\DeclareDocumentCommand\asssupervisor{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhasssupervisor{#1}\enasssupervisor{#1}
-  }{
-    \zhasssupervisor{#1}\enasssupervisor{#2}
+\ProcessKeyOptions [ hust / option ]
+\tl_if_empty:NTF \g__hust_config_tl
+  {
+    \tl_if_eq:NnT \g__hust_degree_type_tl { master }
+      { \file_input:n { hustthesis-m.def } }
+    \tl_if_eq:NnT \g__hust_degree_type_tl { doctor }
+      { \file_input:n { hustthesis-d.def } }
   }
-}
-\asssupervisor{}{}
-\def\schoolcode#1{\gdef\HUST at schoolcode{#1}}
-\schoolcode{}
-\def\stuno#1{\gdef\HUST at stuno{#1}}
-\stuno{}
-\def\classno#1{\gdef\HUST at classno{#1}}
-\classno{}
-\def\secretlevel#1{\gdef\HUST at secretlevel{#1}}
-\secretlevel{}
-\long\def\zhabstract#1{\long\gdef\HUST at zhabstract{#1}}
-\long\def\enabstract#1{\long\gdef\HUST at enabstract{#1}}
-\DeclareDocumentCommand\abstract{+m +g}
-{
-  \IfNoValueTF{#2}{
-    \zhabstract{#1}\enabstract{#1}
-  }{
-    \zhabstract{#1}\enabstract{#2}
+  {
+    \__hust_msg_new:nn { load-config-file }
+      { You~ are~ loading~ config~ file~ "#1". }
+    \__hust_info:n { load-config-file }
+    \file_input:V { \g__hust_config_tl }
   }
-}
-\abstract{}{}
-\def\zhkeywords#1{\gdef\HUST at zhkeywords{#1}\hypersetup{pdfkeywords={#1}}}
-\def\enkeywords#1{\gdef\HUST at enkeywords{#1}}
-\DeclareDocumentCommand\keywords{m g}
-{
-  \IfNoValueTF{#2}{
-    \zhkeywords{#1}\enkeywords{#1}
-  }{
-    \zhkeywords{#1}\enkeywords{#2}
+\PassOptionsToClass
+  {
+    a4paper,
+    UTF8,
+    scheme = chinese,
+    fontset = none,
+    oneside,
+    heading = true,
+    zihao = -4,
+    linespread = \c__hust_line_spread_fp,
+    \g__hust_to_ctex_class_clist,
   }
-}
-\keywords{}{}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-    \def\indexname{索引}
-    \def\figurename{图}
-    \def\tablename{表}
-    \AtBeginDocument{\def\listingscaption{代码}}
-    \def\bibname{参考文献}
-    \def\contentsname{目\hspace{1em}录}
-    \def\contentsnamenospace{目录}
-    \def\appendixname{附录}
-    \def\HUST at listfigurename{插图索引}
-    \def\HUST at listtablename{表格索引}
-    \def\equationautorefname{公式}
-    \def\footnoteautorefname{脚注}
-    \def\itemautorefname~#1\null{第~#1~项\null}
-    \def\figureautorefname{图}
-    \def\tableautorefname{表}
-    \def\appendixautorefname{附录}
-    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
-    \def\chapterautorefname~#1\null{第\zhnumber{#1}章\null}
-    \def\sectionautorefname~#1\null{#1~小节\null}
-    \def\subsectionautorefname~#1\null{#1~小节\null}
-    \def\subsubsectionautorefname~#1\null{#1~小节\null}
-    \def\FancyVerbLineautorefname~#1\null{第~#1~行\null}
-    \def\pageautorefname~#1\null{第~#1~页\null}
-    \def\lstlistingautorefname{代码}
-    \def\definitionautorefname{定义}
-    \def\propositionautorefname{命题}
-    \def\lemmaautorefname{引理}
-    \def\theoremautorefname{定理}
-    \def\axiomautorefname{公理}
-    \def\corollaryautorefname{推论}
-    \def\exerciseautorefname{练习}
-    \def\exampleautorefname{例}
-    \def\proofautorefname{证明}
-    \SetAlgorithmName{算法}{算法}{算法索引}
-    \SetAlgoProcName{过程}{过程}
-    \SetAlgoFuncName{函数}{函数}
-    \def\AlgoLineautorefname~#1\null{第~#1~行\null}
-}{}
-\ifthenelse{\equal{\HUST at language}{chinese}}{}{
-    \def\HUST at listfigurename{List of Figures}
-    \def\HUST at listtablename{List of Tables}
-    \def\equationautorefname{Equation}
-    \def\footnoteautorefname{Footnote}
-    \def\itemautorefname{Item}
-    \def\figureautorefname{Figure}
-    \def\tableautorefname{Table}
-    \def\appendixautorefname{Appendix}
-    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
-    \def\chapterautorefname{Chapter}
-    \def\sectionautorefname{Section}
-    \def\subsectionautorefname{Subsection}
-    \def\subsubsectionautorefname{Sub-subsection}
-    \def\FancyVerbLineautorefname{Line}
-    \def\pageautorefname{Page}
-    \def\lstlistingautorefname{Code Fragment}
-    \def\definitionautorefname{Definition}
-    \def\propositionautorefname{Proposition}
-    \def\lemmaautorefname{Lemma}
-    \def\theoremautorefname{Theorem}
-    \def\axiomautorefname{Axiom}
-    \def\corollaryautorefname{Corollary}
-    \def\exerciseautorefname{Exercise}
-    \def\exampleautorefname{Example}
-    \def\proofautorefname{Proof}
-    \SetAlgorithmName{Algorithm}{Algorithm}{List of Algorithms}
-    \SetAlgoProcName{Procedure}{Procedure}
-    \SetAlgoFuncName{Function}{Function}
-    \def\AlgoLineautorefname{Line}
-}
-\def\HUST at classnotitle{{分}\hfill{类}\hfill{号}}
-\def\HUST at stunotitle{学号}
-\def\HUST at schoolcodetitle{学校代码}
-\def\HUST at secrettile{密级}
-\def\HUST at zhauthortitle{{学}\hfill{位}\hfill{申}\hfill{请}\hfill{人}}
-\def\HUST at zhmajortitle{{学}\hfill{科}\hfill{专}\hfill{业}}
-\def\HUST at zhsupervisortitle{{指}\hfill{导}\hfill{教}\hfill{师}}
-\def\HUST at zhasssupervisortitle{{副}\hfill{指}\hfill{导}\hfill{教}\hfill{师}}
-\def\HUST at zhdatetitle{{答}\hfill{辩}\hfill{日}\hfill{期}}
-
-\def\HUST at enauthortitle{Student}
-\def\HUST at enmajortitle{Major}
-\def\HUST at ensupervisortitle{Supervisor}
-\def\HUST at enasssupervisortitle{Co-Supervisor}
-
-\def\HUST at originaldeclare{独创性声明}
-\long\def\HUST at originaldeclaretext{
-  本人声明所呈交的学位论文是我个人在导师的指导下进行的研究工作及取得的研究成果。尽我所知,除文中已标明引用的内容外,本论文不包含任何其他人或集体已经发表或撰写过的研究成果。对本文的研究做出贡献的个人和集体,均已在文中以明确方式标明。本人完全意识到本声明的法律结果由本人承担。
-}
-\def\HUST at zhauthorsig{学位论文作者签名:}
-\def\HUST at zhdatefield{日期:\hspace{2em}年\hspace{2em}月\hspace{2em}日}
-
-\def\HUST at authtitle{学位论文版权使用授权书}
-\long\def\HUST at authorizationtext{
-  本学位论文作者完全了解学校有关保留、使用学位论文的规定,即:学校有权保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。本人授权华中科技大学可以将本学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
-}
-\long\def\HUST at authorizationaddon{
- 本论文属于
- \tabincell{l}{
-  保密$\square$,在~\makebox[2em]{\hrulefill} 年解密后适用本授权书。\\
-  不保密~$\square$。
- }
-}
-\def\HUST at authorizationcheck{(请在以上方框内打“$\surd$”)}
-\def\HUST at zhteachersig{指导教师签名:}
-
-\def\HUST at zhabstractname{摘\hspace{1em}要}
-\def\HUST at zhabstractnamenospace{摘要}
-\def\HUST at zhkeywordstitle{关键词:}
-\def\HUST at enabstractname{Abstract}
-\def\HUST at enkeywordstitle{Key words:}
-
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \def\HUST at ackname{致\hspace{1em}谢}
-  \def\HUST at acknamenospace{致谢}
-  \def\HUST at publicationtitle{攻读学位期间发表的学术论文}
-}{
-  \def\HUST at ackname{Acknowledge}
-  \def\HUST at acknamenospace{Acknowledge}
-  \def\HUST at publicationtitle{Publication}
-}
-
-\ifthenelse{\equal{\HUST at degree}{none}}{
-  \def\HUST at zhapplyname{学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{fyp}}{
-  \def\HUST at zhapplyname{毕业设计论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{bachelor}}{
-  \def\HUST at zhapplyname{学士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{master}}{
-  \def\HUST at zhapplyname{硕士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master}
-}{}
-
-\ifthenelse{\equal{\HUST at degree}{phd}}{
-  \def\HUST at zhapplyname{博士学位论文}
-  \def\HUST at enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy}
-}{}
-
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \hypersetup{pdfsubject={\HUST at zhschoolname\HUST at zhapplyname}}
-}{
-  \hypersetup{pdfsubject={\HUST at enapplyname}}
-}
-\def\listfigurename{\HUST at listfigurename}
-\def\listtablename{\HUST at listtablename}
-\allowdisplaybreaks[4]
-\abovedisplayskip=10bp plus 2bp minus 2bp
-\abovedisplayshortskip=10bp plus 2bp minus 2bp
-\belowdisplayskip=\abovedisplayskip
-\belowdisplayshortskip=\abovedisplayshortskip
-\numberwithin{equation}{chapter}
-\theoremnumbering{arabic}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \theoremseparator{:}
-}{
-  \theoremseparator{:}
-}
-\theorempreskip{1.2ex plus 0ex minus 1ex}
-\theorempostskip{1.2ex plus 0ex minus 1ex}
-\theoremheaderfont{\normalfont\bfseries\HEI}
-\theoremsymbol{}
-
-\theoremstyle{definition}
-\theorembodyfont{\normalfont}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \newtheorem{definition}{定义}[chapter]
-}{
-  \newtheorem{definition}{Definition}[chapter]
-}
-
-\theoremstyle{plain}
-\theorembodyfont{\itshape}
-\ifthenelse{\equal{\HUST at language}{chinese}}{
-  \newtheorem{proposition}{命题}[chapter]
-  \newtheorem{lemma}{引理}[chapter]
-  \newtheorem{theorem}{定理}[chapter]
-  \newtheorem{axiom}{公理}[chapter]
-  \newtheorem{corollary}{推论}[chapter]
-  \newtheorem{exercise}{练习}[chapter]
-  \newtheorem{example}{例}[chapter]
-  \def\proofname{\hei{证明}}
-}{
-  \newtheorem{proposition}{Proposition}[chapter]
-  \newtheorem{lemma}{Lemma}[chapter]
-  \newtheorem{theorem}{Theorem}[chapter]
-  \newtheorem{axiom}{Axiom}[chapter]
-  \newtheorem{corollary}{Corollary}[chapter]
-  \newtheorem{exercise}{Exercise}[chapter]
-  \newtheorem{example}{Example}[chapter]
-  \def\proofname{\textbf{Proof}}
-}
-\setlength{\intextsep}{0.7\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}
-\setlength{\textfloatsep}{0.8\baselineskip plus 0.1\baselineskip minus 0.2\baselineskip}
-\renewcommand{\textfraction}{0.15}
-\renewcommand{\topfraction}{0.85}
-\renewcommand{\bottomfraction}{0.65}
-\renewcommand{\floatpagefraction}{0.60}
-\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
-\def\@cline#1-#2\@nil{%
-  \omit
-  \@multicnt#1%
-  \advance\@multispan\m at ne
-  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
-  \@multicnt#2%
-  \advance\@multicnt-#1%
-  \advance\@multispan\@ne
-  \leaders\hrule\@height\arrayrulewidth\hfill
-  \cr
-  \noalign{\nobreak\vskip-\arrayrulewidth}}
-\newif\ifHUST at useoldtabular
-\HUST at useoldtabularfalse
-\def\TurnOffTabFontSetting{\HUST at useoldtabulartrue}
-\def\TurnOnTabFontSetting{\HUST at useoldtabularfalse}
-\AtBeginEnvironment{tabular}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
-\AtBeginEnvironment{tabularx}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
-\AtBeginEnvironment{longtable}{
-  \ifHUST at useoldtabular\else
-    \fontsize{11pt}{15.4pt}\selectfont
-  \fi
-}
-\DeclareCaptionFont{HUST at captionfont}{\fontsize{11pt}{14.3pt}\selectfont}
-\DeclareCaptionLabelFormat{HUST at caplabel}{#1~#2}
-\captionsetup{
-  font=HUST at captionfont,
-  labelformat=HUST at caplabel,
-  format=hang,
-  labelsep=quad,
-  skip=12pt
-}
-\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
-\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}}
-\definecolor{HUST at lstgreen}{rgb}{0,0.6,0}
-\definecolor{HUST at lstmauve}{rgb}{0.58,0,0.82}
-
-\lstset{
-  basicstyle=\footnotesize\ttfamily\linespread{1}\selectfont\FANGSONG,
-  keywordstyle=\color{blue}\bfseries,
-  commentstyle=\color{HUST at lstgreen}\itshape\KAI,
-  stringstyle=\color{HUST at lstmauve},
-  showspaces=false,
-  showstringspaces=false,
-  showtabs=false,
-  numbers=left,
-  numberstyle=\tiny\color{black},
-  frame=lines,
-  rulecolor=\color{black},
-  breaklines=true
-}
-\setcounter{secnumdepth}{3}
-\titleformat{\chapter}
+  { ctexbook }
+\LoadClass { ctexbook }
+\RequirePackage
   {
-    \bfseries
-    \HEI
-    \centering
-    \fontsize{18pt}{23.4pt}\selectfont
+    amsmath,
+    geometry,
+    fancyhdr,
+    titletoc,
+    graphicx,
+    multirow,
+    longtable,
+    caption,
+    utfsym,
   }
+\RequirePackage[style=hustthesis]{biblatex}
+\clist_map_inline:Nn \g__hust_anonymous_clist
   {
-    \ifthenelse{\equal{\HUST at language}{chinese}}
-    {\zhnumber{\thechapter}}
-    {Chapter~\thechapter}
+    \tl_gset_eq:cN { g__hust_name_ #1 _tl } \c_empty_tl
   }
-  {1em}
-  {}
-\titlespacing*{\chapter}{0pt}{0pt}{20pt}
-\titleformat*{\section}{\bfseries\HEI\fontsize{16pt}{20.8pt}\selectfont}
-\titlespacing*{\section}{0pt}{18pt}{6pt}
-\titleformat*{\subsection}{\bfseries\HEI\fontsize{14pt}{18.2pt}\selectfont}
-\titlespacing*{\subsection}{0pt}{12pt}{6pt}
-\titleformat*{\subsubsection}{\bfseries\HEI\fontsize{13pt}{16.9pt}\selectfont}
-\titlespacing*{\subsubsection}{0pt}{12pt}{6pt}
-\setcounter{tocdepth}{1}
-\contentsmargin{2.0em}
-\newskip\HUST at oldcftbeforechapskip
-\HUST at oldcftbeforechapskip=\cftbeforechapskip
-\newskip\HUST at oldcftbeforesecskip
-\HUST at oldcftbeforesecskip=\cftbeforesecskip
-\let\HUST at oldl@chapter\l at chapter
-\let\HUST at oldl@section\l at section
-\let\HUST at oldl@subsection\l at subsection
-\def\l at chapter#1#2{\HUST at oldl@chapter{#1}{#2}\cftbeforechapskip=3pt}
-\def\l at section#1#2{\HUST at oldl@section{#1}{#2}\cftbeforechapskip=\HUST at oldcftbeforechapskip\cftbeforesecskip=3pt}
-\def\l at subsection#1#2{\HUST at oldl@subsection{#1}{#2}\cftbeforesecskip=\HUST at oldcftbeforesecskip}
-\renewcommand*\cftfigpresnum{\figurename~}
-\newlength{\HUST at cftfignumwidth@tmp}
-\settowidth{\HUST at cftfignumwidth@tmp}{\cftfigpresnum}
-\addtolength{\cftfignumwidth}{\HUST at cftfignumwidth@tmp}
-\renewcommand{\cftfigaftersnumb}{\quad~}
-\renewcommand*\cfttabpresnum{\tablename~}
-\newlength{\HUST at cfttabnumwidth@tmp}
-\settowidth{\HUST at cfttabnumwidth@tmp}{\cfttabpresnum}
-\addtolength{\cfttabnumwidth}{\HUST at cfttabnumwidth@tmp}
-\renewcommand{\cfttabaftersnumb}{\quad~}
-\let\ps at plain\ps at fancy
-\pagestyle{fancy}
-\fancyhf{}
-\renewcommand{\headrulewidth}{0pt}
-\renewcommand{\footrulewidth}{0pt}
-
-\ifthenelse{\equal{\HUST at degree}{fyp}}{
-  \fancyfoot[R]{\thepage}
-}{
-  \fancyfoot[C]{\thepage}
-}
-
-\ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-  \ifHUST at finalformat\else
-    \fancyhead[C]{
-      \ziju{1em}{\kai{\fontsize{14pt}{18.2pt}\selectfont\HUST at zhschoolname\HUST at zhapplyname}}
-      \vskip -5pt
-      \vbox{
-        \hrule width \textwidth height 2pt
+\geometry
+  {
+    top = 4.5 cm,
+    bottom = 2.8 cm,
+    left = 2.8 cm,
+    right = 2.8 cm,
+    headheight = 30 pt,
+  }
+\tl_const:Nn \c__hust_path_macoffice_tl
+  { /Applications/Microsoft~ Word.app/Contents/Resources/DFonts/ }
+\sys_if_platform_windows:TF
+  { \tl_gset:Nn \g__hust_font_set_tl { win } }
+  {
+    \ctex_if_platform_macos:TF
+      {
+        \file_if_exist:nTF { \c__hust_path_macoffice_tl times.ttf }
+          { \tl_gset:Nn \g__hust_font_set_tl { macoffice } }
+          { \tl_gset:Nn \g__hust_font_set_tl { mac } }
       }
-    }
-  \fi
-}
-\setlist{noitemsep,partopsep=0pt,topsep=.8ex}
-\setlist[1]{labelindent=\parindent}
-\setlist[enumerate,1]{label=\arabic*.,ref=\arabic*}
-\setlist[enumerate,2]{label*=\arabic*,ref=\theenumi.\arabic*}
-\setlist[enumerate,3]{label=\emph{\alph*}),ref=\theenumii\emph{\alph*}}
-\setlist[description]{font=\bfseries\HEI}
-\MakePerPage{footnote}
-\def\frontmatter{
-  \clearpage
-  \@mainmatterfalse
-  \pagenumbering{Roman}
-}
-\def\mainmatter{
-  \clearpage
-  \@mainmattertrue
-  \pagenumbering{arabic}
-}
-\def\backmatter{
-  \clearpage
-  \@mainmatterfalse
-  \settocdepth{chapter}
-  \hypersetup{bookmarksopenlevel=0}
-}
-\def\HUST at zhtitlepage{
-  \begin{center}
-  \vspace*{-1.0cm}
-  \parbox[t][2.2cm][t]{\textwidth}{
-    \begin{center}
-      \setlength{\tabcolsep}{0pt}
-      \setlength{\extrarowheight}{12pt}
-      \TurnOffTabFontSetting
-      \fontsize{14pt}{16.8pt}\selectfont
-      \begin{tabularx}{\textwidth}{p{4em}p{5em}Xp{2em}p{12em}}
-        \HUST at classnotitle    & \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST at classno}\hfill} & &
-        \HUST at stunotitle      & \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST at stuno}\hfill} \\
-        \HUST at schoolcodetitle & \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST at schoolcode}\hfill} & &
-        \HUST at secrettile      & \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST at secretlevel}\hfill}
-      \end{tabularx}
-      \TurnOnTabFontSetting
-    \end{center}
-    }
-  \parbox[t][6cm][t]{\textwidth}{
-    \vspace{1.0cm}
-    \begin{center}
-    \includegraphics[scale=1.1]{hust-title.pdf}\\[0.8cm]
-    \ziju{10bp}{\fontsize{42pt}{54.6pt}\selectfont\HEI\HUST at zhapplyname}
-    \end{center}
+      { \tl_gset:Nn \g__hust_font_set_tl { fandol } }
   }
-  \parbox[t][4.8cm][t]{.8\textwidth}{
-    \vspace{1.4cm}
-    \begin{center}
-    \fontsize{22pt}{35.2pt}\selectfont\hei{\HUST at zhtitle}
-    \end{center}
+\tl_if_empty:NT \g__hust_font_latin_tl
+  { \tl_gset_eq:NN \g__hust_font_latin_tl \g__hust_font_set_tl }
+\tl_if_empty:NT \g__hust_font_cjk_tl
+  { \tl_gset_eq:NN \g__hust_font_cjk_tl \g__hust_font_set_tl }
+\cs_new:Npn \__hust_loadfont_latin:n #1
+  {
+    \__fontspec_main_setmainfont:nn { } { Times~New~Roman }
+    \__fontspec_main_setsansfont:nn { } { Arial }
+    \__fontspec_main_setmonofont:nn { Scale = MatchLowercase } {#1}
   }
-  \parbox[t][7.4cm][t]{\textwidth}{
-    \vspace{1.2cm}
-    \begin{center}
-    \fontsize{18pt}{27.0pt}\selectfont
-    \setlength{\extrarowheight}{0pt}
-    \TurnOffTabFontSetting
-    \begin{tabular}{p{5em}@{{:\hspace{1em}}}l}
-    \HUST at zhauthortitle       & {\HUST at zhauthor} \\
-    \HUST at zhmajortitle      & {\HUST at zhmajor} \\
-    \HUST at zhsupervisortitle & {\HUST at zhsupervisor} \\
-    \ifthenelse{\equal{\HUST at zhasssupervisor}{}}{}{
-      \HUST at zhasssupervisortitle & {\HUST at zhasssupervisor} \\
-    }
-    \HUST at zhdatetitle & \zhdateformat
-    \end{tabular}
-    \TurnOnTabFontSetting
-    \end{center}
+\cs_new_protected:Npn \__hust_loadfont_latin_win:
+  { \__hust_loadfont_latin:n { Courier~New } }
+\cs_new_protected:Npn \__hust_loadfont_latin_mac:
+  {
+    \__hust_loadfont_latin:n { Menlo }
+    \fontspec_if_small_caps:F
+      {
+        \__hust_warning:n { no-small-caps }
+        \__fontspec_main_setmainfont:nn
+          { \c__hust_name_gyrefeature_clist } { texgyretermes }
+      }
   }
-  \end{center}
+\__hust_msg_new:nn { no-small-caps }
+  {
+    I~ am~ using~ TeX~ Gyre~ Termes~ as~ default~ Roman~ font.\\
+    This~ is~ because~ the~ "Times~ New~ Roman"~ font~ in~ your~
+    system~ does~ not~ embed~ glyphs~ for~ small~ capitals.~
+    You~ can~ ignore~ this~ warning~ if~ you~ do~ not~ need~
+    \string\textsc.~ For~ more~ information,~
+    please~ refer~ to~ section~ 3.2.6~ of~ the~ documentation.
+  }
+\cs_new_protected:Npn \__hust_loadfont_latin_macoffice:
+  {
+    \__fontspec_main_setmainfont:nn
+      { \c__hust_name_macofficefeature_clist } { times }
+    \__fontspec_main_setsansfont:nn
+      { \c__hust_name_macofficefeature_clist } { arial }
+    \__fontspec_main_setmonofont:nn
+      { Scale = MatchLowercase } { Menlo }
+  }
+\clist_const:Nn \c__hust_name_macofficefeature_clist
+  {
+    Path = \c__hust_path_macoffice_tl,
+    Extension = .ttf,
+    UprightFont = *,
+    BoldFont = *bd,
+    ItalicFont = *i,
+    BoldItalicFont = *bi,
+  }
+\cs_new_protected:Npn \__hust_loadfont_latin_gyre:
+  {
+    \__fontspec_main_setmainfont:nn
+      { \c__hust_name_gyrefeature_clist } { texgyretermes }
+    \__fontspec_main_setsansfont:nn
+      { \c__hust_name_gyrefeature_clist } { texgyreheros }
+    \__fontspec_main_setmonofont:nn
+      {
+        \c__hust_name_gyrefeature_clist,
+        Scale = MatchLowercase,
+        Ligatures = CommonOff,
+      }
+      { texgyrecursor }
+  }
+\cs_new_eq:NN \__hust_loadfont_latin_fandol: \__hust_loadfont_latin_gyre:
+\clist_const:Nn \c__hust_name_gyrefeature_clist
+  {
+    Extension = .otf,
+    UprightFont = *-regular,
+    BoldFont = *-bold,
+    ItalicFont = *-italic,
+    BoldItalicFont = *-bolditalic,
+  }
+\cs_new:Npn \__hust_hide_no_script_msg:
+  { \msg_redirect_name:nnn { fontspec } { no-script } { info } }
+\cs_new:Npn \__hust_loadfont_cjk_win:N #1
+  {
+    \setCJKmainfont { SimSun } [ #1, ItalicFont = KaiTi ]
+    \setCJKsansfont { SimHei } [#1]
+    \setCJKmonofont { FangSong } [#1]
+    \setCJKfamilyfont { zhsong } { SimSun } [#1]
+    \setCJKfamilyfont { zhhei } { SimHei } [#1]
+    \setCJKfamilyfont { zhfs } { FangSong } [#1]
+    \setCJKfamilyfont { zhkai } { KaiTi } [#1]
+    \__hust_define_stzhongs:nn { STZhongsong } {#1}
+  }
+\cs_new:Npn \__hust_loadfont_cjk_win:
+  { \__hust_loadfont_cjk_win:N \c__hust_name_fakebold_tl }
+\cs_new_protected:Npn \__hust_loadfont_cjk_mac:
+  {
+    \__hust_hide_no_script_msg:
+    \setCJKmainfont { Songti~SC~Light }
+      [
+        BoldFont = Songti~SC~Bold,
+        ItalicFont = Kaiti~SC,
+        BoldItalicFont = Kaiti~SC~Bold,
+      ]
+    \setCJKsansfont { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+    \setCJKmonofont { STFangsong }
+    \setCJKfamilyfont { zhsong } { Songti~SC~Light } [ BoldFont = Songti~SC~Bold ]
+    \setCJKfamilyfont { zhhei } { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+    \setCJKfamilyfont { zhfs } { STFangsong }
+    \setCJKfamilyfont { zhkai } { Kaiti~SC } [ BoldFont = Kaiti~SC~Bold ]
+  }
+\cs_new:Npn \__hust_loadfont_cjk_macoffice:n #1
+  {
+    \setCJKmainfont { Simsun.ttc } [ ItalicFont = Kaiti.ttf, #1 ]
+    \setCJKsansfont { SimHei.ttf } [#1]
+    \setCJKmonofont { Fangsong.ttf } [#1]
+    \setCJKfamilyfont { zhsong } { Simsun.ttc } [#1]
+    \setCJKfamilyfont { zhhei } { SimHei.ttf } [#1]
+    \setCJKfamilyfont { zhfs } { Fangsong.ttf } [#1]
+    \setCJKfamilyfont { zhkai } { Kaiti.ttf } [#1]
+    \__hust_define_stzhongs:nn { \c__hust_path_macoffice_tl STZHONGS.ttf } {#1}
+  }
+\cs_new:Npn \__hust_loadfont_cjk_macoffice:
+  {
+    \__hust_loadfont_cjk_macoffice:n
+      { Path = \c__hust_path_macoffice_tl, \c__hust_name_fakebold_tl }
+  }
+\cs_new_protected:Npn \__hust_loadfont_cjk_fandol:
+  {
+    \__hust_hide_no_script_msg:
+    \setCJKmainfont { FandolSong-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolSong-Bold,
+        ItalicFont = FandolKai-Regular,
+      ]
+    \setCJKsansfont { FandolHei-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolHei-Bold,
+      ]
+    \setCJKmonofont { FandolFang-Regular }
+      [ Extension = .otf ]
+    \setCJKfamilyfont { zhsong } { FandolSong-Regular }
+      [
+        Extension = .otf,
+        BoldFont  = FandolSong-Bold
+      ]
+    \setCJKfamilyfont { zhhei } { FandolHei-Regular }
+      [
+        Extension = .otf,
+        BoldFont = FandolHei-Bold,
+      ]
+    \setCJKfamilyfont { zhfs } { FandolFang-Regular }
+      [ Extension = .otf ]
+    \setCJKfamilyfont { zhkai } { FandolKai-Regular }
+      [ Extension = .otf, \c__hust_name_fakebold_tl ]
+  }
+\cs_new_protected:Npn \__hust_loadfont_cjk_founder:
+  {
+    \sys_if_engine_xetex:T
+      { \xeCJKEditPunctStyle { quanjiao } { optimize-kerning = true } }
+    \sys_if_engine_luatex:T
+      { \defaultCJKfontfeatures { JFM = { zh_CN / { quanjiao, fzpr } } } }
+    \setCJKmainfont { FZShuSong-Z01 }
+      [ BoldFont = FZXiaoBiaoSong-B05, ItalicFont = FZKai-Z03 ]
+    \setCJKsansfont { FZXiHeiI-Z08 } [ BoldFont = FZHei-B01 ]
+    \setCJKmonofont { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhsong } { FZShuSong-Z01 }
+      [ BoldFont = FZXiaoBiaoSong-B05 ]
+    \setCJKfamilyfont { zhhei } { FZHei-B01 }
+      [ \c__hust_name_fakebold_tl ]
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c__hust_name_fakebold_tl ]
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \defaultCJKfontfeatures { }
+  }
+\cs_new_protected:Npn \__hust_loadfont_cjk_noto:
+  {
+    \setCJKmainfont [ \c__hust_name_notofeature_clist ]
+      { NotoSerifCJKsc }
+    \setCJKsansfont [ \c__hust_name_notofeature_clist ]
+      { NotoSansCJKsc  }
+    \setCJKmonofont { Noto~Sans~Mono~CJK~SC }
+    \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC }
+    \setCJKfamilyfont { zhhei } { Noto~Sans~CJK~SC }
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c__hust_name_fakebold_tl ]
+  }
+\cs_new_protected:Npn \__hust_loadfont_cjk_source:
+  {
+    \setCJKmainfont [ \c__hust_name_notofeature_clist ]
+      { SourceHanSerifSC }
+    \setCJKsansfont [ \c__hust_name_notofeature_clist ]
+      { SourceHanSansSC  }
+    \setCJKmonofont { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhsong } { Source~Han~Serif~SC }
+    \setCJKfamilyfont { zhhei } { Source~Han~Sans~SC }
+    \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+    \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+      [ \c__hust_name_fakebold_tl ]
+  }
+\tl_const:Nn \c__hust_name_fakebold_tl { AutoFakeBold = 2.17 }
+\clist_const:Nn \c__hust_name_notofeature_clist
+  {
+    Extension = .otf,
+    UprightFont = *-Regular,
+    BoldFont = *-Bold,
+    ItalicFont = *-Regular,
+    BoldItalicFont = *-Bold,
+    ItalicFeatures = FakeSlant,
+    BoldItalicFeatures = FakeSlant,
+  }
+\tl_new:N \l__hust_name_stzhongsopts_tl
+\tl_set_eq:NN \l__hust_name_stzhongsopts_tl \c__hust_name_fakebold_tl
+\tl_new:N \l__hust_name_stzhongsfile_tl
+\cs_new:Npn \__hust_define_stzhongs:nn #1#2
+  {
+    \tl_set:Nn \l__hust_name_stzhongsfile_tl {#1}
+    \tl_set:Nn \l__hust_name_stzhongsopts_tl {#2}
+  }
+\cs_new:Npn \__hust_loadfont_stzhongs:
+  {
+    \__hust_loadfont_stzhongs:V \l__hust_name_stzhongsfile_tl
+  }
+\cs_new_protected:Npn \__hust_loadfont_stzhongs:n #1
+  {
+    \fontspec_font_if_exist:nTF { #1 }
+      {
+        \newCJKfontfamily \__hust_stzhongs: { #1 }
+          [ \l__hust_name_stzhongsopts_tl ]
+      }
+      {
+        \bool_if:NTF \g__hust_font_dir_bool
+          {
+            \newCJKfontfamily \__hust_stzhongs: { #1 }
+              [ Path = \g__hust_font_dir_tl, \c__hust_name_fakebold_tl ]
+          }
+          {
+            \cs_set_eq:NN \__hust_stzhongs: \rmfamily
+            \__hust_warning:n { missing-stzhongs }
+          }
+      }
+  }
+\__hust_msg_new:nn { missing-stzhongs }
+  {
+    "STZHONGS.TTF"~ is~ not~ found~ in~ your~ system.\\
+    The~ font~ is~ normally~ distributed~ with~ MS~ Windows.~
+    I~ have~ used~ songti~ for~ substitution.
+  }
+\cs_generate_variant:Nn \__hust_loadfont_stzhongs:n { V }
+\cs_new:Npn \__hust_define_math_font:nn #1#2
+  {
+    \cs_new:cpn { __hust_loadfont_math_ #1 : }
+      { \__um_setmathfont:nn { } {#2} }
+  }
+\clist_map_inline:nn
+  {
+    { asana } { Asana-Math.otf },
+    { fira } { FiraMath-Regular.otf },
+    { garamond } { Garamond-Math.otf },
+    { lm } { latinmodern-math.otf },
+    { libertinus } { LibertinusMath-Regular.otf },
+    { stix } { STIXMath-Regular.otf },
+    { bonum } { texgyrebonum-math.otf },
+    { dejavu } { texgyredejavu-math.otf },
+    { pagella } { texgyrepagella-math.otf },
+    { schola } { texgyreschola-math.otf },
+    { termes } { texgyretermes-math.otf },
+  }
+  { \__hust_define_math_font:nn #1 }
+\cs_new:Npn \__hust_loadfont_math_cambria:
+  {
+    \bool_if:NTF \g__hust_font_dir_bool
+      {
+        \__um_setmathfont:nn
+          { Path = \g__hust_font_dir_tl/, FontIndex = 1 }
+          { cambria.ttc }
+      }
+      { \__um_setmathfont:nn { } { Cambria~Math } }
+  }
+\cs_new:Npn \__hust_loadfont_math_xits:
+  {
+    \bool_if:NTF \g__hust_opt_math_int_bool
+      { \tl_set:Nn \l__hust_tmpa_tl { 8 } }
+      { \tl_clear:N \l__hust_tmpa_tl }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = \l__hust_tmpa_tl,
+        BoldFont = XITSMath-Bold,
+      }
+      { XITSMath-Regular }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = 1,
+        range = {cal, bfcal},
+      }
+      { XITSMath-Regular }
+  }
+\cs_new:Npn \__hust_loadfont_math_newcm:
+  {
+    \bool_if:NTF \g__hust_opt_math_int_bool
+      { \tl_set:Nn \l__hust_tmpa_tl { 2 } }
+      { \tl_clear:N \l__hust_tmpa_tl }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = \l__hust_tmpa_tl,
+      }
+      { NewCMMath-Book }
+    \__um_setmathfont:nn
+      {
+        Extension = .otf,
+        StylisticSet = 1,
+        range = {scr,bfscr},
+      }
+      { NewCMMath-Book }
+    \__fontspec_main_setmathrm:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        BoldFont = *-Bold,
+        ItalicFont = *-BookItalic,
+        BoldItalicFont = *-BoldItalic,
+      }
+      { NewCM10 }
+    \__fontspec_main_setmathsf:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        BoldFont = *-Bold,
+        ItalicFont = *-BookOblique,
+        BoldItalicFont = *-BoldOblique,
+      }
+      { NewCMSans10 }
+    \__fontspec_main_setmathtt:nn
+      {
+        Extension = .otf,
+        UprightFont = *-Book,
+        ItalicFont = *-BookItalic,
+        BoldFont = *-Bold,
+        BoldItalicFont = *-BoldOblique,
+      }
+      { NewCMMono10 }
+  }
+\cs_set_eq:NN \__hust_loadfont_math_none: \tex_relax:D
+\cs_new_protected:Npn \__hust_loadfont:
+  {
+    \use:c { __hust_loadfont_latin_ \g__hust_font_latin_tl : }
+    \use:c { __hust_loadfont_cjk_ \g__hust_font_cjk_tl : }
+    \NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+    \NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+    \NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+    \NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+  }
+\__hust_loadfont:
+\ctex_at_end_preamble:n { \__hust_loadfont_stzhongs: }
+\fancyhf {}
+\color_set:nn { headfoot } { red }
+\cs_new_protected:Npn \__hust_draw_hf_hline:n #1
+  {
+    { \color_select:n { headfoot } \tex_hrule:D height #1 }
+  }
+    \chead
+      {
+        \zihao{3} \ziju{0.75} \bfseries \kaishu
+        \color_group_begin:
+        \color_select:n { headfoot }
+        \c__hust_header_tl
+        \color_group_end:
+      }
+\tl_set:Nn { \headrulewidth } { 1 pt }
+\tl_set:Nn { \headrule }
+  {
+    \skip_vertical:n { 3 pt }
+    \__hust_draw_hf_hline:n \headrulewidth
+    \skip_vertical:n \headrulewidth
+    \__hust_draw_hf_hline:n \headrulewidth
+  }
+\cfoot { \zihao{-5} \thepage }
+\tl_set:Nn { \footrulewidth } { 0.5 pt }
+\tl_set:Nn { \footrule }
+  {
+    \__hust_draw_hf_hline:n \footrulewidth
+    \skip_vertical:n { 3 pt }
+  }
+\pagestyle { fancy }
+\tl_new:N \g__hust_info_title_tl
+\tl_new:N \g__hust_info_degree_type_tl
+\tl_new:N \g__hust_info_author_tl
+\tl_new:N \g__hust_info_major_tl
+\tl_new:N \g__hust_info_supervisor_tl
+\tl_new:N \g__hust_info_date_tl
+\tl_new:N \g__hust_info_clc_tl
+\tl_new:N \g__hust_info_student_id_tl
+\tl_new:N \g__hust_info_school_id_tl
+\tl_new:N \g__hust_info_secret_tl
+\tl_new:N \g__hust_info_title_en_tl
+\tl_new:N \g__hust_info_author_en_tl
+\tl_new:N \g__hust_info_major_en_tl
+\tl_new:N \g__hust_info_supervisor_en_tl
+\tl_new:N \g__hust_info_date_en_tl
+\tl_new:N \g__hust_info_degree_en_tl
+\seq_new:N \g__hust_info_committee_seq
+\tl_new:N \l__hust_info_title_sanitized_tl
+\tl_new:N \l__hust_info_title_en_sanitized_tl
+\cs_new_protected:Npn \__hust_set_title:nn #1#2
+  {
+    \tl_gset:cn { g__hust_info_ #1 _tl } { #2 }
+    \tl_set:cn { l__hust_info_ #1 _sanitized_tl } { #2 }
+    \tl_replace_all:cnn { l__hust_info_ #1 _sanitized_tl } { \\ } { ~ }
+    \regex_replace_all:nnc
+      { \s+ } { \ }
+      { l__hust_info_ #1 _sanitized_tl }
+    \regex_replace_all:nnc
+      { ([\x{4e00}-\x{9fff}]) \s+ ([\x{4e00}-\x{9fff}]) } { \1 \2 }
+      { l__hust_info_ #1 _sanitized_tl }
+  }
+\cs_new:Npn \__hust_set_date:n #1
+  {
+    \__hust_set_date_aux:w #1 \q_stop
+  }
+\cs_new_protected:Npn \__hust_set_date_aux:w #1 - #2 - #3 \q_stop
+  {
+    \tl_gset:Nn \g__hust_info_date_tl { {#1} 年 {#2} 月 {#3} 日 }
+    \tl_gset:Nn \g__hust_info_date_en_tl
+      { \clist_item:Nn \c__hust_month_clist {#2},~ {#1} }
+  }
+\clist_const:Nn \c__hust_month_clist
+  {
+    January, February, March, April, May, June,
+    July, August, September, October, November, December,
+  }
+\keys_define:nn { hust / info }
+  {
+    title .tl_gset:N = \g__hust_info_title_tl,
+    title* .tl_gset:N = \g__hust_info_title_en_tl,
+    degree .choices:nn =
+      { academic, professional }
+      {
+        \tl_gset_eq:NN \g__hust_info_degree_tl \l_keys_choice_tl
+      },
+    degree .default:n = { academic },
+    degree* .tl_gset:N = \g__hust_info_degree_en_tl,
+    author .tl_gset:N = \g__hust_info_author_tl,
+    author* .tl_gset:N = \g__hust_info_author_en_tl,
+    major .tl_gset:N = \g__hust_info_major_tl,
+    major* .tl_gset:N = \g__hust_info_major_en_tl,
+    supervisor .tl_gset:N = \g__hust_info_supervisor_tl,
+    supervisor* .tl_gset:N = \g__hust_info_supervisor_en_tl,
+    date .code:n = { \__hust_set_date:n { #1 } },
+    clc .tl_gset:N = \g__hust_info_clc_tl,
+    student-id .tl_gset:N = \g__hust_info_student_id_tl,
+    school-id .tl_gset:N = \g__hust_info_school_id_tl,
+    secret .tl_gset:N = \g__hust_info_secret_tl,
+    committee .code:n =
+      {
+        \seq_gset_from_clist:Nn \g__hust_info_committee_seq { #1 }
+      },
+  }
+\cs_new_protected:Npn \__hust_spread_box:nn #1#2
+  {
+    \mode_leave_vertical:
+    \hbox_to_wd:nn {#1} { \tl_map_inline:nn {#2} { ##1 \hfil } \unskip }
+  }
+\cs_generate_variant:Nn \__hust_spread_box:nn { no }
+\cs_new_protected:Npn \__hust_center_box:nn #1#2
+  {
+    \mode_leave_vertical:
+    \hbox_to_wd:nn {#1} { \tex_hfil:D #2 \tex_hfil:D }
+  }
+\cs_generate_variant:Nn \__hust_center_box:nn { Vn }
+\cs_new:Npn \__hust_fixed_width_box:nn #1#2
+  { \parbox {#1} {#2} }
+\cs_new:Npn \__hust_fixed_width_center_box:nn #1#2
+  { \parbox {#1} { \centering #2 } }
+\cs_new:Npn \__hust_get_text_width:Nn #1#2
+  {
+    \hbox_set:Nn \l__hust_tmpa_box {#2}
+    \dim_set:Nn #1 { \box_wd:N \l__hust_tmpa_box }
+  }
+\cs_generate_variant:Nn \__hust_get_text_width:Nn { NV }
+\cs_new:Npn \__hust_blank_underline:n #1
+  { \rule [ -0.5 ex ] {#1} { 0.4 pt } }
+\NewTemplateType { hust / component } { 0 }
+\DeclareTemplateInterface { hust / component } { plain } { 0 }
+{
+  content : tokenlist = \c_empty_tl,
+  format : tokenlist = \c_empty_tl,
+  width: skip = \c_zero_skip,
+  height: skip = \c_zero_skip,
+  top-lines : integer = \c_zero_int,
+  top-skip : skip = \c_zero_skip,
+  bottom-skip : skip = \c_zero_skip,
+  bottom-lines : integer = \c_zero_int,
+  align : choice { left, right, center, justify } = center,
 }
-\def\HUST at entitlepage{
-  \begin{center}
-    \parbox[t][4.5cm][t]{.9\textwidth}{
-      \begin{center}
-        \fontsize{16pt}{17.6pt}\selectfont
-        \HUST at enapplyname
-      \end{center}
+\DeclareTemplateCode { hust / component } { plain } { 0 }
+{
+  content = \l__hust_component_content_tl,
+  format = \l__hust_component_format_tl,
+  width = \l__hust_component_width_skip,
+  height = \l__hust_component_height_skip,
+  top-lines = \l__hust_component_top_lines_int,
+  top-skip = \l__hust_component_top_skip,
+  bottom-skip = \l__hust_component_bottom_skip,
+  bottom-lines = \l__hust_component_bottom_lines_int,
+  align =
+    {
+      left =
+        \cs_set_eq:NN \l__hust_component_align: \raggedright,
+      right =
+        \cs_set_eq:NN \l__hust_component_align: \raggedleft,
+      center =
+        \cs_set_eq:NN \l__hust_component_align: \centering,
+      justify =
+        \cs_set_eq:NN \l__hust_component_align: \prg_do_nothing:,
     }
-    \parbox[t][5.7cm][t]{\textwidth}{
-      \begin{center}
-        \fontsize{18pt}{23.4pt}\selectfont
-        \textbf{\textsf{\HUST at entitle}}
-      \end{center}
+}
+{
+  \AssignTemplateKeys
+  \l__hust_component_format_tl
+  \int_step_inline:nn { \l__hust_component_top_lines_int }
+    {
+      \mode_leave_vertical:
+      \tex_par:D
     }
-    \parbox[t][5cm][t]{.8\textwidth}{
-      \begin{center}
-      \setlength{\extrarowheight}{5pt}
-      \fontsize{16pt}{24.0pt}\selectfont
-      \TurnOffTabFontSetting
-      \begin{tabular}{l@{~:~}p{18em}}
-        \HUST at enauthortitle     & {\HUST at enauthor} \\
-        \HUST at enmajortitle      & {\HUST at enmajor} \\
-        \HUST at ensupervisortitle & {\HUST at ensupervisor}
-        \ifthenelse{\equal{\HUST at enasssupervisor}{}}{}{
-          \\ \HUST at enasssupervisortitle & {\HUST at enasssupervisor}
+  \dim_compare:nNnTF { \l__hust_component_height_skip } > { \c_zero_skip }
+    {
+      \box_clear_new:N \l__hust_component_box
+      \vbox_set_to_ht:Nnn \l__hust_component_box { \l__hust_component_height_skip }
+        {
+          \skip_vertical:N \l__hust_component_top_skip
+          \l__hust_component_align:
+          \l__hust_component_content_tl
+          \tex_vfill:D
         }
-      \end{tabular}
-      \TurnOnTabFontSetting
-      \end{center}
+      \box_use:N \l__hust_component_box
     }
-    \parbox[t][7cm][b]{.8\textwidth}{
-      \begin{center}
-      \bfseries
-      \fontsize{14pt}{28.0pt}\selectfont
-      \HUST at enschoolname \\
-      \HUST at enaddress \\
-      \endateformat
-    \end{center}
+    {
+      \skip_vertical:N \l__hust_component_top_skip
+      \l__hust_component_align:
+      \l__hust_component_content_tl
+      \tex_par:D
     }
-  \end{center}
+  \int_step_inline:nn { \l__hust_component_bottom_lines_int }
+    {
+      \mode_leave_vertical:
+      \tex_par:D
+    }
+  \skip_vertical:N \l__hust_component_bottom_skip
+  \skip_vertical:N \c_zero_skip
 }
-\def\HUST at authorization{
-  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST at originaldeclare}
-  \vspace{1cm}
+\NewTemplateType { hust / page } { 0 }
+\DeclareTemplateInterface { hust / page } { title } { 0 }
   {
-    \fontsize{12pt}{24.0pt}\selectfont
-    \indent\HUST at originaldeclaretext
+    prefix : tokenlist,
+    components : commalist,
+    style : tokenlist = empty,
+    format : tokenlist = \linespread { } \selectfont,
+    top-skip : skip = \c_zero_skip,
   }
-  \\[1.9cm]
-  \parbox[t]{\textwidth}{
-    \fontsize{12pt}{18.0pt}\selectfont
-    \TurnOffTabFontSetting
-    \hfill\begin{tabular}{ll}
-        \HUST at zhauthorsig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \TurnOnTabFontSetting
+\DeclareTemplateCode { hust / page } { title } { 0 }
+  {
+    prefix = \l__hust_page_prefix_tl,
+    components = \l__hust_page_components_clist,
+    style = \l__hust_page_style_tl,
+    format = \l__hust_page_format_tl,
+    top-skip = \l__hust_page_top_skip,
   }
-  \\[1.9cm]
-  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST at authtitle}
-  \\[1cm]
   {
-    \fontsize{12pt}{24.0pt}\selectfont
-    \indent\HUST at authorizationtext \\
-    \indent\HUST at authorizationaddon \\
-    \indent\HUST at authorizationcheck
+    \AssignTemplateKeys
+    \skip_vertical:N \l__hust_page_top_skip
+    \group_begin:
+      \exp_args:No \thispagestyle { \l__hust_page_style_tl }
+      \l__hust_page_format_tl
+      \clist_map_inline:Nn \l__hust_page_components_clist
+        {
+          \group_begin:
+          \UseInstance { hust / component } { \l__hust_page_prefix_tl / ##1 }
+          \group_end:
+        }
+    \group_end:
+    \clearpage
   }
-  \\[1.9cm]
-  \hspace{2em}\parbox[t]{.9\textwidth}{
-    \fontsize{12pt}{18.0pt}\selectfont
-    \TurnOffTabFontSetting
-    \begin{tabular}{ll}
-        \HUST at zhauthorsig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \hfill
-    \begin{tabular}{ll}
-        \HUST at zhteachersig & \hspace{2em}\\
-        \HUST at zhdatefield & \hspace{2em}\\
-    \end{tabular}
-    \TurnOnTabFontSetting
+\cs_new_protected:Npn \__hust_declare_component_instance:nnn #1#2#3
+  { \DeclareInstance { hust / component } { #1/#2 } { plain } {#3} }
+\cs_new_protected:Npn \__hust_declare_page_instance:nn #1#2
+  {
+    \DeclareInstance { hust / page } {#1} { title }
+    {
+      prefix = #1,
+      #2,
+    }
   }
-  \vfill
-}
-\def\maketitle{
-  \newgeometry{
-    top=1.2in,
-    bottom=1.2in,
-    left=1in,
-    right=1in,
+\__hust_declare_component_instance:nnn { title zh } { identifiers }
+  {
+    content =
+      {
+        \__hust_title_zh_ids_aux:nn { 6em } { clc } % 3 em
+        \skip_horizontal:n { \linewidth - 19em }
+        \__hust_title_zh_ids_aux:nn { 8em } { student_id } % 4 em
+        \tex_par:D
+        \__hust_title_zh_ids_aux:nn { 5em } { school_id } % 4 em
+        \skip_horizontal:n { \linewidth - 19em }
+        \__hust_title_zh_ids_aux:nn { 8em } { secret } % 4 em
+      },
+    format =
+      {
+        \zihao{-4} \bfseries \rmfamily \songti
+        \__hust_line_spread:n { 1.5 }
+      },
+    bottom-skip = 2 cm,
   }
-  \let\HUST at oldthepage\thepage
-  \ifthenelse{\equal{\HUST at language}{english-draft}}
-  {\def\thepage{Titlepage}}
-  {\def\thepage{封面}}
-  \begin{titlepage}
-    \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-      \thispagestyle{empty}
-      \HUST at zhtitlepage
-      \clearpage
+\cs_new:Npn \__hust_title_zh_ids_aux:nn #1#2
+  {
+    \tl_use:c { c__hust_name_ #2 _tl }
+    \__hust_ul_to_wd:nnn { 1 pt } { #1 }
+      { \tl_use:c { g__hust_info_ #2 _tl } }
+  }
+\__hust_declare_component_instance:nnn { title zh } { logo }
+  {
+    content =
+      {
+        \includegraphics [ height = 1.4 cm ] { hust-title.pdf }
+      },
+    bottom-skip = 0.5 cm,
+  }
+\__ctex_save_font_size:nn { a } { 45 bp } % 大初号
+\__hust_declare_component_instance:nnn { title zh } { type }
+  {
+    content = { \c__hust_name_type_zh_tl },
+    format = { \zihao { a } \bfseries \songti \ziju { 0.1 } },
+    bottom-skip = 0.5 cm,
+  }
+\__hust_declare_component_instance:nnn { title zh } { degree }
+  {
+    content =
+      {
+        (
+        \c__hust_name_academic_zh_tl
+        \tl_if_eq:NnTF \g__hust_info_degree_tl { academic }
+          { \c__hust_checkbox_tl }
+          { \c__hust_emptybox_tl }
+        \skip_horizontal:n { 2.5 em }
+        \c__hust_name_professional_zh_tl
+        \tl_if_eq:NnTF \g__hust_info_degree_tl { professional }
+          { \c__hust_checkbox_tl }
+          { \c__hust_emptybox_tl }
+        )
+      },
+    format = { \zihao { -3 } \c__hust_name_degree_font_tl },
+    bottom-skip = 1.5 cm,
+  }
+\__hust_declare_component_instance:nnn { title zh } { title }
+  {
+    content = { \g__hust_info_title_tl },
+    format =
+      {
+        \zihao { 1 } \bfseries \songti
+        \__hust_line_spread:n { 1.5 }
+      },
+    height = 4.8 cm,
+    bottom-skip = 1 cm,
+  }
+\__hust_declare_component_instance:nnn { title zh } { info }
+  {
+    content =
+      {
+        \tl_set:Nn \arraystretch { 2 }
+        \begin{tabular}{p{5em}@{:\hspace{1em}}l}
+          \c__hust_name_author_zh_tl & \g__hust_info_author_tl \\
+          \c__hust_name_major_zh_tl & \g__hust_info_major_tl \\
+          \c__hust_name_supervisor_zh_tl & \g__hust_info_supervisor_tl \\
+          \c__hust_name_date_tl & \g__hust_info_date_tl \\
+        \end{tabular}
+      },
+    format = { \zihao { -3 } \bfseries \rmfamily \songti },
+    bottom-skip = 30 pt,
+  }
+\__hust_declare_component_instance:nnn { title en } { degree }
+  {
+    content =
+      {
+        \c__hust_name_type_en_tl
+        \tl_if_eq:NnTF \g__hust_info_degree_tl { academic }
+          { \c__hust_name_academic_en_tl }
+          { \c__hust_name_professional_en_tl }
+        \g__hust_info_degree_en_tl
+      },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      },
+    bottom-skip = 5.5 cm,
+  }
+\__hust_declare_component_instance:nnn { title en } { title }
+  {
+    content = { \g__hust_info_title_en_tl },
+    format =
+      {
+        \zihao { -2 } \bfseries \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      },
+    height = 3 cm,
+    bottom-skip = 3 cm,
+  }
+\__hust_declare_component_instance:nnn { title en } { info }
+  {
+    content =
+      {
+        \begin{tabular}{l@{\hspace{0.5em}:\hspace{0.5em}}l}
+          \c__hust_name_author_en_tl & \g__hust_info_author_en_tl \\
+          \c__hust_name_major_en_tl & \g__hust_info_major_en_tl \\
+          \c__hust_name_supervisor_en_tl & \g__hust_info_supervisor_en_tl \\
+        \end{tabular}
+      },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      },
+    bottom-skip = 4 cm,
+  }
+\__hust_declare_component_instance:nnn { title en } { address }
+  {
+    content = { \c__hust_address_tl },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      },
+  }
+\__hust_declare_component_instance:nnn { title en } { date }
+  {
+    content = { \tl_use:N \g__hust_info_date_en_tl },
+    format =
+      {
+        \zihao { -3 } \bfseries \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      },
+  }
+\__hust_declare_component_instance:nnn { committee } { title }
+  {
+    content = { \c__hust_name_committee_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \sffamily
+        \__hust_line_spread:n { 1.5 }
+      },
+    bottom-lines = 1,
+  }
+\tl_const:Nn \c__hust_name_committee_tl { 答辩委员会 }
+\__hust_declare_component_instance:nnn { committee } { members }
+  {
+    content =
+      {
+        \tl_set:Nn \arraystretch { 1.5 }
+        \begin{tabular}
+          { |c|c|c|c| }
+          \hline
+          \c__hust_committee_header_tl \\
+          \hline
+          \int_const:Nn \l__hust_info_committee_count_int
+            { \seq_count:N \g__hust_info_committee_seq }
+          \seq_map_indexed_inline:Nn \g__hust_info_committee_seq
+            {
+              \int_case:nnF { #1 }
+                {
+                  { 1 }
+                    {
+                      \clist_item:Nn \c__hust_committee_role_clist { 1 }
+                      & #2 \\ \hline
+                    }
+                  { 2 }
+                    {
+                      \multirow
+                        { \int_eval:n { \l__hust_info_committee_count_int - 1 } }
+                        { * }
+                        { \clist_item:Nn \c__hust_committee_role_clist { 2 } }
+                      & #2 \\ \cline{2-4}
+                    }
+                  { \l__hust_info_committee_count_int }
+                    { & #2 }
+                }
+                { & #2 \\ \cline{2-4} }
+            }
+            \\ \hline
+        \end{tabular}
+      },
+    format =
+      {
+        \zihao { 4 } \sffamily
+        \__hust_line_spread:n { 1.5 }
+      },
+    top-lines = 1,
+  }
+\tl_const:Nn \c__hust_committee_header_tl
+  { \makebox[3em]{} & \makebox[4em][c]{姓名} & \makebox[4em][c]{职称} & \makebox[12em][c]{单位} }
+\clist_const:Nn \c__hust_committee_role_clist
+  { 主席, 委员, }
+\tl_new:N \l__hust_committee_member_tl
+\__hust_declare_component_instance:nnn { decl } { orig title }
+  {
+    content = { \c__hust_orig_decl_title_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \heiti
+      },
+      bottom-lines = 1,
+  }
+\__hust_declare_component_instance:nnn { decl } { orig text }
+  {
+    content = { \c__hust_orig_decl_text_tl },
+    align = justify,
+    bottom-lines = 1,
+  }
+\__hust_declare_component_instance:nnn { decl } { orig sign }
+  {
+    content =
+      {
+        \clist_map_inline:Nn \c__hust_orig_decl_sign_clist
+          {
+            #1 \\
+          }
+      },
+    align = right,
+    bottom-lines = 3,
+  }
+\__hust_declare_component_instance:nnn { decl } { auth title }
+  {
+    content = { \c__hust_auth_decl_title_tl },
+    format =
+      {
+        \zihao { 3 } \bfseries \heiti
+      },
+    top-lines = 1,
+    bottom-lines = 1,
+  }
+\__hust_declare_component_instance:nnn { decl } { auth text }
+  {
+    content = { \c__hust_auth_decl_text_tl },
+    align = justify,
+    bottom-skip = 0.5 cm,
+  }
+\__hust_declare_component_instance:nnn { decl } { auth secr }
+  {
+    content =
+      {
+        \mode_leave_vertical:
+        \hbox_overlap_right:n
+          { \clist_item:Nn \c__hust_auth_decl_secr_clist { 1 } }
+        \skip_vertical:n { -1.2 cm }
+        \skip_horizontal:n { 6 em }
+        \clist_item:Nn \c__hust_auth_decl_secr_clist { 2 }
+        \tex_par:D
+        \skip_horizontal:n { 6 em }
+        \clist_item:Nn \c__hust_auth_decl_secr_clist { 3 }
+        \tex_par:D
+        \clist_item:Nn \c__hust_auth_decl_secr_clist { 4 }
+      },
+    align = justify,
+    bottom-lines = 1,
+  }
+\__hust_declare_component_instance:nnn { decl } { auth sign }
+  {
+    content =
+      {
+        \clist_map_inline:Nn \c__hust_auth_decl_sign_clist
+          {
+            #1
+            \tex_par:D
+          }
+      },
+    align = justify,
+  }
+\__hust_declare_page_instance:nn { title zh }
+  {
+    components = { identifiers, logo, type, degree, title, info, },
+  }
+\DeclareDocumentCommand \makezhtitle { }
+  {
+    \UseInstance { hust / page } { title zh }
+  }
+
+\__hust_declare_page_instance:nn { title en }
+  {
+    components = { degree, title, info, address, date, },
+  }
+\DeclareDocumentCommand \makeentitle { }
+  {
+    \UseInstance { hust / page } { title en }
+  }
+\__hust_declare_page_instance:nn { committee }
+  {
+    components = { title, members, },
+  }
+\DeclareDocumentCommand \makecommittee { }
+  {
+    \UseInstance { hust / page } { committee }
+  }
+\__hust_declare_page_instance:nn { decl }
+  {
+    components =
+      {
+        orig title, orig text, orig sign,
+        auth title, auth text, auth secr, auth sign,
+      },
+    format =
+      {
+        \zihao { -4 } \rmfamily
+        \__hust_line_spread:n { 1.5 }
+      }
+  }
+\DeclareDocumentCommand \makedecl { }
+  {
+    \UseInstance { hust / page } { decl }
+  }
+\DeclareDocumentCommand \maketitle { }
+  {
+    \makezhtitle
+    \tl_if_eq:NnT \g__hust_degree_type_tl { doctor }
+      { \makecommittee }
+    \makeentitle
+    \makedecl
+  }
+\__hust_appto_cmd:Nn \frontmatter
+  {
+    \pagestyle { fancy }
+    \pagenumbering { Roman }
+    \__hust_toc_chapter_frontmatter:
+  }
+\NewDocumentEnvironment { abstract } { }
+  {
+    \chapter**{\c__hust_name_abstract_zh_tl}
+  }
+  { }
+\NewDocumentEnvironment { abstract* } { }
+  {
+    \chapter**{\c__hust_name_abstract_en_tl}
+  }
+  { }
+\NewDocumentCommand \keywords { s }
+  {
+    \IfBooleanTF { #1 }
+      { \__hust_keywords:nw { en } }
+      { \__hust_keywords:nw { zh } }
+  }
+\cs_new_nopar:Npn \__hust_keywords:nw #1 #2
+  {
+    \zihao{-4} \rmfamily
+    \tex_par:D
+    \skip_horizontal:n \c_zero_skip
+    \tex_par:D
+    \tex_noindent:D
+    \group_begin:
+      \bfseries \heiti
+      \tl_use:c { c__hust_name_keywords_ #1 _tl }
+    \group_end:
+    \c_space_tl
+    #2
+  }
+\tl_set:Nn \contentsname { 目\hspace{1em}录 }
+\keys_set:nn { ctex }
+  {
+    tocdepth = section,
+  }
+\contentsmargin { 0 pt }
+\cs_new_protected:Npn \__hust_toc_format:nnnn #1#2#3#4
+  {
+    \titlecontents
+      { #1 }
+      [ 0 pt ]
+      { #3 }
+      { \thecontentslabel \hspace{#2} #3 }
+      { #3 }
+      { #4 }
+  }
+\cs_new:Npn \ddotfill
+  {
+    \leavevmode \leaders \hbox to .22em {\hss .\hss } \hfill \kern 0pt
+  }
+\cs_new_protected:Npn \__hust_toc_chapter_frontmatter:
+  {
+    \__hust_toc_format:nnnn
+      { chapter }
+      { 1 em}
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \ddotfill \thecontentspage }
     }
-    \thispagestyle{empty}
-    \HUST at entitlepage
-  \end{titlepage}
-  \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \def\thepage{版权页}
-    \thispagestyle{empty}
-    \HUST at authorization
-    \clearpage
+\cs_new_protected:Npn \__hust_toc_chapter_mainmatter:
+  {
+    \__hust_toc_format:nnnn
+      { chapter }
+      { 1 em }
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \hfill (\thecontentspage) }
   }
-  \restoregeometry
-  \let\thepage\HUST at oldthepage
-  \setcounter{page}{1}
-}
-\let\makecover\maketitle
-\def\HUST at zhabstractpage{
-  \chapter*{\HUST at zhabstractname}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-  \HUST at zhabstract \par
-  \vskip 1.2ex
-  \noindent\hei{\HUST at zhkeywordstitle}\hspace{.8em} \HUST at zhkeywords
-  \endgroup
-}
-\def\HUST at enabstractpage{
-  \chapter*{\textsf{\HUST at enabstractname}}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-  \HUST at enabstract \par
-  \vskip 1.2ex
-  \noindent\textbf{\HUST at enkeywordstitle}\hspace{.8em} \HUST at enkeywords
-  \endgroup
-}
-\def\makeabstract{
-  \phantomsection
-  \ifthenelse{\equal{\HUST at language}{chinese}}{
-    \addcontentsline{toc}{chapter}{\HUST at zhabstractnamenospace}
-  }{
-    \addcontentsline{toc}{chapter}{\HUST at enabstractname}
+\cs_new_protected:Npn \__hust_toc_chapter_backmatter:
+  {
+    \__hust_toc_format:nnnn
+      { chapter }
+      { 1 em }
+      { \zihao{4} \bfseries \rmfamily \heiti }
+      { \mdseries \ddotfill (\thecontentspage) }
   }
-  \ifthenelse{\equal{\HUST at language}{english-draft}}{}{
-    \HUST at zhabstractpage
-    \clearpage
+\__hust_toc_format:nnnn
+  { section }
+  { 2 em }
+  { \zihao{4} \rmfamily }
+  { \ddotfill (\thecontentspage) }
+\__hust_appto_cmd:Nn \mainmatter
+  {
+    \pagestyle { fancy }
+    \pagenumbering { arabic }
+    \__hust_toc_chapter_mainmatter:
   }
-  \HUST at enabstractpage
-  \clearpage
-}
-\let\HUST at tableofcontents\tableofcontents
-\def\tableofcontents{
-  \ifthenelse{\equal{\HUST at language}{chinese}}{
-    \pdfbookmark{\contentsnamenospace}{\contentsnamenospace}
-  }{
-    \pdfbookmark{\contentsname}{\contentsname}
+\keys_set:nn { ctex }
+  {
+
+    chapter =
+      {
+        format = \zihao{3} \bfseries \rmfamily \heiti \centering \linespread{1.5},
+        name = {},
+        beforeskip = 15.5 bp,
+        afterskip = 14 bp + \CTEX at chapter@lofskip,
+        number = \arabic{ chapter },
+        pagestyle = fancy,
+        fixskip = true,
+      },
+    section =
+      {
+        format = \zihao{4} \bfseries \rmfamily \heiti \raggedright,
+        numberformat = \rmfamily,
+        beforeskip = 10 bp,
+        afterskip = 7 bp,
+      },
+    subsection =
+      {
+        format = \zihao{-4} \bfseries \rmfamily \heiti \raggedright,
+        numberformat = \rmfamily,
+        beforeskip = 7 bp,
+        afterskip = 4 bp,
+      }
   }
-  \HUST at tableofcontents
-  \clearpage
+\cs_set_eq:NN \__hust_chapter:D \chapter
+\RenewDocumentCommand \chapter { s s o m }
+  {
+    \IfNoValueTF{#3}
+      {
+        \IfBooleanTF{#1}
+          {
+            \__hust_chapter:D*{#4}
+            \IfBooleanT{#2}
+              {  \CTEX at addtocline{chapter}{#4} }
+          }
+          { \__hust_chapter:D{#4} }
+      }
+      {
+        \IfBooleanTF{#1}
+          {
+            \__hust_chapter:D*{#4}
+            \IfBooleanT{#2}
+              {  \CTEX at addtocline{chapter}{#3} }
+          }
+          { \__hust_chapter:D[#3]{#4} }
+
+      }
+  }
+\__hust_appto_cmd:Nn \backmatter
+  {
+    \__hust_toc_chapter_backmatter:
+  }
+\NewDocumentEnvironment { acknowledgements } { }
+  {
+    \chapter**{致\hspace{1em}谢}
+  }
+  { }
+\cs_if_exist:NT \printbibliography
+  {
+    \defbibheading{bibliography}[\refname]{%
+      \chapter**{#1}%
+    }
 }
-\newenvironment{ack}{
-  \clearpage
-  \phantomsection
-  \addcontentsline{toc}{chapter}{\HUST at acknamenospace}
-  \chapter*{\HUST at ackname}
-  \begingroup
-  \fontsize{10.5pt}{13.7pt}\selectfont
-}{
-  \endgroup
-}
-\newenvironment{publications}{
-  \clearpage
-  \ifHUST at inappendix
-    \chapter{\HUST at publicationtitle}
-  \else
-    \phantomsection
-    \addcontentsline{toc}{chapter}{\HUST at publicationtitle}
-    \chapter*{\HUST at publicationtitle}
-  \fi
-  \begin{enumerate}[labelindent=0pt,label={[\arabic*]},itemsep=0.5ex]
-  \fontsize{10.5pt}{10.5pt}\selectfont
-}{
-  \end{enumerate}
-}
-\bibliographystyle{hustthesis}
-\let\HUST at bibliography\bibliography
-\def\bibliography#1{
-  \clearpage
-  \phantomsection
-  \addcontentsline{toc}{chapter}{\bibname}
-  \begingroup
-  \fontsize{10.5pt}{10.5pt}\selectfont
-  \setlength\bibsep{0.5ex}
-  \HUST at bibliography{#1}
-  \endgroup
-}
-\newif\ifHUST at inappendix
-\HUST at inappendixfalse
-\newif\ifHUST at appendix@resetmainmatter
-\HUST at appendix@resetmainmatterfalse
-\renewenvironment{appendix}{
-  \if at mainmatter
-    \HUST at appendix@resetmainmatterfalse
-  \else
-    \HUST at appendix@resetmainmattertrue
-    \@mainmattertrue
-  \fi
-  \appendixtitletocon
-  \appendices
-  \titleformat{\chapter}
+\__hust_appto_cmd:Nn \appendix
   {
-    \bfseries\HEI
-    \centering
-    \fontsize{18pt}{23.4pt}\selectfont
   }
-  {\appendixname\,\thechapter}
-  {1em}
-  {}
-  \HUST at inappendixtrue
-}{
-  \endappendices
-  \HUST at inappendixfalse
-  \ifHUST at appendix@resetmainmatter
-    \HUST at appendix@resetmainmatterfalse
-    \@mainmatterfalse
-  \else\fi
-}
-\let\HUST at listoffigures\listoffigures
-\def\listoffigures{
-  \clearpage
-  \ifHUST at inappendix
-    \addtocounter{chapter}{1}
-    \def\listfigurename{\appendixname\,\thechapter\hspace{1em}\HUST at listfigurename}
-  \else
-    \def\listfigurename{\HUST at listfigurename}
-  \fi
-  \phantomsection
-  \ifHUST at inappendix
-    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST at listfigurename}
-  \else
-    \addcontentsline{toc}{chapter}{\listfigurename}
-  \fi
-  \HUST at listoffigures
-  \def\listfigurename{\HUST at listfigurename}
-}
-\let\HUST at listoftables\listoftables
-\def\listoftables{
-  \clearpage
-  \ifHUST at inappendix
-    \addtocounter{chapter}{1}
-    \def\listtablename{\appendixname\,\thechapter\hspace{1em}\HUST at listtablename}
-  \else
-    \def\listtablename{\HUST at listtablename}
-  \fi
-  \phantomsection
-  \ifHUST at inappendix
-    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST at listtablename}
-  \else
-    \addcontentsline{toc}{chapter}{\listtablename}
-  \fi
-  \HUST at listoftables
-  \def\listtablename{\HUST at listtablename}
-}
-\def\email#1{
-  \href{mailto:#1}{\texttt{#1}}
-}
-\endinput
+\keys_set:nn { ctex / appendix }
+  {
+    number = \arabic{chapter},
+  }
+\keys_define:nn { hust }
+  {
+    info .meta:nn = { hust / info } {#1},
+    style .meta:nn = { hust / style } {#1}
+  }
+\keys_set_known:nn { hust }
+  {
+    info =
+      {
+        degree = { academic },
+        secret = ,
+        school-id = { 10487 },
+        date =
+          {
+            \int_use:N \c_sys_year_int -
+            \int_use:N \c_sys_month_int -
+            \int_use:N \c_sys_day_int
+          },
+        anonymous-list =
+          {
+            author, student_id, supervisor,
+            author_en, supervisor_en,
+          },
+        committee =
+          {
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+            { &~&~ },
+          }
+      }
+  }
+\NewDocumentCommand \hustsetup { m }
+  { \keys_set:nn { hust } {#1} }
+
+%% 
+%%     This work consists of the files hustthesis.dtx
+%%               and the derived files hustthesis.ins,
+%%                                     hustthesis.cls,
+%%                                     hustthesis-doc.sty,
+%%                                     hustthesis-m.def,
+%%                                     hustthesis-d.def,
+%%                                     hustthesis.cbx,
+%%                                     hustthesis.bbx.
+%% 
 %%
 %% End of file `hustthesis.cls'.

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2025-02-28 22:10:12 UTC (rev 74351)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2025-02-28 22:12:14 UTC (rev 74352)
@@ -1800,7 +1800,6 @@
  'highlightx'		=> '&POST_onelevel',
  'hmtrump'		=> '&POSThmtrump',
  'huffman'		=> '&POST_onelevel',
- 'hustthesis'		=> '&POSThustthesis',
  'hyperxmp'		=> '&POST_do_man',
  'hyph-utf8'		=> '&POSThyph_utf8',
  'ibygrk'		=> '&POSTibygrk',
@@ -2295,6 +2294,7 @@
  'hobby',       'code\.tex|' . $standardtex,
  'hrefhide',    '\.sty|[^c]\.cfg',        # omit ltxdoc.cfg, would be system-wide
  'huawei',	'.*cover-picture\.pdf|' . $standardtex,
+ 'hustthesis',	'hust-title.pdf|' . $standardtex,
  'hvextern',	'hv(?!doctools).*\.sty|\.lua',  # negative lookahead fun
  'hvfloat',	'hvfloat.*\.inc|' . $standardtex,
  'hwemoji',	'hwemoji-assets.pdf|' . $standardtex,
@@ -7406,12 +7406,6 @@
                   "$DEST/fonts/truetype/public/$package");
 }
 
-sub POSThustthesis {
-  print "POST$package - move ref-example.bib\n";
-  &SYSTEM ("$MV $DEST/bibtex/bib/$package/ref-example.bib"
-            . " $DEST/doc/latex/$package/");
-}
-
 sub POSThyph_utf8 {
   print "POST$package - unpack tlpsrc, etc.\n";
   print "*** Before committing from this:\n";



More information about the tex-live-commits mailing list.