From 82a361bf5afe1ab883a6dcb1b7dccf21b06bc121 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 1 Dec 2022 20:36:45 +0000 Subject: xduts (1dec22) git-svn-id: svn://tug.org/texlive/trunk@65160 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/xelatex/xduts/xdufont.sty | 2 +- .../texmf-dist/tex/xelatex/xduts/xdupgthesis.cls | 121 ++++++++++++++++----- .../texmf-dist/tex/xelatex/xduts/xduugthesis.cls | 87 ++++++++++++++- 3 files changed, 181 insertions(+), 29 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty b/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty index 4233f10dfc5..3d5fb585d62 100644 --- a/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty +++ b/Master/texmf-dist/tex/xelatex/xduts/xdufont.sty @@ -28,7 +28,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{xdufont} - {2022/11/27}{2.16.1.3} + {2022/12/01}{2.18.1.1} {Xidian University Font package} \RequirePackage { xparse, l3keys2e } \PassOptionsToPackage { quiet } { xeCJK } diff --git a/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls b/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls index c6f32e9f0f2..bc23e6e99c2 100644 --- a/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls +++ b/Master/texmf-dist/tex/xelatex/xduts/xdupgthesis.cls @@ -28,7 +28,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{xdupgthesis} - {2022/11/27}{2.16.1.3} + {2022/12/01}{2.18.1.1} {Xidian University Postgraduate Thesis document class} \RequirePackage { xparse, l3keys2e } \PassOptionsToPackage { quiet } { xeCJK } @@ -697,9 +697,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 @@ -724,9 +726,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, @@ -750,6 +756,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, @@ -1265,12 +1272,26 @@ 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, labelfont = algcustomfont, font = algcustomfont } +\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 @@ -1285,9 +1306,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 } @@ -1295,6 +1351,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 } } } { } } @@ -1449,10 +1532,6 @@ \bool_if:NT \l__xdu_rm_appendix_bool { \RenewEnviron { appendixes } { } } } -\bool_new:N \l__xdu_ac_master -\bool_new:N \l__xdu_pro_master -\bool_new:N \l__xdu_ac_phd -\bool_new:N \l__xdu_pro_phd \bool_new:N \l__xdu_phd \bool_new:N \l__xdu_master \bool_new:N \l__xdu_ac @@ -1460,18 +1539,8 @@ \ctex_at_end_preamble:n { \tl_if_eq:NnTF \l__xdu_gr_type_tl { 硕士 } - { - \bool_set_true:N \l__xdu_master - \tl_if_eq:NnTF \l__xdu_degree_type_tl { 学术 } - { \bool_set_true:N \l__xdu_ac_master } - { \bool_set_true:N \l__xdu_pro_master } - } - { - \bool_set_true:N \l__xdu_phd - \tl_if_eq:NnTF \l__xdu_degree_type_tl { 学术 } - { \bool_set_true:N \l__xdu_ac_phd } - { \bool_set_true:N \l__xdu_pro_phd } - } + { \bool_set_true:N \l__xdu_master } + { \bool_set_true:N \l__xdu_phd } \tl_if_eq:NnTF \l__xdu_degree_type_tl { 学术 } { \bool_set_true:N \l__xdu_ac } { \bool_set_true:N \l__xdu_pro } @@ -1590,7 +1659,7 @@ \dim_new:N \l__xdu_cover_author_info_dim \dim_set:Nn \l__xdu_cover_author_info_dim { 7em } \__xdu_str_max_dim:Nn \l__xdu_cover_author_info_dim { \l__xdu_author_str } - \bool_if:NTF \l__xdu_pro_master + \bool_if:NTF \l__xdu_pro { \__xdu_str_max_dim:Nn \l__xdu_cover_author_info_dim { \l__xdu_supv_str \enskip \l__xdu_supv_t_str } @@ -1616,7 +1685,7 @@ \__xdu_cover_ii:nnnn { 4em } { 作者姓名 } { \l__xdu_cover_author_info_dim } { \l__xdu_author_str } - \bool_if:NTF \l__xdu_pro_master + \bool_if:NTF \l__xdu_pro { \__xdu_cover_ii:nnnn { 9em } { 学校导师姓名、职称 } { \l__xdu_cover_author_info_dim } @@ -1665,7 +1734,7 @@ } \__xdu_str_max_dim:Nn \l__xdu_zh_title_page_info_dim { 学位类别:\l__xdu_degree_str } - \bool_if:NTF \l__xdu_pro_master + \bool_if:NTF \l__xdu_pro { \__xdu_str_max_dim:Nn \l__xdu_zh_title_page_info_dim { 学校导师姓名、职称:\l__xdu_supv_str \enskip \l__xdu_supv_t_str } @@ -1712,7 +1781,7 @@ } \par { \bfseries 学位类别: } \l__xdu_degree_str - \bool_if:NTF \l__xdu_pro_master + \bool_if:NTF \l__xdu_pro { \par { \bfseries 学校导师姓名、职称: } @@ -1795,7 +1864,7 @@ \dim_set:Nn \l__xdu_supv_max_dim { \dim_max:nn { \l__xdu_supv_dim } { \l__xdu_supv_max_dim } } } - \bool_if:NT \l__xdu_pro_master + \bool_if:NT \l__xdu_pro { \hbox_set:Nn \l__xdu_supv_box { \l__xdu_supv_ent_en_str } \dim_set:Nn \l__xdu_supv_dim { \box_wd:N \l__xdu_supv_box } @@ -1822,7 +1891,7 @@ \dim_set:Nn \l__xdu_supv_t_max_dim { \dim_max:nn { \l__xdu_supv_t_dim } { \l__xdu_supv_t_max_dim } } } - \bool_if:NT \l__xdu_pro_master + \bool_if:NT \l__xdu_pro { \hbox_set:Nn \l__xdu_supv_t_box { \l__xdu_supv_ent_t_en_str } \dim_set:Nn \l__xdu_supv_t_dim { \box_wd:N \l__xdu_supv_t_box } @@ -1854,7 +1923,7 @@ for~the~degree~of \bool_if:NTF \l__xdu_master { ~Master\\ } { ~Doctor~of~Philosophy\\ } in - \bool_if:NTF \l__xdu_pro_master + \bool_if:NTF \l__xdu_pro { ~\l__xdu_degree_en_str\\ } { ~\l__xdu_major_en_str\\ } } @@ -1874,7 +1943,7 @@ \phantom { Supervisor:~ } \__xdu_en_title_supv:n { \l__xdu_supv_ii_en_str } \phantom { Title:~ } \__xdu_en_title_supv_t:n { \l__xdu_supv_ii_t_en_str } \\ } - \bool_if:NT \l__xdu_pro_master + \bool_if:NT \l__xdu_pro { Supervisor:~ \__xdu_en_title_supv:n { \l__xdu_supv_ent_en_str } Title:~ \__xdu_en_title_supv_t:n { \l__xdu_supv_ent_t_en_str } \\ 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,12 +1058,26 @@ 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, labelfont = algcustomfont, font = algcustomfont } +\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 @@ -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 } } } { } } -- cgit v1.2.3