From dc086771e418d7c66a541d2831b468375c5f7090 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 11 Mar 2022 03:00:57 +0000
Subject: CTAN sync 202203110300

---
 macros/latex/contrib/easybook/easybook.dtx | 169 ++++++++++++++++-------------
 1 file changed, 91 insertions(+), 78 deletions(-)

(limited to 'macros/latex/contrib/easybook/easybook.dtx')

diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 660f3e6375..cb9c5ee12e 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}{2022/03/08}{1.643}
+\ProvidesExplClass{easybook}{2022/03/10}{1.643}
   {Easily typesetting Chinese theses or books}
 
 \bool_set_false:N \l__eb_compile_draft_bool
@@ -303,7 +303,7 @@
 %<*package>
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2022/03/08}{1.643}
+\ProvidesExplPackage{easybase}{2022/03/10}{1.643}
   {Easily typesetting Chinese theses or books}
 
 \cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -433,9 +433,10 @@
   }
 
 \PassOptionsToPackage{list = off}{bicaption}
-\PassOptionsToPackage{many}{tcolorbox}
+\PassOptionsToPackage{nonewpage}{imakeidx}
 \PassOptionsToPackage{upint}{newtxmath}
 \PassOptionsToPackage{svgnames}{xcolor}
+\PassOptionsToPackage{many}{tcolorbox}
 \ProcessKeysOptions{easybase}
 \PassOptionsToPackage{\g__eb_ctex_options_clist}{ctex}
 \@ifclassloaded{ctexbook}{}
