From c47535c840f22e8dc3cacd587723aaa9338193b3 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 17 Mar 2022 20:33:16 +0000
Subject: jxu (17mar22) (branch)

git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62770 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/minimalist/minimbook.cls  | 371 +++++++++------------
 1 file changed, 161 insertions(+), 210 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/minimalist/minimbook.cls')

diff --git a/Master/texmf-dist/tex/latex/minimalist/minimbook.cls b/Master/texmf-dist/tex/latex/minimalist/minimbook.cls
index 384451f8f1a..f346448d3ad 100644
--- a/Master/texmf-dist/tex/latex/minimalist/minimbook.cls
+++ b/Master/texmf-dist/tex/latex/minimalist/minimbook.cls
@@ -2,7 +2,7 @@
 %% This is file `minimalist/minimbook.cls',
 %% generated with the docstrip utility.
 
-%% Copyright (C) 2021 by Jinwen XU
+%% Copyright (C) 2021-2022 by Jinwen XU
 %% 
 %% This is part of the minimalist class series.
 %% 
@@ -16,224 +16,175 @@
 %% 2005/12/01 or later.
 %% 
 \NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\ProvidesClass{minimbook}
-    [2021/12/16 A simple and clear book style]
-\def\minimclass@baseclass{book}
-\RequirePackage{kvoptions}
-\RequirePackage{etoolbox}
-\SetupKeyvalOptions{
-    family = @minimclass,
-    prefix = @minimclass@,
-}
-\DeclareBoolOption[false]{draft}
-\DeclareBoolOption[false]{fast}
-\DeclareBoolOption[false]{classical}
-\DeclareBoolOption[false]{useindent}
-\DeclareBoolOption[false]{useosf}
-\DeclareBoolOption[false]{lmodern}
-\DeclareBoolOption[false]{palatino}
-\DeclareBoolOption[false]{times}
-\DeclareBoolOption[false]{garamond}
-\DeclareBoolOption[false]{noto}
-\DeclareBoolOption[false]{biolinum}
-\DeclareBoolOption[false]{customfont}
-\DeclareStringOption{thmnum}[PJL@thmnum@default]
-
-\newif\if@minimclass@bfivepaper\@minimclass@bfivepaperfalse
-\DeclareVoidOption{b5paper}{\@minimclass@bfivepapertrue}
-\newif\if@minimclass@afourpaper\@minimclass@afourpaperfalse
-\DeclareVoidOption{a4paper}{\@minimclass@afourpapertrue}
-
-\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{\minimclass@baseclass}}
-\ProcessKeyvalOptions*\relax
-\LoadClass{\minimclass@baseclass}
-
-\if@minimclass@draft
-    \@minimclass@fasttrue
-\fi
-\if@minimclass@classical\else
-    \@minimclass@useindenttrue
-\fi
-\if@minimclass@lmodern
-    \@minimclass@customfonttrue
-\fi
-\if@minimclass@palatino
-    \@minimclass@customfonttrue
-\fi
-\if@minimclass@times
-    \@minimclass@customfonttrue
-\fi
-\if@minimclass@garamond
-    \@minimclass@customfonttrue
-\fi
-\if@minimclass@noto
-    \@minimclass@customfonttrue
-\fi
-\if@minimclass@biolinum
-    \@minimclass@customfonttrue
-\fi
+\RequirePackage{l3keys2e}
+\ProvidesExplClass
+  {minimbook}
+  {2022/03/17} {}
+  {A simple and clear book style}
+
+\tl_const:Nn \l__minimclass_base_class_tl { book }
+
+
+\bool_new:N \l__minimclass_load_custom_font_file_bool
+\bool_set_false:N \l__minimclass_load_custom_font_file_bool
+
+
+\keys_define:nn { minimclass }
+  {
+    , draft                   .bool_set:N         = \l__minimclass_fast_bool
+    , draft                   .initial:n          = { false }
+    , fast                    .bool_set:N         = \l__minimclass_fast_bool
+
+    , classical               .bool_set:N         = \l__minimclass_classical_bool
+    , classical               .initial:n          = { false }
+
+    , use indent              .bool_set:N         = \l__minimclass_useindent_bool
+    , use indent              .initial:n          = { true }
+    , use~indent              .bool_set:N         = \l__minimclass_useindent_bool
+    , use-indent              .bool_set:N         = \l__minimclass_useindent_bool
+
+    , load custom font file   .code:n             = {
+                                                      \bool_set_true:N \l__minimclass_load_custom_font_file_bool
+                                                      \str_set:Nn \l__minimclass_custom_font_file_str { #1 }
+                                                    }
+    , load custom font file   .default:n          = { minimalist.font }
+    , load~custom~font~file   .code:n             = {
+                                                      \bool_set_true:N \l__minimclass_load_custom_font_file_bool
+                                                      \str_set:Nn \l__minimclass_custom_font_file_str { #1 }
+                                                    }
+    , load~custom~font~file   .default:n          = { minimalist.font }
+    , load-custom-font-file   .code:n             = {
+                                                      \bool_set_true:N \l__minimclass_load_custom_font_file_bool
+                                                      \str_set:Nn \l__minimclass_custom_font_file_str { #1 }
+                                                    }
+    , load-custom-font-file   .default:n          = { minimalist.font }
+
+
+    , a4paper                 .bool_set:N         = \l__minimclass_a_four_paper_bool
+    , a4paper                 .initial:n          = { false }
+    , b5paper                 .bool_set:N         = \l__minimclass_b_five_paper_bool
+    , b5paper                 .initial:n          = { false }
+
+    , 11pt                    .code:n             = { \PassOptionsToClass { \CurrentOption } { \l__minimclass_base_class_tl } }
+    , 12pt                    .code:n             = { \PassOptionsToClass { \CurrentOption } { \l__minimclass_base_class_tl } }
+
+    , unknown                 .code:n             = {
+                                                      \PassOptionsToPackage { \CurrentOption } { minimalist }
+                                                    }
+  }
+\ProcessKeysOptions { minimclass }
+
+\LoadClass{\l__minimclass_base_class_tl}
+
+\bool_if:NT \l__minimclass_classical_bool
+  {
+    \bool_set_false:N \l__minimclass_useindent_bool
+  }
 
 %%================================
-%% Page layout
+%%  Page layout
 %%================================
-\RequirePackage{silence}
-\WarningFilter{geometry}{Over-specification in}
-\RequirePackage[heightrounded]{geometry}
-\geometry{
-    papersize={7in,10in},
-    % total={40em,60em},
-    total={5.535in,8.300in},
-    hmarginratio=1:1,
-    vmarginratio=1:1,
-    footnotesep=2em plus 2pt minus 2pt,
-}
-\if@minimclass@bfivepaper
-\geometry{
-    b5paper,
-    % total={40em,59em},
-    total={5.535in,8.160in},
-    hmarginratio=1:1,
-    vmarginratio=1:1,
-    footnotesep=2em plus 2pt minus 2pt,
-}
-\fi
-\if@minimclass@afourpaper
-\geometry{
-    a4paper,
-    % total={47em,70em},
-    total={6.500in,9.685in},
-    hmarginratio=1:1,
-    vmarginratio=1:1,
-    footnotesep=2em plus 2pt minus 2pt,
-}
-\fi
-
-\if@minimclass@fast
-    \PassOptionsToPackage{fast}{minimalist}
-    \RequirePackage{draftwatermark}
-    \DraftwatermarkOptions{text={\normalfont DRAFT},color=paper!95!-paper}
-\fi
-\if@minimclass@useindent
-    \RequirePackage{indentfirst}
-\else
-    \AtEndPreamble{\RequirePackage{parskip}}
-\fi
-\RequirePackage{minimalist}
+\RequirePackage { silence }
+\WarningFilter { geometry } { Over-specification }
+
+\PassOptionsToPackage { heightrounded } { geometry }
+\RequirePackage { geometry }
+
+\geometry
+  {
+    papersize = { 7in, 10in },
+    total = { 5.535in, 8.300in },
+    centering,
+    footnotesep = 2em plus 2pt minus 2pt,
+  }
+
+\bool_if:NT \l__minimclass_b_five_paper_bool
+  {
+    \geometry
+      {
+        b5paper,
+        total = { 5.535in, 8.160in },
+        centering,
+        footnotesep = 2em plus 2pt minus 2pt,
+      }
+  }
+
+\bool_if:NT \l__minimclass_a_four_paper_bool
+  {
+    \geometry
+      {
+        a4paper,
+        total = { 6.500in, 9.685in },
+        centering,
+        footnotesep = 2em plus 2pt minus 2pt,
+      }
+  }
+
+\bool_if:NT \l__minimclass_fast_bool
+  {
+    \PassOptionsToPackage { fast } { minimalist }
+    \RequirePackage { draftwatermark }
+    \DraftwatermarkOptions { text = { \normalfont DRAFT }, color = paper!97!-paper }
+  }
+
+\bool_if:NTF \l__minimclass_useindent_bool
+  {
+    \RequirePackage { indentfirst }
+  }
+  {
+    \hook_gput_code:nnn { begindocument/before } { minimclass }
+      {
+        \RequirePackage { parskip }
+      }
+  }
+
+\RequirePackage { minimalist }
 
 %%================================
-%% Fonts
+%%  Fonts
 %%================================
-\RequirePackage{iftex}
-\ifPDFTeX
-\RequirePackage[T1]{fontenc}
-\RequirePackage{inputenc}
-\fi
-\if@minimclass@customfont\else
-\RequirePackage{mathpazo}
-\RequirePackage{newpxtext}
-\fi
-\RequirePackage{amssymb}
-
-\if@minimclass@lmodern
-    \RequirePackage{amssymb}
-    \if@minimclass@useosf
-        \RequirePackage{cfr-lm}
-    \else
-        \RequirePackage{lmodern}
-    \fi
-    \PJLsetlinespacing{\setstretch{1.00}}
-\fi
-
-\if@minimclass@palatino
-    \RequirePackage{amssymb}
-    \RequirePackage{mathpazo}
-    \PassOptionsToPackage{defaultsups}{newpxtext}
-    \RequirePackage{newpxtext}
-    % \RequirePackage{newpxmath}
-    \let\openbox\relax
-    \PJLsetlinespacing{\setstretch{1.07}}
-    \if@minimclass@useosf\useosf\fi
-\fi
-
-\if@minimclass@times
-    \RequirePackage{amssymb}
-    \PassOptionsToPackage{defaultsups}{newtxtext}
-    \RequirePackage{newtxtext}
-    \RequirePackage{newtxmath}
-    \let\openbox\relax
-    \PJLsetlinespacing{\setstretch{1.00}}
-    \if@minimclass@useosf\useosf\fi
-\fi
-
-\if@minimclass@garamond
-    \RequirePackage{amssymb}
-    \if@minimclass@useosf\else
-        \PassOptionsToPackage{lining}{ebgaramond}
-    \fi
-    \RequirePackage{ebgaramond-maths}
-    \RequirePackage{ebgaramond}
-    % \RequirePackage{garamondlibre}
-    \PJLsetlinespacing{\setstretch{1.00}}
-\fi
-
-\if@minimclass@noto
-    \RequirePackage{amssymb}
-    \if@minimclass@useosf
-        \PassOptionsToPackage{oldstyle}{notomath}
-    \fi
-    \RequirePackage{anyfontsize}
-    \RequirePackage{notomath}
-    \PJLsetlinespacing{\setstretch{1.00}}
-\fi
-
-\if@minimclass@biolinum
-    \RequirePackage{amssymb}
-    % \RequirePackage{mathpazo}
-    % \RequirePackage[sansmath]{libertinust1math}
-    \ifPDFTeX
-        \if@minimclass@useosf
-            \PassOptionsToPackage{osf}{biolinum}
-        \fi
-        \RequirePackage{biolinum}
-        \renewcommand*\familydefault{\biolinum@family}
-    \else
-        \PassOptionsToPackage{no-math}{fontspec}
-        \RequirePackage{fontspec}
-        \setmainfont{LinBiolinum_R.otf}[
-            BoldFont       = LinBiolinum_RB.otf ,
-            ItalicFont     = LinBiolinum_RI.otf ,
-            BoldItalicFont = LinBiolinum_RBO.otf,
-            \if@minimclass@useosf Numbers = OldStyle\fi ]
-    \fi
-    \PJLsetlinespacing{\setstretch{1.05}}
-    \RequirePackage[italic,defaultmathsizes]{mathastext}
-\fi
-
-\def\PJL@font@alreadyset{}
-
-\PassOptionsToPackage{verbose=silent}{microtype}
-\RequirePackage{microtype}
-\PassOptionsToPackage{all}{nowidow}
-\RequirePackage{nowidow}
-\RequirePackage{embrac}
+\WarningFilter { latexfont } { Font~shape }
+\WarningFilter { latexfont } { Some~font  }
+
+\cs_new_protected:Nn \__minimclass_load_file_or_config:Nnn
+  {
+    \bool_if:NT #1
+      {
+        \exp_args:Nx \file_if_exist:nT { #2 }
+          {
+            \exp_args:Nx \file_input:n { #2 }
+            \use_none:nn
+          }
+      }
+    \use:n { #3 }
+  }
+
+
+\__minimclass_load_file_or_config:Nnn \l__minimclass_load_custom_font_file_bool { \l__minimclass_custom_font_file_str }
+  {
+    \RequirePackage { projlib-font }
+
+    \bool_if:NF \g_projlib_font_already_set_bool
+      {
+        \RequirePackage { mathpazo }
+        \RequirePackage { newpxtext }
+        \RequirePackage { amssymb }
+      }
+  }
+
+\PassOptionsToPackage { all } { nowidow }
+\RequirePackage { nowidow }
+\RequirePackage { embrac }
 
 %%================================
-%% Graphics
+%%  Graphics
 %%================================
-\RequirePackage{graphicx}
-\graphicspath{{images/}}
-\RequirePackage{wrapfig}
-\RequirePackage{float}
-\RequirePackage{caption}
-\captionsetup{font=small}
-
-%%================================
-%% Index
-%%================================
-\AtEndPreamble{
-\pretocmd{\printindex}{\LocallyStopLineNumbers}{}{}
-\apptocmd{\printindex}{\ResumeLineNumbers}{}{}
-}
+\RequirePackage { graphicx }
+\graphicspath { { images/ } }
+\RequirePackage { wrapfig }
+\RequirePackage { float }
+\RequirePackage { caption }
+\captionsetup { font = small }
 
 \endinput
 %%
-- 
cgit v1.2.3

