diff options
author | Karl Berry <karl@freefriends.org> | 2024-04-29 20:29:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-04-29 20:29:50 +0000 |
commit | fd651337e718d42ddfe97e21b5092b705b702cd6 (patch) | |
tree | 9da1e31b0b259b01544ad1bc4449a65585cc5f80 /Master/texmf-dist/source/latex/easybook/easybook.dtx | |
parent | 37a62ecc04fb4629f7926b5a9be882aaccfd9a2a (diff) |
easybook (29apr24)
git-svn-id: svn://tug.org/texlive/trunk@71125 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/easybook/easybook.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 71 |
1 files changed, 47 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index 2a60d8894fa..14f666ba703 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2024/04/26}{2024bb} +\ProvidesExplClass{easybook}{2024/04/28}{2024bc} {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/26}{2024bb} +\ProvidesExplPackage{easybase}{2024/04/28}{2024bc} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -1309,25 +1309,43 @@ \skip_if_eq:nnF { \eb@toc@lol@skip } { \c_zero_skip } { \addtocontents{lol}{\protect\addvspace{\skip_use:N \eb@toc@lol@skip}} } } -\cs_new_protected:Npn \NewTitleCommand #1#2 - { - \newcounter{#1} - \cs_set_eq:cN { #1mark } \use_none:n +\cs_new_protected:Npn \eb_title_base_set_eq:nn #1#2 + { + \tl_set_eq:cc { CTEX@#2@beforeskip } { CTEX@#1@beforeskip } + \tl_set_eq:cc { CTEX@#2@afterskip } { CTEX@#1@afterskip } + \bool_set_eq:cc { CTEX@#2@numbering } { CTEX@#1@numbering } + \bool_set_eq:cc { CTEX@#2@fixskip } { CTEX@#1@fixskip } + \bool_set_eq:cc { CTEX@#2@hang } { CTEX@#1@hang } + \bool_set_eq:cc { CTEX@#2@runin } { CTEX@#1@runin } + \cs_set_eq:cc { CTEX@#2@tocline } { CTEX@#1@tocline } + \tl_set_eq:cc { CTEX@#2@break } { CTEX@#1@break } + \tl_set_eq:cc { CTEX@#2@format } { CTEX@#1@format } + \tl_set_eq:cc { CTEX@#2@nameformat } { CTEX@#1@nameformat } + \tl_set_eq:cc { CTEX@#2@numberformat } { CTEX@#1@numberformat } + \tl_set_eq:cc { CTEX@#2@titleformat } { CTEX@#1@titleformat } + \tl_set_eq:cc { CTEX@#2@aftername } { CTEX@#1@aftername } + \tl_set_eq:cc { CTEX@#2@aftertitle } { CTEX@#1@aftertitle } + } +\NewDocumentCommand{\NewTitleCommand}{omm} + { + \newcounter{#2} + \cs_set_eq:cN { #2mark } \use_none:n \tl_clear:N \l__ctex_tmp_tl - \__ctex_initial_heading:n {#1} - \__ctex_def_heading_keys:n {#1} + \__ctex_initial_heading:n {#2} + \__ctex_def_heading_keys:n {#2} \exp_args:No \ctex_define:n { \l__ctex_tmp_tl } - \cs_gset_protected:cpx {#1} + \cs_gset_protected:cpx {#2} { - \exp_not:N \@startsection{#1}{#2} - {\exp_not:c { CTEX@#1@indent }} - {\exp_not:c { CTEX@#1@beforeskip }} - {\exp_not:c { CTEX@#1@afterskip }} - {\exp_not:N \normalfont\exp_not:c { CTEX@#1@format }} + \exp_not:N \@startsection{#2}{#3} + {\exp_not:c { CTEX@#2@indent }} + {\exp_not:c { CTEX@#2@beforeskip }} + {\exp_not:c { CTEX@#2@afterskip }} + {\exp_not:N \normalfont\exp_not:c { CTEX@#2@format }} } - \cs_new:cpn { CTEX@#1@tocline } ##1##2 + \cs_new:cpn { CTEX@#2@tocline } ##1##2 { \CTEXnumberline{##1}##2 } - \exp_args:Nc \providecommand { toclevel@#1 }{#2} + \exp_args:Nc \providecommand { toclevel@#2 }{#3} + \IfValueT{#1}{\eb_title_base_set_eq:nn {#1} {#2}} } \NewDocumentCommand{\NewTitleEntryCommand}{O{toc}m} { @@ -1419,14 +1437,14 @@ \tl_gset:Nn \g__eb_bilist_permute_value_tl {#1} \str_if_eq:nnTF {#1} { mix } { - \eb_preto_cmd:nn { CTEX@addtocline } - { \addtocontents{toc}{\boolfalse{bitoc}} } - \eb_preto_cmd:nn { CTEX@addbitocline } - { \addtocontents{toc}{\booltrue{bitoc}} } + \AddToHook{cmd/CTEX@addtocline/before}[bitoc] + {\addtocontents{toc}{\boolfalse{bitoc}}} + \AddToHook{cmd/CTEX@addbitocline/before}[bitoc] + {\addtocontents{toc}{\booltrue{bitoc}}} } { - \RemoveFromHook{cmd/CTEX@addtocline/before} - \RemoveFromHook{cmd/CTEX@addbitocline/before} + \RemoveFromHook{cmd/CTEX@addtocline/before}[bitoc] + \RemoveFromHook{cmd/CTEX@addbitocline/before}[bitoc] } }, name .tl_set:N = \l__eb_print_index_name_tl, @@ -1716,12 +1734,17 @@ \cs_set:Npn \@starttoc #1 { \group_begin: + \makeatletter \file_if_exist_input:n { \jobname.#1 } \UseHookWithArguments{starttoc/after}{1}{#1} \boolfalse{@nobreak} \group_end: } -\AtEndDocument{\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }} +\AddToHook{enddocument/afterlastpage} + { + \IfHookEmptyTF{starttoc/after}{} + {\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }} + } \cs_set_eq:NN \eb@ctexsetii \ctex_set:nn \cs_new_protected:Npn \SetTocStyle #1#2#3 @@ -2504,7 +2527,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/26}{2024bb} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/28}{2024bc} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 |