comparison 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
comparison
equal deleted inserted replaced
230:c54b5ffd41d7 231:8f3a000c3be5
27 \newif\if@mdf@WithIBMPlexDejaVuSansMono 27 \newif\if@mdf@WithIBMPlexDejaVuSansMono
28 \newif\if@mdf@WithAdobeSourcePro 28 \newif\if@mdf@WithAdobeSourcePro
29 \newif\if@mdf@WithSpectral 29 \newif\if@mdf@WithSpectral
30 \newif\if@mdf@WithCharter 30 \newif\if@mdf@WithCharter
31 \newif\if@mdf@WithLibertinus 31 \newif\if@mdf@WithLibertinus
32 \newif\if@mdf@WithGaramond
32 33
33 % A key compatible with options processing as option "fonts" but choices. 34 % A key compatible with options processing as option "fonts" but choices.
34 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{% 35 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{%
35 % do not change anything: just deactivate the default "dejavusansmono" 36 % do not change anything: just deactivate the default "dejavusansmono"
36 default, 37 default,
42 ibmplex, plex, % use the IBM Plex family (incl. Math) 43 ibmplex, plex, % use the IBM Plex family (incl. Math)
43 plex-dejavusansmono, % use IBM Plex Serif/Sans and DejaVu Sans Mono 44 plex-dejavusansmono, % use IBM Plex Serif/Sans and DejaVu Sans Mono
44 adobesourcepro, adobesource, % Use Adobe Source Serif/Sans/Mono 45 adobesourcepro, adobesource, % Use Adobe Source Serif/Sans/Mono
45 spectral, % use Spectral, Source Sans Pro and Source Code Pro 46 spectral, % use Spectral, Source Sans Pro and Source Code Pro
46 charter, % use XCharter (with XCharter Math), Lato and Inconsolata 47 charter, % use XCharter (with XCharter Math), Lato and Inconsolata
47 libertinus % use Libertinus family (incl. Math) 48 libertinus, % use Libertinus family (incl. Math)
49 garamond, % EB Garamond (with Math), Libre Franklin and Inconsolata
48 }{% 50 }{%
49 % Not used for now : store the normalized option value (global and expanded) 51 % Not used for now : store the normalized option value (global and expanded)
50 \xdef\@mdf@fonts{\val}% 52 \xdef\@mdf@fonts{\val}%
51 % Reset all option related font selection flags 53 % Reset all option related font selection flags
52 \@mdf@WithDejaVuSansMonofalse 54 \@mdf@WithDejaVuSansMonofalse
56 \@mdf@WithIBMPlexDejaVuSansMonofalse 58 \@mdf@WithIBMPlexDejaVuSansMonofalse
57 \@mdf@WithAdobeSourceProfalse 59 \@mdf@WithAdobeSourceProfalse
58 \@mdf@WithSpectralfalse 60 \@mdf@WithSpectralfalse
59 \@mdf@WithCharterfalse 61 \@mdf@WithCharterfalse
60 \@mdf@WithLibertinusfalse 62 \@mdf@WithLibertinusfalse
63 \@mdf@WithGaramondfalse
61 % Now set the needed font selection flag 64 % Now set the needed font selection flag
62 \ifcase\nr\relax 65 \ifcase\nr\relax
63 \relax 66 \relax
64 \or 67 \or
65 \@mdf@WithDejaVuSansMonotrue 68 \@mdf@WithDejaVuSansMonotrue
85 \@mdf@WithSpectraltrue 88 \@mdf@WithSpectraltrue
86 \or 89 \or
87 \@mdf@WithChartertrue 90 \@mdf@WithChartertrue
88 \or 91 \or
89 \@mdf@WithLibertinustrue 92 \@mdf@WithLibertinustrue
93 \or
94 \@mdf@WithGaramondtrue
90 \fi 95 \fi
91 } 96 }
92 97
93 % 98 %
94 % By default use the safe option dejavusansmono because is contains 99 % By default use the safe option dejavusansmono because is contains
230 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% 235 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
231 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% 236 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
232 {sphinx} 237 {sphinx}
233 \fi 238 \fi
234 239
240 \if@mdf@WithGaramond
241 \RequirePackage[lining,tabular]{ebgaramond}
242 \RequirePackage{unicode-math}
243 \setmathfont{Garamond-Math}[Scale=MatchLowercase]
244 \setsansfont{Libre Franklin}[Scale=MatchLowercase,Ligatures=TeX]
245 \@mdf@mono@inconsolatatrue
246 \fi
247
235 \defaultfontfeatures{} 248 \defaultfontfeatures{}
236 249
237 \if@mdf@mono@dejavusansmono 250 \if@mdf@mono@dejavusansmono
238 % automatically applied with Scale=MatchLowercase,... 251 % automatically applied with Scale=MatchLowercase,...
239 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available 252 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available