diff docs/_latex/my-doc-fonts.sty @ 231:8f3a000c3be5

Allow the use of Garamond: EB Garamond, Libre Franklin and Inconsolata (with Garamond Math)
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 15 May 2026 21:49:27 +0200
parents c54b5ffd41d7
children 97d66960ea69
line wrap: on
line diff
--- a/docs/_latex/my-doc-fonts.sty	Fri May 15 20:35:43 2026 +0200
+++ b/docs/_latex/my-doc-fonts.sty	Fri May 15 21:49:27 2026 +0200
@@ -29,6 +29,7 @@
 \newif\if@mdf@WithSpectral
 \newif\if@mdf@WithCharter
 \newif\if@mdf@WithLibertinus
+\newif\if@mdf@WithGaramond
 
 % A key compatible with options processing as option "fonts" but choices.
 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{%
@@ -44,7 +45,8 @@
   adobesourcepro, adobesource,  % Use Adobe Source Serif/Sans/Mono
   spectral,        % use Spectral, Source Sans Pro and Source Code Pro
   charter,         % use XCharter (with XCharter Math), Lato and Inconsolata
-  libertinus       % use Libertinus family (incl. Math)
+  libertinus,      % use Libertinus family (incl. Math)
+  garamond,        % EB Garamond (with Math), Libre Franklin and Inconsolata
   }{%
   % Not used for now : store the normalized option value (global and expanded)
   \xdef\@mdf@fonts{\val}%
@@ -58,6 +60,7 @@
   \@mdf@WithSpectralfalse
   \@mdf@WithCharterfalse
   \@mdf@WithLibertinusfalse
+  \@mdf@WithGaramondfalse
   % Now set the needed font selection flag
   \ifcase\nr\relax
     \relax
@@ -87,6 +90,8 @@
     \@mdf@WithChartertrue
   \or
     \@mdf@WithLibertinustrue
+  \or
+    \@mdf@WithGaramondtrue
   \fi
 }
 
@@ -232,6 +237,14 @@
     {sphinx}
 \fi
 
+\if@mdf@WithGaramond
+  \RequirePackage[lining,tabular]{ebgaramond}
+  \RequirePackage{unicode-math}
+  \setmathfont{Garamond-Math}[Scale=MatchLowercase]
+  \setsansfont{Libre Franklin}[Scale=MatchLowercase,Ligatures=TeX]
+  \@mdf@mono@inconsolatatrue
+\fi
+
 \defaultfontfeatures{}
 
 \if@mdf@mono@dejavusansmono