diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-13 23:48:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-13 23:48:13 +0000 |
commit | 083d59e4b247e408456d1833ad80bd724df72d43 (patch) | |
tree | 931fee20cb20b08841e295205d516955654a6c55 /Master/texmf-dist/source/latex | |
parent | 7bf6cb7522ed05d9e300c4a34b443c0a47ea57ed (diff) |
easybook (14feb24)
git-svn-id: svn://tug.org/texlive/trunk@69839 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index 8124d21badb..16f5b792c01 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/02/11}{2024ab} +\ProvidesExplClass{easybook}{2024/02/12}{2024ac} {Easily typesetting Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -297,7 +297,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2024/02/11}{2024ab} +\ProvidesExplPackage{easybase}{2024/02/12}{2024ac} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -334,21 +334,6 @@ } \cs_new_protected:Npn \eb_at_end_preamble:n { \BeforeBeginEnvironment{document} } -\cs_new_protected:Npn \eb_match_load_package:n #1 - { - \regex_match:nnTF { \[ } {#1} - { - \seq_set_split:Nnn \l_tmpa_seq { [ } {#1} - \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl - \seq_pop_right:NN \l_tmpa_seq \l_tmpb_tl - \IfFileExists{\l_tmpa_tl.sty} - { - \exp_last_unbraced:Nx \RequirePackage - { [\l_tmpb_tl }{\l_tmpa_tl} - }{} - } - { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} } - } \cs_new_protected:Npn \eb_if_package_loaded:nnF #1#2#3 { \IfPackageLoadedTF{#1} @@ -376,13 +361,26 @@ { \eb@usepackage@save{##1}[#3] } } } -\NewDocumentCommand{\LoadPackage}{O{}m} +\cs_new_protected:Npn \eb_match_load_package:n #1 { - \seq_set_split:Nnn \l_tmpb_seq { + } {#2} - \int_compare:nNnT { \seq_count:N \l_tmpb_seq } = { 1 } - { \PassOptionsToPackage{#1}{#2} } - \seq_map_function:NN - \l_tmpb_seq \eb_match_load_package:n + \regex_match:nnTF { \[.*\] } {#1} + { \eb@case@load@package #1 } + { \eb@case@load@package{#1} } + } +\NewDocumentCommand{\eb@case@load@package}{omO{}} + { + \IfNoValueTF{#1} + {\IfFileExists{#2.sty}{\RequirePackage{#2}[#3]}{}} + {\IfFileExists{#2.sty}{\RequirePackage[#1]{#2}[#3]}{}} + } +\cs_new_protected:Npn \LoadPackage #1 + { + \int_compare:nTF { \clist_count:n {#1} <= 1 } + { \RequirePackage } + { + \eb_seq_map_inline:nn {#1} + { \eb_match_load_package:n {##1} } + } } \bool_set_true:N \l__eb_class_mode_book_bool @@ -485,14 +483,14 @@ \LoadPackage { - spbmark[text]+ - ulem[normalem]+ - enumitem[shortlabels,inline]+ - chemformula+siunitx+pifont+ - geometry+marginnote+ - pdfpages+multicol+ - fancyhdr+titletoc+caption+ - tabularray+ + [text]{spbmark}, + [normalem]{ulem}, + [{shortlabels,inline}]{enumitem}, + chemformula,siunitx,pifont, + geometry,marginnote, + pdfpages,multicol, + fancyhdr,titletoc,caption, + tabularray, listings } \cs_new_protected:Npn \eb_package_date_check:nn #1#2 @@ -605,7 +603,7 @@ {\tl_set:cn { eb@mark@#1@label } {##1##2}} \cs_new_protected:cpn { eb_mark_#1_name_parse:n } ##1 { - \regex_match:nnTF { \[ } {##1} + \regex_match:nnTF { \[.*\] } {##1} { \use:c { eb@mark@#1@label@layout }##1 } { \use:c { eb@mark@#1@label@layout }{##1} } } @@ -2343,7 +2341,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/02/11}{2024ab} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/02/12}{2024ac} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 |