summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-25 20:48:26 +0000
committerKarl Berry <karl@freefriends.org>2021-07-25 20:48:26 +0000
commit6f654705f79b314523e5e0b829da91294b8a3eb6 (patch)
treed6ef72d3f68299448349aeb6fbfc1c5b86734232 /Master/texmf-dist/tex
parent7df9ca2f9625555792dca502dd3273fcb4e71423 (diff)
easybook (25jul21)
git-svn-id: svn://tug.org/texlive/trunk@60062 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybase.sty120
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybook.cls18
-rw-r--r--Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg19
3 files changed, 63 insertions, 94 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty
index 75b17fa8c0f..cb7569db646 100644
--- a/Master/texmf-dist/tex/latex/easybook/easybase.sty
+++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty
@@ -13,7 +13,7 @@
%% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/07/24}{1.27o}
+\ProvidesExplPackage{easybase}{2021/07/25}{1.27p}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -76,29 +76,35 @@
\seq_set_split:Nnn \l_tmpa_seq { [ } {#1}
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
\seq_pop_right:NN \l_tmpa_seq \l_tmpb_tl
- \eb_package_reload_check:nn { \l_tmpa_tl }
+ \IfFileExists{\l_tmpa_tl.sty}
{
- \IfFileExists{\l_tmpa_tl.sty}
- {
- \exp_last_unbraced:Nx \RequirePackage
- { [\l_tmpb_tl }{\l_tmpa_tl}
- }{}
- }
- }
- {
- \eb_package_reload_check:nn {#1}
- { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} }
+ \exp_last_unbraced:Nx \RequirePackage
+ { [\l_tmpb_tl }{\l_tmpa_tl}
+ }{}
}
+ { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} }
}
\cs_new_protected:Npn \eb_package_reload_check:nn #1#2
{
\@ifpackageloaded{#1}
- {\msg_warning:nnn { easybase } { package-reload } {#1}}{#2}
+ {\msg_warning:nnn { easybase } { package-reload } {#1}}
+ {#2\disable@package@load{#1}{}}
}
\msg_new:nnn { easybase } { package-reload }
{
- There~is~no~need~to~reload~the~#1~macro~package. \\
- Please~review~your~code.
+ The~macro~package~#1~has~been~reloaded. \\
+ Please~pass~the~arguments~by \\
+ the~\string\PassOptionsToPackage{\#1}{#1}\space~command.
+ }
+\cs_set_eq:NN \eb@usepackage@save \usepackage
+\RenewDocumentCommand{\usepackage}{O{}m}
+ {
+ \PassOptionsToPackage{#1}{#2}
+ \eb_clist_map_inline:nn {#2}
+ {
+ \eb_package_reload_check:nn {##1}
+ { \eb@usepackage@save{##1} }
+ }
}
\NewDocumentCommand{\LoadPackage}{O{}m}
{
@@ -114,8 +120,6 @@
\bool_if_exist:NF \l__eb_class_book_bool
{ \bool_set_true:N \l__eb_class_book_bool }
-\bool_if_exist:NF \l__eb_page_twoside_bool
- { \bool_set_true:N \l__eb_page_twoside_bool }
\bool_if_exist:NF \l__eb_compile_draft_bool
{ \bool_set_false:N \l__eb_compile_draft_bool }
\clist_new:N \g__eb_ctex_options_clist
@@ -138,7 +142,8 @@
class/article .code:n =
{
\bool_set_false:N \l__eb_class_book_bool
- \bool_set_false:N \l__eb_page_twoside_bool
+ \boolfalse{@twoside}
+ \boolfalse{@mparswitch}
},
class .initial:n = book,
book .meta:n = { class = book },
@@ -304,14 +309,18 @@
}
}
-\RenewDocumentCommand{\cleardoublepage}{O{empty}}
+\cs_new_protected:Npn \blankpagestyle #1
+ { \tl_set:Nn \l__eb_blank_pagestyle_tl {#1} }
+\blankpagestyle{empty}
+\RenewDocumentCommand{\cleardoublepage}
+ {O{\l__eb_blank_pagestyle_tl}}
{
\clearpage
- \bool_if:NT \l__eb_page_twoside_bool
+ \ifbool{@twoside}
{
\int_if_odd:nF { \c@page }
{ \hbox:n { }\thispagestyle{#1}\clearpage }
- }
+ }{}
}
\DeclareDocumentCommand{\frontmatter}{sO{Roman}}
{
@@ -331,7 +340,7 @@
\exp_args:Nc \NewDocumentCommand { eb@mark@#1@label@layout }
{O{\use:c { CTEXthe#1 }}m}
{\tl_set:cn { eb@mark@#1@label } {##1##2}}
- \cs_new:cpn { eb_mark_#1_number_bool:n } ##1
+ \cs_new:cpn { eb_mark_#1_name_bool:n } ##1
{
\tl_if_in:nnTF {##1} { [ }
{ \use:c { eb@mark@#1@label@layout }##1 }
@@ -356,13 +365,12 @@
head-foot .tl_set:N = \l__eb_fancyhf_content_tl,
head-foot .initial:n =
{
- \bool_if:NTF \l__eb_page_twoside_bool
+ \ifbool{@twoside}
{
\easyhead[EC]{\color{ctex@frame}\kaishu\leftmark}
\easyhead[OC]{\color{ctex@frame}\kaishu\rightmark}
\easyhead[EL,OR]{\color{ctex@frame}\thepage}
- }
- {
+ }{
\easyhead[L]{\color{ctex@frame}\kaishu\leftmark}
\easyhead[R]{\color{ctex@frame}\thepage}
}
@@ -377,11 +385,11 @@
subsec-mark .cs_set:Np = \eb_fancyhf_subsection_mark:n #1,
subsec-mark .initial:n =
{ \CTEXifname{\eb@mark@subsection@label}{}#1 },
- chap-label .code:n = \eb_mark_chapter_number_bool:n {#1},
+ chap-label .code:n = \eb_mark_chapter_name_bool:n {#1},
chap-label .initial:n = \hspace{1em},
- sec-label .code:n = \eb_mark_section_number_bool:n {#1},
+ sec-label .code:n = \eb_mark_section_name_bool:n {#1},
sec-label .initial:n = \hspace{0.5em},
- subsec-label .code:n = \eb_mark_subsection_number_bool:n {#1},
+ subsec-label .code:n = \eb_mark_subsection_name_bool:n {#1},
subsec-label .initial:n = \hspace{0.5em},
headrule .tl_gset:N = \headrule,
@@ -399,16 +407,14 @@
{
\bool_if:NTF \l__eb_mark_uppercase_bool
{ \eb_mark_uppercase:n }
- { \eb_mark_nouppercase:n } { \use:c { eb_fancyhf_#1_mark:n } {#2} }
+ { \eb_mark_nouppercase:n }
+ { \use:c { eb_fancyhf_#1_mark:n } {#2} }
}
\cs_new:Npn \eb@level@markdouble #1#2
{
\markboth
{\eb_mark_uppercase_bool:nn {#1} {#2}}
- {
- \bool_if:NT \l__eb_page_twoside_bool
- { \eb_mark_uppercase_bool:nn {#1} {#2} }
- }
+ {\ifbool{@twoside}{\eb_mark_uppercase_bool:nn {#1} {#2}}{}}
}
\cs_new:Npn \eb@level@markright #1#2
{ \markright{\eb_mark_uppercase_bool:nn {#1} {#2}} }
@@ -1055,7 +1061,7 @@
\eb@level@section@mark{#1}
}
}
-\cs_new_protected:Npn \eb_title_number_intoc_bool:nn #1#2
+\cs_new_protected:Npn \eb_title_number_intoc_spec:nn #1#2
{
\IfBooleanTF{#1}
{
@@ -1068,14 +1074,14 @@
{\eb_title_mark_intoc:n { \eb@toc@title }}
}
}
-\cs_new_protected:Npn \eb_biber_title_level_bool:n #1
+\cs_new_protected:Npn \eb_biber_title_level_spec:n #1
{
\bool_if:NTF \l__eb_class_book_bool
{ \bichapter*{#1}{\l__eb_bib_en_bitoc_title_tl} }
{ \bisection*{#1}{\l__eb_bib_en_bitoc_title_tl} }
\eb@level@section@mark{#1}
}
-\cs_new_protected:Npn \eb_toc_start_multicol_bool:n #1
+\cs_new_protected:Npn \eb_toc_start_multi_column_ext:n #1
{
\bool_if:NTF \l__eb_toc_multi_column_bool
{
@@ -1090,11 +1096,11 @@
\group_begin:
\tl_set_eq:Nc \eb@toc@title { list#4name }
\IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}}
- \eb_title_number_intoc_bool:nn {#2} {#1}
+ \eb_title_number_intoc_spec:nn {#2} {#1}
\dim_add:Nv
\l__eb_toc_offset_dim { l__eb_toc_#4_offset_dim }
\vspace*{\dim_use:N \l__eb_toc_offset_dim}
- \eb_toc_start_multicol_bool:n {#5}
+ \eb_toc_start_multi_column_ext:n {#5}
\group_end:
}
\clist_map_inline:nn
@@ -1121,12 +1127,12 @@
\IfValueT{#2}{\keys_set:nn { eb/listoc } {#2}}
\eb_title_mark_notoc:n { \eb@toc@title }
\vspace*{\dim_use:N \l__eb_toc_offset_dim}
- \eb_toc_start_multicol_bool:n { toc }#3
+ \eb_toc_start_multi_column_ext:n { toc }#3
\IfBooleanT{#1}
{
\eb_title_mark_notoc:n { \eb@bitoc@title }
\vspace*{\dim_use:N \l__eb_toc_offset_dim}
- \eb_toc_start_multicol_bool:n { tec }
+ \eb_toc_start_multi_column_ext:n { tec }
}
\group_end:
}
@@ -1143,7 +1149,7 @@
\IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}}
\tl_set:Nn \imki@indexheaders
{
- \eb_title_number_intoc_bool:nn {#2} {#1}
+ \eb_title_number_intoc_spec:nn {#2} {#1}
\cs_set_eq:NN \thispagestyle \use_none:n
\cs_undefine:N \imki@firstpagestyle
}
@@ -1388,13 +1394,13 @@
\newlist{eb@exercise@list}{enumerate}{2}
\newlist{eb@eqcomp@list}{description}{1}
\setlist[eb@outline@list]{label = outline,itemsep = 0.5ex plus .1ex}
-\setlist[eb@exercise@list]{labelsep = 0.5em}
+\setlist[eb@exercise@list]{labelsep = 0.5em,nosep}
\setlist[eb@eqcomp@list]{labelsep = 0em,nosep}
\setlist[itemize,1]{label = bullet}
\setlist[itemize,2]{label = endash}
\setlist[itemize,3]{label = asterisk}
\setlist[enumerate,1]{label = arabic,ref = \arabic*}
-\setlist[enumerate,2]{label = alph,ref = enumii}
+\setlist[enumerate,2]{label = alph,ref = enumii,labelwidth = *}
\setlist[enumerate,3]{label = roman,ref = enumiii,labelwidth = *}
\setlist[description]{font = sf,labelwidth = *,leftmargin = 2em}
@@ -1673,10 +1679,9 @@
unknown .code:n = \eb_msg_unknown_option:n { bibset }
}
-\cs_new_protected:Npn \BibtexPreSet
- { \PassOptionsToPackage{sort&compress}{natbib} }
-\cs_new_protected:Npn \BibtexPostSet
+\cs_new_protected:Npn \eb_natbib_bibtex_set:
{
+ \LoadPackage[sort&compress]{natbib}
\str_case:VnTF \l__eb_bib_all_style_tl
{
{ numerical }
@@ -1701,7 +1706,7 @@
\IfValueT{##3}{ \keys_set:nn { eb/listoc } {##3} }
\tl_set:Nn \bibsection
{
- \eb_title_number_intoc_bool:nn {##2} {##1}
+ \eb_title_number_intoc_spec:nn {##2} {##1}
\bool_if:NT \l__eb_toc_multi_column_bool
{ \begin{multicols}{\int_use:N \l__eb_toc_columns_int} }
}
@@ -1711,7 +1716,7 @@
}
\cs_new_protected:Npn \eb_put_biblatex:n #1
{ \PassOptionsToPackage{#1}{biblatex} }
-\cs_new_protected:Npn \BiblatexPreSet
+\cs_new_protected:Npn \eb_biblatex_biber_set:
{
\str_case:VnF \l__eb_bib_all_style_tl
{
@@ -1724,14 +1729,11 @@
{ \eb_put_biblatex:n { style = \l__eb_bib_all_style_tl } }
\tl_if_empty:NF \l__eb_bib_cite_style_tl
{ \eb_put_biblatex:n { citestyle = \l__eb_bib_cite_style_tl } }
- \eb_put_biblatex:n { backend = biber }
- }
-\cs_new_protected:Npn \BiblatexPostSet
- {
+ \LoadPackage[backend = biber]{biblatex}
\clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource
\tl_gset:Nn \blx@default@theheading { bibintoc }
\defbibheading{bibintoc}[\bibname]
- {\eb_biber_title_level_bool:n {##1}}
+ {\eb_biber_title_level_spec:n {##1}}
\skip_zero:N \bibitemsep
}
\eb_at_end_preamble:n
@@ -1739,16 +1741,8 @@
\clist_if_empty:NF \l__eb_bib_datafile_clist
{
\bool_if:NTF \l__eb_backend_bibtex_bool
- {
- \BibtexPreSet
- \LoadPackage{natbib}
- \BibtexPostSet
- }
- {
- \BiblatexPreSet
- \LoadPackage{biblatex}
- \BiblatexPostSet
- }
+ { \eb_natbib_bibtex_set: }
+ { \eb_biblatex_biber_set: }
}
}
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls
index d5c82d0cc27..073d8330604 100644
--- a/Master/texmf-dist/tex/latex/easybook/easybook.cls
+++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls
@@ -13,12 +13,11 @@
%% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/07/24}{1.27o}
+\ProvidesExplClass{easybook}{2021/07/25}{1.27p}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
\bool_set_false:N \l__eb_title_newline_bool
-\bool_set_true:N \l__eb_page_twoside_bool
\bool_set_true:N \l__eb_class_book_bool
\tl_new:N \g__eb_config_tl
\tl_new:N \l__eb_font_choice_tl
@@ -43,26 +42,13 @@
paper .value_required:n = true,
paper/unknown .code:n = \PassOptionsToPackage{#1}{geometry},
- oneside .value_forbidden:n = true,
- twoside .value_forbidden:n = true,
- oneside .code:n =
- {
- \bool_set_false:N \l__eb_page_twoside_bool
- \eb_put_ctexbook:n { oneside }
- },
- twoside .code:n =
- {
- \bool_set_true:N \l__eb_page_twoside_bool
- \eb_put_ctexbook:n { twoside }
- },
-
class .choice:,
class .value_required:n = true,
class/book .code:n = { },
class/article .code:n =
{
\bool_set_false:N \l__eb_class_book_bool
- \keys_set:nn { easybook } { oneside }
+ \eb_put_ctexbook:n { oneside }
},
book .meta:n = { class = book },
article .meta:n = { class = article },
diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
index 4d76d2fd8bc..35f5b4ff422 100644
--- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
+++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
@@ -11,7 +11,7 @@
%% conditions of the CC-BY 4.0 License.
%% The latest version of this license is in
%% https://creativecommons.org/licenses/by/4.0/legalcode
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/24}{1.27o}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/25}{1.27p}
{Customization of tcolorbox for easybook}
\cs_new_protected:Npn \eb_tcb_theorem_set:n #1
@@ -49,9 +49,8 @@
{
blank,on~line,center,
sharpish~corners,
- fontupper = \Large\sffamily,
- before~skip = 3.75ex plus.2ex minus .1ex,
- after~skip = 3ex\tl_if_empty:NF \eb@tc@list@prologue { + 0.75ex }
+ fontupper = \Large\sffamily,
+ beforeafter~skip = 3.75ex plus .2ex minus .1ex
}
\tcbset
{
@@ -106,7 +105,7 @@
\NewDocumentEnvironment{exercise}{st+od()O{}+b}
{
\IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} }
- \IfBooleanTF{#2}
+ \IfBooleanF{#2}
{
\eb@tc@exercise@box
{
@@ -125,16 +124,6 @@
}
\eb@tc@exercise@title
}
- }{
- \group_begin:
- \ctex_set:n { section/format += \centering }
- \IfValueT{#4}{\ctex_set:nn { section } {#4}}
- \IfBooleanTF{#1}
- {\section*{\eb@tc@exercise@title}}
- {\section{\eb@tc@exercise@title}}
- \tl_set_eq:NN \theeb@exercise \thesection
- \eb_exercise_label_noempty_use:
- \group_end:
}
\tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue }
\begin{eb@exercise@list}[\eb@tc@list@number,#5]