summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-04-20 03:01:21 +0000
committerNorbert Preining <norbert@preining.info>2024-04-20 03:01:21 +0000
commitb235955f171a9dc4a73c82b7b44fc2be52576393 (patch)
treecdcb94838ac78a3b3dc09997b9741e39082d103e /macros/latex/contrib/easybook
parent059925fc0cab13a83a74089aeee51f4b09bbd914 (diff)
CTAN sync 202404200301
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx88
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin608631 -> 609380 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex31
3 files changed, 83 insertions, 36 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 64ece3b038..b1e774981d 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2021/11/15]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2024/04/02}{2024ar}
+\ProvidesExplClass{easybook}{2024/04/19}{2024as}
{Easily typesetting Chinese theses or books}
\bool_new:N \l__eb_compile_draft_bool
@@ -297,7 +297,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2021/11/15]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2024/04/02}{2024ar}
+\ProvidesExplPackage{easybase}{2024/04/19}{2024as}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1519,19 +1519,6 @@
\seq_put_right:Nn \c__ctex_headings_seq { figure }
\seq_put_right:Nn \c__ctex_headings_seq { lstlisting }
\seq_remove_duplicates:N \c__ctex_headings_seq
-\cs_new_protected:Npn \eb_toc_entry_if_hang:n #1
- {
- \bool_if:NTF \l__eb_toc_entry_hang_bool
- { \contentspush }
- { \use:n }
- {
- \bool_if:NTF \l__eb_toc_number_color_bool
- { \textcolor{ctex@toc@number} }
- { \use:n }
- { \thecontentslabel }
- \tl_use:c { l__eb_toc_#1_after_tl }
- }
- }
\cs_new_protected:Npn \eb_toc_format_define:n #1
{
\ctex_define:n
@@ -1541,30 +1528,71 @@
#1/tocformat+ .code:n = \tl_put_right:cn { l__eb_toc_#1_format_tl } {##1},
#1/tocformat~+ .code:n = \tl_put_right:cn { l__eb_toc_#1_format_tl } {##1},
#1/tocindent .tl_set:c = l__eb_toc_#1_indent_tl,
+ #1/toclabel .cs_set:cp = { eb_toc_entry_#1:nnn } ##1##2##3,
#1/tocrule .tl_set:c = l__eb_toc_#1_rule_tl,
#1/tocafter .tl_set:c = l__eb_toc_#1_after_tl,
- #1/tocbelow .tl_set:c = l__eb_toc_#1_below_tl
+ #1/tocbelow .tl_set:c = l__eb_toc_#1_below_tl,
+ #1/tocbegin .meta:n = { #1/tocbelow = {##1} },
+ #1/tocsep .tl_set:c = l__eb_toc_#1_sep_tl,
+ #1/tocend .tl_set:c = l__eb_toc_#1_end_tl
}
}
-\cs_new_protected:Npn \eb_toc_format_initial:n #1
+\tl_new:N \l_eb_tmpa_tl
+\tl_new:N \l_eb_tmpb_tl
+\cs_new_protected:Npn \eb_toc_format_initial:nn #1#2
{
- \titlecontents{#1}
- [\tl_use:c { l__eb_toc_#1_indent_tl }]
- {\tl_use:c { l__eb_toc_#1_format_tl }}
- {\eb_toc_entry_if_hang:n {#1}}{}
- {\tl_use:c { l__eb_toc_#1_rule_tl }}
- [\tl_use:c { l__eb_toc_#1_below_tl }]
- \ctex_set:nn {#1}
+ \exp_last_unbraced:Nx
+ \use:n
+ {
+ \exp_not:N
+ \titlecontents
+ \tl_use:N \l_eb_tmpa_tl
+ \exp_not:n
+ {
+ {#2}
+ [\tl_use:c { l__eb_toc_#2_indent_tl }]
+ {\tl_use:c { l__eb_toc_#2_format_tl }}
+ {\use:c { eb_toc_entry_#2:nnn } { \thecontentslabel } {#2} {#1}}{}
+ {\tl_use:c { l__eb_toc_#2_rule_tl }}
+ [\tl_use:c { l__eb_toc_#2_below_tl }]
+ }
+ \exp_not:o { \l_eb_tmpb_tl }
+ }
+ \ctex_set:nn {#2}
{
tocindent = 0em,
- tocrule = \tocrule{$\cdot$},
- tocafter = \hspace{1em}
+ tocrule = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}},
+ toclabel =
+ {
+ \bool_if:NTF \l__eb_toc_entry_hang_bool
+ { \IfBooleanTF{##3}{\use:n}{\contentspush} }
+ { \use:n }
+ {
+ \bool_if:NTF \l__eb_toc_number_color_bool
+ { \textcolor{ctex@toc@number} }
+ { \use:n }
+ { ##1 }
+ \tl_use:c { l__eb_toc_##2_after_tl }
+ }
+ },
+ tocafter = \hspace{1em},
+ tocsep = .—,
+ tocend = .
}
}
-\cs_new_protected:Npn \RegisterTocName #1
+\NewDocumentCommand{\RegisterTocName}{sm}
{
- \eb_toc_format_define:n {#1}
- \eb_toc_format_initial:n {#1}
+ \IfBooleanT{#1}
+ {
+ \tl_set:Nn \l_eb_tmpa_tl {*}
+ \tl_set:Nn \l_eb_tmpb_tl
+ {
+ [\tl_use:c { l__eb_toc_#2_sep_tl }]
+ [\tl_use:c { l__eb_toc_#2_end_tl }]
+ }
+ }
+ \eb_toc_format_define:n {#2}
+ \eb_toc_format_initial:nn {#1} {#2}
}
\seq_map_function:NN
\c__ctex_headings_seq \RegisterTocName
@@ -2392,7 +2420,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/02}{2024ar}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/19}{2024as}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 505b625244..f2c68334c9 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index edd3c476ce..d4025ca7e0 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -23,8 +23,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK使用手册,
- version = v2024ar,
- date = 2024/04/02,
+ version = v2024as,
+ date = 2024/04/19,
authors = 瞿毅,
info = 简便地排版中文学位论文或书籍,
email = toquyi@163.com,
@@ -113,6 +113,7 @@
\IfBooleanF{#1}{\cnltx@checkdefault{\hfill\newline}}
}
\newnote{\newtag}[1][New]{\fbox{#1}}
+\newnote{\newtagv}[2][New]{#1\\#2}
% Multi-row values alignment when there are many choices
\newcommand{\leftfillchoice}[2]
{
@@ -831,6 +832,8 @@
\command{tocrule}[\sarg\harg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}]
生成目录引导线的命令,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令与 \keyis{dotalign}{false} 效果相同。命令带 \harg{} 号参数不添加目录页码,此时无格式的页码被保存在 \cs{thecontentspage} 命令中,可以配合盒子命令设置不同的页码左右间距和对齐方式。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 为 \meta{引导点} 的放大倍数。\meta{页码格式} 中最后一个命令可以带有一个参数为页码编号。
\end{commands}
+ \keyval{toclabel}{标题标签格式}\dtag\newtagv{2024as}%
+ 目录中各类型条目标题标签的格式,可与 \option{tocline} 选项联用设置标题。其中参数 \code{\#1} 代表标签的编号 \cs{thecontentslabel},参数 \code{\#2} 代表 \meta{条目名}。
\keyval{tocafter}{距离命令}\dtag\Default{\cs*{hspace}\Marg{1em}}
目录条目标签与标题间的代码,默认为插入 \code{1em} 横向距离。
\keyval{tocbelow}{距离命令}\dtag
@@ -847,14 +850,23 @@
tocrule = \tocrule[0.6pc](1.1){.}[\zihao{5}],
tocline = \CTEXnumberline{#1}#2
},
- section/tocrule = \tocrule-{}\makebox[1cm]{\rlap{\thecontentspage}}
+ section/toclabel = \contentspush{#1\hspace{0.5em}},
+ section/tocrule = \tocrule-{}\makebox[1cm]{\rlap{\thecontentspage}}
}
\end{ctexexam}
\end{options}
\begin{commands}
- \command{RegisterTocName}[\marg{条目名}]
- 给条目类型名称为 \meta{条目名} 的标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后选项初始值与图表条目相同。
+ \command{RegisterTocName}[\sarg\marg{条目名}]
+ 给条目类型名称为 \meta{条目名} 的标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后选项初始值与图表条目相同。带有星号参数的命令使注册目录的条目形成一个段落,此时多出下面三个选项可用:
+ \begin{options}
+ \keyval{tocbegin}{开始代码}\dtag\newtagv{2024as}%
+ 当前级别目录条目第一个标题前的代码,仅在存在更高级别的条目时有效。
+ \keyval{tocsep}{中间代码}\dtag\Default{\Marg{.—}}\newtagv{2024as}%
+ 当前级别目录条目每个标题之间的代码。
+ \keyval{tocend}{结束代码}\dtag\Default{\Marg{.}}\newtagv{2024as}%
+ 当前级别目录条目最后一个标题后的代码。
+ \end{options}
\command{contentsuse}[\marg{条目名}\marg{扩展名}]
激活条目类型名称为 \meta{条目名} 的目录定制功能,它使用的目录文件后缀为 \meta{扩展名}。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。
\command{DeclareFloatList}[\marg{条目名}\marg{扩展名}]
@@ -869,7 +881,7 @@
\DeclareFloatList{algorithm}{loa}
\listofalgorithms[multoc] % 在正文中输出双栏算法目录
\end{ctexexam}
- \command{AllotCaptionExt}[\marg{条目名}\marg{扩展名}]\newtag%
+ \command{AllotCaptionExt}[\marg{条目名}\marg{扩展名}]
给条目类型名称为 \meta{条目名} 的标题分配目录文件 \meta{扩展名},注意 \meta{扩展名} 需要被定义在 \cs*{ext@}\meta{条目名} 命令中才有效(\pkg*{caption} 宏包的默认定义形式)。可以使不同的 \meta{条目名} 共享一个目录:
\begin{ctexexam}
\AllotCaptionExt{table}{lof}
@@ -1421,6 +1433,13 @@
\item 新增目录文件扩展名分配命令 \cs{AllotCaptionExt}。
\end{version}
\shortversion{v = 2024aq,date = 2022/03/31,changes = 修复命令 \cs{ebifbitoc} 用于条目缩进选项 \option{tocindent} 失效的问题。}
+ \begin{version}[v = 2024as,date = 2024/04/19]
+ \changed
+ \item 目录条目样式注册命令 \cs{RegisterTocName} 增加星号参数,支持设置段落型目录。
+ \added
+ \item 新增目录条目标题标签设置的选项 \option{toclabel}。
+ \item 新增段落型目录条目附加代码的选项 \option{tocbegin}、\option{tocsep} 和 \option{tocend}。
+ \end{version}
\end{changelog}
\nocite{*}