summaryrefslogtreecommitdiff
path: root/macros/xetex/latex/xduts/xduts.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/xetex/latex/xduts/xduts.dtx')
-rw-r--r--macros/xetex/latex/xduts/xduts.dtx154
1 files changed, 120 insertions, 34 deletions
diff --git a/macros/xetex/latex/xduts/xduts.dtx b/macros/xetex/latex/xduts/xduts.dtx
index 691a2a6e20..4c7e798e76 100644
--- a/macros/xetex/latex/xduts/xduts.dtx
+++ b/macros/xetex/latex/xduts/xduts.dtx
@@ -1,15 +1,15 @@
% \iffalse
%<*driver>
\ProvidesFile{xduts.dtx}
-[2022/04/10 v0.6.0.0 Xidian University TeX Suite]
+[2022/04/11 v0.7.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/10}{0.6.0.0}
+%<class|sty> {2022/04/11}{0.7.0.0}
%<xdufont> {Xidian University Font package}
-%<xduugthesis> {Xidian University Undergraduate Thesis class}
+%<xduugthesis> {Xidian University Undergraduate Thesis document class}
%<*driver>
\documentclass{ctxdoc}
\changes{v0.6.0.0}{2022/04/10}{新增xdufont宏包}
@@ -143,7 +143,7 @@
\end{document}
%</driver>
% \fi
-% \CheckSum{823}
+% \CheckSum{872}
% \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
@@ -539,6 +539,45 @@
% \end{syntax}
% 设置章节标题后的垂直间距,默认值为\valuex{\{18pt, 12pt, 6pt, 6pt, 6pt, 6pt\}},分别对应\tnx{chapter}、\tnx{section}、\tnx{subsection}、\tnx{subsubsection}、\tnx{paragraph}和\tnx{subparagraph}。
% \end{function}
+% \begin{function}[added=2022-04-11]
+% {
+% style/chap-zihao,
+% style/sec-zihao,
+% style/subsec-zihao,
+% style/subsubsec-zihao,
+% style/para-zihao,
+% style/subpara-zihao
+% }
+% \begin{syntax}
+% \optx{style/chap-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \optx{style/sec-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \optx{style/subsec-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \optx{style/subsubsec-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \optx{style/para-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \optx{style/subpara-zihao}=\metax{0|-0|1|-1|2|-2|3|-3|4|-4|5|-5|6|-6|7|8}
+% \end{syntax}
+% 设置章节标题字号。
+% 当论文语言为中文时,默认值分别为\valuex{3}、\valuex{4}、\valuex{4}、\valuex{4}、\valuex{4}、\valuex{4}。
+% 当论文语言为英文时,默认值分别为\valuex{4}、\valuex{-4}、\valuex{-4}、\valuex{-4}、\valuex{-4}、\valuex{-4}。
+% \end{function}
+% \begin{optdesc}
+% \item[0] 初号
+% \item[−0] 小初号
+% \item[1] 一号
+% \item[-1] 小一号
+% \item[2] 二号
+% \item[-2] 小二号
+% \item[3] 三号
+% \item[-3] 小三号
+% \item[4] 四号
+% \item[-4] 小四号
+% \item[5] 五号
+% \item[-5] 小五号
+% \item[6] 六号
+% \item[-6] 小六号
+% \item[7] 七号
+% \item[8] 八号
+% \end{optdesc}
% \subsection{附录环境}
% \label{附录环境}
% \begin{function}[added=2022-04-04]{appendixes}
@@ -1571,7 +1610,13 @@
% \l_@@_bib_file_clist,
% \l_@@_fig_label_sep_tl,
% \l_@@_before_skip_clist,
-% \l_@@_after_skip_clist
+% \l_@@_after_skip_clist,
+% \l_@@_chap_tl,
+% \l_@@_sec_tl,
+% \l_@@_subsec_tl,
+% \l_@@_subsubsec_tl,
+% \l_@@_para_tl,
+% \l_@@_subpara_tl
% }
% 英文是否使用中文字体。
% \begin{macrocode}
@@ -1598,6 +1643,15 @@
\clist_new:N \l_@@_before_skip_clist
\clist_new:N \l_@@_after_skip_clist
% \end{macrocode}
+% 设置章节标题字号。
+% \begin{macrocode}
+\tl_new:N \l_@@_chap_tl
+\tl_new:N \l_@@_sec_tl
+\tl_new:N \l_@@_subsec_tl
+\tl_new:N \l_@@_subsubsec_tl
+\tl_new:N \l_@@_para_tl
+\tl_new:N \l_@@_subpara_tl
+% \end{macrocode}
% \end{variable}
% \begin{macro}{\keys_define:nn}
% 定义样式键值。
@@ -1633,7 +1687,16 @@
% \end{macrocode}
% 设置章节标题后的垂直间距。
% \begin{macrocode}
- after-skip .clist_set:N = \l_@@_after_skip_clist
+ after-skip .clist_set:N = \l_@@_after_skip_clist,
+% \end{macrocode}
+% 设置章节标题字号。
+% \begin{macrocode}
+ chap-zihao .tl_set:N = \l_@@_chap_tl,
+ sec-zihao .tl_set:N = \l_@@_sec_tl,
+ 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
}
% \end{macrocode}
% \end{macro}
@@ -1642,13 +1705,13 @@
% \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 / fig-label-sep = { 0.75em },
+ style / before-skip = { 24pt, 18pt, 12pt, 12pt, 12pt, 12pt },
+ style / after-skip = { 18pt, 12pt, 6pt, 6pt, 6pt, 6pt }
}
% \end{macrocode}
% \end{macro}
@@ -1731,6 +1794,14 @@
{ \CJKunderline [ thickness = 0.5pt ] { #1 } }
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@@_tl_set_if_empty:Nn}
+% \changes{v0.7.0.0}{2022/04/11}{对空凭据表赋值}
+% 对空凭据表赋值。
+% \begin{macrocode}
+\cs_new:Npn \@@_tl_set_if_empty:Nn #1#2
+ { \tl_if_empty:NT #1 { \tl_set:Nn #1 { #2 } } }
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@@_get_text_width:Nn,\@@_get_text_width:NV}
% 获取文本宽度。
% \begin{arguments}
@@ -1936,7 +2007,7 @@
% \end{macrocode}
% \end{macro}
% \subsubsection{章节和标题}
-% \begin{macro}{\@@_zh_title:nnn}
+% \begin{macro}{\@@_zh_t:nnn}
% 设置中文章节名字和随后的标题内容格式。
% \begin{arguments}
% \item 字体族。
@@ -1944,10 +2015,10 @@
% \item 位置。
% \end{arguments}
% \begin{macrocode}
-\cs_new:Npn \@@_zh_title:nnn #1#2#3
+\cs_new:Npn \@@_zh_t:nnn #1#2#3
{
\use:c { @@_ #1 _family : }
- \zihao { #2 }
+ \zihao { \use:c { l_@@_ #2 _tl } }
\str_if_eq:ccTF { #3 } { c }
{ \centering }
{ \raggedright }
@@ -1955,42 +2026,55 @@
% \end{macrocode}
% \end{macro}
% 设置英文章节名字和随后的标题内容格式。
-% \begin{macro}{\@@_en_title:nn}
+% \begin{macro}{\@@_en_t:nn}
% \begin{arguments}
% \item 字号。
% \item 偏移量。
% \end{arguments}
% \begin{macrocode}
-\cs_new:Npn \@@_en_title:nn #1#2
- { \zihao { #1 } \raggedright \skip_horizontal:n { #2 ex } }
+\cs_new:Npn \@@_en_t:nn #1#2
+ { \zihao { \use:c { l_@@_ #1 _tl } } \raggedright \skip_horizontal:n { #2 ex } }
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ctexset}
+% \changes{v0.7.0.0}{2022/04/11}{自定义章节标题字号}
% 设置章节名字和随后的标题内容格式。
% \begin{macrocode}
\ctex_at_end_preamble:n
{
\@@_lang_switch:nn
{
+ \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 3 }
+ \@@_tl_set_if_empty:Nn \l_@@_sec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsubsec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_para_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subpara_tl { 4 }
\ctexset
{
- chapter / format = { \@@_zh_title:nnn { sf } { 3 } { c } },
- section / format = { \@@_zh_title:nnn { rm } { 4 } { c } },
- subsection / format = { \@@_zh_title:nnn { rm } { 4 } { l } },
- subsubsection / format = { \@@_zh_title:nnn { rm } { 4 } { l } },
- paragraph / format = { \@@_zh_title:nnn { rm } { 4 } { l } },
- subparagraph / format = { \@@_zh_title:nnn { rm } { 4 } { l } }
+ chapter / format = { \@@_zh_t:nnn { sf } { chap } { c } },
+ section / format = { \@@_zh_t:nnn { rm } { sec } { c } },
+ subsection / format = { \@@_zh_t:nnn { rm } { subsec } { l } },
+ subsubsection / format = { \@@_zh_t:nnn { rm } { subsubsec } { l } },
+ paragraph / format = { \@@_zh_t:nnn { rm } { para } { l } },
+ subparagraph / format = { \@@_zh_t:nnn { rm } { subpara } { l } }
}
}
{
+ \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_sec_tl { -4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsec_tl { -4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsubsec_tl { -4 }
+ \@@_tl_set_if_empty:Nn \l_@@_para_tl { -4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subpara_tl { -4 }
\ctexset
{
- chapter / format = { \@@_en_title:nn { 4 } { 0 } },
- section / format = { \@@_en_title:nn { -4 } { 4 } },
- subsection / format = { \@@_en_title:nn { -4 } { 8 } },
- subsubsection / format = { \@@_en_title:nn { -4 } { 12 } },
- paragraph / format = { \@@_en_title:nn { -4 } { 16 } },
- subparagraph / format = { \@@_en_title:nn { -4 } { 20 } }
+ chapter / format = { \@@_en_t:nn { chap } { 0 } },
+ section / format = { \@@_en_t:nn { sec } { 4 } },
+ subsection / format = { \@@_en_t:nn { subsec } { 8 } },
+ subsubsection / format = { \@@_en_t:nn { subsubsec } { 12 } },
+ paragraph / format = { \@@_en_t:nn { para } { 16 } },
+ subparagraph / format = { \@@_en_t:nn { subpara } { 20 } }
}
}
}
@@ -2205,6 +2289,7 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_cover_ii:nnn}
+% \changes{v0.6.1.0}{2022/04/11}{修复logo不存在导致的无法编译}
% 绘制西电logo。
% \begin{arguments}
% \item 盒子高度。
@@ -2218,7 +2303,8 @@
{
\mode_leave_vertical:
\hfil
- \includegraphics [ height = #2, keepaspectratio ] { #3 }
+ \file_if_exist:nT { #3 }
+ { \includegraphics [ height = #2, keepaspectratio ] { #3 } }
\hfil
}
}
@@ -2321,7 +2407,7 @@
% \end{macrocode}
% 排版西电文字logo。
% \begin{macrocode}
- \@@_cover_ii:nnn { 65pt } { 35pt } { xidian-text }
+ \@@_cover_ii:nnn { 65pt } { 35pt } { xidian-text.pdf }
% \end{macrocode}
% 排版封面标题。
% \begin{macrocode}
@@ -2330,7 +2416,7 @@
% \end{macrocode}
% 排版西电logo。
% \begin{macrocode}
- \@@_cover_ii:nnn { 130pt } { 120pt } { xidian-logo }
+ \@@_cover_ii:nnn { 130pt } { 120pt } { xidian-logo.pdf }
% \end{macrocode}
% 拆分论文标题并排版。
% \begin{macrocode}