Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/_latex/my-doc-fonts.sty @ 221:38e2d8ab4965
Implement a style that uses the Libertinus fonts
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 15 May 2026 18:19:46 +0200 |
| parents | 2af9ad8230c7 |
| children | be0cca3df1eb |
comparison
equal
deleted
inserted
replaced
| 220:2af9ad8230c7 | 221:38e2d8ab4965 |
|---|---|
| 22 \newif\if@mdf@WithIBMPlex | 22 \newif\if@mdf@WithIBMPlex |
| 23 \newif\if@mdf@WithIBMPlexDejaVuSansMono | 23 \newif\if@mdf@WithIBMPlexDejaVuSansMono |
| 24 \newif\if@mdf@WithAdobeSourcePro | 24 \newif\if@mdf@WithAdobeSourcePro |
| 25 \newif\if@mdf@WithSpectral | 25 \newif\if@mdf@WithSpectral |
| 26 \newif\if@mdf@WithCharter | 26 \newif\if@mdf@WithCharter |
| 27 \newif\if@mdf@WithLibertinus | |
| 27 | 28 |
| 28 % A key compatible with options processing as option "fonts" but choices. | 29 % A key compatible with options processing as option "fonts" but choices. |
| 29 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{% | 30 \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{% |
| 30 dejavusansmono, | 31 dejavusansmono, |
| 31 ibmplex, plex, | 32 ibmplex, plex, |
| 32 plex-dejavusansmono, | 33 plex-dejavusansmono, |
| 33 adobesourcepro, adobesource, | 34 adobesourcepro, adobesource, |
| 34 spectral, | 35 spectral, |
| 35 charter}{% | 36 charter, |
| 37 libertinus}{% | |
| 36 % Not used for now : store the normalized option value (global and expanded) | 38 % Not used for now : store the normalized option value (global and expanded) |
| 37 \xdef\@mdf@fonts{\val}% | 39 \xdef\@mdf@fonts{\val}% |
| 38 % Reset all option related font selection flags | 40 % Reset all option related font selection flags |
| 39 \@mdf@WithDejaVuSansMonofalse | 41 \@mdf@WithDejaVuSansMonofalse |
| 40 \@mdf@WithIBMPlexfalse | 42 \@mdf@WithIBMPlexfalse |
| 41 \@mdf@WithIBMPlexDejaVuSansMonofalse | 43 \@mdf@WithIBMPlexDejaVuSansMonofalse |
| 42 \@mdf@WithAdobeSourceProfalse | 44 \@mdf@WithAdobeSourceProfalse |
| 43 \@mdf@WithSpectralfalse | 45 \@mdf@WithSpectralfalse |
| 44 \@mdf@WithCharterfalse | 46 \@mdf@WithCharterfalse |
| 47 \@mdf@WithLibertinusfalse | |
| 45 % Now set the needed font selection flag | 48 % Now set the needed font selection flag |
| 46 \ifcase\nr\relax | 49 \ifcase\nr\relax |
| 47 \@mdf@WithDejaVuSansMonotrue | 50 \@mdf@WithDejaVuSansMonotrue |
| 48 \or | 51 \or |
| 49 \@mdf@WithIBMPlextrue | 52 \@mdf@WithIBMPlextrue |
| 61 \gdef\@mdf@fonts{adobesourcepro} | 64 \gdef\@mdf@fonts{adobesourcepro} |
| 62 \or | 65 \or |
| 63 \@mdf@WithSpectraltrue | 66 \@mdf@WithSpectraltrue |
| 64 \or | 67 \or |
| 65 \@mdf@WithChartertrue | 68 \@mdf@WithChartertrue |
| 69 \or | |
| 70 \@mdf@WithLibertinustrue | |
| 66 \fi | 71 \fi |
| 67 } | 72 } |
| 68 | 73 |
| 69 % | 74 % |
| 70 % By default use the safe option dejavusansmono because is contains | 75 % By default use the safe option dejavusansmono because is contains |
| 162 BoldItalicFont = * Bold Italic, | 167 BoldItalicFont = * Bold Italic, |
| 163 Scale = MatchLowercase, | 168 Scale = MatchLowercase, |
| 164 ] | 169 ] |
| 165 \@mdf@mono@inconsolatatrue | 170 \@mdf@mono@inconsolatatrue |
| 166 \fi | 171 \fi |
| 167 | 172 \if@mdf@WithLibertinus |
| 168 \defaultfontfeatures{} | 173 \RequirePackage{newunicodechar} |
| 169 | 174 \RequirePackage[lining,tabular]{libertinus-otf} |
| 170 \if@mdf@mono@dejavusansmono | 175 \defaultfontfeatures{} |
| 171 % automatically applied with Scale=MatchLowercase,... | 176 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% |
| 172 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available | 177 UprightFont = *, |
| 173 \fi | 178 BoldFont = * Bold, |
| 174 | 179 ItalicFont = * Oblique, |
| 175 \if@mdf@mono@sscode | 180 BoldItalicFont = * Bold Oblique, |
| 176 \RequirePackage{newunicodechar} | 181 Scale=MatchLowercase, |
| 177 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} | 182 Ligatures=TeX, |
| 178 \setmonofont{Source Code Pro}[ | 183 ] |
| 179 UprightFont = *, | 184 \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 |
| 180 BoldFont = * Bold, | 185 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 |
| 181 ItalicFont = * Italic, | 186 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 |
| 182 BoldItalicFont = * Bold Italic, | 187 \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA |
| 183 ] | |
| 184 \defaultfontfeatures{} | |
| 185 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% | |
| 186 UprightFont = *, | |
| 187 BoldFont = * Bold, | |
| 188 ItalicFont = * Oblique, | |
| 189 BoldItalicFont = * Bold Oblique, | |
| 190 ] | |
| 191 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 | |
| 192 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 | 188 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 |
| 193 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 | 189 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 |
| 194 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 | 190 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 |
| 195 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 | 191 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 |
| 196 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 | 192 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 |
| 197 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F | 193 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F |
| 198 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 | 194 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 |
| 199 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C | 195 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C |
| 196 \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260 | |
| 197 \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264 | |
| 198 \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265 | |
| 199 %\newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 Missing! | |
| 200 %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423 | |
| 201 %\newunicodechar{␣}{\textvisiblespace}% U+2423 | |
| 202 %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace} | |
| 203 | |
| 200 \PassOptionsToPackage{% | 204 \PassOptionsToPackage{% |
| 201 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% | 205 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% |
| 202 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% | 206 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% |
| 203 {sphinx} | 207 {sphinx} |
| 204 \fi | 208 \fi |
| 205 | 209 |
| 210 \defaultfontfeatures{} | |
| 211 | |
| 212 \if@mdf@mono@dejavusansmono | |
| 213 % automatically applied with Scale=MatchLowercase,... | |
| 214 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available | |
| 215 \fi | |
| 216 | |
| 217 \if@mdf@mono@sscode | |
| 218 \RequirePackage{newunicodechar} | |
| 219 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} | |
| 220 \setmonofont{Source Code Pro}[ | |
| 221 UprightFont = *, | |
| 222 BoldFont = * Bold, | |
| 223 ItalicFont = * Italic, | |
| 224 BoldItalicFont = * Bold Italic, | |
| 225 ] | |
| 226 \defaultfontfeatures{} | |
| 227 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% | |
| 228 UprightFont = *, | |
| 229 BoldFont = * Bold, | |
| 230 ItalicFont = * Oblique, | |
| 231 BoldItalicFont = * Bold Oblique, | |
| 232 ] | |
| 233 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 | |
| 234 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 | |
| 235 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 | |
| 236 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 | |
| 237 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 | |
| 238 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 | |
| 239 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F | |
| 240 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 | |
| 241 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C | |
| 242 \PassOptionsToPackage{% | |
| 243 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% | |
| 244 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% | |
| 245 {sphinx} | |
| 246 \fi | |
| 247 | |
| 206 \if@mdf@mono@inconsolata | 248 \if@mdf@mono@inconsolata |
| 207 \RequirePackage{newunicodechar} | 249 \RequirePackage{newunicodechar} |
| 208 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} | 250 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} |
| 209 \setmonofont{Inconsolata LGC Nerd Font Mono}[% | 251 \setmonofont{Inconsolata LGC Nerd Font Mono}[% |
| 210 UprightFont = *, | 252 UprightFont = *, |
