From 1657eb1ea20d453e066007abbeed9a6fe1eec8f1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 8 Dec 2021 21:07:11 +0000 Subject: easybook (8dec21) git-svn-id: svn://tug.org/texlive/trunk@61251 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/easybook/easybook.dtx | 168 ++++++++++++--------- 1 file changed, 96 insertions(+), 72 deletions(-) (limited to 'Master/texmf-dist/source/latex/easybook') diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index e2a2605b371..f8f3e85ddba 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/12/06}{1.41I} +\ProvidesExplClass{easybook}{2021/12/08}{1.41L} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -39,6 +39,7 @@ 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, @@ -47,9 +48,6 @@ { \tl_set:Nn \l__eb_mathfont_choice_tl {#1} }, mathfont .value_required:n = true, mathfont .initial:n = times, - paper .choice:, - paper .value_required:n = true, - paper/unknown .code:n = \PassOptionsToPackage{#1}{geometry}, class .choice:, class .value_required:n = true, class/book .code:n = { }, @@ -321,7 +319,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/12/06}{1.41I} +\ProvidesExplPackage{easybase}{2021/12/08}{1.41L} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -431,9 +429,7 @@ floatpage .bool_set:N = \l__eb_float_page_bool, floatpage .default:n = true, floatpage .initial:n = false, - paper .choice:, - paper .value_required:n = true, - paper/unknown .code:n = \PassOptionsToPackage{#1}{geometry}, + paper .code:n = \PassOptionsToPackage{#1}{geometry}, paper .initial:n = a4paper, class .choice:, class .value_required:n = true, @@ -1080,10 +1076,10 @@ } } \eb_patch_cmd:wnn { \@footnotetext,\@mpfootnotetext } - { \reset@font } + { \footnotesize } { \setspread{\fp_use:N \l__eb_spread_footnote_fp} - \l__eb_subfont_footnote_tl + \tl_use:N \l__eb_subfont_footnote_tl } \ctex_at_end_package:nn { hyperref } { @@ -1212,7 +1208,7 @@ \ctex_define:n { figure/#1 .meta:nn = { ctex/#1 } {##1} } \ctex_define:n { table/#1 .meta:nn = { ctex/#1 } {##1} } \ctex_define:n { list/#1 .meta:nn = { ctex/#1 } {##1} } -\cs_new_protected:Npn \eb_titletoc_hang_fix:n #1 +\cs_new_protected:Npn \eb_titletoc_if_hang_fix:n #1 { \bool_if:NT \eb@titletoc@hang@fix@bool { @@ -1239,7 +1235,7 @@ \titlecontents{#1} [\dim_use:c { l__eb_toc_#1_indent_dim }] {\tl_use:c { l__eb_toc_#1_format_tl }} - {\eb_titletoc_hang_fix:n {#1}}{} + {\eb_titletoc_if_hang_fix:n {#1}}{} {\tl_use:c { l__eb_toc_#1_rule_tl }} } \seq_map_function:NN @@ -1273,7 +1269,7 @@ { \ctex_define:nn { tocset } { - #1-all .code:n = + #1-every .code:n = { \ctex_set:n { @@ -1302,8 +1298,8 @@ hang .bool_set:N = \eb@titletoc@hang@fix@bool, hang .default:n = true, hang .initial:n = false, - pnumwd .code:n = \contentsmargin{#1}, - pnumwd .initial:n = 1.55em, + pagenumwd .code:n = \contentsmargin{#1}, + pagenumwd .initial:n = 1.55em, unknown .code:n = \eb_msg_abandon_option:n { tocset } } \NewDocumentCommand{\tocrule}{st-O{0.7pc}D(){1.2}mO{}} @@ -1378,7 +1374,7 @@ figure/tocline = \listnumberline{figure}, lstlisting/tocline = \listnumberline{lstlisting} } -\ctex_set:nn { tocset } { tocafter-all = \hspace{1em} } +\ctex_set:nn { tocset } { tocafter-every = \hspace{1em} } \prop_new:N \l__eb_list_label_entry_prop \prop_set_from_keyval:Nn \l__eb_list_label_entry_prop { @@ -1498,16 +1494,16 @@ \ctex_define:nn { style } { - figure-connect .tl_set:N = \l__eb_figure_connector_tl, - table-connect .tl_set:N = \l__eb_table_connector_tl, - listing-connect .tl_set:N = \l__eb_lstlisting_connector_tl, - equation-connect .tl_set:N = \l__eb_equation_connector_tl, - connect-all .meta:n = + connect-figure .tl_set:N = \l__eb_connect_figure_tl, + connect-table .tl_set:N = \l__eb_connect_table_tl, + connect-listing .tl_set:N = \l__eb_connect_lstlisting_tl, + connect-equation .tl_set:N = \l__eb_connect_equation_tl, + connect-every .meta:n = { - figure-connect = #1,table-connect = #1, - listing-connect = #1,equation-connect = #1 + connect-figure = #1,connect-table = #1, + connect-listing = #1,connect-equation = #1 }, - connect-all .initial:n = { . }, + connect-every .initial:n = { . }, unknown .code:n = \eb_msg_abandon_option:n { style } } \eb_seq_map_inline:nn @@ -1518,7 +1514,7 @@ \int_compare:nNnT { \c@chapter } > { 0 } { \thechapter - \tl_use:c { l__eb_#1_connector_tl } + \tl_use:c { l__eb_connect_#1_tl } } \int_to_arabic:v { c@#1 } } @@ -1724,71 +1720,96 @@ } } -\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 - \ctex_define:nn { subfont } { - caption-table .tl_set:N = \l__eb_subfont_table_tl, - caption-figure .tl_set:N = \l__eb_subfont_figure_tl, - caption-listing .tl_set:N = \l__eb_subfont_listing_tl, - caption .meta:n = + caption-table .tl_set:N = \l__eb_subfont_cap_table_tl, + caption-figure .tl_set:N = \l__eb_subfont_cap_figure_tl, + caption-listing .tl_set:N = \l__eb_subfont_cap_listing_tl, + caption-every .meta:n = { caption-table = #1,caption-figure = #1, caption-listing = #1 }, - caption .initial:n = \sffamily\small, + caption-every .initial:n = \sffamily\small, footnote .tl_set:N = \l__eb_subfont_footnote_tl, - footnote .initial:n = \rmfamily, - marginpar .tl_set:N = \marginfont, + footnote .initial:n = \rmfamily\footnotesize, + marginpar .tl_set:N = \l__eb_subfont_marginpar_tl, marginpar .initial:n = \rmfamily\footnotesize, unknown .code:n = \eb_msg_abandon_option:n { subfont } } - -\fp_new:N \l__eb_spread_table_fp -\fp_new:N \l__eb_spread_math_fp -\fp_new:N \l__eb_spread_caption_fp -\fp_new:N \l__eb_spread_footnote_fp - +\cs_new_protected:Npn \addsubfont #1#2 + { + \str_case:nnF {#1} + { + { table } + { \tl_put_right:Nn \l__eb_subfont_cap_table_tl {#2} } + { figure } + { \tl_put_right:Nn \l__eb_subfont_cap_figure_tl {#2} } + { listing } + { \tl_put_right:Nn \l__eb_subfont_cap_listing_tl {#2} } + { every } + { + \tl_put_right:Nn \l__eb_subfont_cap_table_tl {#2} + \tl_put_right:Nn \l__eb_subfont_cap_figure_tl {#2} + \tl_put_right:Nn \l__eb_subfont_cap_listing_tl {#2} + } + } + { \tl_put_right:cn { l__eb_subfont_#1_tl } {#2} } + } \ctex_define:nn { spread } { - line .code:n = \AfterPreamble{\setspread{#1}}, - line .initial:n = 1.354, - table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.354, - math .fp_set:N = \l__eb_spread_math_fp, - math .initial:n = 1.2, - caption .fp_set:N = \l__eb_spread_caption_fp, - caption .initial:n = 1.2, - footnote .fp_set:N = \l__eb_spread_footnote_fp, - footnote .initial:n = 1.2, - spread-all .meta:n = { line = #1,table = #1,math = #1,caption = #1,footnote = #1 }, + line .code:n = \AfterPreamble{\setspread{#1}}, + line .initial:n = 1.354, + table .fp_set:N = \l__eb_spread_table_fp, + table .initial:n = 1.354, + math .fp_set:N = \l__eb_spread_math_fp, + math .initial:n = 1.2, + footnote .fp_set:N = \l__eb_spread_footnote_fp, + footnote .initial:n = 1.2, + caption-table .fp_set:N = \l__eb_spread_cap_table_fp, + caption-figure .fp_set:N = \l__eb_spread_cap_figure_fp, + caption-listing .fp_set:N = \l__eb_spread_cap_listing_fp, + caption-every .meta:n = + { + caption-table = #1,caption-figure = #1, + caption-listing = #1 + }, + caption-every .initial:n = 1.2, + every .meta:n = + { + line = #1,table = #1,math = #1, + caption-every = #1,footnote = #1 + }, unknown .code:n = \eb_msg_abandon_option:n { spread } } +\tl_gset:Nn \marginfont { \l__eb_subfont_marginpar_tl } \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} -\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} +\eb_seq_map_inline:nn + { table,figure,listing } + { + \DeclareCaptionFont{eb@#1@font} + { + \setspread{\fp_use:c { l__eb_spread_cap_#1_fp }} + \tl_use:c { l__eb_subfont_cap_#1_tl } + } + } \captionsetup { format = hang, - font = {stretch = \fp_use:N \l__eb_spread_caption_fp}, labelfont = {color = ctex@frame}, labelsep = quad, singlelinecheck = true, belowskip = 0pt, aboveskip = 10pt } -\captionsetup[table]{font += eb@table@font} -\captionsetup[figure]{font += eb@figure@font} -\captionsetup[lstlisting]{font += eb@listing@font} +\captionsetup[table]{font = eb@table@font} +\captionsetup[figure]{font = eb@figure@font} +\captionsetup[lstlisting]{font = eb@listing@font} \captionsetup[subfigure] { labelformat = parens, - font+ = eb@figure@font, + font = eb@figure@font, belowskip = 2pt, aboveskip = 6pt } @@ -2039,13 +2060,16 @@ \c__eb_thmtools_entry_clist { notebraces = \l__eb_thm_notebraces_tl } \exp_last_unbraced:NNV \declaretheoremstyle[\c__eb_thmtools_entry_clist]{easy-theorem} - \deftheorem{lemma}{引理} - \deftheorem{example}{例} - \deftheorem{theorem}{定理} - \deftheorem{corollary}{推论} - \deftheorem{definition}{定义} - \deftheorem{proposition}{性质} - \deftheorem{remark}{注}[numbered = no] + \deftheorem{exam}{例} + \deftheorem{conj}{猜想} + \deftheorem{defi}{定义} + \deftheorem{prop}{性质} + \deftheorem{lemm}{引理} + \deftheorem{theo}{定理} + \deftheorem{corol}{推论} + \deftheorem{assum}{假设} + \deftheorem{axiom}{公理} + \deftheorem{rema}{注}[numbered = no] \deftheorem{proof}{证明}[numbered = no,qed = \qedsymbol] } @@ -2277,7 +2301,7 @@ \eb_link_color_set:n linkcolor .default:n = navyblue, linkcolor .initial:n = navyblue, - linkcolor-all .code:n = \eb_define_link_color:n { \exp_not:n {#1} } + linkcolor-every .code:n = \eb_define_link_color:n { \exp_not:n {#1} } } \ctex_define:nx { style } { @@ -2292,7 +2316,7 @@ } \eb_theme_color_set:n color .initial:n = none, - color-all .code:n = \eb_define_theme_color:n { \exp_not:n {#1} } + color-every .code:n = \eb_define_theme_color:n { \exp_not:n {#1} } } \bool_set_false:N \l__eb_toc_number_color_bool @@ -2417,7 +2441,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/06}{1.41I} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41L} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 -- cgit v1.2.3