diff docs/_latex/my-doc-fonts.sty @ 242:0737faace808

A style variant with "Crimson Pro", "Cabin", "Source Code Pro" and "Erewhon Math"
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 16 May 2026 01:13:28 +0200
parents e18c4bec7889
children 255c5598abd7
line wrap: on
line diff
--- a/docs/_latex/my-doc-fonts.sty	Sat May 16 00:35:51 2026 +0200
+++ b/docs/_latex/my-doc-fonts.sty	Sat May 16 01:13:28 2026 +0200
@@ -34,6 +34,7 @@
 \newif\if@mdf@WithGaramond
 \newif\if@mdf@WithTufte
 \newif\if@mdf@WithPalatino
+\newif\if@mdf@WithCrimson
 
 % A key compatible with options processing as option "fonts" but choices.
 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{%
@@ -53,6 +54,7 @@
   garamond,        % EB Garamond (with Math), Libre Franklin and Inconsolata
   tufte,      % Tufte fonts: ETbb (with Math), GilliusADFNo2, DejaVu Sans Mono
   palatino,        % Palatino, Inter and Source Code Pro
+  crimson,         % Crimson Pro, Cabin and Source Code Pro (incl. Erewhon Math)
   }{%
   % Not used for now : store the normalized option value (global and expanded)
   \xdef\@mdf@fonts{\val}%
@@ -69,6 +71,7 @@
   \@mdf@WithGaramondfalse
   \@mdf@WithTuftefalse
   \@mdf@WithPalatinofalse
+  \@mdf@WithCrimsonfalse
   % Now set the needed font selection flag
   \ifcase\nr\relax
     \relax
@@ -104,6 +107,8 @@
     \@mdf@WithTuftetrue
   \or
     \@mdf@WithPalatinotrue
+  \or
+    \@mdf@WithCrimsontrue
   \fi
 }
 
@@ -249,6 +254,16 @@
   \@mdf@mono@libertinusmonotrue
 \fi
 
+\if@mdf@WithCrimson
+  \RequirePackage{unicode-math}
+  \defaultfontfeatures{Ligatures=TeX, Numbers={Lining,Tabular}}
+  \setmainfont{Crimson Pro}
+  \setsansfont{Cabin}[Scale=MatchLowercase]
+  \defaultfontfeatures{}% Erewhon Math needs this here!
+  \setmathfont{Erewhon Math}[Scale=MatchLowercase]
+  \@mdf@mono@sscodetrue
+\fi
+
 \defaultfontfeatures{}
 
 \if@mdf@mono@dejavusansmono
@@ -377,7 +392,7 @@
 \if@mdf@mono@libertinusmono
   % This is stolen from libertinus-otf.sty!
   \setmonofont{LibertinusMono}[%
-    Ligatures = TeX,  
+    Ligatures = TeX,
     Numbers = {Lining, Tabular},
     Scale = MatchLowercase,
     FakeStretch = 0.94,