texlive[65186] Master/texmf-dist: xduts (3dec22)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 3 22:02:26 CET 2022


Revision: 65186
          http://tug.org/svn/texlive?view=revision&revision=65186
Author:   karl
Date:     2022-12-03 22:02:25 +0100 (Sat, 03 Dec 2022)
Log Message:
-----------
xduts (3dec22)

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

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-12-03 21:02:14 UTC (rev 65185)
+++ trunk/Master/texmf-dist/source/xelatex/xduts/xduts.dtx	2022-12-03 21:02:25 UTC (rev 65186)
@@ -1,7 +1,7 @@
 % \iffalse
 %<*driver>
 \ProvidesFile{xduts.dtx}
-[2022/12/01 v2.18.1.1 Xidian University TeX Suite]
+[2022/12/03 v3.1.0.0 Xidian University TeX Suite]
 %</driver>
 %<class|sty>\NeedsTeXFormat{LaTeX2e}
 %<class|sty>\RequirePackage{expl3}
@@ -8,7 +8,7 @@
 %<xdufont>\ProvidesExplPackage{xdufont}
 %<xdupgthesis>\ProvidesExplClass{xdupgthesis}
 %<xduugthesis>\ProvidesExplClass{xduugthesis}
-%<class|sty>  {2022/12/01}{2.18.1.1}
+%<class|sty>  {2022/12/03}{3.1.0.0}
 %<xdufont>  {Xidian University Font package}
 %<xdupgthesis>  {Xidian University Postgraduate Thesis document class}
 %<xduugthesis>  {Xidian University Undergraduate Thesis document class}
@@ -276,7 +276,7 @@
 % 文件配置见\secrefx{文件配置},
 % 交叉引用配置见\secrefx{交叉引用配置},
 % caption配置见\secrefx{caption配置},
-% 表格配置见\secrefx{表格配置},
+% 图表配置见\secrefx{图表配置},
 % 算法配置见\secrefx{算法配置},
 % 对照表配置见\secrefx{对照表配置},
 % 作者简介配置见\secrefx{作者简介配置}。
@@ -317,7 +317,7 @@
 % 文件配置见\secrefx{文件配置},
 % 交叉引用配置见\secrefx{交叉引用配置},
 % caption配置见\secrefx{caption配置},
-% 表格配置见\secrefx{表格配置},
+% 图表配置见\secrefx{图表配置},
 % 算法配置见\secrefx{算法配置},
 % 章节配置见\secrefx{章节配置},
 % 附录配置见\secrefx{附录环境},
@@ -679,20 +679,36 @@
 % \end{function}
 % \changes{v2.17.0.0}{2022/11/28}{设置图、表、算法caption格式}
 % \begin{function}[added=2022-11-28]{style/caption-format}
+% 已弃用。
+% \end{function}
+% \begin{function}[added=2022-04-03]{style/fig-label-sep}
+% 已弃用。
+% \end{function}
+% \subsection{图表配置}
+% \label{图表配置}
+% \changes{v3.0.0.0}{2022/12/03}{设置图表caption格式}
+% \begin{function}[added=2022-12-03]{style/ft-caption-format}
 %   \begin{syntax}
-%     \optx{style/caption-format}=\metax{plain|(hang)}
+%     \optx{style/ft-caption-format}=\metax{plain|(hang)}
 %   \end{syntax}
-% 设置图、表、算法caption的对齐方式。
+% 设置图表caption格式。
 % \begin{optdesc}
-%   \item[plain] 无缩进。
+%   \item[plain] 无缩进,即自然段落。
 %   \item[hang] 悬挂缩进。
 % \end{optdesc}
 % \end{function}
-% \begin{function}[added=2022-04-03]{style/fig-label-sep}
-% 已弃用。
+% \changes{v3.0.0.0}{2022/12/03}{设置图表caption对齐方式}
+% \begin{function}[added=2022-12-03]{style/ft-caption-align}
+%   \begin{syntax}
+%     \optx{style/ft-caption-align}=\metax{left|centering|(centering-left)}
+%   \end{syntax}
+% 设置图表caption对齐方式。
+% \begin{optdesc}
+%   \item[left] 左对齐。
+%   \item[centering] 居中。
+%   \item[centering-left] 只有一行时居中,多行时左对齐。
+% \end{optdesc}
 % \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}
@@ -726,16 +742,43 @@
 %   \item[true] 五号。
 %   \item[false] 小四号。
 % \end{optdesc}
-% \begin{function}[added=2022-11-29]{style/algorithm-caption-align}
+% \changes{v3.0.0.0}{2022/12/03}{设置算法caption格式}
+% \begin{function}[added=2022-12-03]{style/alg-caption-format}
 %   \begin{syntax}
-%     \optx{style/algorithm-caption-align}=\metax{(left)|centering}
+%     \optx{style/alg-caption-format}=\metax{plain|(hang)}
 %   \end{syntax}
+% 设置算法caption格式。
+% \begin{optdesc}
+%   \item[plain] 无缩进,即自然段落。
+%   \item[hang] 悬挂缩进。
+% \end{optdesc}
+% \end{function}
+% \changes{v3.0.0.0}{2022/12/03}{设置算法caption对齐方式}
+% \begin{function}[added=2022-12-03]{style/alg-caption-align}
+%   \begin{syntax}
+%     \optx{style/alg-caption-align}=\metax{(left)|centering|centering-left}
+%   \end{syntax}
 % 设置算法caption对齐方式。
-% \end{function}
 % \begin{optdesc}
 %   \item[left] 左对齐。
-%   \item[centering] 居中,此时\optx{style/caption-format}中的设置对算法caption无效。
+%   \item[centering] 居中。
+%   \item[centering-left] 只有一行时居中,多行时左对齐。
 % \end{optdesc}
+% \end{function}
+% \changes{v3.1.0.0}{2022/12/03}{设置算法三线间距}
+% \begin{function}[added=2022-12-03]{style/add-alg-rule-vspace}
+%   \begin{syntax}
+%     \optx{style/add-alg-rule-vspace}=\metax{true|(false)}
+%   \end{syntax}
+% 设置是否为ruled样式的算法环境的三条横线增加纵向间距。
+% \begin{optdesc}
+%   \item[true] 增加。
+%   \item[false] 不增加。
+% \end{optdesc}
+% \end{function}
+% \begin{function}[added=2022-11-29]{style/algorithm-caption-align}
+% 已弃用。
+% \end{function}
 % \subsection{章节配置}
 % \label{章节配置}
 % \begin{function}[added=2022-04-05]{style/before-skip}
@@ -3219,11 +3262,14 @@
 %     \l_@@_fix_graphics_bool,
 %     \l_@@_ref_add_space_bool,
 %     \l_@@_cap_label_sep_tl,
-%     \l_@@_cap_format_tl,
+%     \l_@@_ft_cap_format_tl,
+%     \l_@@_alg_cap_format_tl,
+%     \l_@@_ft_cap_align_tl,
+%     \l_@@_alg_cap_align_tl,
+%     \l_@@_add_alg_rule_vspace_bool,
 %     \l_@@_tab_small_bool,
 %     \l_@@_alg_small_cap_bool,
 %     \l_@@_alg_small_bool,
-%     \l_@@_alg_capt_align_tl,
 %     \l_@@_before_skip_clist,
 %     \l_@@_after_skip_clist,
 %     \l_@@_chap_tl,
@@ -3272,8 +3318,18 @@
 %    \end{macrocode}
 % 图、表、算法caption格式。
 %    \begin{macrocode}
-\tl_new:N \l_@@_cap_format_tl
+\tl_new:N \l_@@_ft_cap_format_tl
+\tl_new:N \l_@@_alg_cap_format_tl
 %    \end{macrocode}
+% 图、表、算法caption对齐方式。
+%    \begin{macrocode}
+\tl_new:N \l_@@_ft_cap_align_tl
+\tl_new:N \l_@@_alg_cap_align_tl
+%    \end{macrocode}
+% 设置算法三线间距。
+%    \begin{macrocode}
+\bool_new:N \l_@@_add_alg_rule_vspace_bool
+%    \end{macrocode}
 % 设置表格字号是否为五号。
 %    \begin{macrocode}
 \bool_new:N \l_@@_tab_small_bool
@@ -3286,10 +3342,6 @@
 %    \begin{macrocode}
 \bool_new:N \l_@@_alg_small_bool
 %    \end{macrocode}
-% 设置算法caption对齐方式。
-%    \begin{macrocode}
-\tl_new:N \l_@@_alg_capt_align_tl
-%    \end{macrocode}
 % 设置章节标题前后的垂直间距。
 %    \begin{macrocode}
 \clist_new:N \l_@@_before_skip_clist
@@ -3357,9 +3409,22 @@
 %    \end{macrocode}
 % 图、表、算法caption格式。
 %    \begin{macrocode}
-    caption-format .choices:nn = { plain, hang }
-      { \tl_set_eq:NN \l_@@_cap_format_tl \l_keys_choice_tl },
+    ft-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l_@@_ft_cap_format_tl \l_keys_choice_tl },
+    alg-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l_@@_alg_cap_format_tl \l_keys_choice_tl },
 %    \end{macrocode}
+% 图、表、算法caption对齐方式。
+%    \begin{macrocode}
+    ft-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l_@@_ft_cap_align_tl \l_keys_choice_tl },
+    alg-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l_@@_alg_cap_align_tl \l_keys_choice_tl },
+%    \end{macrocode}
+% 设置算法三线间距。
+%    \begin{macrocode}
+    add-alg-rule-vspace .bool_set:N = \l_@@_add_alg_rule_vspace_bool,
+%    \end{macrocode}
 % 设置表格字号是否为五号。
 %    \begin{macrocode}
     table-small-font .bool_set:N = \l_@@_tab_small_bool,
@@ -3372,11 +3437,6 @@
 %    \begin{macrocode}
     algorithm-small-font .bool_set:N = \l_@@_alg_small_bool,
 %    \end{macrocode}
-% 设置算法caption对齐方式。
-%    \begin{macrocode}
-    algorithm-caption-align .choices:nn = { left, centering }
-      { \tl_set_eq:NN \l_@@_alg_capt_align_tl \l_keys_choice_tl },
-%    \end{macrocode}
 % 设置章节标题前的垂直间距。
 %    \begin{macrocode}
     before-skip .clist_set:N = \l_@@_before_skip_clist,
