diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook/easybase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index da95e0d7a5b..67b1a765a4c 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/11/20}{1.40T} +\ProvidesExplPackage{easybase}{2021/11/22}{1.40U} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -166,7 +166,6 @@ } } -\bool_new:N \l__eb_toc_multi_column_bool \bool_new:N \l__eb_mark_uppercase_bool \bool_new:N \l__eb_chap_counter_withpart_bool \tl_new:N \l__eb_foot_counter_parent_choice_tl @@ -194,10 +193,7 @@ } } \cs_new:Npn \eb_msg_unknown_option:n #1 - { - \msg_warning:nnx - { easybase } { ignore-#1 } { \l_keys_key_str } - } + { \msg_warning:nnx { easybase } { ignore-#1 } { \l_keys_key_str } } \cs_if_exist:NF \chapter { \newcounter{chapter} @@ -210,7 +206,10 @@ \ctex_after_end_preamble:n { \NewDocumentCommand{\chapter}{som} - {\msg_error:nn { easybase } { no-chapter }} + { + \msg_error:nn { easybase } { no-chapter } + \msg_redirect_name:nnn { easybase } { no-chapter } { none } + } } } \msg_new:nnn { easybase } { no-chapter } @@ -235,8 +234,8 @@ } \cs_new_protected:Npn \eb_package_date_check:nn #1#2 { - \IfPackageAtLeastTF{#1}{#2} - {}{\msg_warning:nnn { easybase } { package-old } {#1}} + \IfPackageAtLeastTF{#1}{#2}{} + {\msg_warning:nnn { easybase } { package-old } {#1}} } \msg_new:nnn { easybase } { package-old } { @@ -281,8 +280,8 @@ } \ctex_define:nn { style } { - multoc .bool_set:N = \l__eb_toc_multi_column_bool, - multoc .default:n = true, + multoc .int_set:N = \l__eb_toc_columns_int, + multoc .default:n = 2, withpart .bool_set:N = \l__eb_chap_counter_withpart_bool, withpart .default:n = true, withpart .initial:n = false, @@ -1207,16 +1206,15 @@ \tl_new:N \eb@bitoc@title \keys_define:nn { eb/listoc } { - section .code:n = \tl_set:Nn \l__eb_toc_type_tl { section }, - chapter .code:n = { }, - article .meta:n = section, - book .meta:n = chapter, - multoc .bool_set:N = \l__eb_toc_multi_column_bool, - multoc .default:n = true, - multoc .initial:n = false, - title .code:n = \eb_assign_toc_title:n {#1}, - columns .int_set:N = \l__eb_toc_columns_int, - columns .initial:n = 2 + section .code:n = \tl_set:Nn \l__eb_toc_type_tl { section }, + chapter .code:n = { }, + article .meta:n = section, + book .meta:n = chapter, + multoc .int_set:N = \l__eb_toc_columns_int, + multoc .default:n = 2, + multoc .initial:n = 1, + columns .meta:n = { multoc = #1 }, + title .code:n = \eb_assign_toc_title:n {#1} } \bool_if:NTF \l__eb_class_book_bool { \keys_define:nn { } { eb/listoc .inherit:n = ctex/chapter } } @@ -1235,14 +1233,8 @@ \cs_new_protected:Npn \eb_title_mark_intoc:n #1 { \tl_if_eq:NnTF \l__eb_toc_type_tl { chapter } - { - \bichapter*{#1}{\eb@bitoc@title} - \chaptermark{#1} - } - { - \bisection*{#1}{\eb@bitoc@title} - \sectionmark{#1} - } + { \bichapter*{#1}{\eb@bitoc@title} } + { \bisection*{#1}{\eb@bitoc@title} } } \cs_new_protected:Npn \eb_title_mark_notoc:n #1 { @@ -1278,7 +1270,7 @@ } \cs_new_protected:Npn \eb_toc_start_multi_column_ext:n #1 { - \bool_if:NTF \l__eb_toc_multi_column_bool + \int_compare:nNnTF { \l__eb_toc_columns_int } > { 1 } { \begin{multicols}{\int_use:N \l__eb_toc_columns_int} \@starttoc{#1} @@ -1423,7 +1415,7 @@ line .code:n = \AfterPreamble{\setspread{#1}}, line .initial:n = 1.354, table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.2, + 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, @@ -1619,6 +1611,11 @@ \RenewDocumentCommand{\declaretheoremstyle}{O{}mO{}} {\eb@declaretheoremsyle@save[#1,#3]{#2}} \cs_set_eq:NN \newtheorem \declaretheorem +\cs_new_protected:Npn \eb_if_thmframe_with_tcolorbox:TF #1#2 + { + \bool_if:NT \l__eb_thmframe_bool + { \@ifpackageloaded{tcolorbox}{#1}{#2} } + } \NewDocumentCommand{\deftheorem} {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { @@ -1627,19 +1624,10 @@ name = \tl_use:c { c__eb_name_#1_tl }, style = easy-theorem,#5 ] - \bool_if:NT \l__eb_thmframe_bool - { - \@ifpackageloaded{tcolorbox} - {\tcolorboxenvironment{#1}{#4}} - {\msg_warning:nn { easybase } { need-tcolorbox }} - } + \eb_if_thmframe_with_tcolorbox:TF + { \tcolorboxenvironment{#1}{#4} } { } \labelformat{#1}{\tl_use:c { c__eb_name_#1_tl }~##1} } -\msg_new:nnn { easybase } { need-tcolorbox } - { - Now~that~the~thmframe~option~is~true. \\ - Please~load~the~tcolorbox~macro~package. - } \prop_new:N \l__eb_thmtools_entry_prop \clist_const:Nn \c__eb_thmtools_entry_clist @@ -1689,8 +1677,15 @@ within = \bool_if:NT \l__eb_class_book_bool { chapter }, headformat = \NAME\NUMBER\NOTE } +\msg_new:nnn { easybase } { need-tcolorbox } + { + Now~that~the~thmframe~option~is~true. \\ + Please~load~the~tcolorbox~macro~package. + } \eb_at_end_preamble:n { + \eb_if_thmframe_with_tcolorbox:TF { } + { \msg_warning:nn { easybase } { need-tcolorbox } } \clist_put_right:Nx \c__eb_thmtools_entry_clist { notebraces = \l__eb_thm_notebraces_tl } \exp_last_unbraced:NNV @@ -1801,8 +1796,6 @@ { \exp_args:NV \bibliographystyle \l__eb_bib_otherstyle_tl } \tl_if_empty:NF \l__eb_bib_cite_style_tl { \exp_args:NV \setcitestyle \l__eb_bib_cite_style_tl } - \AtEndEnvironment{thebibliography} - {\bool_if:NT \l__eb_toc_multi_column_bool { \end{multicols} }} \NewDocumentCommand{\printbibliography}{st+o} { \group_begin: @@ -1811,12 +1804,14 @@ \cs_set_protected:Npn \bibsection { \eb_title_number_intoc_spec:nn {##2} {##1} - \bool_if:NT \l__eb_toc_multi_column_bool + \int_compare:nNnT { \l__eb_toc_columns_int } > { 1 } { \begin{multicols}{\int_use:N \l__eb_toc_columns_int} } } \exp_args:NV \bibliography \l__eb_bib_datafile_clist \group_end: } + \AtEndEnvironment{thebibliography} + {\int_compare:nNnT { \l__eb_toc_columns_int } > { 1 } { \end{multicols} }} \skip_zero:N \bibsep } \cs_new_protected:Npn \eb_put_biblatex:n #1 |