@@ -548,10 +549,10 @@
       {
         \color{ctex@emph}
         \eb@tag@brackets@left
-        \bgroup
-        \ignorespaces{#1}\unskip\@@italiccorr
-        \eb@tag@brackets@right
-        \egroup
+          {
+            \ignorespaces{#1}\unskip\@@italiccorr
+            \eb@tag@brackets@right
+          }
       }
   }
 \ctex_define:nn { style }
@@ -837,14 +838,14 @@
         { \bool_set_true:N \l__eb_fnpara_bottom_bool }
         { flush }
         {
-          \tl_set:Nn \l__eb_footnote_value_tl { default }
+          \tl_set:Nn \l__eb_footnote_value_tl { plain }
           \clist_push:Nn \l__eb_footnote_value_clist {#1}
         }
       }
       {
         \bool_lazy_or:nnT
           { \str_if_eq_p:nn {#1} { hang } }
-          { \str_if_eq_p:nn {#1} { default } }
+          { \str_if_eq_p:nn {#1} { plain } }
           { \tl_set:Nn \l__eb_footnote_value_tl {#1} }
       }
   }
@@ -873,12 +874,12 @@
 \clist_new:N \l__eb_footnote_value_clist
 \ctex_define:nn { hdrset }
   {
-    fnindent .dim_set:N             = \footindent,
-    fnindent .initial:n             = 0.8em,
-    fnparskip .skip_set:N           = \footparskip,
+    fnfirstindent .dim_set:N        = \fnfirstindent,
+    fnfirstindent .initial:n        = 0.8em,
+    fnparskip .skip_set:N           = \fnparskip,
     fnparskip .initial:n            = 0ex plus .1ex,
-    fnparindent .tl_set:N           = \footparindent,
-    fnparindent .initial:n          = 2em,
+    fnafterindent .tl_set:N         = \fnafterindent,
+    fnafterindent .initial:n        = 2em,
     fnpara-form .tl_set:N           = \l__eb_fnpara_format_tl,
     fntext-pos .tl_set:N            = \l__eb_fntext_position_tl,
     fntext-pos .initial:n           = super,
@@ -888,7 +889,7 @@
     fncust-form .code:n = \eb_fnboth_format_set:nn {#1} { cust },
     fnboth-form .meta:n = { fnmate-form = #1,fncust-form = #1 },
     footnotetype .multichoices:nn   =
-      { default,hang,bottom,para,flush }
+      { plain,hang,bottom,para,flush }
       { \eb_footnote_value_handle:n {#1} },
     footnotetype .value_required:n  = true,
     footnotetype .initial:n         = hang,
@@ -931,51 +932,61 @@
     \eb_fnpara_if_pos_bottom:
   }
 \cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont }
+\cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
 \cs_new_protected:Npn \eb_fnpara_if_pos_bottom:
   {
     \bool_if:NT \l__eb_fnpara_bottom_bool
       {
-        \cs_set:Npn \@makecol
+        \@ifpackageloaded{footmisc}
+          {\msg_warning:nn { easybase } { bottom-not-compatible }}
           {
-            \setbox\@outputbox\box\@cclv
-            \xdef\@freelist{\@freelist\@midlist}
-            \global\let\@midlist\@empty
-            \@combinefloats
-            \eb@footmisc@ifvoid\footins{}
-              {
-                \setbox\@outputbox\vbox
-                \bgroup
-                \boxmaxdepth\@maxdepth
-                \unvbox\@outputbox
-                \vfill\relax
-                \vskip\skip\footins
-                \color@begingroup
-                \normalcolor\footnoterule
-                \unvbox\footins
-                \color@endgroup
-                \egroup
-              }
-            \eb@footmisc@ifvoid\@kludgeins
-              {\@makespecialcolbox}
+            \cs_set:Npn \@makecol
               {
-                \setbox\@outputbox\vbox to\@colht
+                \setbox\@outputbox\box\@cclv
+                \xdef\@freelist{\@freelist\@midlist}
+                \global\let\@midlist\@empty
+                \@combinefloats
+                \eb@footmisc@ifvoid\footins{}
                   {
-                    \@texttop\dimen@\dp\@outputbox
+                    \setbox\@outputbox\vbox
+                    \bgroup
+                    \boxmaxdepth\@maxdepth
                     \unvbox\@outputbox
-                    \vskip -\dimen@\@textbottom
+                    \vfill\relax
+                    \vskip\skip\footins
+                    \color@begingroup
+                    \normalcolor\footnoterule
+                    \unvbox\footins
+                    \color@endgroup
+                    \egroup
                   }
+                \eb@footmisc@ifvoid\@kludgeins
+                  {\@makespecialcolbox}
+                  {
+                    \setbox\@outputbox\vbox to\@colht
+                      {
+                        \@texttop\dimen@\dp\@outputbox
+                        \unvbox\@outputbox
+                        \vskip -\dimen@\@textbottom
+                      }
+                  }
+                \global\maxdepth\@maxdepth
               }
-            \global\maxdepth\@maxdepth
           }
       }
   }
+\msg_new:nnn { easybase } { bottom-not-compatible }
+  {
+    Not~compatible~with~the~'footmisc'~package, \\
+    Please~use~the~'bottom'~option~of~'footmisc'~package.
+  }
 
 \cs_new_protected:Npn \eb_footnote_direct_hang:
   {
     \hbox_set:Nn \l_tmpa_box
       {
-        \dim_compare:nNnTF { \footindent } > { 0pt }
-          { \hbox_to_wd:nn { \footindent } { \eb@makefnmark\hss } }
+        \dim_compare:nNnTF { \fnfirstindent } > { 0pt }
+          { \hbox_to_wd:nn { \fnfirstindent } { \eb@makefnmark\hss } }
           { \eb@makefnmark }
       }
     \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box }
@@ -987,23 +998,23 @@
     \mode_leave_vertical:
     \hbox_overlap_left:n { \box_use:N \l_tmpa_box }
   }
-\cs_new_protected:Npn \eb_footnote_direct_default:
+\cs_new_protected:Npn \eb_footnote_direct_plain:
   {
     \noindent
     \clist_if_in:NnT \l__eb_footnote_value_clist { flush }
-      { \dim_zero:N \footindent }
-    \int_case:nn { \dim_sign:V \footindent }
+      { \dim_zero:N \fnfirstindent }
+    \int_case:nn { \dim_sign:V \fnfirstindent }
       {
         { 1 } { \use_i:nnn }
         { 0 } { \use_ii:nnn }
         { -1 } { \use_iii:nnn }
       }
-      { \hbox_to_wd:nn { \footindent } { \hss\eb@makefnmark } }
+      { \hbox_to_wd:nn { \fnfirstindent } { \hss\eb@makefnmark } }
       { \hbox_overlap_left:n { \eb@makefnmark } }
       {
         \hbox_overlap_left:n
           {
-            \hbox_to_wd:nn { -\footindent }
+            \hbox_to_wd:nn { -\fnfirstindent }
               { \eb@makefnmark\hss }
           }
       }
@@ -1014,21 +1025,32 @@
     \str_case:Vn \l__eb_footnote_value_tl
       {
         { hang } { \use_i:nn }
-        { default } { \use_ii:nn }
+        { plain } { \use_ii:nn }
       }
       { \eb_footnote_direct_hang: }
-      { \eb_footnote_direct_default: }
-    \skip_set:NV \parskip \footparskip
-    \dim_set:NV \parindent \footparindent
+      { \eb_footnote_direct_plain: }
+    \skip_set:NV \parskip \fnparskip
+    \dim_set:NV \parindent \fnafterindent
     \l__eb_fnpara_format_tl{#1}
     \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par }
     \group_end:
   }
-\cs_set_eq:NN \eb@makefntext@save \@makefntext
+\eb_patch_cmd:wnn { \@footnotetext,\@mpfootnotetext }
+  { \reset@font }
+  {
+    \setspread{\fp_use:N \l__eb_spread_footnote_fp}
+    \tl_use:N \l__eb_subfont_footnote_tl
+  }
+\cs_set_eq:NN \eb@@makefntext \@makefntext
+\cs_set_eq:NN \eb@@footnotetext \@footnotetext
 \ctex_at_end_package:nn { footmisc }
   {
     \eb_package_date_check:nn { footmisc } { 2022/02/10 }
-    \notbool{FN@para}{\cs_set_eq:NN \@makefntext \eb@makefntext@save}{}
+    \ifbool{FN@para}{}
+      {
+        \cs_set_eq:NN \@makefntext \eb@@makefntext
+        \cs_set_eq:NN \@footnotetext \eb@@footnotetext
+      }
     \ifboolexpr
       {
         bool {FN@hangfoot} or
@@ -1045,7 +1067,7 @@
 \msg_new:nnn { easybase } { footmisc }
   {
     It~is~not~recommended~that~you~use~the \\
-    hang,~symbol,~perpage,~marginal,~flushmargin~or~bottom \\
+    hang,~symbol,~perpage,~marginal~or~flushmargin \\
     options~of~the~'footmisc'~package.
   }
 
@@ -1079,12 +1101,6 @@
         \@footnotemark
       }
   }
-\eb_patch_cmd:wnn { \@footnotetext,\@mpfootnotetext }
-  { \reset@font }
-  {
-    \setspread{\fp_use:N \l__eb_spread_footnote_fp}
-    \tl_use:N \l__eb_subfont_footnote_tl
-  }
 \ctex_at_end_package:nn { hyperref }
   {
     \cs_set:Npn \@xfootnotemark [#1]
@@ -1140,13 +1156,12 @@
 \defdownfntmark
   {
     \eb_fnmate_format_initial:
-    \tl_if_eq:NnT \l__eb_fntext_position_tl { super }
+    \tl_if_eq:NnTF \l__eb_fntext_position_tl { super }
       { \eb@fnmate@super* }
+      { \use:n }
       {
         \tl_use:N \l__eb_fntext_before_tl
-        \bgroup
-        \l__eb_fnmate_format_tl{\@thefnmark}
-        \egroup
+          { \l__eb_fnmate_format_tl{\@thefnmark} }
       }
     \tl_use:N \l__eb_fntext_after_tl
   }
@@ -1196,8 +1211,6 @@
     \eb@@makefnmark{#1}{#1}\@footnotetext{#2}
     \group_end:
   }
-\cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
-\cs_set:Npn \thempfootnote { \int_to_alph:n { \c@mpfootnote } }
 
 \newcounter{bichapter}
 \newcounter{bisection}[bichapter]
@@ -1557,18 +1570,18 @@
   {
     \normalsize\normalfont
     \titlerule*[#3]{\IfValueTF{#4}{\scalebox{#4}{#5}}{#5}}#6
-    \bgroup
-    \IfBooleanF{#2}
       {
-        \IfBooleanTF{#1}
-          {\thecontentspage}
+        \IfBooleanF{#2}
           {
-            \bool_if:NTF \l__eb_toc_dot_align_bool
-              { \contentspage }
-              { \thecontentspage }
+            \IfBooleanTF{#1}
+              {\thecontentspage}
+              {
+                \bool_if:NTF \l__eb_toc_dot_align_bool
+                  { \contentspage }
+                  { \thecontentspage }
+              }
           }
       }
-    \egroup
   }
 \ctex_set:n
   {
@@ -1619,7 +1632,6 @@
         \group_begin:
         \tl_set_eq:NN \eb@toc@title \indexname
         \cs_set_eq:NN \imki@indexlevel \use_none:n
-        \setkeys{imkiindex}{noclearpage}
         \IfValueT{#3}{\keys_set:nn { eb/floattoc } {#3}}
         \cs_set_protected:Npn \imki@indexheaders
           {
@@ -1797,8 +1809,9 @@
 
 \cs_set_protected:Npn \hangpara #1#2
   {
-    \setlength{\hangindent}{#1}
-    \hangafter #2\noindent\ignorespaces
+    \dim_set:Nn \hangindent {#1}
+    \int_set:Nn \hangafter {#2}
+    \noindent\ignorespaces
   }
 \DeclareDocumentEnvironment{hangparas}{mm+b}
   {
@@ -2312,7 +2325,7 @@
   }
 %</package>
 %<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2022/03/08}{1.643}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2022/03/10}{1.643}
   {Customization of tcolorbox for easybook}
 
 \cs_set_protected:Npn \addtotcbstyle #1#2
-- 
cgit v1.2.3

