summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/easybook/easybase.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook/easybase.sty')
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybase.sty60
1 files changed, 29 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty
index 153dad9cb12..03e40595877 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/02/11}{2024ab}
+\ProvidesExplPackage{easybase}{2024/02/12}{2024ac}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -57,21 +57,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}
@@ -99,13 +84,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
@@ -208,14 +206,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
@@ -328,7 +326,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} }
}