diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 174 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 |
3 files changed, 137 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index 9eea28444d8..05e6bf034b8 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -13,11 +13,10 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/07/30}{1.28} +\ProvidesExplPackage{easybase}{2021/08/01}{1.28b} {Typeset Chinese theses or books} \cs_generate_variant:Nn \int_to_arabic:n { v } -\cs_generate_variant:Nn \int_to_alph:n { v } \cs_generate_variant:Nn \dim_add:Nn { NV,Nv } \cs_generate_variant:Nn \dim_set:Nn { NV } \cs_generate_variant:Nn \prop_set_from_keyval:Nn { NV } @@ -449,8 +448,6 @@ \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } -\tl_new:N \l__eb_fnmark_number_choice_tl -\bool_new:N \l__eb_fntext_bottom_bool \ctex_define:nn { style } { footwith .choices:nn = @@ -459,6 +456,73 @@ footwith .value_required:n = true, footwith .initial:n = chapter } +\NewDocumentCommand{\eb_assign_fnmark_code:n} + {>{\SplitArgument{1}{,}}m} + {\eb_assign_fnmark_code_pos:nn #1} +\cs_new_protected:Npn \eb_assign_fnmark_code_pos:nn #1#2 + { + \tl_set:Nn \l__eb_fnmark_before_tl {#1} + \tl_if_novalue:nTF {#2} + { \tl_clear:N \l__eb_fnmark_after_tl } + { \tl_set:Nn \l__eb_fnmark_after_tl {#2} } + } +\cs_new:Npn \eb_fnmark_counter_pifont:N #1 + { \ding{\int_eval:n { 171 + #1 }} } +\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1 + { \ding{\int_eval:n { 181 + #1 }} } +\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1 + { \ding{\int_eval:n { 191 + #1 }} } +\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1 + { \ding{\int_eval:n { 201 + #1 }} } +\cs_new:Npn \eb_int_format_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 } + } + } +\cs_new_protected:Npn \eb_fnmark_normal_label_set:nn #1#2 + { + \tl_set:Nn \l__eb_fnmark_number_type_tl {#1} + \cs_set:cpx {#2} + { + \str_case:VnT \l__eb_fnmark_number_type_tl + { + { plain } + { \exp_not:N \int_use:N } + { pifont } + { \exp_not:N \eb_fnmark_counter_pifont:N } + { pifont* } + { \exp_not:N \eb_fnmark_counter_pifont_neg:N } + { pifont-sans } + { \exp_not:N \eb_fnmark_counter_pifont_sans:N } + { pifont-sans* } + { \exp_not:N \eb_fnmark_counter_pifont_sans_neg:N } + } + { \exp_not:N \c@footnote } + } + } +\cs_new_protected:Npn \eb_fnmark_shorter_label_set:nn #1#2 + { + \tl_set:Nn \l__eb_fnmark_shorter_label_tl {#1} + \eb_clist_map_inline:nn + { A,a,1,I,i,c } + { + \tl_if_in:nnT {#1} {##1} + { + \tl_replace_once:Nnn \l__eb_fnmark_shorter_label_tl {##1} + { \eb_int_format_trans:NN ##1 \c@footnote } + \seq_map_break: + } + } + \cs_set_eq:cN {#2} \l__eb_fnmark_shorter_label_tl + } +\bool_new:N \l__eb_fntext_bottom_bool \ctex_define:nn { hdrset } { fnmargin .dim_set:N = \footnoteindent, @@ -471,9 +535,9 @@ fnmark-pos .tl_set:N = \l__eb_fnmark_position_tl, fnmark-pos .initial:n = super, - afterfnmark .tl_set:N = \l__eb_fnmark_after_tl, - afterfnmark .initial:n = - { \tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } }, + fnmark-code .code:n = \eb_assign_fnmark_code:n {#1}, + fnmark-code .initial:n = + { ,\tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } }, fnmark-form .tl_set:N = \l__eb_fnmark_format_tl, footnotetype .multichoices:nn = @@ -488,8 +552,18 @@ fnmark-num .choices:nn = { plain,pifont,pifont*,pifont-sans,pifont-sans* } - { \tl_set:Nn \l__eb_fnmark_number_choice_tl {#1} }, + { \eb_fnmark_normal_label_set:nn {#1} { the@footnote } }, fnmark-num .value_required:n = true, + fnmark-num/unknown .code:n = + { \eb_fnmark_shorter_label_set:nn {#1} { the@footnote } }, + fntext-num .choices:nn = + { plain,pifont,pifont*,pifont-sans,pifont-sans* } + { \eb_fnmark_normal_label_set:nn {#1} { thefootnote } }, + fntext-num .value_required:n = true, + fntext-num/unknown .code:n = + { \eb_fnmark_shorter_label_set:nn {#1} { thefootnote } }, + fnboth-num .meta:n = { fntext-num = #1,fnmark-num = #1 }, + fnboth-num .initial:n = plain, unknown .code:n = \eb_msg_unknown_option:n { hdrset } } @@ -603,20 +677,58 @@ } \ProvideDocumentCommand{\super}{mo}{\textsuperscript{#1}} \providecommand{\spb@textsuperscript@save}{\textsuperscript} -\providecommand{\footref}[1] +\cs_set_protected:Npn \footref #1 { \group_begin: - \unrestored@protected@xdef\@thefnmark{\ref{#1}} + \unrestored@protected@xdef\eb@thefnmark{\ref{#1}} \group_end: \@footnotemark } +\cs_set_protected:Npn \footnote + { + \@ifnextchar [ + {\@xfootnote} + { + \exp_args:NV \stepcounter \@mpfn + \eb_current_label:n { @footnote } + \protected@xdef\@thefnmark{\thempfn} + \protected@xdef\eb@thefnmark{\the@footnote} + \@footnotemark + \@footnotetext + } + } +\cs_set:Npn \footnotemark + { + \@ifnextchar [ + {\@xfootnotemark} + { + \stepcounter{footnote} + \protected@xdef\eb@thefnmark{\the@footnote} + \@footnotemark + } + } +\ctex_at_end_package:nn { hyperref } + { + \cs_set:Npn \@xfootnotemark [#1] + { + \group_begin: + \setcounter{footnote}{#1} + \unrestored@protected@xdef\eb@thefnmark{\the@footnote} + \group_end: + \@footnotemark + } + } \cs_set:Npn \@makefnmark { \hbox:n { \tl_use:N \l__eb_subfont_footnote_tl \tl_use:N \l__eb_fnmark_format_tl - {\super{\@thefnmark}[0pt]} + { + \tl_if_eq:NnTF \@mpfn { footnote } + { \super{\eb@thefnmark}[0pt] } + { \super{\@thefnmark}[0pt] } + } } } \cs_new:Npn \eb@makefnmark @@ -627,8 +739,12 @@ \tl_use:N \l__eb_fnmark_format_tl { \tl_if_eq:NnT \l__eb_fnmark_position_tl { super } - { \spb@textsuperscript@save }{\@thefnmark} - \tl_use:N \l__eb_fnmark_after_tl + { \spb@textsuperscript@save } + { + \tl_use:N \l__eb_fnmark_before_tl + \@thefnmark + \tl_use:N \l__eb_fnmark_after_tl + } } } } @@ -645,30 +761,8 @@ \cs_new:Npn \Footnote #1 { \Footnotemark{#1}\@footnotetext } \cs_new:Npn \Footnotemark #1 { \eb@@makefnmark{#1}\@footnotemark } \cs_new:Npn \Footnotetext #1 { \eb@@makefnmark{#1}\@footnotetext } -\cs_new:Npn \eb_fnmark_counter_pifont:N #1 - { \ding{\int_eval:n { 171 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1 - { \ding{\int_eval:n { 181 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1 - { \ding{\int_eval:n { 191 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1 - { \ding{\int_eval:n { 201 + #1 }} } -\cs_new:Npn \eb_footnote_counter:N #1 - { - \str_case:VnF \l__eb_fnmark_number_choice_tl - { - { plain } { \int_use:N #1 } - { pifont } { \eb_fnmark_counter_pifont:N #1 } - { pifont* } { \eb_fnmark_counter_pifont_neg:N #1 } - { pifont-sans } { \eb_fnmark_counter_pifont_sans:N #1 } - { pifont-sans* } { \eb_fnmark_counter_pifont_sans_neg:N #1 } - } - { \int_use:N #1 } - } -\cs_new:Npn \eb_alph:n #1 { \int_to_alph:v { c@#1 } } -\cs_set:Npn \thefootnote { \eb_footnote_counter:N \c@footnote } -\cs_set:Npn \thempfootnote { \eb_alph:n { mpfootnote } } \cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi } +\cs_set:Npn \thempfootnote { \int_to_alph:n { \c@mpfootnote } } \contentsuse{lstlisting}{lol} \seq_put_left:Nn \c__ctex_headings_seq { chapter } @@ -912,11 +1006,10 @@ \tl_remove_once:cn { theeb@#4 } {#5} \eb_current_label:n { eb@#4 } } -\cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@#1 } } \cs_new:Npn \eb_section_counter_prefix:n #1 { \int_compare:nNnT { \c@chapter } > { 0 } { \use:c { the#1chapter }. } - \eb_arabic:n { #1section } + \int_to_arabic:v { c@#1section } } \cs_set:Npn \thebichapter { \eb_arabic:n { bichapter } } \cs_set:Npn \thebisection { \eb_section_counter_prefix:n { bi } } @@ -1868,7 +1961,10 @@ \clist_map_inline:nn { page,none } { \tl_if_eq:NnT \l_keys_value_tl {##1} - { \clist_map_break:n { \colorlet{ctex@toc@number}{black} } } + { + \colorlet{ctex@toc@number}{black} + \clist_map_break: + } } }, linktoc .default:n = all, diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 869ec593ba9..5c8e26a8a23 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/07/30}{1.28} +\ProvidesExplClass{easybook}{2021/08/01}{1.28b} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index 3e8302d018e..979d4213da9 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -11,7 +11,7 @@ %% conditions of the CC-BY 4.0 License. %% The latest version of this license is in %% https://creativecommons.org/licenses/by/4.0/legalcode -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/30}{1.28} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/01}{1.28b} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } |