diff options
author | Karl Berry <karl@freefriends.org> | 2024-04-20 19:26:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-04-20 19:26:20 +0000 |
commit | 634d502fc084474c97cf4bfb56a3da4ba5449d4e (patch) | |
tree | 7ddbcb52247bb1960249912bff5902dcb42f77c9 /Master/texmf-dist/tex/latex | |
parent | 5c5785010657cc192547f5e0f93520dd92a0dce6 (diff) |
easybook (20apr24)
git-svn-id: svn://tug.org/texlive/trunk@71016 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 84 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 |
3 files changed, 58 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index 6241165ab95..b28fd502d9a 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \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 } @@ -1242,19 +1242,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 @@ -1264,30 +1251,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 diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 56aed60ae8b..7cffe14e679 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \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 diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index 2f8e0d95507..48f32dc5d45 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -18,7 +18,7 @@ %% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -\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 |