summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook/easybook.dtx
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/easybook.dtx
parent059925fc0cab13a83a74089aeee51f4b09bbd914 (diff)
CTAN sync 202404200301
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx88
1 files changed, 58 insertions, 30 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