diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-20 20:17:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-20 20:17:34 +0000 |
commit | 7f67c7c0b66228ec6cdb3c7e8c42b50a5ad40105 (patch) | |
tree | b1e04fbefcc5d105f09f6c45d15c729cc4b225ea /Master/texmf-dist/tex | |
parent | ffede0c46f9c6e83b45c32d99aa60773fc0e1e9b (diff) |
easybook (20may21)
git-svn-id: svn://tug.org/texlive/trunk@59278 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 135 |
1 files changed, 87 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index e4e979a09ab..cb17d7f65a5 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,etoolbox} -\ProvidesExplClass{easybook}{2021/05/18}{1.25l}{beta} +\ProvidesExplClass{easybook}{2021/05/19}{1.25m}{beta} \cs_generate_variant:Nn \eb_ctex_define:nn { nx } \cs_generate_variant:Nn \int_to_arabic:n { v } @@ -124,21 +124,20 @@ { xindy } { imakeidx }, { CJKmath = true } { xeCJK }, { no-math } { fontspec }, - { noto,upint } { newtxmath } + { upint } { newtxmath } } { \PassOptionsToPackage #1 } \eb_put_ctexbook:n { \g__eb_options_clist } \LoadClass[UTF8]{ctexbook} \bool_new:N \l__eb_multoc_bool -\bool_new:N \l__eb_notomath_bool \bool_new:N \l__eb_uppercase_bool \bool_new:N \l__eb_chap_withpart_bool -\tl_new:N \l__eb_foot_numberwith_tl +\tl_new:N \l__eb_foot_numparent_choice_tl \seq_const_from_clist:Nn \c__eb_options_path_seq { - style,elsefont,spread, + style,subfont,spread, refset,bibset,thmset, geoset,hdrset,tocset } @@ -162,19 +161,19 @@ withpart .bool_set:N = \l__eb_chap_withpart_bool, withpart .default:n = true, withpart .initial:n = false, - notomath .bool_set:N = \l__eb_notomath_bool, - notomath .default:n = true, - notomath .initial:n = true, rulewidth .dim_set:N = \l__eb_rule_width_dim, rulewidth .initial:n = 0.75pt, uppercase .bool_set:N = \l__eb_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, - figpath .tl_set:N = \l_eb_graphics_path_tl, + figurepath .tl_set:N = \l_eb_graphics_path_tl, footwith .choices:nn = { part,page,chapter } - { \tl_set_eq:NN \l__eb_foot_numberwith_tl \l_keys_choice_tl }, + { + \tl_set_eq:NN + \l__eb_foot_numparent_choice_tl \l_keys_choice_tl + }, footwith .value_required:n = true, footwith .initial:n = chapter, @@ -205,11 +204,6 @@ enumitem, listings } -\ctex_at_end_preamble:n - { - \bool_if:NT \l__eb_notomath_bool - { \RequirePackage{newtxmath,bm} } - } \ctex_at_end:n { \tl_if_empty:NF \g__eb_config_tl @@ -336,8 +330,6 @@ \cs_new_protected:Npn \kaishu { \eb_switch_family:n { kaishu } } \cs_new_protected:Npn \fangsong { \eb_switch_family:n { fangsong } } } -\eb_at_end_preamble:n - { \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } \includepdfset{fitpaper = true} \geometry @@ -475,7 +467,10 @@ fnmark-num .choices:nn = { plain,pifont,pifont*,pifont-sans,pifont-sans* } - { \tl_gset_eq:NN \l__eb_fnmark_number_tl \l_keys_choice_tl }, + { + \tl_gset_eq:NN + \l__eb_fnmark_number_choice_tl \l_keys_choice_tl + }, fnmark-num .value_required:n = true } @@ -522,6 +517,7 @@ } \tl_if_empty:NF \l_eb_graphics_path_tl { \exp_args:No \graphicspath { \l_eb_graphics_path_tl } } + \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } \eb_at_end_preamble:n @@ -534,12 +530,12 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_withpart_bool { \counterwithin*{chapter}{part} } - \tl_if_eq:NnT \l__eb_foot_numberwith_tl { part } + \tl_if_eq:NnT \l__eb_foot_numparent_choice_tl { part } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{part} } - \tl_if_eq:NnT \l__eb_foot_numberwith_tl { page } + \tl_if_eq:NnT \l__eb_foot_numparent_choice_tl { page } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{page} @@ -552,14 +548,14 @@ { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces - \l__eb_font_footnote_tl + \l__eb_subfont_footnote_tl } \eb_patch_cmd:Nnn \@mpfootnotetext { \reset@font } { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces - \l__eb_font_footnote_tl + \l__eb_subfont_footnote_tl } \ctex_after_end_preamble:n { @@ -567,7 +563,7 @@ \eb_patch_cmd:Nnn \@footnotemark { \@makefnmark } { - \tl_use:N \l__eb_font_footnote_tl + \tl_use:N \l__eb_subfont_footnote_tl \tl_use:N \l__eb_fnmark_format_tl {\hbox:n { \textsuperscript{\@thefnmark} }} } @@ -575,7 +571,7 @@ } \cs_set:Npn \@makefnmark { - \tl_use:N \l__eb_font_footnote_tl + \tl_use:N \l__eb_subfont_footnote_tl \tl_use:N \l__eb_fnmark_format_tl { \hbox:n @@ -610,7 +606,7 @@ { \ding{\int_eval:n { 201 + #1 }} } \cs_new:Npn \eb_footnote_counter:N #1 { - \tl_case:NnF \l__eb_fnmark_number_tl + \tl_case:NnF \l__eb_fnmark_number_choice_tl { \c__eb_fnmark_number_plain_tl { \int_use:N #1 } @@ -685,7 +681,7 @@ } } -\cs_new:Npn \EbNumberline #1 +\cs_new:Npn \EbNumberLine #1 { \CTEXifname { @@ -742,9 +738,9 @@ { \ctex_set:n { - chapter/tocline = \EbNumberline{##1}##2, - section/tocline = \EbNumberline{##1}##2, - subsection/tocline = \EbNumberline{##1}##2 + chapter/tocline = \EbNumberLine{##1}##2, + section/tocline = \EbNumberLine{##1}##2, + subsection/tocline = \EbNumberLine{##1}##2 } }, hang .default:n = true, @@ -972,8 +968,8 @@ { \bisection{\eb@toc@title}{\eb@bitoc@title} } }{ \IfBooleanTF{#2} - { \eb_title_mark_notoc:n {\eb@toc@title} } - { \eb_title_mark_intoc:n {\eb@toc@title} } + {\eb_title_mark_notoc:n {\eb@toc@title}} + {\eb_title_mark_intoc:n {\eb@toc@title}} } } \cs_new_protected:Npn \eb_biber_title_level_bool:n #1 @@ -993,7 +989,7 @@ \bool_if:NTF \l__eb_multoc_bool { \twocolumn } { \onecolumn } }{ \boolfalse{@restonecol} - \bool_if:NT \l__eb_multoc_bool { \twocolumn } + \bool_if:NTF \l__eb_multoc_bool { \twocolumn } { \onecolumn } } } { \tl_set:Nn \l__eb_toc_type_tl { article } } @@ -1137,23 +1133,66 @@ } } -\tl_new:N \l__eb_font_table_tl -\tl_new:N \l__eb_font_figure_tl -\tl_new:N \l__eb_font_listing_tl -\tl_new:N \l__eb_font_footnote_tl +\tl_new:N \l__eb_subfont_table_tl +\tl_new:N \l__eb_subfont_figure_tl +\tl_new:N \l__eb_subfont_listing_tl +\tl_new:N \l__eb_subfont_footnote_tl + +\seq_const_from_clist:Nn \c__eb_subfont_math_choice_seq + { + noto,notosans,times,scholax,stix, + charter,ebgaramond,libertine,none + } +\seq_map_inline:Nn \c__eb_subfont_math_choice_seq + { \tl_const:cn { c__eb_subfont_math_#1_tl } {#1} } -\eb_ctex_define:nn { elsefont } +\eb_ctex_define:nn { subfont } { - table-cap .tl_set:N = \l__eb_font_table_tl, + table-cap .tl_set:N = \l__eb_subfont_table_tl, table-cap .initial:n = \sffamily\small, - figure-cap .tl_set:N = \l__eb_font_figure_tl, + figure-cap .tl_set:N = \l__eb_subfont_figure_tl, figure-cap .initial:n = \sffamily\small, - listing-cap .tl_set:N = \l__eb_font_listing_tl, + listing-cap .tl_set:N = \l__eb_subfont_listing_tl, listing-cap .initial:n = \sffamily\small, - footnote .tl_set:N = \l__eb_font_footnote_tl, + footnote .tl_set:N = \l__eb_subfont_footnote_tl, footnote .initial:n = \rmfamily, marginpar .tl_set:N = \marginfont, - marginpar .initial:n = \rmfamily\footnotesize + marginpar .initial:n = \rmfamily\footnotesize, + + math .choices:xn = + { \seq_use:Nn \c__eb_subfont_math_choice_seq { , } } + { + \tl_gset_eq:NN + \l__eb_subfont_math_choice_tl \l_keys_choice_tl + }, + math .value_required:n = true, + math .initial:n = noto + } + +\cs_new_protected:Npn \eb_put_newtxmath:n #1 + { \PassOptionsToPackage{#1}{newtxmath} } +\eb_at_end_preamble:n + { + \tl_case:NnT \l__eb_subfont_math_choice_tl + { + \c__eb_subfont_math_noto_tl + { \eb_put_newtxmath:n { noto } } + \c__eb_subfont_math_notosans_tl + { \eb_put_newtxmath:n { notosans } } + \c__eb_subfont_math_ebgaramond_tl + { \eb_put_newtxmath:n { ebgaramond } } + \c__eb_subfont_math_times_tl + { \eb_put_newtxmath:n { noOT1 } } + \c__eb_subfont_math_libertine_tl + { \eb_put_newtxmath:n { libertine,noOT1 } } + \c__eb_subfont_math_stix_tl + { \eb_put_newtxmath:n { stix2,noOT1 } } + \c__eb_subfont_math_scholax_tl + { \eb_put_newtxmath:n { nc,noOT1 } } + \c__eb_subfont_math_charter_tl + { \eb_put_newtxmath:n { charter,noOT1 } } + } + { \RequirePackage{newtxmath,bm} } } \fp_new:N \l__eb_spread_line_fp @@ -1186,9 +1225,9 @@ \DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} -\DeclareCaptionFont{eb@table@font}{\l__eb_font_table_tl} -\DeclareCaptionFont{eb@figure@font}{\l__eb_font_figure_tl} -\DeclareCaptionFont{eb@listing@font}{\l__eb_font_listing_tl} +\DeclareCaptionFont{eb@table@font}{\l__eb_subfont_table_tl} +\DeclareCaptionFont{eb@figure@font}{\l__eb_subfont_figure_tl} +\DeclareCaptionFont{eb@listing@font}{\l__eb_subfont_listing_tl} \captionsetup { format = hang, @@ -1304,7 +1343,7 @@ { \tl_const:cn { c__eb_name_#1_tl } {#3} } { \tl_const:cn { c__eb_name_#1_tl } {#2} } } -\NewDocumentCommand{\EbNewtheorem} +\NewDocumentCommand{\EbNewTheorem} {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { \ctex_at_end_preamble:n @@ -1392,7 +1431,7 @@ { remark } { 注 } [ numbered = no ], { { proof } { 证明 } [ numbered = no,qed = \qedsymbol ] } } - { \EbNewtheorem #1 } + { \EbNewTheorem #1 } } \ctex_at_end_package:nn { tasks } @@ -1940,7 +1979,7 @@ part = { pagestyle = empty, - tocline = \EbNumberline{#1}#2, + tocline = \EbNumberLine{#1}#2, format = \color{ctex@frame}\sffamily\Huge, aftername = { |