From 909458d2a89fa74c77683cbaf6f3b83861b186c3 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sun, 4 Sep 2022 03:01:15 +0000
Subject: CTAN sync 202209040301

---
 macros/unicodetex/latex/beaulivre/beaulivre.cls | 323 ++++++++++++++----------
 1 file changed, 190 insertions(+), 133 deletions(-)

(limited to 'macros/unicodetex/latex/beaulivre/beaulivre.cls')

diff --git a/macros/unicodetex/latex/beaulivre/beaulivre.cls b/macros/unicodetex/latex/beaulivre/beaulivre.cls
index 7c63f73479..d06122aa4e 100644
--- a/macros/unicodetex/latex/beaulivre/beaulivre.cls
+++ b/macros/unicodetex/latex/beaulivre/beaulivre.cls
@@ -15,11 +15,10 @@
 %% and version 1.3c or later is part of all distributions of LaTeX version
 %% 2005/12/01 or later.
 %% 
-\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\RequirePackage{l3keys2e}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplClass
   {beaulivre}
-  {2022/06/16} {}
+  {2022/09/03} {}
   {A colorful book style}
 
 \tl_const:Nn \l__colorclass_base_class_tl { book }
@@ -126,7 +125,7 @@
                                                       \PassOptionsToPackage { \CurrentOption } { colorist }
                                                     }
   }
-\ProcessKeysOptions { colorclass }
+\ProcessKeyOptions [ colorclass ]
 
 \LoadClass{\l__colorclass_base_class_tl}
 
@@ -183,9 +182,6 @@
 
 \RequirePackage { colorist }
 
-\raggedbottom
-\hfuzz=2pt
-\vfuzz=2pt
 
 %%================================
 %%  Fonts
@@ -193,6 +189,15 @@
 \WarningFilter { latexfont } { Font~shape }
 \WarningFilter { latexfont } { Some~font  }
 
+\hook_gput_code:nnn { begindocument/before } { colorclass }
+  {
+    \IfPackageLoadedTF { biblatex }
+      {
+        \PassOptionsToPackage { biblatex } { embrac }
+      } {}
+    \RequirePackage { embrac }
+  }
+
 \cs_new_protected:Nn \__colorclass_load_file_or_config:Nnn
   {
     \bool_if:NT #1
@@ -231,46 +236,62 @@
           {
             \bool_if:NTF \l__projlib_font_useosf_bool
               {
-                \setmainfont { TeXGyrePagellaX-Regular.otf }
+                \setmainfont { TeXGyrePagellaX }
                   [
-                    BoldFont       = TeXGyrePagellaX-Bold.otf ,
-                    ItalicFont     = TeXGyrePagellaX-Italic.otf ,
-                    BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Italic,
+                    BoldItalicFont = *-BoldItalic,
                     Numbers        = OldStyle ,
                   ]
-                \setsansfont { SourceSansPro-Regular.otf }
+                \setsansfont { SourceSansPro }
                   [
-                    Scale          = 1.05 ,
-                    BoldFont       = SourceSansPro-Semibold.otf ,
-                    ItalicFont     = SourceSansPro-RegularIt.otf ,
-                    BoldItalicFont = SourceSansPro-SemiboldIt.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Semibold,
+                    ItalicFont     = *-RegularIt,
+                    BoldItalicFont = *-SemiboldIt,
+                    WordSpace      = {1.25, 1, 1} ,
                     Numbers        = OldStyle ,
                   ]
               }
               {
-                \setmainfont { TeXGyrePagellaX-Regular.otf }
+                \setmainfont { TeXGyrePagellaX }
                   [
-                    BoldFont       = TeXGyrePagellaX-Bold.otf ,
-                    ItalicFont     = TeXGyrePagellaX-Italic.otf ,
-                    BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Italic,
+                    BoldItalicFont = *-BoldItalic,
                   ]
-                \setsansfont { SourceSansPro-Regular.otf }
+                \setsansfont { SourceSansPro }
                   [
-                    Scale          = 1.05 ,
-                    BoldFont       = SourceSansPro-Semibold.otf ,
-                    ItalicFont     = SourceSansPro-RegularIt.otf ,
-                    BoldItalicFont = SourceSansPro-SemiboldIt.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Semibold,
+                    ItalicFont     = *-RegularIt,
+                    BoldItalicFont = *-SemiboldIt,
+                    WordSpace      = {1.25, 1, 1} ,
                   ]
               }
-            \setmonofont { NewCMMono10-Regular.otf }
+            \setmonofont { NewCMMono10 }
               [
                 Scale          = 1.05 ,
-                BoldFont       = NewCMMono10-Bold.otf ,
-                ItalicFont     = NewCMMono10-Italic.otf ,
-                BoldItalicFont = NewCMMono10-BoldOblique.otf ,
+                Extension      = .otf,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Bold,
+                ItalicFont     = *-Italic,
+                BoldItalicFont = *-BoldOblique,
               ]
 
             \projlib_language_set_linespacing_latin:n { \setstretch { 1.07 } }
+
+            \hook_gput_code:nnn { begindocument/before } { colorclass }
+              {
+                \RenewEmph{[}{]}
+                \RenewEmph{(}{)}
+              }
           }
       }
 