@@ -3419,7 +3479,11 @@
     style / fix-includegraphics     = false,
     style / ref-add-space           = false,
     style / caption-label-sep       = { 0.75em },
-    style / caption-format          = { hang },
+    style / ft-caption-format       = { hang },
+    style / alg-caption-format      = { hang },
+    style / ft-caption-align        = { centering-left },
+    style / alg-caption-align       = { left },
+    style / add-alg-rule-vspace     = { false },
     style / table-small-font        = true,
     style / algorithm-small-caption = true,
     style / algorithm-small-font    = true,
@@ -4762,6 +4826,7 @@
 % \end{macro}
 % \subsection{Caption}
 % \begin{macro}{\DeclareCaptionLabelSeparator,\DeclareCaptionFont,\captionsetup}
+% \changes{v3.0.0.0}{2022/12/03}{设置图、表caption格式}
 % \changes{v2.17.0.0}{2022/11/28}{设置图、表caption格式}
 % \changes{v0.1.2.0}{2022/04/03}{设置图片标签与后面标题之间的间距}
 % \changes{v0.1.3.0}{2022/04/03}{设置图片标签与标题字体字号}
@@ -4768,16 +4833,10 @@
 % \changes{v2.10.1.0}{2022/06/26}{修复算法标签与标题字体字号警告}
 % 设置图表标签与后面标题之间的间距及caption字体字号。
 %    \begin{macrocode}
+\PassOptionsToPackage { ruled } { caption }
 \RequirePackage { caption }
 \DeclareCaptionLabelSeparator { customskip } { \hskip \l_@@_cap_label_sep_tl }
 \DeclareCaptionFont { customfont   } { \@@_rm_family: \zihao { 5 } }
-\DeclareCaptionFont { algcustomfont }
-  {
-    \@@_rm_family:
-    \bool_if:NTF \l_@@_alg_small_cap_bool
-      { \zihao { 5  } }
-      { \zihao { -4 } }
-  }
 \captionsetup
   {
     labelsep = customskip,
@@ -4785,12 +4844,21 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l_@@_cap_format_tl { hang }
-      { \captionsetup { format = hang } } { }
+    \tl_if_eq:NnTF \l_@@_ft_cap_format_tl { hang }
+      { \captionsetup { format = hang  } }
+      { \captionsetup { format = plain } }
+    \tl_if_eq:NnTF \l_@@_ft_cap_align_tl { left }
+      { \captionsetup { singlelinecheck = false, justification = justified } }
+      {
+        \tl_if_eq:NnTF \l_@@_ft_cap_align_tl { centering }
+          { \captionsetup { singlelinecheck = false, justification = centerlast } }
+          { \captionsetup { singlelinecheck = true, justification = justified   } }
+      }
   }
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\captionsetup}
+% \begin{macro}{\DeclareCaptionFont,\captionsetup*}
+% \changes{v3.0.0.0}{2022/12/03}{设置算法caption格式}
 % \changes{v2.18.0.0}{2022/11/28}{设置算法caption对齐方式}
 % \changes{v2.17.0.0}{2022/11/28}{设置算法caption格式}
 % \changes{v1.0.4.0}{2022/04/15}{设置\pkgx{algorithm}算法标签与标题字体字号及标签与后面标题之间的间距}
@@ -4798,8 +4866,15 @@
 % \changes{v2.6.0.0}{2022/06/25}{设置\pkgx{algorithm}算法Caption字号是否为五号}
 % 设置\pkgx{algorithm}算法标签与标题字体字号及标签与后面标题之间的间距。
 %    \begin{macrocode}
-\captionsetup [ algorithm ]
+\DeclareCaptionFont { algcustomfont }
   {
+    \@@_rm_family:
+    \bool_if:NTF \l_@@_alg_small_cap_bool
+      { \zihao { 5  } }
+      { \zihao { -4 } }
+  }
+\captionsetup* [ algorithm ]
+  {
     labelsep  = customskip,
     labelfont = algcustomfont,
     font      = algcustomfont
@@ -4806,15 +4881,51 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l_@@_alg_capt_align_tl { left }
+    \tl_if_eq:NnTF \l_@@_alg_cap_format_tl { hang }
+      { \captionsetup* [ algorithm ] { format = hang  } }
+      { \captionsetup* [ algorithm ] { format = plain } }
+    \captionsetup* [ ruled ] { strut = 0 }
+    \tl_if_eq:NnTF \l_@@_ft_cap_align_tl { left }
       {
-        \tl_if_eq:NnTF \l_@@_cap_format_tl { hang }
-          { \captionsetup [ algorithm ] { format = hang } } { }
+        \captionsetup* [ algorithm ]
+          { singlelinecheck = false, justification = justified }
       }
-      { \captionsetup [ algorithm ] { justification = centering } }
+      {
+        \tl_if_eq:NnTF \l_@@_ft_cap_align_tl { centering }
+          {
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = false, justification = centerlast }
+          }
+          {
+            \cs_set_eq:NN \floatc at ruled \floatc at plain
+            \captionsetup* [ ruled ] { slc = 1 }
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = true, justification = justified }
+          }
+      }
   }
 %    \end{macrocode}
 % \end{macro}
