texlive[63075] Master/texmf-dist: xduts (19apr22)

commits+karl at tug.org commits+karl at tug.org
Tue Apr 19 00:42:06 CEST 2022


Revision: 63075
          http://tug.org/svn/texlive?view=revision&revision=63075
Author:   karl
Date:     2022-04-19 00:42:06 +0200 (Tue, 19 Apr 2022)
Log Message:
-----------
xduts (19apr22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/xelatex/xduts/README.md
    trunk/Master/texmf-dist/doc/xelatex/xduts/xduts.pdf
    trunk/Master/texmf-dist/source/xelatex/xduts/xduts.dtx
    trunk/Master/texmf-dist/source/xelatex/xduts/xduts.ins
    trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty
    trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls

Modified: trunk/Master/texmf-dist/doc/xelatex/xduts/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/xduts/README.md	2022-04-18 22:41:51 UTC (rev 63074)
+++ trunk/Master/texmf-dist/doc/xelatex/xduts/README.md	2022-04-18 22:42:06 UTC (rev 63075)
@@ -17,10 +17,12 @@
 
 ## Installation
 
-You can install XDUTS by either CTAN or GitHub by following the instructions below. 
+You can install XDUTS from either CTAN or GitHub by following the instructions below. 
 
 ### CTAN
 
+#### TeX Live/MacTeX
+
 Make sure the latest version of TeX Live/MacTeX is installed. Then, you can install XDUTS by running command below. If on Windows, it may be necessary to start a Command Prompt as an Administrator. If on macOS or GNU/Linux, please run the command with `sudo`.
 
 ```shell
@@ -33,6 +35,20 @@
 texdoc xduts
 ```
 
+#### MiKTeX
+
+You can install XDUTS by running command below.
+
+```shell
+miktex packages install xduts
+```
+
+Run command below to open the documentation.
+
+```shell
+texdoc xduts
+```
+
 ### GitHub
 
 Generally speaking, CTAN updates XDUTS slowly. If you want to use the latest version of XDUTS, download this repository and run the following commands to get the corresponding documentation and document class/package files.

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

Modified: trunk/Master/texmf-dist/source/xelatex/xduts/xduts.dtx
===================================================================
--- trunk/Master/texmf-dist/source/xelatex/xduts/xduts.dtx	2022-04-18 22:41:51 UTC (rev 63074)
+++ trunk/Master/texmf-dist/source/xelatex/xduts/xduts.dtx	2022-04-18 22:42:06 UTC (rev 63075)
@@ -1,13 +1,13 @@
 % \iffalse
 %<*driver>
 \ProvidesFile{xduts.dtx}
-[2022/04/11 v0.7.0.0 Xidian University TeX Suite]
+[2022/04/16 v1.2.0.0 Xidian University TeX Suite]
 %</driver>
 %<class|sty>\NeedsTeXFormat{LaTeX2e}
 %<class|sty>\RequirePackage{expl3}
 %<xduugthesis>\ProvidesExplClass{xduugthesis}
 %<xdufont>\ProvidesExplPackage{xdufont}
-%<class|sty>  {2022/04/11}{0.7.0.0}
+%<class|sty>  {2022/04/16}{1.2.0.0}
 %<xdufont>  {Xidian University Font package}
 %<xduugthesis>  {Xidian University Undergraduate Thesis document class}
 %<*driver>
@@ -39,8 +39,8 @@
 \usepackage{multirow}
 \usepackage{makecell}
 % 交叉引用
-\newcommand{\secref}[1]{第\xspace\ref{#1}\xspace{节}}
-\newcommand{\tableref}[1]{\tablename\xspace\ref{#1}\xspace}
+\newcommand{\secrefx}[1]{第\xspace\ref{#1}\xspace 节}
+\newcommand{\tabrefx}[1]{\tablename\xspace\ref{#1}\xspace}
 % 文档类选项
 \newcommand{\optx}[1]{\xspace\opt{#1}\xspace}
 % /name LaTeX3控制序列
@@ -68,8 +68,6 @@
 \newcommand{\valuex}[1]{\xspace\texttt{#1}\xspace}
 % 命令
 \newcommand{\cmdx}[1]{\xspace\texttt{#1}\xspace}
-% 引用
-\newcommand{\secrefx}[1]{第\xspace\ref{#1}\xspace 节}
 % 链接
 \newcommand{\footurl}[1]{\footnote{\url{#1}}}
 \newcommand{\ctanurl}[1]{\href{https://mirrors.ustc.edu.cn/CTAN/#1}{\ttfamily CTAN://#1}}
@@ -143,7 +141,7 @@
 \end{document}
 %</driver>
 % \fi
-% \CheckSum{872}
+% \CheckSum{1068}
 % \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
@@ -213,12 +211,15 @@
 % 中提及的内容本文档将不再提及。
 % \xduts{}中的所有文档类和宏包仅内置了实现功能所必要的宏包,
 % 对于常用的宏包如\pkgx{subfig}、\pkgx{algpseudocodex}、
-% \pkgx{amsmath}、\pkgx{amsthm}和\pkgx{siunitx}等均未内置,
+% \pkgx{amsmath}、\pkgx{amsthm}和\pkgx{siunitx}等\textbf{均未内置},
 % 用户视需求自行加载。
 % 请在最新版\LaTeX{}环境中使用最新版\xduts{},
 % 认真阅读相应文档类/宏包使用说明章节即可使用\xduts{}。
 % \par
 % 相应格式规范均已实现,用户仅需要撰写文章内容即可,请勿随意添加格式修改命令。
+% \changes{v1.1.2.1}{2022/04/15}{增加默认值说明}
+% 部分样式的默认值并不严格符合学校规范,
+% 用户可以结合学校规范并参考\secrefx{功能说明}功能说明自行修改。
 % \subsection{xdufont}
 % \pkgx{xdufont}宏包基于\pkgx{xeCJK},相较于\pkgx{ctex}宏包的主要优势为默认支持宋体粗体、斜体,内置多种字体配置,可任意搭配中/英/数学字体,更加符合校内各种文档的撰写要求。
 % \par
@@ -237,6 +238,7 @@
 % \subsection{xduugthesis}
 % \pkgx{xduugthesis}基于\clsx{ctexbook}文档类,
 % 提供多种字体配置,部分样式可自定义,信息录入便捷。
+% 请在阅读《本科生毕业设计(论文)工作手册》后再使用\pkgx{xduugthesis}。
 % \par
 % 典型的\clsx{xduugthesis}主文件结构应该如下所示:
 % \begin{latexexample}[moretexcs={\xdusetup,\frontmatter,\mainmatter,\chapter,\backmatter},emph={[1]document}]
@@ -256,7 +258,11 @@
 % 部分英文字体切换见\secrefx{英文字体},
 % 论文语言切换见\secrefx{语言配置},
 % 参考文献配置见\secrefx{参考文献配置},
-% 图片配置见\secrefx{图片配置},
+% 页面配置见\secrefx{页面配置},
+% 交叉引用配置见\secrefx{交叉引用配置},
+% Caption配置见\secrefx{Caption配置},
+% 表格配置见\secrefx{表格配置},
+% 算法配置见\secrefx{算法配置},
 % 章节配置见\secrefx{章节配置}。
 % 如需附录,请使用附录环境,具体见\secrefx{附录环境}。
 % 仅支持如下信息录入,具体每个选项的含义见\secrefx{信息录入},如没有部分选项,则删除该行即可。
@@ -284,6 +290,7 @@
 % \par
 % 学会以上用法后即可立即使用\clsx{xduugthesis}文档类了。
 % \section{功能说明}
+% \label{功能说明}
 % 请根据\secrefx{使用说明}中相应文档类/宏包的说明来选择性地阅读本节内容。
 % \subsection{编译}
 % \label{编译}
@@ -332,9 +339,9 @@
 % \label{字体选项}
 % \begin{function}[added=2022-03-06]{style/cjk-font}
 %   \begin{syntax}
-%     \optx{style/cjk-font}=\metax{adobe|fandol|founder|sinotype|(win)|none}
+%     \optx{style/cjk-font}=\metax{adobe|(fandol)|founder|sinotype|win|none}
 %   \end{syntax}
-% 设置中文字体,具体配置见\tableref{tab:cjk-font}。
+% 设置中文字体,具体配置见\tabrefx{tab:cjk-font}。
 % \end{function}
 % \begin{optdesc}
 %   \item[none] 关闭内置中文字体配置,需自行配置中文字体。
@@ -375,11 +382,11 @@
 %   \end{syntax}
 % 设置中文字体伪斜体倾斜程度。默认为\valuex{0.2}。
 % \end{function}
-% \begin{function}[added=2022-03-06]{style/latin-font}
+% \begin{function}[added=2022-03-06,updated=2022-04-13]{style/latin-font}
 %   \begin{syntax}
-%     \optx{style/latin-font}=\metax{(tacn)|thcs|none}
+%     \optx{style/latin-font}=\metax{tacn|thcs|(gyre)|none}
 %   \end{syntax}
-% 设置英文字体,具体配置见\tableref{tab:latin-font}。
+% 设置英文字体,具体配置见\tabrefx{tab:latin-font}。
 % \end{function}
 % \begin{optdesc}
 %   \item[none] 关闭内置英文字体配置,需自行配置英文字体。
@@ -395,6 +402,7 @@
 % \midrule
 % |tacn|\tnote{1}   & Times New Roman     & Arial                 & Courier New           \\
 % |thcs|\tnote{2}   & Times New Roman     & Helvetica             & Courier Std           \\
+% |gyre|            & TeX Gyre Termes     & TeX Gyre Heros        & TeX Gyre Cursor       \\
 % \bottomrule
 % \end{tabularx}
 % \begin{tablenotes}
@@ -407,7 +415,7 @@
 %   \begin{syntax}
 %     \optx{style/math-font}=\metax{asana|cambria|(cm)|fira|garamond|lm|...|termes|xits|none}
 %   \end{syntax}
-% 设置数学字体,具体配置见\tableref{tab:math-font}。除Computer Modern字体外,均使用\pkgx{unicode-math}宏包调用字体。
+% 设置数学字体,具体配置见\tabrefx{tab:math-font}。除Computer Modern字体外,均使用\pkgx{unicode-math}宏包调用字体。
 % \end{function}
 % \changes{v0.1.4.1}{2022/04/04}{数学字体风格介绍}
 % \begin{optdesc}
@@ -481,7 +489,7 @@
 %   \begin{syntax}
 %     \optx{style/en-cjk-font}=\metax{true|(false)}
 %   \end{syntax}
-% 切换字体族时,英文是否使用中文字体。主要作用于封面、章节标题、页眉页脚等。
+% 切换字体族时,英文是否使用中文字体。主要作用于封面、章节标题、caption、页眉页脚等。
 % \end{function}
 % \begin{optdesc}
 %   \item[true] 英文使用相对应字体族的中文字体。
@@ -517,14 +525,67 @@
 %   \end{syntax}
 % 设置参考文献\filex{.bib}文件,多个文件之间需要使用英文半角逗号隔开。
 % \end{function}
-% \subsection{图片配置}
-% \label{图片配置}
+% \subsection{页面配置}
+% \label{页面配置}
+% \begin{function}[added=2022-04-12]{style/symmetric-margin}
+%   \begin{syntax}
+%     \optx{style/symmetric-margin}=\metax{true|(false)}
+%   \end{syntax}
+% 设置左右页边距是否对称。
+% \end{function}
+% \begin{optdesc}
+%   \item[true] 对称。
+%   \item[false] 不对称。
+% \end{optdesc}
+% \subsection{交叉引用配置}
+% \label{交叉引用配置}
+% \begin{function}[added=2022-04-16]{style/ref-add-space}
+%   \begin{syntax}
+%     \optx{style/ref-add-space}=\metax{true|(false)}
+%   \end{syntax}
+% 是否自动调整\tnx{ref}两侧中英文间空白。
+% \end{function}
+% \begin{optdesc}
+%   \item[true] 自动调整\tnx{ref}两侧中英文间空白。未避免产生不正常的空白宽度,请不要在\tnx{ref}两侧输入空格。仅在\optx{language}等于|zh|时有效。
+%   \item[false] 保持原始\tnx{ref}命令效果。
+% \end{optdesc}
+% \subsection{Caption配置}
+% \label{Caption配置}
+% \changes{v1.0.0.0}{2022/04/14}{设置图、表、算法标签与后面标题之间的间距}
+% \begin{function}[added=2022-04-14]{style/caption-label-sep}
+%   \begin{syntax}
+%     \optx{style/caption-label-sep}=\argx{间距}
+%   \end{syntax}
+% 设置图、表、算法标签与后面标题之间的间距,默认值为\valuex{0.75em}。
+% \end{function}
 % \begin{function}[added=2022-04-03]{style/fig-label-sep}
+% 已弃用。
+% \end{function}
+% \subsection{表格配置}
+% \label{表格配置}
+% \changes{v0.10.0.1}{2022/04/13}{补充表格内容字号文档说明}
+% \begin{function}[added=2022-04-13,updated=2022-04-15]{style/table-small-font}
 %   \begin{syntax}
-%     \optx{style/fig-label-sep}=\argx{间距}
+%     \optx{style/table-small-font}=\metax{(true)|false}
 %   \end{syntax}
-% 设置图片标签与后面标题之间的间距,默认值为\valuex{0.75em}。
+% 设置表格内容字号是否为五号。
 % \end{function}
+% \begin{optdesc}
+%   \item[true] 五号。
+%   \item[false] 小四号。
+% \end{optdesc}
+% \subsection{算法配置}
+% \label{算法配置}
+% \begin{function}[added=2022-04-15]{style/algorithm-small-font}
+%   \begin{syntax}
+%     \optx{style/algorithm-small-font}=\metax{(true)|false}
+%   \end{syntax}
+% 设置算法内容字号是否为五号。
+% \end{function}
+% \begin{optdesc}
+%   \item[true] 五号。
+%   \item[false] 小四号。
+% \end{optdesc}
 % \subsection{章节配置}
 % \label{章节配置}
 % \begin{function}[added=2022-04-05]{style/before-skip}
@@ -756,8 +817,8 @@
 % \begin{variable}
 %   {
 %     \l_@@_cjk_font_tl,
-%     \l_@@_fake_bold_str,
-%     \l_@@_fake_slant_str,
+%     \l_@@_fake_bold_tl,
+%     \l_@@_fake_slant_tl,
 %     \l_@@_latin_font_tl,
 %     \l_@@_math_font_tl,
 %     \l_@@_unicode_math_tl,
@@ -768,13 +829,14 @@
 %    \begin{macrocode}
 \tl_new:N \l_@@_cjk_font_tl
 %    \end{macrocode}
+% \changes{v0.8.2.0}{2022/04/12}{修复LaTeX3新接口导致的Overleaf无法编译}
 % 中文字体伪粗体粗细程度。
 %    \begin{macrocode}
-\str_new:N \l_@@_fake_bold_str
+\tl_new:N \l_@@_fake_bold_tl
 %    \end{macrocode}
 % 中文字体伪斜体倾斜程度。
 %    \begin{macrocode}
-\str_new:N \l_@@_fake_slant_str
+\tl_new:N \l_@@_fake_slant_tl
 %    \end{macrocode}
 % 英文字体配置名称。
 %    \begin{macrocode}
@@ -811,15 +873,15 @@
 %    \end{macrocode}
 % 中文字体伪粗体粗细程度。
 %    \begin{macrocode}
-    cjk-fake-bold .str_set:N = \l_@@_fake_bold_str,
+    cjk-fake-bold .tl_set:N = \l_@@_fake_bold_tl,
 %    \end{macrocode}
 % 中文字体伪斜体倾斜程度。
 %    \begin{macrocode}
-    cjk-fake-slant .str_set:N = \l_@@_fake_slant_str,
+    cjk-fake-slant .tl_set:N = \l_@@_fake_slant_tl,
 %    \end{macrocode}
 % 英文字体配置。
 %    \begin{macrocode}
-    latin-font .choices:nn = { tacn, thcs, none }
+    latin-font .choices:nn = { tacn, thcs, gyre, none }
       { \tl_set_eq:NN \l_@@_latin_font_tl \l_keys_choice_tl },
 %    \end{macrocode}
 % 数学字体配置。
@@ -844,18 +906,19 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\keys_set:nn}
+% \changes{v0.9.1.0}{2022/04/13}{修改中英文字体默认配置}
 % 初始设置。
 %    \begin{macrocode}
 \keys_set:nn { xdu }
   {
-    style / cjk-font              = win,
-    style / cjk-fake-bold         = 3,
-    style / cjk-fake-slant        = 0.2,
-    style / latin-font            = tacn,
-    style / math-font             = cm,
-    style / unicode-math          = { },
-    style / font-type             = font,
-    style / font-path             = fonts
+    style / cjk-font       = fandol,
+    style / cjk-fake-bold  = 3,
+    style / cjk-fake-slant = 0.2,
+    style / latin-font     = gyre,
+    style / math-font      = cm,
+    style / unicode-math   = { },
+    style / font-type      = font,
+    style / font-path      = fonts
   }
 %    \end{macrocode}
 % \end{macro}
@@ -925,7 +988,7 @@
 \cs_new:Npn \@@_cfg_cjk_font_sub_fb:n #1
   {
     BoldFont     = { #1 },
-    BoldFeatures = { FakeBold = \l_@@_fake_bold_str }
+    BoldFeatures = { FakeBold = \l_@@_fake_bold_tl }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -935,7 +998,7 @@
 \cs_new:Npn \@@_cfg_cjk_font_sub_fs:n #1
   {
     SlantedFont     = { #1 },
-    SlantedFeatures = { FakeSlant = \l_@@_fake_slant_str }
+    SlantedFeatures = { FakeSlant = \l_@@_fake_slant_tl }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -947,8 +1010,8 @@
     BoldSlantedFont     = { #1 },
     BoldSlantedFeatures =
       {
-        FakeBold  = \l_@@_fake_bold_str,
-        FakeSlant = \l_@@_fake_slant_str
+        FakeBold  = \l_@@_fake_bold_tl,
+        FakeSlant = \l_@@_fake_slant_tl
       }
   }
 %    \end{macrocode}
@@ -959,7 +1022,7 @@
 \cs_new:Npn \@@_cfg_cjk_font_sub_bfs:n #1
   {
     BoldSlantedFont     = { #1 },
-    BoldSlantedFeatures = { FakeSlant = \l_@@_fake_slant_str }
+    BoldSlantedFeatures = { FakeSlant = \l_@@_fake_slant_tl }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -978,7 +1041,7 @@
 \cs_new:Npn \@@_cfg_cjk_font_sub_fi:n #1
   {
     ItalicFont     = { #1 },
-    ItalicFeatures = { FakeSlant = \l_@@_fake_slant_str }
+    ItalicFeatures = { FakeSlant = \l_@@_fake_slant_tl }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -988,7 +1051,7 @@
 \cs_new:Npn \@@_cfg_cjk_font_sub_ifb:n #1
   {
     BoldItalicFont     = { #1 },
-    BoldItalicFeatures = { FakeBold = \l_@@_fake_bold_str }
+    BoldItalicFeatures = { FakeBold = \l_@@_fake_bold_tl }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1000,8 +1063,8 @@
     BoldItalicFont     = { #1 },
     BoldItalicFeatures =
       {
-        FakeBold  = \l_@@_fake_bold_str,
-        FakeSlant = \l_@@_fake_slant_str
+        FakeBold  = \l_@@_fake_bold_tl,
+        FakeSlant = \l_@@_fake_slant_tl
       }
   }
 %    \end{macrocode}
@@ -1207,7 +1270,6 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_set_latin_font:nnn #1#2#3
   {
-    \@@_font_path:
     BoldFont        = { #1 },
     SlantedFont     = { #2 },
     BoldSlantedFont = { #3 },
@@ -1216,6 +1278,22 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_off_latin_ligatures:}
+% \changes{v0.8.3.0}{2022/04/13}{匹配小写字母字符高度}
+% 匹配小写字母字符高度。
+%    \begin{macrocode}
+\cs_new:Npn \@@_set_latin_scale:
+  { Scale = MatchLowercase , }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@_off_latin_ligatures:}
+% \changes{v0.8.3.0}{2022/04/13}{关闭连字}
+% 关闭连字。
+%    \begin{macrocode}
+\cs_new:Npn \@@_off_latin_ligatures:
+  { Ligatures = CommonOff , }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_set_latin_main_font:nnnnn}
 % 配置英文罗马族字体,参数分别为字体名称、字体文件名称(常规、粗体、意大利体、粗意大利体)。
 % \begin{arguments}
@@ -1230,11 +1308,18 @@
   {
     \str_if_eq:NNTF { \l_@@_font_type_tl } { font }
       { \setmainfont { #1 } }
-      { \setmainfont { #2 } [ \@@_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      {
+        \setmainfont { #2 }
+          [
+            \@@_font_path:
+            \@@_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\@@_set_latin_sans_font:nnnnn}
+% \changes{v0.8.3.0}{2022/04/13}{修正英文无衬线族字体字符高度}
 % 配置英文无衬线族字体,参数分别为字体名称、字体文件名称(常规、粗体、意大利体、粗意大利体)。
 % \begin{arguments}
 %   \item 字体名称。
@@ -1247,12 +1332,20 @@
 \cs_new:Npn \@@_set_latin_sans_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l_@@_font_type_tl } { font }
-      { \setsansfont { #1 } }
-      { \setsansfont { #2 } [ \@@_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setsansfont { #1 } [ \@@_set_latin_scale: ] }
+      {
+        \setsansfont { #2 }
+          [
+            \@@_font_path:
+            \@@_set_latin_scale:
+            \@@_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\@@_set_latin_mono_font:nnnnn}
+% \changes{v0.8.3.0}{2022/04/13}{修正英文等宽族字体字符高度并取消连字}
 % 配置英文等宽族字体,参数分别为字体名称、字体文件名称(常规、粗体、意大利体、粗意大利体)。
 % \begin{arguments}
 %   \item 字体名称。
@@ -1265,11 +1358,79 @@
 \cs_new:Npn \@@_set_latin_mono_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l_@@_font_type_tl } { font }
-      { \setmonofont{ #1 } }
-      { \setmonofont{ #2 } [ \@@_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setmonofont{ #1 } [ \@@_set_latin_scale: \@@_off_latin_ligatures: ]}
+      {
+        \setmonofont{ #2 }
+          [
+            \@@_font_path:
+            \@@_set_latin_scale:
+            \@@_off_latin_ligatures:
+            \@@_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_set_latin_main_font:nnnn}
+% \changes{v0.9.0.0}{2022/04/13}{配置TeX Live内置英文罗马族字体}
+% 配置英文罗马族字体,参数分别为字体文件名称(常规、粗体、意大利体、粗意大利体)。
+% \begin{arguments}
+%   \item 常规字体名称。
+%   \item 粗体字体名称。
+%   \item 意大利体字体名称。
+%   \item 粗意大利体字体名称。
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_set_latin_main_font:nnnn #1#2#3#4
+  {
+    \setmainfont { #1 }
+      [
+        \@@_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@_set_latin_sans_font:nnnn}
+% \changes{v0.9.0.0}{2022/04/13}{配置TeX Live内置英文无衬线族字体}
+% 配置英文无衬线族字体,参数分别为字体文件名称(常规、粗体、意大利体、粗意大利体)。
+% \begin{arguments}
+%   \item 常规字体名称。
+%   \item 粗体字体名称。
+%   \item 意大利体字体名称。
+%   \item 粗意大利体字体名称。
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_set_latin_sans_font:nnnn #1#2#3#4
+  {
+    \setsansfont { #1 }
+      [
+        \@@_set_latin_scale:
+        \@@_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@_set_latin_mono_font:nnnn}
+% \changes{v0.9.0.0}{2022/04/13}{配置TeX Live内置英文等宽族字体}
+% 配置英文等宽族字体,参数分别为字体文件名称(常规、粗体、意大利体、粗意大利体)。
+% \begin{arguments}
+%   \item 常规字体名称。
+%   \item 粗体字体名称。
+%   \item 意大利体字体名称。
+%   \item 粗意大利体字体名称。
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_set_latin_mono_font:nnnn #1#2#3#4
+  {
+    \setmonofont{ #1 }
+      [
+        \@@_set_latin_scale:
+        \@@_off_latin_ligatures:
+        \@@_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_load_latin_font_tacn:}
 % 英文字体配置\valuex{tacn}。
 %    \begin{macrocode}
@@ -1310,6 +1471,30 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_load_latin_font_gyre:}
+% \changes{v0.9.0.0}{2022/04/13}{新增gyre系列英文字体配置}
+% 英文字体配置\valuex{gyre}。
+%    \begin{macrocode}
+\cs_new:Npn \@@_load_latin_font_gyre:
+  {
+    \@@_set_latin_main_font:nnnn
+      { texgyretermes-regular.otf    }
+      { texgyretermes-bold.otf       }
+      { texgyretermes-italic.otf     }
+      { texgyretermes-bolditalic.otf }
+    \@@_set_latin_sans_font:nnnn
+      { texgyreheros-regular.otf     }
+      { texgyreheros-bold.otf        }
+      { texgyreheros-italic.otf      }
+      { texgyreheros-bolditalic.otf  }
+    \@@_set_latin_mono_font:nnnn
+      { texgyrecursor-regular.otf    }
+      { texgyrecursor-bold.otf       }
+      { texgyrecursor-italic.otf     }
+      { texgyrecursor-bolditalic.otf }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_load_latin_font_none:}
 % 英文字体配置\valuex{none}。
 %    \begin{macrocode}
@@ -1608,7 +1793,9 @@
 %     \l_@@_lang_tl,
 %     \l_@@_bib_tool_tl,
 %     \l_@@_bib_file_clist,
-%     \l_@@_fig_label_sep_tl,
+%     \l_@@_cap_label_sep_tl,
+%     \l_@@_tab_small_bool,
+%     \l_@@_alg_small_bool,
 %     \l_@@_before_skip_clist,
 %     \l_@@_after_skip_clist,
 %     \l_@@_chap_tl,
@@ -1616,7 +1803,8 @@
 %     \l_@@_subsec_tl,
 %     \l_@@_subsubsec_tl,
 %     \l_@@_para_tl,
-%     \l_@@_subpara_tl
+%     \l_@@_subpara_tl,
+%     \l_@@_sym_mgn_bool
 %   }
 % 英文是否使用中文字体。
 %    \begin{macrocode}
@@ -1634,10 +1822,22 @@
 %    \begin{macrocode}
 \clist_new:N \l_@@_bib_file_clist
 %    \end{macrocode}
-% 图片标签与后面标题之间的间距。
+% 是否在\tnx{ref}两侧自动调整中英文间空白。
 %    \begin{macrocode}
-\tl_new:N \l_@@_fig_label_sep_tl
+\tl_new:N \l_@@_ref_add_space
 %    \end{macrocode}
+% 标签与后面标题之间的间距。
+%    \begin{macrocode}
+\tl_new:N \l_@@_cap_label_sep_tl
+%    \end{macrocode}
+% 设置表格字号是否为五号。
+%    \begin{macrocode}
+\bool_new:N \l_@@_tab_small_bool
+%    \end{macrocode}
+% 设置算法字号是否为五号。
+%    \begin{macrocode}
+\bool_new:N \l_@@_alg_small_bool
+%    \end{macrocode}
 % 设置章节标题前后的垂直间距。
 %    \begin{macrocode}
 \clist_new:N \l_@@_before_skip_clist
@@ -1652,6 +1852,10 @@
 \tl_new:N \l_@@_para_tl
 \tl_new:N \l_@@_subpara_tl
 %    \end{macrocode}
+% 设置页边距是否对称。
+%    \begin{macrocode}
+\bool_new:N \l_@@_sym_mgn_bool
+%    \end{macrocode}
 % \end{variable}
 % \begin{macro}{\keys_define:nn}
 % 定义样式键值。
@@ -1677,10 +1881,22 @@
 %    \begin{macrocode}
     bib-resource .clist_set:N = \l_@@_bib_file_clist,
 %    \end{macrocode}
-% 图片标签与后面标题之间的间距。
+% 是否在\tnx{ref}两侧自动调整中英文间空白。
 %    \begin{macrocode}
-    fig-label-sep .tl_set:N = \l_@@_fig_label_sep_tl,
+    ref-add-space .bool_set:N = \l_@@_ref_add_space,
 %    \end{macrocode}
+% 标签与后面标题之间的间距。
+%    \begin{macrocode}
+    caption-label-sep .tl_set:N = \l_@@_cap_label_sep_tl,
+%    \end{macrocode}
+% 设置表格字号是否为五号。
+%    \begin{macrocode}
+    table-small-font .bool_set:N = \l_@@_tab_small_bool,
+%    \end{macrocode}
+% 设置算法字号是否为五号。
+%    \begin{macrocode}
+    algorithm-small-font .bool_set:N = \l_@@_alg_small_bool,
+%    \end{macrocode}
 % 设置章节标题前的垂直间距。
 %    \begin{macrocode}
     before-skip .clist_set:N = \l_@@_before_skip_clist,
@@ -1696,7 +1912,11 @@
     subsec-zihao .tl_set:N = \l_@@_subsec_tl,
     subsubsec-zihao .tl_set:N = \l_@@_subsubsec_tl,
     para-zihao .tl_set:N = \l_@@_para_tl,
-    subpara-zihao .tl_set:N = \l_@@_subpara_tl
+    subpara-zihao .tl_set:N = \l_@@_subpara_tl,
+%    \end{macrocode}
+% 设置页边距是否对称。
+%    \begin{macrocode}
+    symmetric-margin .bool_set:N = \l_@@_sym_mgn_bool
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1705,13 +1925,17 @@
 %    \begin{macrocode}
 \keys_set:nn { xdu }
   {
-    style / en-cjk-font   = false,
-    style / language      = zh,
-    style / bib-backend   = biblatex,
-    style / bib-resource  = { },
-    style / fig-label-sep = { 0.75em },
-    style / before-skip   = { 24pt, 18pt, 12pt, 12pt, 12pt, 12pt },
-    style / after-skip    = { 18pt, 12pt, 6pt, 6pt, 6pt, 6pt }
+    style / en-cjk-font          = false,
+    style / language             = zh,
+    style / bib-backend          = biblatex,
+    style / bib-resource         = { },
+    style / ref-add-space        = false,
+    style / caption-label-sep    = { 0.75em },
+    style / table-small-font     = true,
+    style / algorithm-small-font = true,
+    style / before-skip          = { 24pt, 18pt, 12pt, 12pt, 12pt, 12pt },
+    style / after-skip           = { 18pt, 12pt, 6pt, 6pt, 6pt, 6pt },
+    style / symmetric-margin     = false
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1847,10 +2071,10 @@
   }
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\@@_n_chapter_head:nn}
+% \begin{macro}{\@@_n_chapter_head_ii:nn}
 % 新建无编号章节并添加页眉和书签并单独设置标题样式。
 %    \begin{macrocode}
-\cs_new:Npn \@@_n_chapter_head:nn #1#2
+\cs_new:Npn \@@_n_chapter_head_ii:nn #1#2
   {
     {
       \ctexset { chapter / format = { #2 } }
@@ -1859,6 +2083,22 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_n_chapter_head:nn}
+% \changes{v1.1.4.0}{2022/04/16}{新建无编号章节并单独添加页眉和书签}
+% 新建无编号章节并添加页眉和书签,多用于章节标题为2个汉字的情况。
+% \begin{arguments}
+%   \item 书签和页眉处。
+%   \item 章节标题处。
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_n_chapter_head:nn #1#2
+  {
+    \@@_add_bookmark:n { #1 }
+    \chapter*          { #2 }
+    \markboth          { #1 } { }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_n_chapter_head_toc:n}
 % 新建无编号章节并添加目录及页眉。
 %    \begin{macrocode}
@@ -1865,11 +2105,27 @@
 \cs_new:Npn \@@_n_chapter_head_toc:n #1
   {
     \@@_add_toc:n { #1 }
-    \chapter*     { #1 }
-    \markboth     { #1 } { }
+    \chapter* { #1 }
+    \markboth { #1 } { }
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_n_chapter_head_toc:nn}
+% \changes{v1.1.4.0}{2022/04/16}{新建无编号章节并单独添加目录及页眉}
+% 新建无编号章节并添加目录及页眉,多用于章节标题为2个汉字的情况。
+% \begin{arguments}
+%   \item 目录、书签、页眉处。
+%   \item 章节标题处。
+% \end{arguments}
+%    \begin{macrocode}
+\cs_new:Npn \@@_n_chapter_head_toc:nn #1#2
+  {
+    \@@_add_toc:n { #1 }
+    \chapter* { #2 }
+    \markboth { #1 } { }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_typeout_keywords:nNn}
 % 排版关键词。
 % \begin{arguments}
@@ -1913,12 +2169,26 @@
   }
 \savegeometry { main }
 %    \end{macrocode}
-% 封面页面:上2.5厘米、下2.5厘米、内侧3厘米、外侧2厘米。
+% 左右对称正文页面:上3厘米、下2厘米、内侧3厘米、外侧3厘米;页眉2厘米;页脚1厘米。
 %    \begin{macrocode}
 \newgeometry
   {
+    top    = 3cm,
+    bottom = 2cm,
+    inner  = 3cm,
+    outer  = 3cm,
+    head   = 2cm,
+    foot   = 1cm
+  }
+\savegeometry { main-sym }
+%    \end{macrocode}
+% 封面页面:上2.5厘米、下2厘米、内侧3厘米、外侧2厘米。
+% \changes{v0.10.3.0}{2022/04/14}{修复封面超页}
+%    \begin{macrocode}
+\newgeometry
+  {
     top    = 2.5cm,
-    bottom = 2.5cm,
+    bottom = 2cm,
     inner  = 3cm,
     outer  = 2cm
   }
@@ -1925,6 +2195,18 @@
 \savegeometry { cover }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\@@_load_main_geometry:}
+% \changes{v0.8.0.0}{2022/04/12}{根据用户配置加载正文页边距配置}
+% 根据用户配置加载正文页边距配置。
+%    \begin{macrocode}
+\cs_new:Npn \@@_load_main_geometry:
+  {
+    \bool_if:NTF \l_@@_sym_mgn_bool
+      { \loadgeometry { main-sym } }
+      { \loadgeometry { main     } }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \subsubsection{页眉页脚}
 % \begin{macro}{\chaptermark}
 % 设置奇数页页眉为章标题。
@@ -2174,14 +2456,114 @@
 \renewcommand { \theequation } { \thechapter - \arabic { equation } }
 %    \end{macrocode}
 % \end{macro}
-% \subsection{图片}
+% \subsection{算法}
+% \begin{macro}{\ALG at name,\algorithmcfname}
+% \changes{v1.1.1.0}{2022/04/15}{汉化算法标签名称}
+% 算法标签名称。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \clist_map_inline:nn
+      {
+        { \algorithmname   },
+        { \ALG at name        },
+        { \algorithmcfname }
+      }
+      { \cs_set:Npn #1 { \@@_lang_switch:nn { 算法 } { Algorithm } } }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thealgorithm,\floatplacement}
+% \changes{v0.10.1.0}{2022/04/13}{重定义算法编号样式}
+% \changes{v0.10.2.0}{2022/04/14}{修正算法环境未加载导致的无法编译}
+% \changes{v0.10.4.0}{2022/04/14}{修正\pkgx{algorithm}算法编号样式}
+% \changes{v1.0.1.0}{2022/04/14}{修改\pkgx{algorithm}算法浮动体默认浮动位置}
+% \changes{v1.1.2.0}{2022/04/15}{检测是否加载\pkgx{algorithm}}
+% 重定义\pkgx{algorithm}宏包算法编号样式并修改默认浮动位置。
+%    \begin{macrocode}
+\PassOptionsToPackage { chapter } { algorithm }
+\ctex_at_end_preamble:n
+  {
+    \@ifpackageloaded { algorithm }
+      {
+        \cs_if_exist:NT \thealgorithm
+          {
+            \floatplacement { algorithm } { tbp }
+            \cs_set:Npn \thealgorithm { \thechapter . \arabic { algorithm } }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewenvironment}
+% \changes{v1.1.0.0}{2022/04/15}{设置\pkgx{algorithm}算法内容字号}
+% 设置\pkgx{algorithm}算法内容字号。
+%    \begin{macrocode}
+            \bool_if:NT \l_@@_alg_small_bool
+              {
+                \renewenvironment { algorithm }
+                  {
+                    \@nameuse { fst at algorithm }
+                    \@float at setevery { algorithm }
+                    \ctex_gadd_ltxhook:nn
+                      { cmd/@floatboxreset/after }
+                      { \zihao { 5 } }
+                    \@float { algorithm }
+                  }
+                  { \float at end }
+              }
+          }
+      }
+      { }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thealgocf}
+% \changes{v0.10.4.0}{2022/04/14}{修正\pkgx{algorithm2e}算法编号样式}
+% \changes{v1.1.2.0}{2022/04/15}{检测是否加载\pkgx{algorithm2e}}
+% 重定义\pkgx{algorithm2e}宏包算法编号样式。
+%    \begin{macrocode}
+\PassOptionsToPackage { algochapter } { algorithm2e }
+\ctex_at_end_preamble:n
+  {
+    \@ifpackageloaded { algorithm2e }
+      {
+        \cs_if_exist:NT \thealgocf
+          {
+            \cs_set:Npn \thealgocf { \thechapter . \arabic { algocf } }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\renewenvironment}
+% \changes{v1.0.3.0}{2022/04/15}{修改\pkgx{algorithm2e}算法浮动体默认浮动位置}
+% 修改\pkgx{algorithm2e}算法浮动体默认浮动位置。
+%    \begin{macrocode}
+            \renewenvironment { \algocf at envname } [ 1 ] [ tbp ]
+              {
+                \setboolean { algocf at algostar } { false }
+                \setboolean { algocf at procenvironment } { false }
+                \gdef \algocfautorefname { \algorithmautorefname }
+                \begin { algocf at algorithm } [ #1 ] \ignorespaces
+              }
+              { \end { algocf at algorithm } \ignorespacesafterend }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SetAlFnt}
+% \changes{v1.1.0.0}{2022/04/15}{设置\pkgx{algorithm2e}算法内容字号}
+% 设置\pkgx{algorithm2e}算法内容字号。
+%    \begin{macrocode}
+            \bool_if:NT \l_@@_alg_small_bool
+              { \SetAlFnt { \zihao { 5 } } }
+          }
+      }
+      { }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \subsection{Caption}
 % \begin{macro}{\DeclareCaptionLabelSeparator,\DeclareCaptionFont,\captionsetup}
 % \changes{v0.1.2.0}{2022/04/03}{设置图片标签与后面标题之间的间距}
 % \changes{v0.1.3.0}{2022/04/03}{设置图片标签与标题字体字号}
-% 设置图片标签与后面标题之间的间距。
+% 设置图表标签与后面标题之间的间距。
 %    \begin{macrocode}
 \RequirePackage { caption }
-\DeclareCaptionLabelSeparator { customskip } { \hskip \l_@@_fig_label_sep_tl }
+\DeclareCaptionLabelSeparator { customskip } { \hskip \l_@@_cap_label_sep_tl }
 \DeclareCaptionFont { customfont } { \@@_rm_family: \zihao { 5 } }
 \captionsetup
   {
@@ -2190,6 +2572,37 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\captionsetup}
+% \changes{v1.0.4.0}{2022/04/15}{设置\pkgx{algorithm}算法标签与标题字体字号及标签与后面标题之间的间距}
+% \changes{v1.1.3.0}{2022/04/15}{修正\pkgx{algorithm}算法标签字体系列}
+% 设置\pkgx{algorithm}算法标签与标题字体字号及标签与后面标题之间的间距。
+%    \begin{macrocode}
+\captionsetup [ algorithm ]
+  {
+    labelsep  = customskip,
+    labelfont = customfont,
+    font      = customfont
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SetAlgoCaptionSeparator,\SetAlCapNameFnt,\SetAlCapFnt}
+% \changes{v1.0.0.0}{2022/04/14}{修正\pkgx{algorithm2e}算法标签与后面标题之间的间距}
+% \changes{v1.0.4.0}{2022/04/15}{修正\pkgx{algorithm2e}算法标签与标题字体字号}
+% 设置\pkgx{algorithm2e}算法标签与标题字体字号及标签与后面标题之间的间距。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \cs_if_exist:NT \thealgocf
+      {
+        \SetAlgoCaptionSeparator { \hbox_to_wd:nn { \l_@@_cap_label_sep_tl } { } }
+        \SetAlCapNameFnt         { \@@_rm_family: \zihao { 5 } }
+        \SetAlCapFnt             { \@@_rm_family: \zihao { 5 } }
+        \SetAlCapSty             { }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \subsection{图片}
 % \begin{macro}{\PassOptionsToPackage,\captionsetup}
 % \changes{v0.4.2.0}{2022/04/05}{设置子图标签与标题字体字号}
 % 设置子图标签与标题字体字号,支持\pkgx{subfig}和\pkgx{subcaption}宏包。
@@ -2198,6 +2611,23 @@
 \captionsetup [ sub ] { font = customfont }
 %    \end{macrocode}
 % \end{macro}
+% \subsection{表格}
+% \changes{v0.10.0.0}{2022/04/13}{设置表格字号是否为五号}
+% \changes{v1.0.2.0}{2022/04/14}{修复表格五号字无法设定浮动位置}
+% \begin{macro}{table}
+% 设置表格字号是否为五号。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l_@@_tab_small_bool
+      {
+        \renewenvironment { table }
+          { \def\@floatboxreset { \reset at font\small\@setminipage } \@float { table } }
+          { \end at float }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \subsection{超链接和PDF元数据}
 % \begin{macro}{\hyperref}
 % 配置超链接和PDF元数据。
@@ -2220,6 +2650,35 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \subsection{交叉引用}
+% \begin{macro}{\@@_trad_ref:n,\ref}
+% \changes{v1.2.0.0}{2022/04/16}{优化中文环境下\tnx{ref}两侧中英文间空白}
+% 优化中文环境下\tnx{ref}两侧中英文间空白。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l_@@_ref_add_space
+      {
+        \str_if_eq:NNT { \l_@@_lang_tl } { zh }
+          {
+            \RequirePackage { xspace }
+            \xspaceaddexceptions { 。?!,、;:“”‘’—….--~·《》<>_ }
+            \cs_generate_variant:Nn \str_if_in:nnTF { xnTF }
+            \ctex_after_end_preamble:n
+              {
+                \cs_set_eq:NN \@@_trad_ref:n \ref
+                \cs_set:Npn \ref #1
+                  {
+                    \str_if_in:xnTF { \__hyp_get_anchor:n { #1 } } { chapter }
+                      {         \@@_trad_ref:n { #1 }         }
+                      { \xspace \@@_trad_ref:n { #1 } \xspace }
+                  }
+              }
+          }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \subsection{参考文献}
 % \begin{macro}{\@@_begin_document:n}
 % 钩子。
@@ -2251,6 +2710,8 @@
 % 附录环境。
 % \changes{v0.3.0.0}{2022/04/04}{新增附录环境}
 % \changes{v0.3.1.0}{2022/04/04}{修正附录中图表编号样式}
+% \changes{v0.10.2.0}{2022/04/14}{修正附录中算法编号样式}
+% \changes{v0.10.4.0}{2022/04/14}{修正附录中\pkgx{algorithm2e}算法编号样式}
 %    \begin{macrocode}
 \RequirePackage { environ }
 \NewEnviron { appendixes }
@@ -2258,6 +2719,10 @@
     \appendix
     \renewcommand { \thefigure } { \thechapter \arabic { figure } }
     \renewcommand { \thetable  } { \thechapter \arabic { table  } }
+    \cs_if_exist:NT \thealgorithm
+      { \cs_set:Npn \thealgorithm { \thechapter \arabic { algorithm } } }
+    \cs_if_exist:NT \thealgocf
+      { \cs_set:Npn \thealgocf { \thechapter \arabic { algocf } } }
     \BODY
   }
 %    \end{macrocode}
@@ -2368,7 +2833,16 @@
 \cs_generate_variant:Nn \@@_split_title:Nn { NV }
 %    \end{macrocode}
 % \end{macro}
+% \begin{variable}{\l_@@_is_ent_bool,\l_@@_is_wide_bool}
+% \changes{v0.8.1.0}{2022/04/12}{封面导师标签标志位}
+% 是否为校外毕设,是否为宽名称。
+%    \begin{macrocode}
+\bool_new:N \l_@@_is_ent_bool
+\bool_new:N \l_@@_is_wide_bool
+%    \end{macrocode}
+% \end{variable}
 % \begin{macro}{\@@_cover_iii:nnnn}
+% \changes{v0.8.1.0}{2022/04/12}{使用标志位计算论文信息标签宽度}
 % \changes{v0.1.4.0}{2022/04/03}{自动调整论文信息标签宽度}
 % 绘制论文信息并自动调整论文信息标签宽度。
 % \begin{arguments}
@@ -2380,11 +2854,17 @@
 %    \begin{macrocode}
 \ctex_at_end_preamble:n
   {
+    \tl_if_blank:VF \l_@@_supv_dept_str
+      { \bool_set_true:N \l_@@_is_wide_bool }
+    \tl_if_blank:VF \l_@@_supv_ent_str
+      { \bool_set_true:N \l_@@_is_wide_bool }
+    \tl_if_blank:VF \l_@@_supv_sch_str
+      { \bool_set_true:N \l_@@_is_wide_bool }
     \cs_new:Npn \@@_cover_iii:nnnn #1#2#3#4
       {
-        \tl_if_blank:VTF \l_@@_supv_dept_str
+        \bool_if:NTF \l_@@_is_wide_bool
+          { \@@_cover_iii:nnnnn { 6em } { #1 } { #2 } { #3 } { #4 } }
           { \@@_cover_iii:nnnnn { 4em } { #1 } { #2 } { #3 } { #4 } }
-          { \@@_cover_iii:nnnnn { 6em } { #1 } { #2 } { #3 } { #4 } }
       }
   }
 %    \end{macrocode}
@@ -2434,9 +2914,14 @@
     \@@_cover_iii:nnnn { 专业     } { rm } { -3 } { \l_@@_major_str  }
     \@@_cover_iii:nnnn { 学生姓名 } { rm } { -3 } { \l_@@_author_str }
 %    \end{macrocode}
+% \changes{v0.8.1.0}{2022/04/12}{修正封面论文信息标签宽度}
 % 校外毕设,排版校外导师姓名、校内导师姓名。
 %    \begin{macrocode}
-    \tl_if_blank:VTF \l_@@_supv_str
+    \tl_if_blank:VF \l_@@_supv_ent_str
+      { \bool_set_true:N \l_@@_is_ent_bool }
+    \tl_if_blank:VF \l_@@_supv_sch_str
+      { \bool_set_true:N \l_@@_is_ent_bool }
+    \bool_if:NTF \l_@@_is_ent_bool
       {
         \@@_cover_iii:nnnn { 校外导师姓名 } { rm } { -3 } { \l_@@_supv_ent_str }
         \@@_cover_iii:nnnn { 校内导师姓名 } { rm } { -3 } { \l_@@_supv_sch_str }
@@ -2457,15 +2942,18 @@
       }
     \cleardoublepage
 %    \end{macrocode}
+% \changes{v0.8.0.0}{2022/04/12}{支持对称页边距}
 % 更换页面尺寸、页面样式和页码样式。
 %    \begin{macrocode}
-    \loadgeometry  { main  }
+    \@@_load_main_geometry:
     \pagestyle     { plain }
     \pagenumbering { Roman }
 %    \end{macrocode}
 % 中文摘要,宋体小四号。
 %    \begin{macrocode}
-    \@@_n_chapter_head:n { 摘要 }
+    \@@_n_chapter_head:nn
+      { 摘要            }
+      { 摘 { \quad } 要 }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }
@@ -2483,7 +2971,7 @@
 % 英文摘要,Times New Roman字体,小四号。
 % \changes{v0.4.3.0}{2022/04/05}{修正英文摘要标题字体}
 %    \begin{macrocode}
-    \@@_n_chapter_head:nn {ABSTRACT} { \rmfamily \zihao{3} \bfseries \centering }
+    \@@_n_chapter_head_ii:nn {ABSTRACT} { \rmfamily \zihao{3} \bfseries \centering }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }
@@ -2498,12 +2986,15 @@
     }
     \cleardoublepage
 %    \end{macrocode}
+% \changes{v1.1.4.0}{2022/04/16}{为目录章节标题增加间距}
+% \changes{v1.1.5.0}{2022/04/16}{目录中移除目录章节}
 % 目录。
 %    \begin{macrocode}
     \setcounter { tocdepth } { 5 }
-    \tl_set:Nn \contentsname { \@@_lang_switch:nn { 目录 } { Contents } }
-    \@@_add_bookmark:n { \contentsname }
-    \tableofcontents
+    \@@_n_chapter_head:nn
+      { \@@_lang_switch:nn { 目录            } { Contents } }
+      { \@@_lang_switch:nn { 目 { \quad } 录 } { Contents } }
+    \@starttoc { toc }
     \cleardoublepage
   }
 %    \end{macrocode}
@@ -2510,11 +3001,12 @@
 % \end{macro}
 % \subsection{正文}
 % \begin{macro}{\mainmatter}
+% \changes{v0.8.0.0}{2022/04/12}{支持对称页边距}
 % 排版正文部分。
 %    \begin{macrocode}
 \renewcommand{\mainmatter}
   {
-    \loadgeometry  { main   }
+    \@@_load_main_geometry:
     \pagestyle     { plain  }
     \pagenumbering { arabic }
     \dim_set:Nn \parindent { 2\ccwd }
@@ -2528,9 +3020,12 @@
 \renewcommand{\backmatter}
   {
 %    \end{macrocode}
+% \changes{v1.1.4.0}{2022/04/16}{为致谢章节标题增加间距}
 % 致谢。
 %    \begin{macrocode}
-    \@@_n_chapter_head_toc:n { \@@_lang_switch:nn { 致谢 } { Acknowledgements } }
+    \@@_n_chapter_head_toc:nn
+      { \@@_lang_switch:nn { 致谢            } { Acknowledgements } }
+      { \@@_lang_switch:nn { 致 { \quad } 谢 } { Acknowledgements } }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }

Modified: trunk/Master/texmf-dist/source/xelatex/xduts/xduts.ins
===================================================================
--- trunk/Master/texmf-dist/source/xelatex/xduts/xduts.ins	2022-04-18 22:41:51 UTC (rev 63074)
+++ trunk/Master/texmf-dist/source/xelatex/xduts/xduts.ins	2022-04-18 22:42:06 UTC (rev 63075)
@@ -2,23 +2,25 @@
 \askforoverwritefalse
 \preamble
 
-    Copyright (C) 2022--\the\year by @note286 in GitHub
----------------------------------------------------------------------
+Copyright 2022--\the\year by @note286 in GitHub and CTAN
 
-    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
-       http://www.latex-project.org/lppl/lppl-1-3c.txt
-    and 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 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 `author-maintained'.
 
----------------------------------------------------------------------
+The Current Maintainer of this work is @note286 in GitHub and CTAN.
 
+This work consists of the files README.md, xduts.dtx, and xduts.ins
+and the derived files xduts.pdf, xduugthesis.cls, and xdufont.sty.
+
+The copyright of xidian-text.pdf and xidian-logo.pdf is Xidian University.
+
 \endpreamble
 \postamble
 \endpostamble

Modified: trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty	2022-04-18 22:41:51 UTC (rev 63074)
+++ trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty	2022-04-18 22:42:06 UTC (rev 63075)
@@ -6,34 +6,36 @@
 %%
 %% xduts.dtx  (with options: `sty,xdufont')
 %% 
-%%     Copyright (C) 2022--2022 by @note286 in GitHub
-%% ---------------------------------------------------------------------
+%% Copyright 2022--2022 by @note286 in GitHub and CTAN
 %% 
-%%     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
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
-%%     and 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 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 `author-maintained'.
 %% 
-%% ---------------------------------------------------------------------
+%% The Current Maintainer of this work is @note286 in GitHub and CTAN.
 %% 
+%% This work consists of the files README.md, xduts.dtx, and xduts.ins
+%% and the derived files xduts.pdf, xduugthesis.cls, and xdufont.sty.
+%% 
+%% The copyright of xidian-text.pdf and xidian-logo.pdf is Xidian University.
+%% 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplPackage{xdufont}
-  {2022/04/11}{0.7.0.0}
+  {2022/04/16}{1.2.0.0}
   {Xidian University Font package}
 \RequirePackage { xparse, l3keys2e }
 \PassOptionsToPackage { quiet } { xeCJK }
 \RequirePackage { xeCJK           }
 \tl_new:N \l__xdu_cjk_font_tl
-\str_new:N \l__xdu_fake_bold_str
-\str_new:N \l__xdu_fake_slant_str
+\tl_new:N \l__xdu_fake_bold_tl
+\tl_new:N \l__xdu_fake_slant_tl
 \tl_new:N \l__xdu_latin_font_tl
 \tl_new:N \l__xdu_math_font_tl
 \tl_new:N \l__xdu_unicode_math_tl
@@ -44,9 +46,9 @@
     cjk-font .choices:nn =
       { win, adobe, founder, sinotype, fandol, none }
       { \tl_set_eq:NN \l__xdu_cjk_font_tl \l_keys_choice_tl },
-    cjk-fake-bold .str_set:N = \l__xdu_fake_bold_str,
-    cjk-fake-slant .str_set:N = \l__xdu_fake_slant_str,
-    latin-font .choices:nn = { tacn, thcs, none }
+    cjk-fake-bold .tl_set:N = \l__xdu_fake_bold_tl,
+    cjk-fake-slant .tl_set:N = \l__xdu_fake_slant_tl,
+    latin-font .choices:nn = { tacn, thcs, gyre, none }
       { \tl_set_eq:NN \l__xdu_latin_font_tl \l_keys_choice_tl },
     math-font .choices:nn =
       {
@@ -61,14 +63,14 @@
   }
 \keys_set:nn { xdu }
   {
-    style / cjk-font              = win,
-    style / cjk-fake-bold         = 3,
-    style / cjk-fake-slant        = 0.2,
-    style / latin-font            = tacn,
-    style / math-font             = cm,
-    style / unicode-math          = { },
-    style / font-type             = font,
-    style / font-path             = fonts
+    style / cjk-font       = fandol,
+    style / cjk-fake-bold  = 3,
+    style / cjk-fake-slant = 0.2,
+    style / latin-font     = gyre,
+    style / math-font      = cm,
+    style / unicode-math   = { },
+    style / font-type      = font,
+    style / font-path      = fonts
   }
 \cs_new:Npn \__xdu_if_platform_macos:FT #1#2
   { \file_if_exist:nTF { /System/Library/Fonts/Menlo.ttc } { #2 } { #1 } }
@@ -93,12 +95,12 @@
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fb:n #1
   {
     BoldFont     = { #1 },
-    BoldFeatures = { FakeBold = \l__xdu_fake_bold_str }
+    BoldFeatures = { FakeBold = \l__xdu_fake_bold_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fs:n #1
   {
     SlantedFont     = { #1 },
-    SlantedFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    SlantedFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fbfs:n #1
   {
@@ -105,14 +107,14 @@
     BoldSlantedFont     = { #1 },
     BoldSlantedFeatures =
       {
-        FakeBold  = \l__xdu_fake_bold_str,
-        FakeSlant = \l__xdu_fake_slant_str
+        FakeBold  = \l__xdu_fake_bold_tl,
+        FakeSlant = \l__xdu_fake_slant_tl
       }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_bfs:n #1
   {
     BoldSlantedFont     = { #1 },
-    BoldSlantedFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    BoldSlantedFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_i:n #1
   {
@@ -121,12 +123,12 @@
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fi:n #1
   {
     ItalicFont     = { #1 },
-    ItalicFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    ItalicFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_ifb:n #1
   {
     BoldItalicFont     = { #1 },
-    BoldItalicFeatures = { FakeBold = \l__xdu_fake_bold_str }
+    BoldItalicFeatures = { FakeBold = \l__xdu_fake_bold_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fifb:n #1
   {
@@ -133,8 +135,8 @@
     BoldItalicFont     = { #1 },
     BoldItalicFeatures =
       {
-        FakeBold  = \l__xdu_fake_bold_str,
-        FakeSlant = \l__xdu_fake_slant_str
+        FakeBold  = \l__xdu_fake_bold_tl,
+        FakeSlant = \l__xdu_fake_slant_tl
       }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_r:n #1
@@ -250,7 +252,6 @@
 \cs_new:Npn \__xdu_load_cjk_font_none: { }
 \cs_new:Npn \__xdu_set_latin_font:nnn #1#2#3
   {
-    \__xdu_font_path:
     BoldFont        = { #1 },
     SlantedFont     = { #2 },
     BoldSlantedFont = { #3 },
@@ -257,24 +258,73 @@
     ItalicFont      = { #2 },
     BoldItalicFont  = { #3 }
   }
+\cs_new:Npn \__xdu_set_latin_scale:
+  { Scale = MatchLowercase , }
+\cs_new:Npn \__xdu_off_latin_ligatures:
+  { Ligatures = CommonOff , }
 \cs_new:Npn \__xdu_set_latin_main_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
       { \setmainfont { #1 } }
-      { \setmainfont { #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      {
+        \setmainfont { #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 \cs_new:Npn \__xdu_set_latin_sans_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
-      { \setsansfont { #1 } }
-      { \setsansfont { #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setsansfont { #1 } [ \__xdu_set_latin_scale: ] }
+      {
+        \setsansfont { #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_scale:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 \cs_new:Npn \__xdu_set_latin_mono_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
-      { \setmonofont{ #1 } }
-      { \setmonofont{ #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setmonofont{ #1 } [ \__xdu_set_latin_scale: \__xdu_off_latin_ligatures: ]}
+      {
+        \setmonofont{ #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_scale:
+            \__xdu_off_latin_ligatures:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
+\cs_new:Npn \__xdu_set_latin_main_font:nnnn #1#2#3#4
+  {
+    \setmainfont { #1 }
+      [
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+\cs_new:Npn \__xdu_set_latin_sans_font:nnnn #1#2#3#4
+  {
+    \setsansfont { #1 }
+      [
+        \__xdu_set_latin_scale:
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+\cs_new:Npn \__xdu_set_latin_mono_font:nnnn #1#2#3#4
+  {
+    \setmonofont{ #1 }
+      [
+        \__xdu_set_latin_scale:
+        \__xdu_off_latin_ligatures:
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
 \cs_new:Npn \__xdu_load_latin_font_tacn:
   {
     \__xdu_set_latin_main_font:nnnnn
@@ -305,6 +355,24 @@
       { CourierStd-Oblique.otf     }
       { CourierStd-BoldOblique.otf }
   }
+\cs_new:Npn \__xdu_load_latin_font_gyre:
+  {
+    \__xdu_set_latin_main_font:nnnn
+      { texgyretermes-regular.otf    }
+      { texgyretermes-bold.otf       }
+      { texgyretermes-italic.otf     }
+      { texgyretermes-bolditalic.otf }
+    \__xdu_set_latin_sans_font:nnnn
+      { texgyreheros-regular.otf     }
+      { texgyreheros-bold.otf        }
+      { texgyreheros-italic.otf      }
+      { texgyreheros-bolditalic.otf  }
+    \__xdu_set_latin_mono_font:nnnn
+      { texgyrecursor-regular.otf    }
+      { texgyrecursor-bold.otf       }
+      { texgyrecursor-italic.otf     }
+      { texgyrecursor-bolditalic.otf }
+  }
 \cs_new:Npn \__xdu_load_latin_font_none: { }
 \cs_new:Npn \__xdu_load_unicode_math_pkg:
   {

Modified: trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls	2022-04-18 22:41:51 UTC (rev 63074)
+++ trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls	2022-04-18 22:42:06 UTC (rev 63075)
@@ -6,27 +6,29 @@
 %%
 %% xduts.dtx  (with options: `class,xduugthesis')
 %% 
-%%     Copyright (C) 2022--2022 by @note286 in GitHub
-%% ---------------------------------------------------------------------
+%% Copyright 2022--2022 by @note286 in GitHub and CTAN
 %% 
-%%     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
-%%        http://www.latex-project.org/lppl/lppl-1-3c.txt
-%%     and 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 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 `author-maintained'.
 %% 
-%% ---------------------------------------------------------------------
+%% The Current Maintainer of this work is @note286 in GitHub and CTAN.
 %% 
+%% This work consists of the files README.md, xduts.dtx, and xduts.ins
+%% and the derived files xduts.pdf, xduugthesis.cls, and xdufont.sty.
+%% 
+%% The copyright of xidian-text.pdf and xidian-logo.pdf is Xidian University.
+%% 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplClass{xduugthesis}
-  {2022/04/11}{0.7.0.0}
+  {2022/04/16}{1.2.0.0}
   {Xidian University Undergraduate Thesis document class}
 \RequirePackage { xparse, l3keys2e }
 \PassOptionsToPackage { quiet } { xeCJK }
@@ -45,8 +47,8 @@
 \RequirePackage { xeCJKfntef      }
 \RequirePackage { graphicx        }
 \tl_new:N \l__xdu_cjk_font_tl
-\str_new:N \l__xdu_fake_bold_str
-\str_new:N \l__xdu_fake_slant_str
+\tl_new:N \l__xdu_fake_bold_tl
+\tl_new:N \l__xdu_fake_slant_tl
 \tl_new:N \l__xdu_latin_font_tl
 \tl_new:N \l__xdu_math_font_tl
 \tl_new:N \l__xdu_unicode_math_tl
@@ -57,9 +59,9 @@
     cjk-font .choices:nn =
       { win, adobe, founder, sinotype, fandol, none }
       { \tl_set_eq:NN \l__xdu_cjk_font_tl \l_keys_choice_tl },
-    cjk-fake-bold .str_set:N = \l__xdu_fake_bold_str,
-    cjk-fake-slant .str_set:N = \l__xdu_fake_slant_str,
-    latin-font .choices:nn = { tacn, thcs, none }
+    cjk-fake-bold .tl_set:N = \l__xdu_fake_bold_tl,
+    cjk-fake-slant .tl_set:N = \l__xdu_fake_slant_tl,
+    latin-font .choices:nn = { tacn, thcs, gyre, none }
       { \tl_set_eq:NN \l__xdu_latin_font_tl \l_keys_choice_tl },
     math-font .choices:nn =
       {
@@ -74,14 +76,14 @@
   }
 \keys_set:nn { xdu }
   {
-    style / cjk-font              = win,
-    style / cjk-fake-bold         = 3,
-    style / cjk-fake-slant        = 0.2,
-    style / latin-font            = tacn,
-    style / math-font             = cm,
-    style / unicode-math          = { },
-    style / font-type             = font,
-    style / font-path             = fonts
+    style / cjk-font       = fandol,
+    style / cjk-fake-bold  = 3,
+    style / cjk-fake-slant = 0.2,
+    style / latin-font     = gyre,
+    style / math-font      = cm,
+    style / unicode-math   = { },
+    style / font-type      = font,
+    style / font-path      = fonts
   }
 \cs_new:Npn \__xdu_if_platform_macos:FT #1#2
   { \file_if_exist:nTF { /System/Library/Fonts/Menlo.ttc } { #2 } { #1 } }
@@ -106,12 +108,12 @@
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fb:n #1
   {
     BoldFont     = { #1 },
-    BoldFeatures = { FakeBold = \l__xdu_fake_bold_str }
+    BoldFeatures = { FakeBold = \l__xdu_fake_bold_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fs:n #1
   {
     SlantedFont     = { #1 },
-    SlantedFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    SlantedFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fbfs:n #1
   {
@@ -118,14 +120,14 @@
     BoldSlantedFont     = { #1 },
     BoldSlantedFeatures =
       {
-        FakeBold  = \l__xdu_fake_bold_str,
-        FakeSlant = \l__xdu_fake_slant_str
+        FakeBold  = \l__xdu_fake_bold_tl,
+        FakeSlant = \l__xdu_fake_slant_tl
       }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_bfs:n #1
   {
     BoldSlantedFont     = { #1 },
-    BoldSlantedFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    BoldSlantedFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_i:n #1
   {
@@ -134,12 +136,12 @@
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fi:n #1
   {
     ItalicFont     = { #1 },
-    ItalicFeatures = { FakeSlant = \l__xdu_fake_slant_str }
+    ItalicFeatures = { FakeSlant = \l__xdu_fake_slant_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_ifb:n #1
   {
     BoldItalicFont     = { #1 },
-    BoldItalicFeatures = { FakeBold = \l__xdu_fake_bold_str }
+    BoldItalicFeatures = { FakeBold = \l__xdu_fake_bold_tl }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_sub_fifb:n #1
   {
@@ -146,8 +148,8 @@
     BoldItalicFont     = { #1 },
     BoldItalicFeatures =
       {
-        FakeBold  = \l__xdu_fake_bold_str,
-        FakeSlant = \l__xdu_fake_slant_str
+        FakeBold  = \l__xdu_fake_bold_tl,
+        FakeSlant = \l__xdu_fake_slant_tl
       }
   }
 \cs_new:Npn \__xdu_cfg_cjk_font_r:n #1
@@ -263,7 +265,6 @@
 \cs_new:Npn \__xdu_load_cjk_font_none: { }
 \cs_new:Npn \__xdu_set_latin_font:nnn #1#2#3
   {
-    \__xdu_font_path:
     BoldFont        = { #1 },
     SlantedFont     = { #2 },
     BoldSlantedFont = { #3 },
@@ -270,24 +271,73 @@
     ItalicFont      = { #2 },
     BoldItalicFont  = { #3 }
   }
+\cs_new:Npn \__xdu_set_latin_scale:
+  { Scale = MatchLowercase , }
+\cs_new:Npn \__xdu_off_latin_ligatures:
+  { Ligatures = CommonOff , }
 \cs_new:Npn \__xdu_set_latin_main_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
       { \setmainfont { #1 } }
-      { \setmainfont { #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      {
+        \setmainfont { #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 \cs_new:Npn \__xdu_set_latin_sans_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
-      { \setsansfont { #1 } }
-      { \setsansfont { #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setsansfont { #1 } [ \__xdu_set_latin_scale: ] }
+      {
+        \setsansfont { #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_scale:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
 \cs_new:Npn \__xdu_set_latin_mono_font:nnnnn #1#2#3#4#5
   {
     \str_if_eq:NNTF { \l__xdu_font_type_tl } { font }
-      { \setmonofont{ #1 } }
-      { \setmonofont{ #2 } [ \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 } ] }
+      { \setmonofont{ #1 } [ \__xdu_set_latin_scale: \__xdu_off_latin_ligatures: ]}
+      {
+        \setmonofont{ #2 }
+          [
+            \__xdu_font_path:
+            \__xdu_set_latin_scale:
+            \__xdu_off_latin_ligatures:
+            \__xdu_set_latin_font:nnn { #3 } { #4 } { #5 }
+          ]
+      }
   }
+\cs_new:Npn \__xdu_set_latin_main_font:nnnn #1#2#3#4
+  {
+    \setmainfont { #1 }
+      [
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+\cs_new:Npn \__xdu_set_latin_sans_font:nnnn #1#2#3#4
+  {
+    \setsansfont { #1 }
+      [
+        \__xdu_set_latin_scale:
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
+\cs_new:Npn \__xdu_set_latin_mono_font:nnnn #1#2#3#4
+  {
+    \setmonofont{ #1 }
+      [
+        \__xdu_set_latin_scale:
+        \__xdu_off_latin_ligatures:
+        \__xdu_set_latin_font:nnn { #2 } { #3 } { #4 }
+      ]
+  }
 \cs_new:Npn \__xdu_load_latin_font_tacn:
   {
     \__xdu_set_latin_main_font:nnnnn
@@ -318,6 +368,24 @@
       { CourierStd-Oblique.otf     }
       { CourierStd-BoldOblique.otf }
   }
+\cs_new:Npn \__xdu_load_latin_font_gyre:
+  {
+    \__xdu_set_latin_main_font:nnnn
+      { texgyretermes-regular.otf    }
+      { texgyretermes-bold.otf       }
+      { texgyretermes-italic.otf     }
+      { texgyretermes-bolditalic.otf }
+    \__xdu_set_latin_sans_font:nnnn
+      { texgyreheros-regular.otf     }
+      { texgyreheros-bold.otf        }
+      { texgyreheros-italic.otf      }
+      { texgyreheros-bolditalic.otf  }
+    \__xdu_set_latin_mono_font:nnnn
+      { texgyrecursor-regular.otf    }
+      { texgyrecursor-bold.otf       }
+      { texgyrecursor-italic.otf     }
+      { texgyrecursor-bolditalic.otf }
+  }
 \cs_new:Npn \__xdu_load_latin_font_none: { }
 \cs_new:Npn \__xdu_load_unicode_math_pkg:
   {
@@ -435,7 +503,10 @@
 \tl_new:N \l__xdu_lang_tl
 \tl_new:N \l__xdu_bib_tool_tl
 \clist_new:N \l__xdu_bib_file_clist
-\tl_new:N \l__xdu_fig_label_sep_tl
+\tl_new:N \l__xdu_ref_add_space
+\tl_new:N \l__xdu_cap_label_sep_tl
+\bool_new:N \l__xdu_tab_small_bool
+\bool_new:N \l__xdu_alg_small_bool
 \clist_new:N \l__xdu_before_skip_clist
 \clist_new:N \l__xdu_after_skip_clist
 \tl_new:N \l__xdu_chap_tl
@@ -444,6 +515,7 @@
 \tl_new:N \l__xdu_subsubsec_tl
 \tl_new:N \l__xdu_para_tl
 \tl_new:N \l__xdu_subpara_tl
+\bool_new:N \l__xdu_sym_mgn_bool
 \keys_define:nn { xdu / style }
   {
     en-cjk-font .bool_set:N = \l__xdu_en_cjk_font_bool,
@@ -452,7 +524,10 @@
     bib-backend .choices:nn = { bibtex, biblatex }
       { \tl_set_eq:NN \l__xdu_bib_tool_tl \l_keys_choice_tl },
     bib-resource .clist_set:N = \l__xdu_bib_file_clist,
-    fig-label-sep .tl_set:N = \l__xdu_fig_label_sep_tl,
+    ref-add-space .bool_set:N = \l__xdu_ref_add_space,
+    caption-label-sep .tl_set:N = \l__xdu_cap_label_sep_tl,
+    table-small-font .bool_set:N = \l__xdu_tab_small_bool,
+    algorithm-small-font .bool_set:N = \l__xdu_alg_small_bool,
     before-skip .clist_set:N = \l__xdu_before_skip_clist,
     after-skip .clist_set:N = \l__xdu_after_skip_clist,
     chap-zihao .tl_set:N = \l__xdu_chap_tl,
@@ -460,17 +535,22 @@
     subsec-zihao .tl_set:N = \l__xdu_subsec_tl,
     subsubsec-zihao .tl_set:N = \l__xdu_subsubsec_tl,
     para-zihao .tl_set:N = \l__xdu_para_tl,
-    subpara-zihao .tl_set:N = \l__xdu_subpara_tl
+    subpara-zihao .tl_set:N = \l__xdu_subpara_tl,
+    symmetric-margin .bool_set:N = \l__xdu_sym_mgn_bool
   }
 \keys_set:nn { xdu }
   {
-    style / en-cjk-font   = false,
-    style / language      = zh,
-    style / bib-backend   = biblatex,
-    style / bib-resource  = { },
-    style / fig-label-sep = { 0.75em },
-    style / before-skip   = { 24pt, 18pt, 12pt, 12pt, 12pt, 12pt },
-    style / after-skip    = { 18pt, 12pt, 6pt, 6pt, 6pt, 6pt }
+    style / en-cjk-font          = false,
+    style / language             = zh,
+    style / bib-backend          = biblatex,
+    style / bib-resource         = { },
+    style / ref-add-space        = false,
+    style / caption-label-sep    = { 0.75em },
+    style / table-small-font     = true,
+    style / algorithm-small-font = true,
+    style / before-skip          = { 24pt, 18pt, 12pt, 12pt, 12pt, 12pt },
+    style / after-skip           = { 18pt, 12pt, 6pt, 6pt, 6pt, 6pt },
+    style / symmetric-margin     = false
   }
 \NewDocumentCommand \xdusetup { m }
   { \keys_set:nn { xdu } { #1 } }
@@ -523,7 +603,7 @@
     \chapter*          { #1 }
     \markboth          { #1 } { }
   }
-\cs_new:Npn \__xdu_n_chapter_head:nn #1#2
+\cs_new:Npn \__xdu_n_chapter_head_ii:nn #1#2
   {
     {
       \ctexset { chapter / format = { #2 } }
@@ -530,12 +610,24 @@
       \__xdu_n_chapter_head:n { #1 }
     }
   }
+\cs_new:Npn \__xdu_n_chapter_head:nn #1#2
+  {
+    \__xdu_add_bookmark:n { #1 }
+    \chapter*          { #2 }
+    \markboth          { #1 } { }
+  }
 \cs_new:Npn \__xdu_n_chapter_head_toc:n #1
   {
     \__xdu_add_toc:n { #1 }
-    \chapter*     { #1 }
-    \markboth     { #1 } { }
+    \chapter* { #1 }
+    \markboth { #1 } { }
   }
+\cs_new:Npn \__xdu_n_chapter_head_toc:nn #1#2
+  {
+    \__xdu_add_toc:n { #1 }
+    \chapter* { #2 }
+    \markboth { #1 } { }
+  }
 \cs_new:Npn \__xdu_typeout_keywords:nNn #1#2#3
   {
     \str_clear_new:N \l__xdu_keywords_label_str
@@ -565,12 +657,28 @@
 \savegeometry { main }
 \newgeometry
   {
+    top    = 3cm,
+    bottom = 2cm,
+    inner  = 3cm,
+    outer  = 3cm,
+    head   = 2cm,
+    foot   = 1cm
+  }
+\savegeometry { main-sym }
+\newgeometry
+  {
     top    = 2.5cm,
-    bottom = 2.5cm,
+    bottom = 2cm,
     inner  = 3cm,
     outer  = 2cm
   }
 \savegeometry { cover }
+\cs_new:Npn \__xdu_load_main_geometry:
+  {
+    \bool_if:NTF \l__xdu_sym_mgn_bool
+      { \loadgeometry { main-sym } }
+      { \loadgeometry { main     } }
+  }
 \renewcommand { \chaptermark } [ 1 ]
   {
     \markboth
@@ -722,8 +830,66 @@
   }
   { \renewcommand { #1 } { \__xdu_rm_family: \zihao { -4 } } }
 \renewcommand { \theequation } { \thechapter - \arabic { equation } }
+\ctex_at_end_preamble:n
+  {
+    \clist_map_inline:nn
+      {
+        { \algorithmname   },
+        { \ALG at name        },
+        { \algorithmcfname }
+      }
+      { \cs_set:Npn #1 { \__xdu_lang_switch:nn { 算法 } { Algorithm } } }
+  }
+\PassOptionsToPackage { chapter } { algorithm }
+\ctex_at_end_preamble:n
+  {
+    \@ifpackageloaded { algorithm }
+      {
+        \cs_if_exist:NT \thealgorithm
+          {
+            \floatplacement { algorithm } { tbp }
+            \cs_set:Npn \thealgorithm { \thechapter . \arabic { algorithm } }
+            \bool_if:NT \l__xdu_alg_small_bool
+              {
+                \renewenvironment { algorithm }
+                  {
+                    \@nameuse { fst at algorithm }
+                    \@float at setevery { algorithm }
+                    \ctex_gadd_ltxhook:nn
+                      { cmd/@floatboxreset/after }
+                      { \zihao { 5 } }
+                    \@float { algorithm }
+                  }
+                  { \float at end }
+              }
+          }
+      }
+      { }
+  }
+\PassOptionsToPackage { algochapter } { algorithm2e }
+\ctex_at_end_preamble:n
+  {
+    \@ifpackageloaded { algorithm2e }
+      {
+        \cs_if_exist:NT \thealgocf
+          {
+            \cs_set:Npn \thealgocf { \thechapter . \arabic { algocf } }
+            \renewenvironment { \algocf at envname } [ 1 ] [ tbp ]
+              {
+                \setboolean { algocf at algostar } { false }
+                \setboolean { algocf at procenvironment } { false }
+                \gdef \algocfautorefname { \algorithmautorefname }
+                \begin { algocf at algorithm } [ #1 ] \ignorespaces
+              }
+              { \end { algocf at algorithm } \ignorespacesafterend }
+            \bool_if:NT \l__xdu_alg_small_bool
+              { \SetAlFnt { \zihao { 5 } } }
+          }
+      }
+      { }
+  }
 \RequirePackage { caption }
-\DeclareCaptionLabelSeparator { customskip } { \hskip \l__xdu_fig_label_sep_tl }
+\DeclareCaptionLabelSeparator { customskip } { \hskip \l__xdu_cap_label_sep_tl }
 \DeclareCaptionFont { customfont } { \__xdu_rm_family: \zihao { 5 } }
 \captionsetup
   {
@@ -730,8 +896,33 @@
     labelsep = customskip,
     font     = customfont
   }
+\captionsetup [ algorithm ]
+  {
+    labelsep  = customskip,
+    labelfont = customfont,
+    font      = customfont
+  }
+\ctex_at_end_preamble:n
+  {
+    \cs_if_exist:NT \thealgocf
+      {
+        \SetAlgoCaptionSeparator { \hbox_to_wd:nn { \l__xdu_cap_label_sep_tl } { } }
+        \SetAlCapNameFnt         { \__xdu_rm_family: \zihao { 5 } }
+        \SetAlCapFnt             { \__xdu_rm_family: \zihao { 5 } }
+        \SetAlCapSty             { }
+      }
+  }
 \PassOptionsToPackage { font = small } { subfig }
 \captionsetup [ sub ] { font = customfont }
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l__xdu_tab_small_bool
+      {
+        \renewenvironment { table }
+          { \def\@floatboxreset { \reset at font\small\@setminipage } \@float { table } }
+          { \end at float }
+      }
+  }
 \RequirePackage{hyperref}
 \hypersetup
   {
@@ -747,6 +938,28 @@
         pdfauthor  = \l__xdu_author_str
       }
   }
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l__xdu_ref_add_space
+      {
+        \str_if_eq:NNT { \l__xdu_lang_tl } { zh }
+          {
+            \RequirePackage { xspace }
+            \xspaceaddexceptions { 。?!,、;:“”‘’—….--~·《》<>_ }
+            \cs_generate_variant:Nn \str_if_in:nnTF { xnTF }
+            \ctex_after_end_preamble:n
+              {
+                \cs_set_eq:NN \__xdu_trad_ref:n \ref
+                \cs_set:Npn \ref #1
+                  {
+                    \str_if_in:xnTF { \__hyp_get_anchor:n { #1 } } { chapter }
+                      {         \__xdu_trad_ref:n { #1 }         }
+                      { \xspace \__xdu_trad_ref:n { #1 } \xspace }
+                  }
+              }
+          }
+      }
+  }
 \cs_new_protected:Npn \__xdu_begin_document:n #1
   { \ctex_gadd_ltxhook:nn { env/document/begin } { #1 } }
 \__xdu_begin_document:n
@@ -768,6 +981,10 @@
     \appendix
     \renewcommand { \thefigure } { \thechapter \arabic { figure } }
     \renewcommand { \thetable  } { \thechapter \arabic { table  } }
+    \cs_if_exist:NT \thealgorithm
+      { \cs_set:Npn \thealgorithm { \thechapter \arabic { algorithm } } }
+    \cs_if_exist:NT \thealgocf
+      { \cs_set:Npn \thealgocf { \thechapter \arabic { algocf } } }
     \BODY
   }
 \cs_new:Npn \__xdu_cover_i:nn #1#2
@@ -834,13 +1051,21 @@
       }
   }
 \cs_generate_variant:Nn \__xdu_split_title:Nn { NV }
+\bool_new:N \l__xdu_is_ent_bool
+\bool_new:N \l__xdu_is_wide_bool
 \ctex_at_end_preamble:n
   {
+    \tl_if_blank:VF \l__xdu_supv_dept_str
+      { \bool_set_true:N \l__xdu_is_wide_bool }
+    \tl_if_blank:VF \l__xdu_supv_ent_str
+      { \bool_set_true:N \l__xdu_is_wide_bool }
+    \tl_if_blank:VF \l__xdu_supv_sch_str
+      { \bool_set_true:N \l__xdu_is_wide_bool }
     \cs_new:Npn \__xdu_cover_iii:nnnn #1#2#3#4
       {
-        \tl_if_blank:VTF \l__xdu_supv_dept_str
+        \bool_if:NTF \l__xdu_is_wide_bool
+          { \__xdu_cover_iii:nnnnn { 6em } { #1 } { #2 } { #3 } { #4 } }
           { \__xdu_cover_iii:nnnnn { 4em } { #1 } { #2 } { #3 } { #4 } }
-          { \__xdu_cover_iii:nnnnn { 6em } { #1 } { #2 } { #3 } { #4 } }
       }
   }
 \renewcommand{\frontmatter}
@@ -866,7 +1091,11 @@
     \__xdu_cover_iii:nnnn { 学院     } { rm } { -3 } { \l__xdu_dept_str   }
     \__xdu_cover_iii:nnnn { 专业     } { rm } { -3 } { \l__xdu_major_str  }
     \__xdu_cover_iii:nnnn { 学生姓名 } { rm } { -3 } { \l__xdu_author_str }
-    \tl_if_blank:VTF \l__xdu_supv_str
+    \tl_if_blank:VF \l__xdu_supv_ent_str
+      { \bool_set_true:N \l__xdu_is_ent_bool }
+    \tl_if_blank:VF \l__xdu_supv_sch_str
+      { \bool_set_true:N \l__xdu_is_ent_bool }
+    \bool_if:NTF \l__xdu_is_ent_bool
       {
         \__xdu_cover_iii:nnnn { 校外导师姓名 } { rm } { -3 } { \l__xdu_supv_ent_str }
         \__xdu_cover_iii:nnnn { 校内导师姓名 } { rm } { -3 } { \l__xdu_supv_sch_str }
@@ -883,10 +1112,12 @@
           }
       }
     \cleardoublepage
-    \loadgeometry  { main  }
+    \__xdu_load_main_geometry:
     \pagestyle     { plain }
     \pagenumbering { Roman }
-    \__xdu_n_chapter_head:n { 摘要 }
+    \__xdu_n_chapter_head:nn
+      { 摘要            }
+      { 摘 { \quad } 要 }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }
@@ -897,7 +1128,7 @@
       \__xdu_typeout_keywords:nNn { 关键词: } { \l__xdu_keywords_zh_clist } { \qquad }
     }
     \cleardoublepage
-    \__xdu_n_chapter_head:nn {ABSTRACT} { \rmfamily \zihao{3} \bfseries \centering }
+    \__xdu_n_chapter_head_ii:nn {ABSTRACT} { \rmfamily \zihao{3} \bfseries \centering }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }
@@ -909,14 +1140,15 @@
     }
     \cleardoublepage
     \setcounter { tocdepth } { 5 }
-    \tl_set:Nn \contentsname { \__xdu_lang_switch:nn { 目录 } { Contents } }
-    \__xdu_add_bookmark:n { \contentsname }
-    \tableofcontents
+    \__xdu_n_chapter_head:nn
+      { \__xdu_lang_switch:nn { 目录            } { Contents } }
+      { \__xdu_lang_switch:nn { 目 { \quad } 录 } { Contents } }
+    \@starttoc { toc }
     \cleardoublepage
   }
 \renewcommand{\mainmatter}
   {
-    \loadgeometry  { main   }
+    \__xdu_load_main_geometry:
     \pagestyle     { plain  }
     \pagenumbering { arabic }
     \dim_set:Nn \parindent { 2\ccwd }
@@ -924,7 +1156,9 @@
   }
 \renewcommand{\backmatter}
   {
-    \__xdu_n_chapter_head_toc:n { \__xdu_lang_switch:nn { 致谢 } { Acknowledgements } }
+    \__xdu_n_chapter_head_toc:nn
+      { \__xdu_lang_switch:nn { 致谢            } { Acknowledgements } }
+      { \__xdu_lang_switch:nn { 致 { \quad } 谢 } { Acknowledgements } }
     {
       \dim_set:Nn \parindent { 2\ccwd }
       \rmfamily \zihao { -4 }



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