comparison docs/_latex/my-doc-fonts.sty @ 204:afecfdcfd288

A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata". Used e.g. for ConfigMix PDF docs.
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 13 May 2026 14:34:39 +0200
parents ede8b44f6faf
children c80b430fdc0f
comparison
equal deleted inserted replaced
203:ede8b44f6faf 204:afecfdcfd288
13 }{% 13 }{%
14 \RequirePackage{color} 14 \RequirePackage{color}
15 } 15 }
16 16
17 \newif\if@mdf@@sscode\@mdf@@sscodefalse 17 \newif\if@mdf@@sscode\@mdf@@sscodefalse
18 \newif\if@mdf@@inconsolata\@mdf@@inconsolatafalse
18 19
19 \newif\if@mdf@WithDejaVuSansMono 20 \newif\if@mdf@WithDejaVuSansMono
20 \newif\if@mdf@WithPlexMono 21 \newif\if@mdf@WithPlexMono
21 \newif\if@mdf@WithAdobeSource 22 \newif\if@mdf@WithAdobeSource
22 \newif\if@mdf@WithSpectral 23 \newif\if@mdf@WithSpectral
24 \newif\if@mdf@WithCharter
23 25
24 \def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse\@mdf@WithAdobeSourcefalse} 26 \def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse\@mdf@WithAdobeSourcefalse\@mdf@WithCharterfalse}
25 27
26 \DeclareOptionX{dejavusansmono}[true]{\@mdf@reset@font@options\csname @mdf@WithDejaVuSansMono#1\endcsname} 28 \DeclareOptionX{dejavusansmono}[true]{\@mdf@reset@font@options\csname @mdf@WithDejaVuSansMono#1\endcsname}
27 \DeclareOptionX{plexmono}[true]{\@mdf@reset@font@options\csname @mdf@WithPlexMono#1\endcsname} 29 \DeclareOptionX{plexmono}[true]{\@mdf@reset@font@options\csname @mdf@WithPlexMono#1\endcsname}
28 \DeclareOptionX{adobesource}[true]{\@mdf@reset@font@options\csname @mdf@WithAdobeSource#1\endcsname} 30 \DeclareOptionX{adobesource}[true]{\@mdf@reset@font@options\csname @mdf@WithAdobeSource#1\endcsname}
29 \DeclareOptionX{spectral}[true]{\@mdf@reset@font@options\csname @mdf@WithSpectral#1\endcsname} 31 \DeclareOptionX{spectral}[true]{\@mdf@reset@font@options\csname @mdf@WithSpectral#1\endcsname}
32 \DeclareOptionX{charter}[true]{\@mdf@reset@font@options\csname @mdf@WithCharter#1\endcsname}
30 33
31 % 34 %
32 % By default use the safe option dejavusansmono because is contains 35 % By default use the safe option dejavusansmono because is contains
33 % all characters without any hacks. 36 % all characters without any hacks.
34 % 37 %
106 ItalicFont = * Italic, 109 ItalicFont = * Italic,
107 BoldItalicFont = * Bold Italic, 110 BoldItalicFont = * Bold Italic,
108 ] 111 ]
109 \@mdf@@sscodetrue 112 \@mdf@@sscodetrue
110 \fi 113 \fi
114 \if@mdf@WithCharter
115 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
116 \setmainfont{XCharter}
117 \setsansfont{Lato}[
118 UprightFont = * Regular,
119 BoldFont = * Bold,
120 ItalicFont = * Italic,
121 BoldItalicFont = * Bold Italic,
122 Scale = MatchLowercase,
123 ]
124 \@mdf@@inconsolatatrue
125 \fi
111 126
112 \defaultfontfeatures{} 127 \defaultfontfeatures{}
113 128
114 \if@mdf@@sscode 129 \if@mdf@@sscode
115 \RequirePackage{newunicodechar} 130 \RequirePackage{newunicodechar}
140 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% 155 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
141 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% 156 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
142 {sphinx} 157 {sphinx}
143 \fi 158 \fi
144 159
160 \if@mdf@@inconsolata
161 \RequirePackage{newunicodechar}
162 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase}
163 \setmonofont{Inconsolata LGC Nerd Font Mono}[%
164 UprightFont = *,
165 BoldFont = * Bold,
166 ItalicFont = * Italic,
167 BoldItalicFont = * Bold Italic,
168 ]
169 \defaultfontfeatures{}
170 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
171 UprightFont = *,
172 BoldFont = * Bold,
173 ItalicFont = * Oblique,
174 BoldItalicFont = * Bold Oblique,
175 ]
176 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
177 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
178 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
179 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
180 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
181 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
182 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
183 \fi
184
145 \defaultfontfeatures{} 185 \defaultfontfeatures{}
146 186
147 \endinput 187 \endinput