+% \changes{v3.1.0.0}{2022/12/03}{设置\pkgx{algorithm}算法三线间距}
+% \begin{macro}{\ctex_at_end_preamble:n}
+% 设置\pkgx{algorithm}算法三线间距。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l_@@_add_alg_rule_vspace_bool
+      {
+        \cs_set:Npn \fs at ruled
+          {
+            \cs_set_eq:NN \@fs at capt \floatc at plain
+            \cs_set:Npn   \@fs at pre  { \hrule height .8pt depth 0pt \kern 5pt }
+            \cs_set:Npn   \@fs at post { \kern 5pt \hrule \relax                }
+            \cs_set:Npn   \@fs at mid  { \kern 5pt \hrule \kern 5pt             }
+            \cs_set_eq:NN \@fs at iftopcapt \iftrue
+          }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\SetAlgoCaptionSeparator,\SetAlCapNameFnt,\SetAlCapFnt}
 % \changes{v2.18.0.0}{2022/11/29}{设置\pkgx{algorithm2e}算法caption对齐方式}
 % \changes{v2.17.0.0}{2022/11/28}{设置\pkgx{algorithm2e}算法caption格式}
@@ -4841,33 +4952,51 @@
 %    \end{macrocode}
 % 设置\pkgx{algorithm2e}算法caption格式及对齐方式。
 %    \begin{macrocode}
