From 0781add1baa6a963734054e477f84d1a57c40454 Mon Sep 17 00:00:00 2001 From: Alexara Wu Date: Wed, 10 Jan 2024 15:13:11 +0800 Subject: [PATCH] feat: new option `style/indent-first` --- sjtutex/source/sjtutex.dtx | 66 ++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/sjtutex/source/sjtutex.dtx b/sjtutex/source/sjtutex.dtx index e4a6514c..ea06f5da 100644 --- a/sjtutex/source/sjtutex.dtx +++ b/sjtutex/source/sjtutex.dtx @@ -1102,6 +1102,13 @@ % 该选项包含许多子项目,用于设置论文样式。具体内容见下。 % \end{function} % +% \begin{function}[added=2024-01-10]{style/indent-first} +% \begin{syntax} +% \OPT{indent-first} = <(true)|false> +% \end{syntax} +% 章节标题后首段是否缩进。 +% \end{function} +% % \begin{function}[added=2023-11-30]{style/equation-font} % \begin{syntax} % \OPT{equation-font} = \marg{字体设置} @@ -3954,8 +3961,7 @@ titleformat = , lofskip = \c_zero_skip , lotskip = \c_zero_skip , - aftername = \quad , - afterindent = true + aftername = \quad } % % @@ -3965,44 +3971,62 @@ % %<*class> \ctex_set:nn { section } - { %<*thesis> + { beforeskip = 24 bp , afterskip = 6 bp , format = \zihao { 4 } \setbaselineskip { 18 bp } \bfseries - \CJKsffamily , -% -% format = \large \bfseries \CJKsffamily , - afterindent = true + \CJKsffamily } +% +% { format = \large \bfseries \CJKsffamily } \ctex_set:nn { subsection } - { %<*thesis> + { beforeskip = 12 bp , afterskip = 6 bp , format = \zihao { -4 } \setbaselineskip { 16 bp } \bfseries - \CJKsffamily , -% -% format = \normalsize \bfseries \CJKsffamily , - afterindent = true + \CJKsffamily } +% +% { format = \normalsize \bfseries \CJKsffamily } \ctex_set:nn { subsubsection } - { %<*thesis> + { beforeskip = 6 bp , afterskip = 6 bp , - format = \zihao { -4 } \setbaselineskip { 16 bp } \normalfont , -% -% format = \normalsize \normalfont , - afterindent = true + format = \zihao { -4 } \setbaselineskip { 16 bp } \normalfont } -\ctex_set:nn { paragraph } - { afterindent = true } -\ctex_set:nn { subparagraph } - { afterindent = true } +% +% { format = \normalsize \normalfont } \ctex_set:n { secnumdepth = 3 } % \end{macrocode} % +% \changes{unreleased}{2024/01/10}{新增 \opt{style/indent-first} 选项。} +% \begin{macro}{style/indent-first} +% 章节标题后首段是否缩进。 +% \begin{macrocode} +\keys_define:nn { sjtu / style } + { + indent-first .choice: , + indent-first .choices:nn = + { true, false } + { + \clist_map_inline:nn + { +%
part, +% chapter, + section, subsection, subsubsection, + paragraph, subparagraph + } + { \ctex_set:nn {####1} { afterindent = #1 } } + } , + indent-first .default:n = { true } , + indent-first .initial:n = { true } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\SJTU@head,\@@_head_aux_s:nn,\@@_head_aux_s:nx, % \@@_pdf_bookmark:nn,\@@_phantom_section:} % 定义一个灵活的章节标题命令专门处理不同的需求。