summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook/easybook.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx89
1 files changed, 42 insertions, 47 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 302df73e05..637e238152 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/11/20}{1.40T}
+\ProvidesExplClass{easybook}{2021/11/22}{1.40U}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -325,7 +325,7 @@
%<*package>
\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 }
@@ -471,7 +471,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
@@ -499,10 +498,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}
@@ -515,7 +511,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 }
@@ -540,8 +539,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 }
{
@@ -586,8 +585,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,
@@ -1512,16 +1511,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 } }
@@ -1540,14 +1538,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
{
@@ -1583,7 +1575,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}
@@ -1728,7 +1720,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,
@@ -1924,6 +1916,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{}}
{
@@ -1932,19 +1929,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
@@ -1994,8 +1982,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
@@ -2106,8 +2101,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:
@@ -2116,12 +2109,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
@@ -2375,7 +2370,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/11/20}{1.40T}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/11/22}{1.40U}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \setexercise #1