From d9708fcdbce4fd58921f746a388a8563e8e5ab48 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Oct 2021 20:42:04 +0000 Subject: easybook (19oct21) git-svn-id: svn://tug.org/texlive/trunk@60802 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/easybook/easybase.sty | 141 +++++++++++++++------ Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 +- .../texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 +- 3 files changed, 102 insertions(+), 43 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index cb1b30ed9cf..4299278afef 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}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/10/18}{1.3O} +\ProvidesExplPackage{easybase}{2021/10/18}{1.3P} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -569,7 +569,28 @@ { \tl_set:Nn \l__eb_footnote_choice_tl {#1} } } } +\cs_new_protected:Npn \eb_fn_shift_set:nnn #1#2#3 + { + \str_if_eq:nnTF {#1} { match } + { + \tl_set:cv { l__eb_fn#2_#3shift_tl } + { l__spb_super_script_#3shift_dim } + } + { \tl_set:cn { l__eb_fn#2_#3shift_tl } {#1} } + } +\cs_new_protected:Npn \eb_fn_format_set:nn #1#2 + { + \str_if_eq:nnTF {#1} { match } + { \bool_set_true:c { l__eb_fn#2_format_match_bool } } + { + \bool_set_false:c { l__eb_fn#2_format_match_bool } + \tl_set:cn { l__eb_fn#2_format_tl } {#1} + } + } + \bool_new:N \l__eb_fnpara_bottom_bool +\tl_new:N \l__eb_fnmate_format_tl +\tl_new:N \l__eb_fncust_format_tl \clist_new:N \l__eb_footnote_mulchoice_clist \ctex_define:nn { hdrset } { @@ -581,14 +602,14 @@ fnparindent .initial:n = 2em, fnpara-form .tl_set:N = \l__eb_fnpara_format_tl, - fnmark-pos .tl_set:N = \l__eb_fnmark_position_tl, - fnmark-pos .initial:n = super, + fntext-pos .tl_set:N = \l__eb_fntext_position_tl, + fntext-pos .initial:n = super, fntext-code .code:n = \eb_assign_fnmark_code:n {#1}, fntext-code .initial:n = - { ,\tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } }, - fnmark-form .tl_set:N = \l__eb_fnmark_format_tl, - fncust-form .tl_set:N = \l__eb_fncust_format_tl, - fnboth-form .meta:n = { fnmark-form = #1,fncust-form = #1 }, + { ,\tl_if_eq:NnF \l__eb_fntext_position_tl { super } { \space } }, + fnmate-form .code:n = \eb_fn_format_set:nn {#1} { mate }, + fncust-form .code:n = \eb_fn_format_set:nn {#1} { cust }, + fnboth-form .meta:n = { fnmate-form = #1,fncust-form = #1 }, footnotetype .multichoices:nn = { default,hang,bottom,para,flush } @@ -596,6 +617,13 @@ footnotetype .value_required:n = true, footnotetype .initial:n = hang, + fnmark-vshift .code:n = \eb_fn_shift_set:nnn {#1} { mark } { v }, + fnmark-hshift .code:n = \eb_fn_shift_set:nnn {#1} { mark } { h }, + fntext-vshift .code:n = \eb_fn_shift_set:nnn {#1} { text } { v }, + fnmark-vshift .initial:n = 0pt, + fnmark-hshift .initial:n = 0pt, + fntext-vshift .initial:n = 0pt, + fnmark-num .choices:nn = { plain,pifont,pifont*,pifont-sans,pifont-sans* } { \eb_fnmark_normal_label_set:nn {#1} { the@footnote } }, @@ -669,6 +697,7 @@ } } } + \cs_new_protected:Npn \eb_footnote_direct_hang: { \hbox_set:Nn \l_tmpa_box @@ -729,15 +758,7 @@ \@ifpackagewith{footmisc}{hang} {\cs_set_eq:NN \@makefntext \eb@makefntext}{} } -\eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext } - { \reset@font } - { - \linespread{\fp_use:N \l__eb_spread_footnote_fp} - \selectfont\ignorespaces - \l__eb_subfont_footnote_tl - } -\ProvideDocumentCommand{\super}{d()mo}{\textsuperscript{#2}} -\providecommand{\spbset}{\use_none:n} + \cs_set_protected:Npn \footref #1 { \group_begin: @@ -768,6 +789,13 @@ \@footnotemark } } +\eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext } + { \reset@font } + { + \linespread{\fp_use:N \l__eb_spread_footnote_fp} + \selectfont\ignorespaces + \l__eb_subfont_footnote_tl + } \ctex_at_end_package:nn { hyperref } { \cs_set:Npn \@xfootnotemark [#1] @@ -779,22 +807,45 @@ \H@@footnotemark } } + +\ProvideDocumentCommand{\super}{od()mo}{\textsuperscript{#3}} +\providecommand{\spbset}{\use_none:n} \NewDocumentCommand{\eb@fnmark@super}{sm} { \IfBooleanTF{#1} - {\super{#2}[0pt]} - {\super(\l__eb_fnmark_format_tl){#2}[0pt]} + {\super[\l__eb_fntext_vshift_tl]{#2}[0pt]} + { + \super[\l__eb_fnmark_vshift_tl] + (\l__eb_fnmate_format_tl){#2} + [\l__eb_fnmark_hshift_tl] + } } \cs_new_protected:Npn \eb_fnmark_format_initial: { - \spbset{super-format = { },nohshift} + \bool_if:NF \l__eb_fnmate_format_match_bool + { \spbset{super-format = { }} } \tl_use:N \l__eb_subfont_footnote_tl } +\bool_set_true:N \l__eb_normal_footnote_bool +\bool_new:N \l__eb_fnmate_format_match_bool +\bool_new:N \l__eb_fncust_format_match_bool +\cs_new_protected:Npn \eb_fn_format_if_match:T #1 + { + \bool_if:NTF \l__eb_normal_footnote_bool + { \bool_if:NT \l__eb_fnmate_format_match_bool {#1} } + { \bool_if:NT \l__eb_fncust_format_match_bool {#1} } + } +\cs_new_protected:Npn \eb_fn_set_eq_format: + { + \tl_set_eq:NN + \l__eb_fnmate_format_tl \l__spb_super_script_formati_tl + } \cs_set:Npn \@makefnmark { \hbox:n { \eb_fnmark_format_initial: + \eb_fn_format_if_match:T { \eb_fn_set_eq_format: } \tl_if_eq:NnTF \@mpfn { footnote } { \eb@fnmark@super{\eb@thefnmark} } { \eb@fnmark@super{\@thefnmark} } @@ -805,15 +856,18 @@ \hbox:n { \eb_fnmark_format_initial: - \tl_if_eq:NnT \l__eb_fnmark_position_tl { super } - { \eb@fnmark@super* } + \tl_use:N \l__eb_fnmark_before_tl + \tl_if_eq:NnTF \l__eb_fntext_position_tl { super } { - \tl_use:N \l__eb_fnmark_before_tl - {\l__eb_fnmark_format_tl{\@thefnmark}} - \tl_use:N \l__eb_fnmark_after_tl + \eb_fn_format_if_match:T { \tl_clear:N \l__eb_fnmate_format_tl } + \eb@fnmark@super* } + { \eb_fn_format_if_match:T { \eb_fn_set_eq_format: } } + {\l__eb_fnmate_format_tl{\@thefnmark}} + \tl_use:N \l__eb_fnmark_after_tl } } + \tl_clear:N \@thefnmark \tl_new:N \eb@thefnmark \cs_new:Npn \eb@@makefnmark #1#2 @@ -829,8 +883,12 @@ \cs_new_protected:Npn \eb_fncust_format_initial: { % \hdrset{fntext-code = { }} - \tl_set_eq:NN - \l__eb_fnmark_format_tl \l__eb_fncust_format_tl + \bool_set_false:N \l__eb_normal_footnote_bool + \bool_if:NF \l__eb_fncust_format_match_bool + { + \tl_set_eq:NN + \l__eb_fnmate_format_tl \l__eb_fncust_format_tl + } } \NewDocumentCommand{\Footnote}{O{#2}mm} { @@ -864,6 +922,19 @@ \seq_put_right:Nn \c__ctex_headings_seq { table } \seq_put_right:Nn \c__ctex_headings_seq { lstlisting } \seq_remove_duplicates:N \c__ctex_headings_seq +\cs_new_protected:Npn \eb_titletoc_hang_fix:n #1 + { + \bool_if:NT \eb@titletoc@hang@fix@bool + { + \contentspush + { + \bool_if:NT \l__eb_toc_number_color_bool + { \color{ctex@toc@number} } + \thecontentslabel + \hspace{\use:c { eb@toc@#1@numsep }} + } + } + } \cs_new_protected:Npn \eb_toc_assign_keys:n #1 { \ctex_define:n { tocset/#1 .meta:nn = { ctex/tocset/#1 } {##1} } @@ -882,18 +953,7 @@ \titlecontents{#1} [\dim_use:c { l__eb_toc_#1_indent_dim }] {\tl_use:c { l__eb_toc_#1_format_tl }} - { - \bool_if:NT \eb@titletoc@hang@fix@bool - { - \contentspush - { - \bool_if:NT \l__eb_toc_number_color_bool - { \color{ctex@toc@number} } - \thecontentslabel - \hspace{\use:c { eb@toc@#1@numsep }} - } - } - }{} + {\eb_titletoc_hang_fix:n {#1}}{} {\tl_use:c { l__eb_toc_#1_rule_tl }} } \seq_map_function:NN @@ -1888,8 +1948,7 @@ \LoadPackage[backend = biber]{biblatex} \clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource \tl_gset:Nn \blx@default@theheading { bibintoc } - \defbibheading{bibintoc}[\bibname] - {\eb_biber_title_level_spec:n {##1}} + \defbibheading{bibintoc}[\bibname]{\eb_biber_title_level_spec:n {##1}} \skip_zero:N \bibitemsep } \eb_at_end_preamble:n @@ -1993,6 +2052,7 @@ linktype/colors .code:n = { \bool_set_true:N \l__eb_toc_number_color_bool + \colorlet{ctex@toc@number}{ctex@link} \eb_put_hyperref:n { colorlinks } }, linktype/various .meta:n = linktype/colors, @@ -2038,7 +2098,6 @@ linkcol-all .code:n = { \eb_define_link_color:n { \exp_not:n {#1} } } } -\colorlet{ctex@toc@number}{ctex@link} \ctex_define:nx { style } { color .choice:, diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 3533a39aad0..2d517d72446 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/10/18}{1.3O} +\ProvidesExplClass{easybook}{2021/10/18}{1.3P} {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 0e70735bc75..b7c9f589107 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -18,7 +18,7 @@ %% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3O} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3P} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } -- cgit v1.2.3