diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook/easybase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index 55718c41e73..c0a087cf62e 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{etoolbox} -\ProvidesExplPackage{easybase}{2024/09/30}{2024eb} +\ProvidesExplPackage{easybase}{2024/10/02}{2024ed} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -522,25 +522,14 @@ \UseFntSymbsList{empty} \cs_set_eq:NN \DefineFntSymbols \SetFntSymbsList \cs_set_eq:NN \setfntsymbol \UseFntSymbsList -\cs_new:Npn \eb_int_type_trans:NN #1 - { - \str_case:nn {#1} - { - { A } { \int_to_Alph:n } - { a } { \int_to_alph:n } - { 1 } { \int_to_arabic:n } - { I } { \int_to_Roman:n } - { i } { \int_to_roman:n } - { c } { \exp_args:NV \zhnumber } - { s } { \eb_int_to_symbols:n } - } - } +\tl_new:N \l__eb_fnmarktext_tmpa_tl +\tl_new:N \l__eb_fnmarktext_tmpb_tl \cs_new_protected:Npn \eb_fnmarktext_normal_label_set:Nn #1#2 { - \tl_set:Nn \l__eb_fnmarktext_number_type_tl {#2} + \tl_set:Nn \l__eb_fnmarktext_tmpa_tl {#2} \cs_set:Npx #1 { - \str_case:VnT \l__eb_fnmarktext_number_type_tl + \str_case:VnT \l__eb_fnmarktext_tmpa_tl { { plain } { \exp_not:N \int_use:N } @@ -558,18 +547,33 @@ \cs_set_eq:NN \thedownfootnote \thefootnote } \cs_generate_variant:Nn \msg_warning:nnnn { nnnV } +\cs_new:Npn \eb_footnote_int_trans:n #1 + { + \prop_item:Nn \l__eb_int_trans_cmds_prop {#1} + \exp_not:N \c@footnote + } +\prop_set_from_keyval:Nn \l__eb_int_trans_cmds_prop + { + A = \exp_not:N \int_to_Alph:n, + a = \exp_not:N \int_to_alph:n, + 1 = \exp_not:N \int_to_arabic:n, + I = \exp_not:N \int_to_Roman:n, + i = \exp_not:N \int_to_roman:n, + c = \exp_not:n { \exp_args:NV \zhnumber }, + s = \exp_not:N \eb_int_to_symbols:n + } \cs_new_protected:Npn \eb_fnmarktext_short_label_set:Nn #1#2 { - \tl_set:Nn \l__eb_fnmarktext_short_tokens_tl {#2} + \tl_set:Nn \l__eb_fnmarktext_tmpb_tl {#2} \clist_map_inline:nn { A,a,1,I,i,c,s } { \regex_match:nnTF {##1} {#2} { \regex_replace_once:nnN {##1} - { \c{eb_int_type_trans:NN} ##1 \c{c@footnote} } - \l__eb_fnmarktext_short_tokens_tl - \cs_set_eq:NN #1 \l__eb_fnmarktext_short_tokens_tl + { \c{eb_footnote_int_trans:n}\0 } + \l__eb_fnmarktext_tmpb_tl + \cs_set:Npx #1 { \l__eb_fnmarktext_tmpb_tl } \clist_map_break: } { @@ -2057,6 +2061,20 @@ \tl_clear:N \l__eb_eqsymb_intro_tl \ignorespaces } +\cs_new:Npn \eb_tl_exist_noempty:cT #1#2 + { \tl_if_exist:cT {#1} { \tl_if_empty:cF {#1} {#2} } } +\cs_new:Npn \eb_undefine_counter:n #1 + { + \cs_undefine:c { c@#1 } + \cs_undefine:c { the#1 } + \exp_args:Nc \providecommand { c@@ckpt }{} + \@removefromreset{#1}{@ckpt} + } +\ProvideDocumentCommand{\declarecounter}{mo} + { + \eb_undefine_counter:n {#1} + \IfValueTF{#2}{\newcounter{#1}[#2]}{\newcounter{#1}} + } \cs_new_protected:Npn \eb_theorem_load_thmtools: { \RequirePackage{amsthm,thmtools} @@ -2066,7 +2084,15 @@ {\eb@declaretheoremstyle@save[##1,##3]{##2}} \RenewDocumentCommand{\declaretheorem}{+O{}m+O{}} { + \cs_undefine:c {##2} + \eb_undefine_counter:n {##2} + \eb_tl_exist_noempty:cT { g__eb_thmt_##2_parent_tl } + { + \exp_args:Nnv \@removefromreset {##2} + { g__eb_thmt_##2_parent_tl } + } \eb@declaretheorem@save[style = default,##1,##3]{##2} + \tl_gset:cV { g__eb_thmt_##2_parent_tl } \thmt@parent \settheoremtocline{##2} { \listnumberline{##2} @@ -2092,7 +2118,6 @@ bodyfont = \normalfont, postheadspace = 1em ] - \cs_undefine:N \proof \DeclareFloatList{theorem}{loe} \AssignPartialExt{loe}{ple} \eb_preto_cmd:nn { listoftheorems } @@ -2131,13 +2156,14 @@ \DeclareFloatList{theorem}{thlist} \AssignPartialExt{thlist}{ple} } -\str_case:Vn \l__eb_theorem_support_tl +\str_case:VnT \l__eb_theorem_support_tl { { thmtools } { \eb_theorem_load_thmtools: } { keytheorems } { \eb_theorem_load_keytheorems: } } + { \cs_undefine:N \proof } \setchemformula { math-scripts = false, |