@@ -281,48 +302,55 @@
       {
         \__colorclass_if_font_exist:nnn { SourceHanSerifSC-Regular }
           {
-            \setCJKmainfont { SourceHanSerifSC-Regular }
+            \setCJKmainfont { SourceHanSerifSC }
               [
-                BoldFont       = SourceHanSerifSC-Bold ,
-                ItalicFont     = * ,
-                BoldItalicFont = SourceHanSerifSC-Bold ,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Bold,
+                ItalicFont     = *-Regular,
+                BoldItalicFont = *-Bold,
               ]
           }
           {
-            \setCJKmainfont { FandolSong-Regular.otf }
+            \setCJKmainfont { FandolSong }
               [
-                BoldFont       = FandolSong-Bold.otf ,
-                ItalicFont     = FandolKai-Regular.otf ,
-                BoldItalicFont = FandolKai-Regular.otf ,
+                Extension      = .otf,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Bold,
+                ItalicFont     = FandolKai-Regular ,
+                BoldItalicFont = FandolKai-Regular ,
                 BoldItalicFeatures = { FakeBold = 4 } ,
               ]
           }
 
         \__colorclass_if_font_exist:nnn { SourceHanSansSC-Regular }
           {
-            \setCJKsansfont{SourceHanSansSC-Regular}
+            \setCJKsansfont { SourceHanSansSC }
               [
-                BoldFont       = SourceHanSansSC-Bold ,
-                ItalicFont     = * ,
-                BoldItalicFont = SourceHanSansSC-Bold ,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Bold,
+                ItalicFont     = *-Regular,
+                BoldItalicFont = *-Bold,
               ]
           }
           {
-            \setCJKsansfont { FandolHei-Regular.otf }
+            \setCJKsansfont { FandolHei }
               [
-                BoldFont       = FandolHei-Bold.otf ,
-                ItalicFont     = * ,
-                BoldItalicFont = FandolHei-Bold.otf ,
+                Extension      = .otf,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Bold,
+                ItalicFont     = *-Regular,
+                BoldItalicFont = *-Bold,
               ]
           }
 
         \__colorclass_if_font_exist:nnn { SourceHanMonoSC-Regular }
           {
-            \setCJKmonofont { SourceHanMonoSC-Regular }
+            \setCJKmonofont { SourceHanMonoSC }
               [
-                BoldFont       = SourceHanMonoSC-Medium ,
-                ItalicFont     = * ,
-                BoldItalicFont = SourceHanMonoSC-Medium ,
+                UprightFont    = *-Regular,
+                BoldFont       = *-Medium,
+                ItalicFont     = *-Regular,
+                BoldItalicFont = *-Medium,
               ]
           }
           {
@@ -340,46 +368,53 @@
           {
             \__colorclass_if_font_exist:nnn { SourceHanSerifSC-Regular }
               {
-                \setCJKfamilyfont { SCmain } { SourceHanSerifSC-Regular }
+                \setCJKfamilyfont { SCmain } { SourceHanSerifSC }
                   [
-                    BoldFont       = SourceHanSerifSC-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSerifSC-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { SCmain } { FandolSong-Regular.otf }
+                \setCJKfamilyfont { SCmain } { FandolSong }
                   [
-                    BoldFont       = FandolSong-Bold.otf ,
-                    ItalicFont     = FandolKai-Regular.otf ,
-                    BoldItalicFont = FandolKai-Regular.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = FandolKai-Regular ,
+                    BoldItalicFont = FandolKai-Regular ,
                     BoldItalicFeatures = { FakeBold = 4 } ,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanSansSC-Regular }
               {
-                \setCJKfamilyfont { SCsans } { SourceHanSansSC-Regular }
+                \setCJKfamilyfont { SCsans } { SourceHanSansSC }
                   [
-                    BoldFont       = SourceHanSansSC-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSansSC-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { SCsans } { FandolHei-Regular.otf }
+                \setCJKfamilyfont { SCsans } { FandolHei }
                   [
-                    BoldFont       = FandolHei-Bold.otf ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = FandolHei-Bold.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanMonoSC-Regular }
               {
-                \setCJKfamilyfont { SCmono } { SourceHanMonoSC-Regular }
+                \setCJKfamilyfont { SCmono } { SourceHanMonoSC }
                   [
-                    BoldFont       = SourceHanMonoSC-Medium ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanMonoSC-Medium ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Medium,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Medium,
                   ]
               }
               {
@@ -398,46 +433,53 @@
           {
             \__colorclass_if_font_exist:nnn { SourceHanSerifTC-Regular }
               {
-                \setCJKfamilyfont { TCmain } { SourceHanSerifTC-Regular }
+                \setCJKfamilyfont { TCmain } { SourceHanSerifTC }
                   [
-                    BoldFont       = SourceHanSerifTC-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSerifTC-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { TCmain } { FandolSong-Regular.otf }
+                \setCJKfamilyfont { TCmain } { FandolSong }
                   [
-                    BoldFont       = FandolSong-Bold.otf ,
-                    ItalicFont     = FandolKai-Regular.otf ,
-                    BoldItalicFont = FandolKai-Regular.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = FandolKai-Regular ,
+                    BoldItalicFont = FandolKai-Regular ,
                     BoldItalicFeatures = { FakeBold = 4 } ,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanSansTC-Regular }
               {
-                \setCJKfamilyfont { TCsans } { SourceHanSansTC-Regular }
+                \setCJKfamilyfont { TCsans } { SourceHanSansTC }
                   [
-                    BoldFont       = SourceHanSansTC-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSansTC-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { TCsans } { FandolHei-Regular.otf }
+                \setCJKfamilyfont { TCsans } { FandolHei }
                   [
-                    BoldFont       = FandolHei-Bold.otf ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = FandolHei-Bold.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanMonoTC-Regular }
               {
-                \setCJKfamilyfont { TCmono } { SourceHanMonoTC-Regular }
+                \setCJKfamilyfont { TCmono } { SourceHanMonoTC }
                   [
-                    BoldFont       = SourceHanMonoTC-Medium ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanMonoTC-Medium ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Medium,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Medium,
                   ]
               }
               {
@@ -456,46 +498,53 @@
           {
             \__colorclass_if_font_exist:nnn { SourceHanSerif-Regular }
               {
-                \setCJKfamilyfont { JPmain } { SourceHanSerif-Regular }
+                \setCJKfamilyfont { JPmain } { SourceHanSerif }
                   [
-                    BoldFont       = SourceHanSerif-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSerif-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { JPmain } { FandolSong-Regular.otf }
+                \setCJKfamilyfont { JPmain } { FandolSong }
                   [
-                    BoldFont       = FandolSong-Bold.otf ,
-                    ItalicFont     = FandolKai-Regular.otf ,
-                    BoldItalicFont = FandolKai-Regular.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = FandolKai-Regular ,
+                    BoldItalicFont = FandolKai-Regular ,
                     BoldItalicFeatures = { FakeBold = 4 } ,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanSans-Regular }
               {
-                \setCJKfamilyfont { JPsans } { SourceHanSans-Regular }
+                \setCJKfamilyfont { JPsans } { SourceHanSans }
                   [
-                    BoldFont       = SourceHanSans-Bold ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanSans-Bold ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
               {
-                \setCJKfamilyfont { JPsans } { FandolHei-Regular.otf }
+                \setCJKfamilyfont { JPsans } { FandolHei }
                   [
-                    BoldFont       = FandolHei-Bold.otf ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = FandolHei-Bold.otf ,
+                    Extension      = .otf,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Bold,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Bold,
                   ]
               }
             \__colorclass_if_font_exist:nnn { SourceHanMono-Regular }
               {
-                \setCJKfamilyfont { JPmono } { SourceHanMono-Regular }
+                \setCJKfamilyfont { JPmono } { SourceHanMono }
                   [
-                    BoldFont       = SourceHanMono-Medium ,
-                    ItalicFont     = * ,
-                    BoldItalicFont = SourceHanMono-Medium ,
+                    UprightFont    = *-Regular,
+                    BoldFont       = *-Medium,
+                    ItalicFont     = *-Regular,
+                    BoldItalicFont = *-Medium,
                   ]
               }
               {
@@ -547,9 +596,14 @@
                 \RequirePackage { unicode-math }
                 \unimathsetup { math-style = ISO, partial = upright, nabla = upright }
                 \setmathfont { KpMath-Regular.otf }
+                \setmathfont { KpMath-Regular.otf }
+                  [
+                    range = \amalg ,
+                    Scale = 0.84625
+                  ]
                 \setmathfont { KpMath-Sans.otf }
                   [
-                    range = { \sum, \prod, \coprod }
+                    range = { \sum }
                   ]
                 \setmathfont { latinmodern-math.otf }
                   [
@@ -583,8 +637,8 @@
                     \cs_gset_eq:NN \square \mdwhtsquare
                   }
 
-                % A temporary hack proposed in https://tex.stackexchange.com/a/647789
-                \hook_gput_code:nnn { begindocument } { minimclass }
+                % https://tex.stackexchange.com/a/647789
+                \hook_gput_code:nnn { begindocument } { colorclass }
                   {
                     \NewCommandCopy\unicodevdots\vdots
                     \RenewDocumentCommand{\vdots}{}{\mathrel{\loweredvdots}}
@@ -669,8 +723,30 @@
 \char_set_catcode_active:n { `\· }
 \cs_new_protected:Npn · { \ensuremath\cdot }
 
-\PassOptionsToPackage { all } { nowidow }
-\RequirePackage { nowidow }
+%%================================
+%%  Graphics
+%%================================
+\RequirePackage { graphicx }
+\graphicspath { { images/ } }
+\RequirePackage { wrapfig }
+\RequirePackage { float }
+\RequirePackage { caption }
+\captionsetup { font = small }
+
+%%================================
+%%  Icing on the cake
+%%================================
+\bool_if:NT \l__colorclass_fast_bool { \endinput }
+
+\sys_if_engine_luatex:TF
+  {
+    \RequirePackage { lua-widow-control }
+    \lwcsetup { balanced }
+  }
+  {
+    \PassOptionsToPackage { all } { nowidow }
+    \RequirePackage { nowidow }
+  }
 
 \sys_if_engine_xetex:T
   {
@@ -684,25 +760,6 @@
       }
   }
 
-\hook_gput_code:nnn { begindocument/before } { colorclass }
-  {
-    \IfPackageLoadedTF { biblatex }
-      {
-        \PassOptionsToPackage { biblatex } { embrac }
-      } {}
-    \RequirePackage { embrac }
-  }
-
-%%================================
-%%  Graphics
-%%================================
-\RequirePackage { graphicx }
-\graphicspath { { images/ } }
-\RequirePackage { wrapfig }
-\RequirePackage { float }
-\RequirePackage { caption }
-\captionsetup { font = small }
-
 \endinput
 %%
 %% End of file `beaulivre/beaulivre.cls'.
-- 
cgit v1.2.3

