diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/easybook/easybook.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index f8f3e85ddba..ce53b486005 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,14 +15,14 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/12/08}{1.41L} +\ProvidesExplClass{easybook}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool \bool_set_true:N \l__eb_class_mode_book_bool \tl_new:N \g__eb_config_tl -\tl_new:N \l__eb_font_choice_tl +\tl_new:N \l__eb_font_value_tl \clist_new:N \g__eb_options_clist \cs_new_protected:Npn \eb_put_ctexbook:n #1 { \PassOptionsToClass{#1}{ctexbook} } @@ -35,18 +35,12 @@ enmode .meta:n = { newline,scheme = plain }, font .choices:nn = { noto,garamond,times,times*,libertine,palatino,auto } - { \tl_set:Nn \l__eb_font_choice_tl {#1} }, + { \tl_set:Nn \l__eb_font_value_tl {#1} }, font .value_required:n = true, font .initial:n = auto, cjkfont .code:n = \eb_put_ctexbook:n { fontset = #1 }, paper .code:n = \PassOptionsToPackage{#1}{geometry}, - mathfont .choices:nn = - { - noto,notosans,times,libertine, - charter,garamond,none,nc,stix - } - { \tl_set:Nn \l__eb_mathfont_choice_tl {#1} }, - mathfont .value_required:n = true, + mathfont .tl_set:N = \l__eb_mathfont_value_tl, mathfont .initial:n = times, class .choice:, class .value_required:n = true, @@ -72,7 +66,7 @@ \RequirePackage{easybase} \ctex_at_end:n { - \use:c { eb@font@load@\l__eb_font_choice_tl } + \use:c { eb@font@load@\l__eb_font_value_tl } \tl_if_empty:NF \g__eb_config_tl { \file_input:n { \g__eb_config_tl } } } @@ -231,18 +225,16 @@ } \cs_new_protected:Npn \eb_put_newtxmath:n #1 { \PassOptionsToPackage{#1}{newtxmath} } -\str_case:VnT \l__eb_mathfont_choice_tl - { - { times } { } - { nc } { \eb_put_newtxmath:n { nc } } - { noto } { \eb_put_newtxmath:n { noto } } - { stix } { \eb_put_newtxmath:n { stix2 } } - { charter } { \eb_put_newtxmath:n { charter } } - { notosans } { \eb_put_newtxmath:n { notosans } } - { garamond } { \eb_put_newtxmath:n { ebgaramond } } - { libertine } { \eb_put_newtxmath:n { libertine } } - } - { \LoadPackage{newtxmath+bm} } +\cs_generate_variant:Nn \eb_put_newtxmath:n { V } +\str_case:VnF \l__eb_mathfont_value_tl + { + { times } { \LoadPackage{newtxmath+bm} } + { none } { } + } + { + \eb_put_newtxmath:V \l__eb_mathfont_value_tl + \LoadPackage{newtxmath+bm} + } \ctex_set:n { @@ -319,7 +311,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/12/08}{1.41L} +\ProvidesExplPackage{easybase}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -463,7 +455,7 @@ \bool_new:N \l__eb_mark_uppercase_bool \bool_new:N \l__eb_chap_counter_withpart_bool -\tl_new:N \l__eb_foot_counter_parent_choice_tl +\tl_new:N \l__eb_foot_counter_parent_value_tl \eb_seq_map_inline:nn { @@ -473,11 +465,8 @@ } { \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } - \cs_new_protected:cpn {#1} ##1 { \ctex_set:nn {#1} {##1} } + \cs_new_protected:cpn { eb#1 } ##1 { \ctex_set:nn {#1} {##1} } } -\keys_define:nn { } { ctex/link .inherit:n = ctex/refset } -\ctex_define:n { link .meta:nn = { ctex/link } {#1} } -\cs_set_eq:NN \link \refset \eb_seq_map_inline:nn { style,subfont,spread,bibset,thmset,hdrset,tocset } { @@ -581,7 +570,7 @@ withpart .default:n = true, withpart .initial:n = false, rulewidth .dim_set:N = \l__eb_rule_width_dim, - rulewidth .initial:n = 0.6pt, + rulewidth .initial:n = 0.5pt, uppercase .bool_set:N = \l__eb_mark_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, @@ -747,7 +736,7 @@ { footwith .choices:nn = { part,page,chapter } - { \tl_set:Nn \l__eb_foot_counter_parent_choice_tl {#1} }, + { \tl_set:Nn \l__eb_foot_counter_parent_value_tl {#1} }, footwith .value_required:n = true, footwith .initial:n = chapter } @@ -830,7 +819,7 @@ } \cs_set_eq:cN {#2} \l__eb_fnmate_short_tokens_tl } -\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 +\cs_new_protected:Npn \eb_footnote_value_handle:n #1 { \str_case:nnF {#1} { @@ -838,7 +827,7 @@ { \bool_set_true:N \l__eb_fnpara_bottom_bool } { flush } { - \tl_set:Nn \l__eb_footnote_choice_tl { default } + \tl_set:Nn \l__eb_footnote_value_tl { default } \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} } } @@ -846,7 +835,7 @@ \bool_lazy_or:nnT { \str_if_eq_p:nn {#1} { hang } } { \str_if_eq_p:nn {#1} { default } } - { \tl_set:Nn \l__eb_footnote_choice_tl {#1} } + { \tl_set:Nn \l__eb_footnote_value_tl {#1} } } } \cs_new_protected:Npn \eb_fnmate_shift_set:nnn #1#2#3 @@ -892,7 +881,7 @@ footnotetype .multichoices:nn = { default,hang,bottom,para,flush } - { \eb_footnote_choice_handle:n {#1} }, + { \eb_footnote_value_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -927,7 +916,7 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_counter_withpart_bool { \counterwithin*{chapter}{part} } - \str_case:VnT \l__eb_foot_counter_parent_choice_tl + \str_case:VnT \l__eb_foot_counter_parent_value_tl { { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } @@ -1016,7 +1005,7 @@ \cs_set:Npn \@makefntext #1 { \group_begin: - \str_case:Vn \l__eb_footnote_choice_tl + \str_case:Vn \l__eb_footnote_value_tl { { hang } { \use_i:nn } { default } { \use_ii:nn } @@ -1026,7 +1015,7 @@ \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent \l__eb_fnpara_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } + \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext @@ -1737,7 +1726,7 @@ marginpar .initial:n = \rmfamily\footnotesize, unknown .code:n = \eb_msg_abandon_option:n { subfont } } -\cs_new_protected:Npn \addsubfont #1#2 +\cs_new_protected:Npn \addtosubfont #1#2 { \str_case:nnF {#1} { @@ -2441,17 +2430,17 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41L} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41N} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 { \keys_set:nn { eb/exercise } {#1} } -\cs_set_protected:Npn \addtcbstyle #1#2 +\cs_set_protected:Npn \addtotcbstyle #1#2 { \tcbset{#1/.append~style = {#2}} } \cs_set_protected:Npn \deftcbstyle #1#2 { \tcbset{#1/.style = {#2}} } \cs_new_protected:Npn \tcbappstyle - { \@ifstar{\deftcbstyle}{\addtcbstyle} } + { \@ifstar{\deftcbstyle}{\addtotcbstyle} } \cs_set_eq:NN \newtcbstyle \deftcbstyle \keys_define:nn { eb/exercise } { @@ -2467,7 +2456,7 @@ tocnumsep .initial:n = 1em, label .tl_set:N = \eb@tc@exercise@label, enumitem .code:n = \setexerlist{#1}, - tcolorbox .code:n = \addtcbstyle{exercise}{#1} + tcolorbox .code:n = \addtotcbstyle{exercise}{#1} } \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } |