Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new option style/indent-first #51

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 45 additions & 21 deletions sjtutex/source/sjtutex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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{字体设置}
Expand Down Expand Up @@ -3954,8 +3961,7 @@
titleformat = ,
lofskip = \c_zero_skip ,
lotskip = \c_zero_skip ,
aftername = \quad ,
afterindent = true
aftername = \quad
}
%</!article>
%</class>
Expand All @@ -3965,44 +3971,62 @@
%</scheme&(zh|ja)>
%<*class>
\ctex_set:nn { section }
{
%<*thesis>
{
beforeskip = 24 bp ,
afterskip = 6 bp ,
format = \zihao { 4 } \setbaselineskip { 18 bp } \bfseries
\CJKsffamily ,
%</thesis>
%<!thesis> format = \large \bfseries \CJKsffamily ,
afterindent = true
\CJKsffamily
}
%</thesis>
%<!thesis> { format = \large \bfseries \CJKsffamily }
\ctex_set:nn { subsection }
{
%<*thesis>
{
beforeskip = 12 bp ,
afterskip = 6 bp ,
format = \zihao { -4 } \setbaselineskip { 16 bp } \bfseries
\CJKsffamily ,
%</thesis>
%<!thesis> format = \normalsize \bfseries \CJKsffamily ,
afterindent = true
\CJKsffamily
}
%</thesis>
%<!thesis> { format = \normalsize \bfseries \CJKsffamily }
\ctex_set:nn { subsubsection }
{
%<*thesis>
{
beforeskip = 6 bp ,
afterskip = 6 bp ,
format = \zihao { -4 } \setbaselineskip { 16 bp } \normalfont ,
%</thesis>
%<!thesis> format = \normalsize \normalfont ,
afterindent = true
format = \zihao { -4 } \setbaselineskip { 16 bp } \normalfont
}
\ctex_set:nn { paragraph }
{ afterindent = true }
\ctex_set:nn { subparagraph }
{ afterindent = true }
%</thesis>
%<!thesis> { 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
{
%<article> part,
%<!article> 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:}
% 定义一个灵活的章节标题命令专门处理不同的需求。
Expand Down