summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/beaulivre/beaulivre.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/unicodetex/latex/beaulivre/beaulivre.cls')
-rw-r--r--macros/unicodetex/latex/beaulivre/beaulivre.cls126
1 files changed, 74 insertions, 52 deletions
diff --git a/macros/unicodetex/latex/beaulivre/beaulivre.cls b/macros/unicodetex/latex/beaulivre/beaulivre.cls
index 05924ada80..7c63f73479 100644
--- a/macros/unicodetex/latex/beaulivre/beaulivre.cls
+++ b/macros/unicodetex/latex/beaulivre/beaulivre.cls
@@ -1,7 +1,7 @@
%%
%% This is file `beaulivre/beaulivre.cls',
%% generated with the docstrip utility.
-
+%%
%% Copyright (C) 2021-2022 by Jinwen XU
%%
%% This is part of the colorist class series.
@@ -19,7 +19,7 @@
\RequirePackage{l3keys2e}
\ProvidesExplClass
{beaulivre}
- {2022/04/24} {}
+ {2022/06/16} {}
{A colorful book style}
\tl_const:Nn \l__colorclass_base_class_tl { book }
@@ -229,43 +229,39 @@
\__colorclass_load_file_or_config:Nnn \l__colorclass_load_custom_font_file_latin_bool { \l__colorclass_custom_font_file_latin_str }
{
- \__colorclass_if_font_exist:nnn { Palatino~Linotype }
+ \bool_if:NTF \l__projlib_font_useosf_bool
{
- \bool_if:NTF \l__projlib_font_useosf_bool
- {
- \setmainfont { Palatino~Linotype } [ Numbers = OldStyle ]
- }
- {
- \setmainfont { Palatino~Linotype }
- }
+ \setmainfont { TeXGyrePagellaX-Regular.otf }
+ [
+ BoldFont = TeXGyrePagellaX-Bold.otf ,
+ ItalicFont = TeXGyrePagellaX-Italic.otf ,
+ BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
+ Numbers = OldStyle ,
+ ]
+ \setsansfont { SourceSansPro-Regular.otf }
+ [
+ Scale = 1.05 ,
+ BoldFont = SourceSansPro-Semibold.otf ,
+ ItalicFont = SourceSansPro-RegularIt.otf ,
+ BoldItalicFont = SourceSansPro-SemiboldIt.otf ,
+ Numbers = OldStyle ,
+ ]
}
{
- \bool_if:NTF \l__projlib_font_useosf_bool
- {
- \setmainfont { TeXGyrePagellaX-Regular.otf }
- [
- BoldFont = TeXGyrePagellaX-Bold.otf ,
- ItalicFont = TeXGyrePagellaX-Italic.otf ,
- BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
- Numbers = OldStyle ,
- ]
- }
- {
- \setmainfont { TeXGyrePagellaX-Regular.otf }
- [
- BoldFont = TeXGyrePagellaX-Bold.otf ,
- ItalicFont = TeXGyrePagellaX-Italic.otf ,
- BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
- ]
- }
+ \setmainfont { TeXGyrePagellaX-Regular.otf }
+ [
+ BoldFont = TeXGyrePagellaX-Bold.otf ,
+ ItalicFont = TeXGyrePagellaX-Italic.otf ,
+ BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ,
+ ]
+ \setsansfont { SourceSansPro-Regular.otf }
+ [
+ Scale = 1.05 ,
+ BoldFont = SourceSansPro-Semibold.otf ,
+ ItalicFont = SourceSansPro-RegularIt.otf ,
+ BoldItalicFont = SourceSansPro-SemiboldIt.otf ,
+ ]
}
- \setsansfont { SourceSansPro-Regular.otf }
- [
- Scale = 1.05 ,
- BoldFont = SourceSansPro-Bold.otf ,
- ItalicFont = SourceSansPro-RegularIt.otf ,
- BoldItalicFont = SourceSansPro-BoldIt.otf ,
- ]
\setmonofont { NewCMMono10-Regular.otf }
[
Scale = 1.05 ,
@@ -544,10 +540,8 @@
{
\bool_if:NF \g_projlib_font_already_set_bool
{
- \bool_if:NTF \l__colorclass_fast_bool
- {
- \RequirePackage { amssymb }
- }
+ \RequirePackage { amssymb }
+ \bool_if:NF \l__colorclass_fast_bool
{
\PassOptionsToPackage { warnings-off = { mathtools-colon, mathtools-overbracket } } { unicode-math }
\RequirePackage { unicode-math }
@@ -559,6 +553,11 @@
]
\setmathfont { latinmodern-math.otf }
[
+ range = { \ast } ,
+ Scale = 1.10
+ ]
+ \setmathfont { latinmodern-math.otf }
+ [
range = { frak, bffrak }
]
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
@@ -571,17 +570,34 @@
[
range = { it / { Latin, latin }, bfit / { Latin, latin }, up / num, bfup / num }
]
+ \setmathfont { KpMath-Regular.otf } [ range = {} ]
+
+ \sys_if_engine_luatex:T
+ {
+ \mathitalicsmode=1
+ }
\hook_gput_code:nnn { begindocument } { colorclass }
{
- \NewCommandCopy \colorclass_backup_mid: \mid
- \RenewDocumentCommand \mid {}
- { \skip_horizontal:n {-.1em} \colorclass_backup_mid: \skip_horizontal:n {-.1em} }
- \NewCommandCopy \colorclass_backup_nmid: \nmid
- \RenewDocumentCommand \nmid {}
- { \skip_horizontal:n {-.1em} \colorclass_backup_nmid: \skip_horizontal:n {-.1em} }
+ \cs_gset_eq:NN \overline \wideoverbar
+ \cs_gset_eq:NN \square \mdwhtsquare
}
+ % A temporary hack proposed in https://tex.stackexchange.com/a/647789
+ \hook_gput_code:nnn { begindocument } { minimclass }
+ {
+ \NewCommandCopy\unicodevdots\vdots
+ \RenewDocumentCommand{\vdots}{}{\mathrel{\loweredvdots}}
+ }
+ \newcommand{\loweredvdots}{\mathpalette\loweredvdots@\relax}
+ \newcommand{\loweredvdots@}[2]{%
+ \begingroup
+ \sbox\z@{$\m@th#1\unicodevdots$}%
+ \vrule width \z@ height 2.25\ht\z@ depth 0.012\ht\z@
+ \raisebox{0.25\height}{\usebox\z@}%
+ \endgroup
+ }
+
\RequirePackage { tikz-cd }
\tikzcdset { arrow~style = tikz, diagrams = { >={Stealth[round,length=3.4pt,width=6.15pt,inset=2.25pt]} } }
@@ -650,21 +666,27 @@
}
}
+\char_set_catcode_active:n { `\· }
+\cs_new_protected:Npn · { \ensuremath\cdot }
+
\PassOptionsToPackage { all } { nowidow }
\RequirePackage { nowidow }
-\RequirePackage { regexpatch }
-\skip_new:N \g_colorclass_parfillskip_skip
-\xpatchcmd{\@trivlist}{\@flushglue}{\g_colorclass_parfillskip_skip}{}{}
-\hook_gput_code:nnn { begindocument } { colorclass }
+\sys_if_engine_xetex:T
{
- \skip_gset:Nn \g_colorclass_parfillskip_skip { 0pt plus \dim_eval:n { \linewidth - 2\parindent } }
- \skip_gset_eq:NN \parfillskip \g_colorclass_parfillskip_skip
+ \RequirePackage { regexpatch }
+ \skip_new:N \g_colorclass_parfillskip_skip
+ \xpatchcmd{\@trivlist}{\@flushglue}{\g_colorclass_parfillskip_skip}{}{}
+ \hook_gput_code:nnn { begindocument } { colorclass }
+ {
+ \skip_gset:Nn \g_colorclass_parfillskip_skip { 0pt plus \dim_eval:n { \linewidth - 3em } }
+ \skip_gset_eq:NN \parfillskip \g_colorclass_parfillskip_skip
+ }
}
\hook_gput_code:nnn { begindocument/before } { colorclass }
{
- \@ifpackageloaded { biblatex }
+ \IfPackageLoadedTF { biblatex }
{
\PassOptionsToPackage { biblatex } { embrac }
} {}