diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls b/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls index f4b4c5fbca0..26afb1b1b6d 100644 --- a/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls +++ b/Master/texmf-dist/tex/xelatex/xduts/xduugthesis.cls @@ -28,7 +28,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{xduugthesis} - {2022/11/27}{2.16.1.3} + {2022/12/01}{2.18.1.1} {Xidian University Undergraduate Thesis document class} \RequirePackage { xparse, l3keys2e } \PassOptionsToPackage { quiet } { xeCJK } @@ -530,9 +530,11 @@ \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 \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 @@ -557,9 +559,13 @@ 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 }, 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, @@ -583,6 +589,7 @@ style / fix-includegraphics = false, style / ref-add-space = false, style / caption-label-sep = { 0.75em }, + style / caption-format = { hang }, style / table-small-font = true, style / algorithm-small-caption = true, style / algorithm-small-font = true, @@ -1051,6 +1058,11 @@ labelsep = customskip, font = customfont } +\ctex_at_end_preamble:n + { + \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang } + { \captionsetup { format = hang } } { } + } \captionsetup [ algorithm ] { labelsep = customskip, @@ -1059,6 +1071,15 @@ } \ctex_at_end_preamble:n { + \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left } + { + \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang } + { \captionsetup [ algorithm ] { format = hang } } { } + } + { \captionsetup [ algorithm ] { justification = centering } } + } +\ctex_at_end_preamble:n + { \cs_if_exist:NT \thealgocf { \SetAlgoCaptionSeparator { \hbox_to_wd:nn { \l__xdu_cap_label_sep_tl } { } } @@ -1071,9 +1092,44 @@ \SetAlCapNameFnt { \__xdu_rm_family: \zihao { -4 } } \SetAlCapFnt { \__xdu_rm_family: \zihao { -4 } } } - \SetAlCapSty { } + \SetAlCapSty { } + \tl_if_eq:NnTF \l__xdu_alg_capt_align_tl { left } + { + \box_new:N \l__xdu_algtwoe_capt_box + \RenewDocumentCommand { \algocf@makecaption } { mm } + { + \hbox_set:Nn \l__xdu_algtwoe_capt_box + { \AlCapFnt #1 \algocf@capseparator \AlCapNameFnt #2 } + \dim_compare:nNnTF { \box_wd:N \l__xdu_algtwoe_capt_box } > { \hsize } + { + \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang } + { + \makebox { \AlCapFnt #1 \algocf@capseparator } + \makebox { \parbox [ t ] { \hsize } { \AlCapNameFnt #2 } } + } + { + \parbox { \columnwidth } + { \AlCapFnt #1 \algocf@capseparator \AlCapNameFnt #2} + } + } + { \makebox [ \columnwidth ] { \box_use:N \l__xdu_algtwoe_capt_box } } + } + } + { + \RenewDocumentCommand { \algocf@makecaption } { mm } + { + \parbox { \columnwidth } + { \centering \AlCapFnt #1 \algocf@capseparator \AlCapNameFnt #2 } + } + } + \RenewDocumentCommand { \algocf@makecaption@ruled } { mm } + { \global \sbox \algocf@capbox { \algocf@makecaption { #1 } { #2 } } } + \RenewDocumentCommand { \algocf@makecaption@boxed } { mm } + { \global \sbox \algocf@capbox { \algocf@makecaption { #1 } { #2 } } } } } +\cs_new:Npn \__xdu_tblr_caption_box:n #1 + { \makebox [ \tablewidth ] { \parbox { \columnwidth } { #1 } } } \ctex_at_end_preamble:n { \@ifpackageloaded { tabularray } @@ -1081,6 +1137,33 @@ \SetTblrStyle { head } { font = \__xdu_rm_family: \zihao { 5 } } \DefTblrTemplate { caption-sep } { default } { \hskip \l__xdu_cap_label_sep_tl } + \tl_if_eq:NnTF \l__xdu_cap_format_tl { hang } + { + \DefTblrTemplate { firsthead } { default } + { \__xdu_tblr_caption_box:n { \UseTblrTemplate { caption } { default } } } + \DefTblrTemplate { middlehead, lasthead } { default } + { \__xdu_tblr_caption_box:n { \UseTblrTemplate { capcont } { default } } } + } + { + \DefTblrTemplate { firsthead } { default } + { \__xdu_tblr_caption_box:n { \UseTblrTemplate { caption } { plain } } } + \DefTblrTemplate { middlehead, lasthead } { default } + { \__xdu_tblr_caption_box:n { \UseTblrTemplate { capcont } { plain } } } + } + \DefTblrTemplate { firstfoot, middlefoot } { default } + { \__xdu_tblr_caption_box:n { \UseTblrTemplate { contfoot } { default } } } + \DefTblrTemplate { lastfoot } { default } + { + \__xdu_tblr_caption_box:n + { + \UseTblrTemplate { note } { default } + \UseTblrTemplate { remark } { default } + } + } + \DefTblrTemplate { conthead-text } { default } + { \__xdu_lang_switch:nn { (续表) } { (Continued) } } + \DefTblrTemplate { contfoot-text } { default } + { \__xdu_lang_switch:nn { 接下页 } { Continued~on~next~page } } } { } } |