summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/colorist/colorbook.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/colorist/colorbook.cls')
-rw-r--r--Master/texmf-dist/tex/latex/colorist/colorbook.cls340
1 files changed, 143 insertions, 197 deletions
diff --git a/Master/texmf-dist/tex/latex/colorist/colorbook.cls b/Master/texmf-dist/tex/latex/colorist/colorbook.cls
index a2ee22f3def..ce2d27ce8b9 100644
--- a/Master/texmf-dist/tex/latex/colorist/colorbook.cls
+++ b/Master/texmf-dist/tex/latex/colorist/colorbook.cls
@@ -2,7 +2,7 @@
%% This is file `colorist/colorbook.cls',
%% generated with the docstrip utility.
-%% Copyright (C) 2021 by Jinwen XU
+%% Copyright (C) 2021-2022 by Jinwen XU
%%
%% This is part of the colorist class series.
%%
@@ -16,211 +16,157 @@
%% 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\ProvidesClass{colorbook}
- [2021/12/16 A colorful book style]
-\def\colorclass@baseclass{book}
-\RequirePackage{kvoptions}
-\RequirePackage{etoolbox}
-\SetupKeyvalOptions{
- family = @colorclass,
- prefix = @colorclass@,
-}
-\DeclareBoolOption[false]{draft}
-\DeclareBoolOption[false]{fast}
-\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@colorclass@bfivepaper\@colorclass@bfivepaperfalse
-\DeclareVoidOption{b5paper}{\@colorclass@bfivepapertrue}
-\newif\if@colorclass@afourpaper\@colorclass@afourpaperfalse
-\DeclareVoidOption{a4paper}{\@colorclass@afourpapertrue}
-
-\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{\colorclass@baseclass}}
-\ProcessKeyvalOptions*\relax
-\LoadClass{\colorclass@baseclass}
-
-\if@colorclass@draft
- \@colorclass@fasttrue
-\fi
-\if@colorclass@lmodern
- \@colorclass@customfonttrue
-\fi
-\if@colorclass@palatino
- \@colorclass@customfonttrue
-\fi
-\if@colorclass@times
- \@colorclass@customfonttrue
-\fi
-\if@colorclass@garamond
- \@colorclass@customfonttrue
-\fi
-\if@colorclass@noto
- \@colorclass@customfonttrue
-\fi
-\if@colorclass@biolinum
- \@colorclass@customfonttrue
-\fi
+\RequirePackage{l3keys2e}
+\ProvidesExplClass
+ {colorbook}
+ {2022/03/19} {}
+ {A colorful book style}
+
+\tl_const:Nn \l__colorclass_base_class_tl { book }
+
+
+\bool_new:N \l__colorclass_load_custom_font_file_bool
+\bool_set_false:N \l__colorclass_load_custom_font_file_bool
+
+
+\keys_define:nn { colorclass }
+ {
+ , draft .bool_set:N = \l__colorclass_fast_bool
+ , draft .initial:n = { false }
+ , fast .bool_set:N = \l__colorclass_fast_bool
+
+
+ , load custom font file .code:n = {
+ \bool_set_true:N \l__colorclass_load_custom_font_file_bool
+ \str_set:Nn \l__colorclass_custom_font_file_str { #1 }
+ }
+ , load custom font file .default:n = { colorist.font }
+ , load~custom~font~file .code:n = {
+ \bool_set_true:N \l__colorclass_load_custom_font_file_bool
+ \str_set:Nn \l__colorclass_custom_font_file_str { #1 }
+ }
+ , load~custom~font~file .default:n = { colorist.font }
+ , load-custom-font-file .code:n = {
+ \bool_set_true:N \l__colorclass_load_custom_font_file_bool
+ \str_set:Nn \l__colorclass_custom_font_file_str { #1 }
+ }
+ , load-custom-font-file .default:n = { colorist.font }
+
+
+ , a4paper .bool_set:N = \l__colorclass_a_four_paper_bool
+ , a4paper .initial:n = { false }
+ , b5paper .bool_set:N = \l__colorclass_b_five_paper_bool
+ , b5paper .initial:n = { false }
+
+ , 11pt .code:n = { \PassOptionsToClass { \CurrentOption } { \l__colorclass_base_class_tl } }
+ , 12pt .code:n = { \PassOptionsToClass { \CurrentOption } { \l__colorclass_base_class_tl } }
+
+ , unknown .code:n = {
+ \PassOptionsToPackage { \CurrentOption } { colorist }
+ }
+ }
+\ProcessKeysOptions { colorclass }
+
+\LoadClass{\l__colorclass_base_class_tl}
%%================================
-%% Page layout
+%% Page layout
%%================================
-\RequirePackage{silence}
-\WarningFilter{geometry}{Over-specification in}
-\RequirePackage[heightrounded]{geometry}
-\geometry{
- papersize={8.5in,11in},
- % total={47em,66em},
- total={6.500in,9.130in},
- hmarginratio=1:1,
- vmarginratio=1:1,
- footnotesep=2em plus 2pt minus 2pt,
-}
-\if@colorclass@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@colorclass@afourpaper
-\geometry{
- a4paper,
- % total={47em,70em},
- total={6.500in,9.685in},
- hmarginratio=1:1,
- vmarginratio=1:1,
- footnotesep=2em plus 2pt minus 2pt,
-}
-\fi
-
-\RequirePackage{indentfirst}
-
-\if@colorclass@fast
- \PassOptionsToPackage{fast}{colorist}
- \RequirePackage{draftwatermark}
- \DraftwatermarkOptions{text={\normalfont DRAFT},color=paper!95!-paper}
-\fi
-
-\RequirePackage{colorist}
+\RequirePackage { silence }
+\WarningFilter { geometry } { Over-specification }
+
+\PassOptionsToPackage { heightrounded } { geometry }
+\RequirePackage { geometry }
+
+\geometry
+ {
+ papersize = { 8.5in, 11in },
+ total = { 6.500in, 9.130in },
+ centering,
+ footnotesep = 2em plus 2pt minus 2pt,
+ }
+
+\bool_if:NT \l__colorclass_b_five_paper_bool
+ {
+ \geometry
+ {
+ b5paper,
+ total = { 5.535in, 8.160in },
+ centering,
+ footnotesep = 2em plus 2pt minus 2pt,
+ }
+ }
+
+\bool_if:NT \l__colorclass_a_four_paper_bool
+ {
+ \geometry
+ {
+ a4paper,
+ total = { 6.500in, 9.685in },
+ centering,
+ footnotesep = 2em plus 2pt minus 2pt,
+ }
+ }
+
+\bool_if:NT \l__colorclass_fast_bool
+ {
+ \PassOptionsToPackage { fast } { colorist }
+ \RequirePackage { draftwatermark }
+ \DraftwatermarkOptions { text = { \normalfont DRAFT }, color = paper!97!-paper }
+ }
+
+\RequirePackage { indentfirst }
+
+\RequirePackage { colorist }
+
+\hfuzz=2pt
+\vfuzz=2pt
%%================================
-%% Fonts
+%% Fonts
%%================================
-\RequirePackage{iftex}
-\ifPDFTeX
-\RequirePackage[T1]{fontenc}
-\RequirePackage{inputenc}
-\fi
-\if@colorclass@customfont\else
-\RequirePackage{mathpazo}
-\RequirePackage{newpxtext}
-\fi
-\RequirePackage{amssymb}
-
-\if@colorclass@lmodern
- \RequirePackage{amssymb}
- \if@colorclass@useosf
- \RequirePackage{cfr-lm}
- \else
- \RequirePackage{lmodern}
- \fi
- \PJLsetlinespacing{\setstretch{1.00}}
-\fi
-
-\if@colorclass@palatino
- \RequirePackage{amssymb}
- \RequirePackage{mathpazo}
- \PassOptionsToPackage{defaultsups}{newpxtext}
- \RequirePackage{newpxtext}
- % \RequirePackage{newpxmath}
- \let\openbox\relax
- \PJLsetlinespacing{\setstretch{1.07}}
- \if@colorclass@useosf\useosf\fi
-\fi
-
-\if@colorclass@times
- \RequirePackage{amssymb}
- \PassOptionsToPackage{defaultsups}{newtxtext}
- \RequirePackage{newtxtext}
- \RequirePackage{newtxmath}
- \let\openbox\relax
- \PJLsetlinespacing{\setstretch{1.00}}
- \if@colorclass@useosf\useosf\fi
- \let\colorist@textsc\relax
-\fi
-
-\if@colorclass@garamond
- \RequirePackage{amssymb}
- \if@colorclass@useosf\else
- \PassOptionsToPackage{lining}{ebgaramond}
- \fi
- \RequirePackage{ebgaramond-maths}
- \RequirePackage{ebgaramond}
- % \RequirePackage{garamondlibre}
- \PJLsetlinespacing{\setstretch{1.00}}
- \let\colorist@textsc\relax
-\fi
-
-\if@colorclass@noto
- \RequirePackage{amssymb}
- \if@colorclass@useosf
- \PassOptionsToPackage{oldstyle}{notomath}
- \fi
- \RequirePackage{anyfontsize}
- \RequirePackage{notomath}
- \PJLsetlinespacing{\setstretch{1.00}}
-\fi
-
-\if@colorclass@biolinum
- \RequirePackage{amssymb}
- % \RequirePackage{mathpazo}
- % \RequirePackage[sansmath]{libertinust1math}
- \ifPDFTeX
- \if@colorclass@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@colorclass@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 \__colorclass_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 }
+ }
+
+
+\__colorclass_load_file_or_config:Nnn \l__colorclass_load_custom_font_file_bool { \l__colorclass_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}
+\RequirePackage { graphicx }
+\graphicspath { { images/ } }
+\RequirePackage { wrapfig }
+\RequirePackage { float }
+\RequirePackage { caption }
+\captionsetup { font = small }
\endinput
%%