-        \tl_if_eq:NnTF \l_@@_alg_capt_align_tl { left }
+        \RenewDocumentCommand { \algocf at makecaption } { mm }
           {
-            \box_new:N \l_@@_algtwoe_capt_box
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
+            \box_clear_new:N \l_@@_algiie_capt_box
+            \hbox_set:Nn \l_@@_algiie_capt_box
+              { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+            \dim_compare:nNnTF { \box_wd:N \l_@@_algiie_capt_box } > { \hsize }
               {
-                \hbox_set:Nn \l_@@_algtwoe_capt_box
-                  { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
-                \dim_compare:nNnTF { \box_wd:N \l_@@_algtwoe_capt_box } > { \hsize }
+                \tl_if_eq:NnTF \l_@@_alg_cap_format_tl { hang }
                   {
-                    \tl_if_eq:NnTF \l_@@_cap_format_tl { hang }
+                    \tl_if_eq:NnTF \l_@@_alg_cap_align_tl { centering }
                       {
                         \makebox { \AlCapFnt #1 \algocf at capseparator }
+                        \makebox
+                          {
+                            \parbox [ t ] { \hsize }
+                              { \centering \AlCapNameFnt #2 }
+                          }
+                      }
+                      {
+                        \makebox { \AlCapFnt #1 \algocf at capseparator }
                         \makebox { \parbox [ t ] { \hsize } { \AlCapNameFnt #2 } }
                       }
+                  }
+                  {
+                    \tl_if_eq:NnTF \l_@@_alg_cap_align_tl { centering }
                       {
                         \parbox { \columnwidth }
+                          { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
+                      }
+                      {
+                        \parbox { \columnwidth }
                           { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
                       }
                   }
-                  { \makebox [ \columnwidth ] { \box_use:N \l_@@_algtwoe_capt_box } }
               }
-          }
-          {
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
               {
-                 \parbox { \columnwidth }
-                   { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                \tl_if_eq:NnTF \l_@@_alg_cap_align_tl { left }
+                  {
+                    \parbox { \columnwidth }
+                      { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
+                  {
+                    \parbox { \columnwidth }
+                      { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
               }
           }
       \RenewDocumentCommand { \algocf at makecaption@ruled } { mm }
@@ -4878,6 +5007,20 @@
   }
 %    \end{macrocode}
 % \end{macro}
+% \changes{v3.1.0.0}{2022/12/03}{设置\pkgx{algorithm2e}算法三线间距}
+% \begin{macro}{\ctex_at_end_preamble:n}
+% 设置\pkgx{algorithm2e}算法三线间距。
+%    \begin{macrocode}
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l_@@_add_alg_rule_vspace_bool
+      {
+        \dim_set:Nn \interspacetitleruled { 5pt }
+        \dim_set:Nn \interspacealgoruled  { 5pt }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_tblr_caption_box:n}
 % \changes{v2.16.2.0}{2022/11/27}{\envx{longtblr}环境整页宽的caption盒子}
 % \pkgx{tabularray}中\envx{longtblr}环境整页宽的caption盒子。
@@ -4933,12 +5076,12 @@
 %    \end{macrocode}
 % \end{macro}
 % \subsection{图片}
-% \begin{macro}{\PassOptionsToPackage,\captionsetup}
+% \begin{macro}{\PassOptionsToPackage,\captionsetup*}
 % \changes{v0.4.2.0}{2022/04/05}{设置子图标签与标题字体字号}
 % 设置子图标签与标题字体字号,支持\pkgx{subfig}和\pkgx{subcaption}宏包。
 %    \begin{macrocode}
 \PassOptionsToPackage { font = small } { subfig }
-\captionsetup [ sub ] { font = customfont }
+\captionsetup* [ sub ] { font = customfont }
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\captionsetup}

Modified: trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty	2022-12-03 21:02:14 UTC (rev 65185)
+++ trunk/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty	2022-12-03 21:02:25 UTC (rev 65186)
@@ -28,7 +28,7 @@
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplPackage{xdufont}
-  {2022/12/01}{2.18.1.1}
+  {2022/12/03}{3.1.0.0}
   {Xidian University Font package}
 \RequirePackage { xparse, l3keys2e }
 \PassOptionsToPackage { quiet } { xeCJK }

Modified: trunk/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls	2022-12-03 21:02:14 UTC (rev 65185)
+++ trunk/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls	2022-12-03 21:02:25 UTC (rev 65186)
@@ -28,7 +28,7 @@
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplClass{xdupgthesis}
-  {2022/12/01}{2.18.1.1}
+  {2022/12/03}{3.1.0.0}
   {Xidian University Postgraduate Thesis document class}
 \RequirePackage { xparse, l3keys2e }
 \PassOptionsToPackage { quiet } { xeCJK }
@@ -697,11 +697,14 @@
 \bool_new:N \l__xdu_fix_graphics_bool
 \tl_new:N \l__xdu_ref_add_space_bool
 \tl_new:N \l__xdu_cap_label_sep_tl
-\tl_new:N \l__xdu_cap_format_tl
+\tl_new:N \l__xdu_ft_cap_format_tl
+\tl_new:N \l__xdu_alg_cap_format_tl
+\tl_new:N \l__xdu_ft_cap_align_tl
+\tl_new:N \l__xdu_alg_cap_align_tl
+\bool_new:N \l__xdu_add_alg_rule_vspace_bool
 \bool_new:N \l__xdu_tab_small_bool
 \bool_new:N \l__xdu_alg_small_cap_bool
 \bool_new:N \l__xdu_alg_small_bool
-\tl_new:N \l__xdu_alg_capt_align_tl
 \clist_new:N \l__xdu_before_skip_clist
 \clist_new:N \l__xdu_after_skip_clist
 \tl_new:N \l__xdu_chap_tl
@@ -726,13 +729,18 @@
     fix-includegraphics .bool_set:N = \l__xdu_fix_graphics_bool,
     ref-add-space .bool_set:N = \l__xdu_ref_add_space_bool,
     caption-label-sep .tl_set:N = \l__xdu_cap_label_sep_tl,
-    caption-format .choices:nn = { plain, hang }
-      { \tl_set_eq:NN \l__xdu_cap_format_tl \l_keys_choice_tl },
+    ft-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l__xdu_ft_cap_format_tl \l_keys_choice_tl },
+    alg-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l__xdu_alg_cap_format_tl \l_keys_choice_tl },
+    ft-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l__xdu_ft_cap_align_tl \l_keys_choice_tl },
+    alg-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l__xdu_alg_cap_align_tl \l_keys_choice_tl },
+    add-alg-rule-vspace .bool_set:N = \l__xdu_add_alg_rule_vspace_bool,
     table-small-font .bool_set:N = \l__xdu_tab_small_bool,
     algorithm-small-caption .bool_set:N = \l__xdu_alg_small_cap_bool,
     algorithm-small-font .bool_set:N = \l__xdu_alg_small_bool,
-    algorithm-caption-align .choices:nn = { left, centering }
-      { \tl_set_eq:NN \l__xdu_alg_capt_align_tl \l_keys_choice_tl },
     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,
@@ -756,7 +764,11 @@
     style / fix-includegraphics     = false,
     style / ref-add-space           = false,
     style / caption-label-sep       = { 0.75em },
-    style / caption-format          = { hang },
+    style / ft-caption-format       = { hang },
+    style / alg-caption-format      = { hang },
+    style / ft-caption-align        = { centering-left },
+    style / alg-caption-align       = { left },
+    style / add-alg-rule-vspace     = { false },
     style / table-small-font        = true,
     style / algorithm-small-caption = true,
     style / algorithm-small-font    = true,
@@ -1257,16 +1269,10 @@
       }
       { }
   }
+\PassOptionsToPackage { ruled } { caption }
 \RequirePackage { caption }
 \DeclareCaptionLabelSeparator { customskip } { \hskip \l__xdu_cap_label_sep_tl }
 \DeclareCaptionFont { customfont   } { \__xdu_rm_family: \zihao { 5 } }
-\DeclareCaptionFont { algcustomfont }
-  {
-    \__xdu_rm_family:
-    \bool_if:NTF \l__xdu_alg_small_cap_bool
-      { \zihao { 5  } }
-      { \zihao { -4 } }
-  }
 \captionsetup
   {
     labelsep = customskip,
@@ -1274,11 +1280,26 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
-      { \captionsetup { format = hang } } { }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_format_tl { hang }
+      { \captionsetup { format = hang  } }
+      { \captionsetup { format = plain } }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { left }
+      { \captionsetup { singlelinecheck = false, justification = justified } }
+      {
+        \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { centering }
+          { \captionsetup { singlelinecheck = false, justification = centerlast } }
+          { \captionsetup { singlelinecheck = true, justification = justified   } }
+      }
   }
-\captionsetup [ algorithm ]
+\DeclareCaptionFont { algcustomfont }
   {
+    \__xdu_rm_family:
+    \bool_if:NTF \l__xdu_alg_small_cap_bool
+      { \zihao { 5  } }
+      { \zihao { -4 } }
+  }
+\captionsetup* [ algorithm ]
+  {
     labelsep  = customskip,
     labelfont = algcustomfont,
     font      = algcustomfont
@@ -1285,15 +1306,45 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left }
+    \tl_if_eq:NnTF \l__xdu_alg_cap_format_tl { hang }
+      { \captionsetup* [ algorithm ] { format = hang  } }
+      { \captionsetup* [ algorithm ] { format = plain } }
+    \captionsetup* [ ruled ] { strut = 0 }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { left }
       {
-        \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
-          { \captionsetup [ algorithm ] { format = hang } } { }
+        \captionsetup* [ algorithm ]
+          { singlelinecheck = false, justification = justified }
       }
-      { \captionsetup [ algorithm ] { justification = centering } }
+      {
+        \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { centering }
+          {
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = false, justification = centerlast }
+          }
+          {
+            \cs_set_eq:NN \floatc at ruled \floatc at plain
+            \captionsetup* [ ruled ] { slc = 1 }
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = true, justification = justified }
+          }
+      }
   }
 \ctex_at_end_preamble:n
   {
+    \bool_if:NT \l__xdu_add_alg_rule_vspace_bool
+      {
+        \cs_set:Npn \fs at ruled
+          {
+            \cs_set_eq:NN \@fs at capt \floatc at plain
+            \cs_set:Npn   \@fs at pre  { \hrule height .8pt depth 0pt \kern 5pt }
+            \cs_set:Npn   \@fs at post { \kern 5pt \hrule \relax                }
+            \cs_set:Npn   \@fs at mid  { \kern 5pt \hrule \kern 5pt             }
+            \cs_set_eq:NN \@fs at iftopcapt \iftrue
+          }
+      }
+  }
+\ctex_at_end_preamble:n
+  {
     \cs_if_exist:NT \thealgocf
       {
         \SetAlgoCaptionSeparator { \hbox_to_wd:nn { \l__xdu_cap_label_sep_tl } { } }
@@ -1307,33 +1358,51 @@
             \SetAlCapFnt             { \__xdu_rm_family: \zihao { -4 } }
           }
         \SetAlCapSty { }
-        \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left }
+        \RenewDocumentCommand { \algocf at makecaption } { mm }
           {
-            \box_new:N \l__xdu_algtwoe_capt_box
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
+            \box_clear_new:N \l__xdu_algiie_capt_box
+            \hbox_set:Nn \l__xdu_algiie_capt_box
+              { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+            \dim_compare:nNnTF { \box_wd:N \l__xdu_algiie_capt_box } > { \hsize }
               {
-                \hbox_set:Nn \l__xdu_algtwoe_capt_box
-                  { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
-                \dim_compare:nNnTF { \box_wd:N \l__xdu_algtwoe_capt_box } > { \hsize }
+                \tl_if_eq:NnTF \l__xdu_alg_cap_format_tl { hang }
                   {
-                    \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
+                    \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { centering }
                       {
                         \makebox { \AlCapFnt #1 \algocf at capseparator }
+                        \makebox
+                          {
+                            \parbox [ t ] { \hsize }
+                              { \centering \AlCapNameFnt #2 }
+                          }
+                      }
+                      {
+                        \makebox { \AlCapFnt #1 \algocf at capseparator }
                         \makebox { \parbox [ t ] { \hsize } { \AlCapNameFnt #2 } }
                       }
+                  }
+                  {
+                    \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { centering }
                       {
                         \parbox { \columnwidth }
+                          { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
+                      }
+                      {
+                        \parbox { \columnwidth }
                           { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
                       }
                   }
-                  { \makebox [ \columnwidth ] { \box_use:N \l__xdu_algtwoe_capt_box } }
               }
-          }
-          {
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
               {
-                 \parbox { \columnwidth }
-                   { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { left }
+                  {
+                    \parbox { \columnwidth }
+                      { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
+                  {
+                    \parbox { \columnwidth }
+                      { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
               }
           }
       \RenewDocumentCommand { \algocf at makecaption@ruled } { mm }
@@ -1342,6 +1411,14 @@
         { \global \sbox \algocf at capbox { \algocf at makecaption { #1 } { #2 } } }
       }
   }
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l__xdu_add_alg_rule_vspace_bool
+      {
+        \dim_set:Nn \interspacetitleruled { 5pt }
+        \dim_set:Nn \interspacealgoruled  { 5pt }
+      }
+  }
 \cs_new:Npn \__xdu_tblr_caption_box:n #1
   { \makebox [ \tablewidth ] { \parbox { \columnwidth } { #1 } } }
 \ctex_at_end_preamble:n
@@ -1382,7 +1459,7 @@
       { }
   }
 \PassOptionsToPackage { font = small } { subfig }
-\captionsetup [ sub ] { font = customfont }
+\captionsetup* [ sub ] { font = customfont }
 \ctex_at_end_preamble:n
   {
     \@ifpackageloaded { subfig }

Modified: trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls	2022-12-03 21:02:14 UTC (rev 65185)
+++ trunk/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls	2022-12-03 21:02:25 UTC (rev 65186)
@@ -28,7 +28,7 @@
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplClass{xduugthesis}
-  {2022/12/01}{2.18.1.1}
+  {2022/12/03}{3.1.0.0}
   {Xidian University Undergraduate Thesis document class}
 \RequirePackage { xparse, l3keys2e }
 \PassOptionsToPackage { quiet } { xeCJK }
@@ -530,11 +530,14 @@
 \bool_new:N \l__xdu_fix_graphics_bool
 \tl_new:N \l__xdu_ref_add_space_bool
 \tl_new:N \l__xdu_cap_label_sep_tl
-\tl_new:N \l__xdu_cap_format_tl
+\tl_new:N \l__xdu_ft_cap_format_tl
+\tl_new:N \l__xdu_alg_cap_format_tl
+\tl_new:N \l__xdu_ft_cap_align_tl
+\tl_new:N \l__xdu_alg_cap_align_tl
+\bool_new:N \l__xdu_add_alg_rule_vspace_bool
 \bool_new:N \l__xdu_tab_small_bool
 \bool_new:N \l__xdu_alg_small_cap_bool
 \bool_new:N \l__xdu_alg_small_bool
-\tl_new:N \l__xdu_alg_capt_align_tl
 \clist_new:N \l__xdu_before_skip_clist
 \clist_new:N \l__xdu_after_skip_clist
 \tl_new:N \l__xdu_chap_tl
@@ -559,13 +562,18 @@
     fix-includegraphics .bool_set:N = \l__xdu_fix_graphics_bool,
     ref-add-space .bool_set:N = \l__xdu_ref_add_space_bool,
     caption-label-sep .tl_set:N = \l__xdu_cap_label_sep_tl,
-    caption-format .choices:nn = { plain, hang }
-      { \tl_set_eq:NN \l__xdu_cap_format_tl \l_keys_choice_tl },
+    ft-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l__xdu_ft_cap_format_tl \l_keys_choice_tl },
+    alg-caption-format .choices:nn = { plain, hang }
+      { \tl_set_eq:NN \l__xdu_alg_cap_format_tl \l_keys_choice_tl },
+    ft-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l__xdu_ft_cap_align_tl \l_keys_choice_tl },
+    alg-caption-align .choices:nn = { left, centering, centering-left }
+      { \tl_set_eq:NN \l__xdu_alg_cap_align_tl \l_keys_choice_tl },
+    add-alg-rule-vspace .bool_set:N = \l__xdu_add_alg_rule_vspace_bool,
     table-small-font .bool_set:N = \l__xdu_tab_small_bool,
     algorithm-small-caption .bool_set:N = \l__xdu_alg_small_cap_bool,
     algorithm-small-font .bool_set:N = \l__xdu_alg_small_bool,
-    algorithm-caption-align .choices:nn = { left, centering }
-      { \tl_set_eq:NN \l__xdu_alg_capt_align_tl \l_keys_choice_tl },
     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,
@@ -589,7 +597,11 @@
     style / fix-includegraphics     = false,
     style / ref-add-space           = false,
     style / caption-label-sep       = { 0.75em },
-    style / caption-format          = { hang },
+    style / ft-caption-format       = { hang },
+    style / alg-caption-format      = { hang },
+    style / ft-caption-align        = { centering-left },
+    style / alg-caption-align       = { left },
+    style / add-alg-rule-vspace     = { false },
     style / table-small-font        = true,
     style / algorithm-small-caption = true,
     style / algorithm-small-font    = true,
@@ -1043,16 +1055,10 @@
       }
       { }
   }
+\PassOptionsToPackage { ruled } { caption }
 \RequirePackage { caption }
 \DeclareCaptionLabelSeparator { customskip } { \hskip \l__xdu_cap_label_sep_tl }
 \DeclareCaptionFont { customfont   } { \__xdu_rm_family: \zihao { 5 } }
-\DeclareCaptionFont { algcustomfont }
-  {
-    \__xdu_rm_family:
-    \bool_if:NTF \l__xdu_alg_small_cap_bool
-      { \zihao { 5  } }
-      { \zihao { -4 } }
-  }
 \captionsetup
   {
     labelsep = customskip,
@@ -1060,11 +1066,26 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
-      { \captionsetup { format = hang } } { }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_format_tl { hang }
+      { \captionsetup { format = hang  } }
+      { \captionsetup { format = plain } }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { left }
+      { \captionsetup { singlelinecheck = false, justification = justified } }
+      {
+        \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { centering }
+          { \captionsetup { singlelinecheck = false, justification = centerlast } }
+          { \captionsetup { singlelinecheck = true, justification = justified   } }
+      }
   }
-\captionsetup [ algorithm ]
+\DeclareCaptionFont { algcustomfont }
   {
+    \__xdu_rm_family:
+    \bool_if:NTF \l__xdu_alg_small_cap_bool
+      { \zihao { 5  } }
+      { \zihao { -4 } }
+  }
+\captionsetup* [ algorithm ]
+  {
     labelsep  = customskip,
     labelfont = algcustomfont,
     font      = algcustomfont
@@ -1071,15 +1092,45 @@
   }
 \ctex_at_end_preamble:n
   {
-    \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left }
+    \tl_if_eq:NnTF \l__xdu_alg_cap_format_tl { hang }
+      { \captionsetup* [ algorithm ] { format = hang  } }
+      { \captionsetup* [ algorithm ] { format = plain } }
+    \captionsetup* [ ruled ] { strut = 0 }
+    \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { left }
       {
-        \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
-          { \captionsetup [ algorithm ] { format = hang } } { }
+        \captionsetup* [ algorithm ]
+          { singlelinecheck = false, justification = justified }
       }
-      { \captionsetup [ algorithm ] { justification = centering } }
+      {
+        \tl_if_eq:NnTF \l__xdu_ft_cap_align_tl { centering }
+          {
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = false, justification = centerlast }
+          }
+          {
+            \cs_set_eq:NN \floatc at ruled \floatc at plain
+            \captionsetup* [ ruled ] { slc = 1 }
+            \captionsetup* [ algorithm ]
+              { singlelinecheck = true, justification = justified }
+          }
+      }
   }
 \ctex_at_end_preamble:n
   {
+    \bool_if:NT \l__xdu_add_alg_rule_vspace_bool
+      {
+        \cs_set:Npn \fs at ruled
+          {
+            \cs_set_eq:NN \@fs at capt \floatc at plain
+            \cs_set:Npn   \@fs at pre  { \hrule height .8pt depth 0pt \kern 5pt }
+            \cs_set:Npn   \@fs at post { \kern 5pt \hrule \relax                }
+            \cs_set:Npn   \@fs at mid  { \kern 5pt \hrule \kern 5pt             }
+            \cs_set_eq:NN \@fs at iftopcapt \iftrue
+          }
+      }
+  }
+\ctex_at_end_preamble:n
+  {
     \cs_if_exist:NT \thealgocf
       {
         \SetAlgoCaptionSeparator { \hbox_to_wd:nn { \l__xdu_cap_label_sep_tl } { } }
@@ -1093,33 +1144,51 @@
             \SetAlCapFnt             { \__xdu_rm_family: \zihao { -4 } }
           }
         \SetAlCapSty { }
-        \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left }
+        \RenewDocumentCommand { \algocf at makecaption } { mm }
           {
-            \box_new:N \l__xdu_algtwoe_capt_box
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
+            \box_clear_new:N \l__xdu_algiie_capt_box
+            \hbox_set:Nn \l__xdu_algiie_capt_box
+              { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+            \dim_compare:nNnTF { \box_wd:N \l__xdu_algiie_capt_box } > { \hsize }
               {
-                \hbox_set:Nn \l__xdu_algtwoe_capt_box
-                  { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
-                \dim_compare:nNnTF { \box_wd:N \l__xdu_algtwoe_capt_box } > { \hsize }
+                \tl_if_eq:NnTF \l__xdu_alg_cap_format_tl { hang }
                   {
-                    \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang }
+                    \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { centering }
                       {
                         \makebox { \AlCapFnt #1 \algocf at capseparator }
+                        \makebox
+                          {
+                            \parbox [ t ] { \hsize }
+                              { \centering \AlCapNameFnt #2 }
+                          }
+                      }
+                      {
+                        \makebox { \AlCapFnt #1 \algocf at capseparator }
                         \makebox { \parbox [ t ] { \hsize } { \AlCapNameFnt #2 } }
                       }
+                  }
+                  {
+                    \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { centering }
                       {
                         \parbox { \columnwidth }
+                          { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
+                      }
+                      {
+                        \parbox { \columnwidth }
                           { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2}
                       }
                   }
-                  { \makebox [ \columnwidth ] { \box_use:N \l__xdu_algtwoe_capt_box } }
               }
-          }
-          {
-            \RenewDocumentCommand { \algocf at makecaption } { mm }
               {
-                 \parbox { \columnwidth }
-                   { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                \tl_if_eq:NnTF \l__xdu_alg_cap_align_tl { left }
+                  {
+                    \parbox { \columnwidth }
+                      { \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
+                  {
+                    \parbox { \columnwidth }
+                      { \centering \AlCapFnt #1 \algocf at capseparator \AlCapNameFnt #2 }
+                  }
               }
           }
       \RenewDocumentCommand { \algocf at makecaption@ruled } { mm }
@@ -1128,6 +1197,14 @@
         { \global \sbox \algocf at capbox { \algocf at makecaption { #1 } { #2 } } }
       }
   }
+\ctex_at_end_preamble:n
+  {
+    \bool_if:NT \l__xdu_add_alg_rule_vspace_bool
+      {
+        \dim_set:Nn \interspacetitleruled { 5pt }
+        \dim_set:Nn \interspacealgoruled  { 5pt }
+      }
+  }
 \cs_new:Npn \__xdu_tblr_caption_box:n #1
   { \makebox [ \tablewidth ] { \parbox { \columnwidth } { #1 } } }
 \ctex_at_end_preamble:n
@@ -1168,7 +1245,7 @@
       { }
   }
 \PassOptionsToPackage { font = small } { subfig }
-\captionsetup [ sub ] { font = customfont }
+\captionsetup* [ sub ] { font = customfont }
 \ctex_at_end_preamble:n
   {
     \@ifpackageloaded { subfig }



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