diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-18 19:49:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-18 19:49:23 +0000 |
commit | b6c67ad0856449e51a22add69b5c29dc448710a9 (patch) | |
tree | 89504e3aae5ceeb84da2b6fab8b625a30ceb756d /Master/texmf-dist/source | |
parent | 35c5189954f8dae9b32d44e6e315a98adc9dd7e3 (diff) |
easybook (18oct21)
git-svn-id: svn://tug.org/texlive/trunk@60794 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 163 |
1 files changed, 97 insertions, 66 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index ac09fdcaf72..a7d77a29ae3 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/10/16}{1.3N} +\ProvidesExplClass{easybook}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -319,7 +319,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/10/16}{1.3N} +\ProvidesExplPackage{easybase}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -797,9 +797,9 @@ { \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 +\cs_new:Npn \eb_fnmark_counter_pisans:N #1 { \ding{\int_eval:n { 191 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1 +\cs_new:Npn \eb_fnmark_counter_pisans_neg:N #1 { \ding{\int_eval:n { 201 + #1 }} } \cs_new:Npn \eb_int_format_trans:NN #1 { @@ -826,10 +826,10 @@ { \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 } + { pisans } + { \exp_not:N \eb_fnmark_counter_pisans:N } + { pisans* } + { \exp_not:N \eb_fnmark_counter_pisans_neg:N } } { \exp_not:N \c@footnote } } @@ -849,33 +849,49 @@ } \cs_set_eq:cN {#2} \l__eb_fnmark_short_tokens_tl } -\bool_new:N \l__eb_fntext_bottom_bool +\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 + { + \str_case:nnF {#1} + { + { bottom } + { \bool_set_true:N \l__eb_fnpara_bottom_bool } + { flush } + { + \tl_set:Nn \l__eb_footnote_choice_tl { default } + \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} + } + } + { + \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} } + } + } +\bool_new:N \l__eb_fnpara_bottom_bool +\clist_new:N \l__eb_footnote_mulchoice_clist \ctex_define:nn { hdrset } { - fnmargin .dim_set:N = \footnoteindent, - fnmargin .initial:n = 0.75em, + fnindent .dim_set:N = \footnoteindent, + fnindent .initial:n = 0.75em, fnparskip .skip_set:N = \footparskip, fnparskip .initial:n = 0ex, fnparindent .dim_set:N = \footparindent, fnparindent .initial:n = 2em, - fntext-form .tl_set:N = \l__eb_fntext_format_tl, + 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, - fnmark-code .code:n = \eb_assign_fnmark_code:n {#1}, - fnmark-code .initial:n = + 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 }, footnotetype .multichoices:nn = - { default,hang,bottom,para } - { - \tl_if_eq:nnTF { bottom } {#1} - { \bool_set_true:N \l__eb_fntext_bottom_bool } - { \tl_set:Nn \l__eb_footnotetype_choice_tl {#1} } - }, + { default,hang,bottom,para,flush } + { \eb_footnote_choice_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -912,7 +928,11 @@ { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } } - \bool_if:NT \l__eb_fntext_bottom_bool + \eb_fnpara_if_pos_bottom: + } +\cs_new_protected:Npn \eb_fnpara_if_pos_bottom: + { + \bool_if:NT \l__eb_fnpara_bottom_bool { \cs_set:Npn \@makecol { @@ -948,57 +968,66 @@ } } } -\cs_set:Npn \@makefntext #1 +\cs_new_protected:Npn \eb_footnote_direct_hang: { - \group_begin: - \str_case:Vn \l__eb_footnotetype_choice_tl + \hbox_set:Nn \l_tmpa_box { - { hang } { \use_i:nn } - { default } { \use_ii:nn } + \dim_compare:nNnTF { \footnoteindent } > { 0pt } + { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } + { \eb@makefnmark } + } + \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } + \dim_zero:N \rightmargin + \dim_set_eq:NN \linewidth \columnwidth + \dim_sub:Nn \linewidth { \leftmargin } + \parshape\@ne\leftmargin\linewidth + \@setpar{{\@@par}} + \mode_leave_vertical: + \hbox_overlap_left:n { \box_use:N \l_tmpa_box } + } +\cs_new_protected:Npn \eb_footnote_direct_default: + { + \noindent + \clist_if_in:NnT \l__eb_footnote_mulchoice_clist { flush } + { \dim_zero:N \footnoteindent } + \int_case:nn { \dim_sign:V \footnoteindent } + { + { 1 } { \use_i:nnn } + { 0 } { \use_ii:nnn } + { -1 } { \use_iii:nnn } } + { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } + { \hbox_overlap_left:n { \eb@makefnmark } } { - \hbox_set:Nn \l_tmpa_box + \hbox_overlap_left:n { - \dim_compare:nNnTF { \footnoteindent } > { 0pt } - { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } - { \eb@makefnmark } - } - \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } - \dim_zero:N \rightmargin - \dim_set_eq:NN \linewidth \columnwidth - \dim_sub:Nn \linewidth { \leftmargin } - \parshape\@ne\leftmargin\linewidth - \@setpar{{\@@par}} - \mode_leave_vertical: - \hbox_overlap_left:n { \box_use:N \l_tmpa_box } - } - { - \noindent - \int_case:nn { \dim_sign:V \footnoteindent } - { - { 1 } { \use_i:nnn } - { 0 } { \use_ii:nnn } - { -1 } { \use_iii:nnn } - } - { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } - { \hbox_overlap_left:n { \eb@makefnmark } } - { - \hbox_overlap_left:n - { - \hbox_to_wd:nn { -\footnoteindent } - { \eb@makefnmark\hss } - } + \hbox_to_wd:nn { -\footnoteindent } + { \eb@makefnmark\hss } } } + } +\cs_set:Npn \@makefntext #1 + { + \group_begin: + \str_case:Vn \l__eb_footnote_choice_tl + { + { hang } { \use_i:nn } + { default } { \use_ii:nn } + } + { \eb_footnote_direct_hang: } + { \eb_footnote_direct_default: } \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent - \l__eb_fntext_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnotetype_choice_tl { hang } { \par } + \l__eb_fnpara_format_tl{#1} + \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext \ctex_at_end_package:nn { footmisc } - { \cs_set_eq:NN \@makefntext \eb@makefntext } + { + \@ifpackagewith{footmisc}{hang} + {\cs_set_eq:NN \@makefntext \eb@makefntext}{} + } \eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext } { \reset@font } { @@ -1079,7 +1108,7 @@ { \eb@fnmark@super* } { \tl_use:N \l__eb_fnmark_before_tl - \l__eb_fnmark_format_tl{\@thefnmark} + {\l__eb_fnmark_format_tl{\@thefnmark}} \tl_use:N \l__eb_fnmark_after_tl } } @@ -1098,7 +1127,7 @@ } \cs_new_protected:Npn \eb_fncust_format_initial: { - \hdrset{fnmark-code = { }} + % \hdrset{fntext-code = { }} \tl_set_eq:NN \l__eb_fnmark_format_tl \l__eb_fncust_format_tl } @@ -1914,7 +1943,7 @@ name = \tl_use:c { c__eb_name_#1_tl }, style = easy-theorem,#5 ] - \bool_if:NT \l__eb_thmbox_bool + \bool_if:NT \l__eb_thmframe_bool { \@ifpackageloaded{tcolorbox} {\tcolorboxenvironment{#1}{#4}} @@ -1924,7 +1953,7 @@ } \msg_new:nnn { easybase } { need-tcolorbox } { - Now~that~the~thmbox~option~is~true. \\ + Now~that~the~thmframe~option~is~true. \\ Please~load~the~tcolorbox~macro~package. } \cs_set_eq:NN \EBNewTheorem \DeclareTheorem @@ -1949,9 +1978,11 @@ { \ctex_define:nn { thmset } { #1 .tl_set:N = #2 } } \ctex_define:nn { thmset } { - thmbox .bool_set:N = \l__eb_thmbox_bool, + thmframe .bool_set:N = \l__eb_thmframe_bool, + thmframe .default:n = true, + thmframe .initial:n = false, + thmbox .meta:n = { thmframe = #1 }, thmbox .default:n = true, - thmbox .initial:n = false, notebraces .tl_set:N = \l__eb_thm_notebraces_tl, unknown .code:n = \eb_msg_unknown_option:n { thmset } } @@ -2391,7 +2422,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/16}{1.3N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3O} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } |