Mercurial > hgrepos > Python > libs > ConfigMix
changeset 794:57de2981f589 default tip
Update to the latest Sphinx customizations
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 02 Jun 2026 12:35:24 +0200 |
| parents | 46578f03a7cb |
| children | |
| files | docs/_latex/my-doc-fonts.sty docs/_latex/my-doc-style.sty |
| diffstat | 2 files changed, 1006 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/_latex/my-doc-fonts.sty Wed May 20 12:57:36 2026 +0200 +++ b/docs/_latex/my-doc-fonts.sty Tue Jun 02 12:35:24 2026 +0200 @@ -1,12 +1,19 @@ % -*- coding: utf-8 -*- % SPDX-FileCopyrightText: © 2026 Franz Glasner -% SPDX-License-Identifier: BSD-3-Clause +% SPDX-License-Identifier: BSD-3-Clause OR MIT +% +% Some font hacks for my Sphinx PDF documents. +% Needs a LaTeX environment with a working `fontspec' package. % -% Some font hacks for my Sphinx PDF documents +% Options: +% - nomath: Disable math support completely +% - noglobalunicodemath: Do not load unicode-math globally but only when +% really needed +% - fonts=<FONT>: Use font pairing named <FONT>. See the list below. % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{my-doc-fonts}[% - 2026/05/18 v0.5 (Franz Glasner) Fonts for Sphinx generated PDFs] + 2026/06/02 rv:c7ae4cfc2c5c (Franz Glasner) Fonts for Sphinx generated PDFs] \RequirePackage{xkeyval} \RequirePackage{fontspec} \IfFileExists{xcolor.sty}{% @@ -23,12 +30,28 @@ \newif\if@mdf@mono@inconsolata\@mdf@mono@inconsolatafalse \newif\if@mdf@mono@libertinusmono\@mdf@mono@libertinusmonofalse \newif\if@mdf@mono@hackmono\@mdf@mono@hackmonofalse +\newif\if@mdf@mono@firamono\@mdf@mono@firamonofalse +\newif\if@mdf@mono@firamonomedium\@mdf@mono@firamonomediumfalse +\newif\if@mdf@mono@gomono\@mdf@mono@gomonofalse +\newif\if@mdf@augment@cmutypewritertext\@mdf@augment@cmutypewritertextfalse \newif\if@mdf@augment@libertinusmono\@mdf@augment@libertinusmonofalse \newif\if@mdf@augment@ibmplexmono\@mdf@augment@ibmplexmonofalse +\newif\if@mdf@augment@redhatmono\@mdf@augment@redhatmonofalse +\newif\if@mdf@augment@cascadiacode\@mdf@augment@cascadiacodefalse +\newif\if@mdf@augment@jetbrainsmono\@mdf@augment@jetbrainsmonofalse +\newif\if@mdf@augment@firamono\@mdf@augment@firamonofalse +\newif\if@mdf@augment@gomono\@mdf@augment@gomonofalse + +\newif\if@mdf@GlobalUnicodeMath\@mdf@GlobalUnicodeMathtrue +\DeclareOptionX{noglobalunicodemath}{\@mdf@GlobalUnicodeMathfalse} + +\newif\if@mdf@UseUnicodeMath\@mdf@UseUnicodeMathtrue +\DeclareOptionX{nomath}{\@mdf@UseUnicodeMathfalse} + +\newif\if@mdf@NeedUprightUnicodeMath\@mdf@NeedUprightUnicodeMathfalse \newif\if@mdf@WithDejaVuSansMono \newif\if@mdf@WithCM -\newif\if@mdf@WithRobotoMono \newif\if@mdf@WithIBMPlex \newif\if@mdf@WithIBMPlexDejaVuSansMono \newif\if@mdf@WithAdobeSourcePro @@ -37,13 +60,26 @@ \newif\if@mdf@WithLibertinus \newif\if@mdf@WithGaramond \newif\if@mdf@WithTufte +\newif\if@mdf@WithTufteHack +\newif\if@mdf@WithTufteFiraMono \newif\if@mdf@WithPalatino \newif\if@mdf@WithPalatinoKB +\newif\if@mdf@WithPalatinoRosario \newif\if@mdf@WithCrimson \newif\if@mdf@WithCrimsonCabin \newif\if@mdf@WithDejaVu \newif\if@mdf@WithMerriweather \newif\if@mdf@WithLiterata +\newif\if@mdf@WithLiterataFiraMono +\newif\if@mdf@WithLiterataRobotoMono +\newif\if@mdf@WithVollkorn +\newif\if@mdf@WithErewhon +\newif\if@mdf@WithGentium +\newif\if@mdf@WithZillaSlab +\newif\if@mdf@WithAleo +\newif\if@mdf@WithLora +\newif\if@mdf@WithStix +\newif\if@mdf@WithBaskerville % A key compatible with options processing as option "fonts" but choices. \define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{% @@ -53,7 +89,6 @@ dejavusansmono, % use DejaVu Sans Mono as monospaced font % the fonts below are augmented for missing characters cm, % assume CM fonts and just fix missing characters - robotomono, % use Roboto Mono as mono font ibmplex, plex, % use the IBM Plex family (incl. Math) plex-dejavusansmono, % use IBM Plex Serif/Sans and DejaVu Sans Mono adobesourcepro, adobesource, % Use Adobe Source Serif/Sans/Mono @@ -62,20 +97,33 @@ libertinus, % use Libertinus family (incl. Math) garamond, % EB Garamond (with Math), Libre Franklin and Inconsolata tufte, % Tufte fonts: ETbb (with Math), GilliusADFNo2, DejaVu Sans Mono + tufte-hack, % Tufte variant: ETbb (with Math), GilliusADFNo2, Hack + tufte-firamono, % Tufte variant: ETbb (with Math), GilliusADFNo2, Fira Mono palatino, % Palatino, Inter and Source Code Pro palatino-kb, % Palatino, Lato and Inconsolata (original KB-Admin style) - crimson, % Crimson Pro, Open Sans and Roboto Mono (Erewhon Math) + palatino-rosario,% Palatino, Rosario and CMU Typewriter Text (Asana Math) + crimson, % Crimson Pro, (Intel) Clear Sans and Roboto Mono (Erewhon Math) crimson-cabin, % Crimson Pro, Cabin and Source Code Pro (Erewhon Math) dejavu, % All DejaVu fonts (Serif, Sans, Mono) - merriweather, % Merriweather, Merriweather Sans, Hack (STIX Two Math) - literata, % Literata, Inter, IBM Plex Mono (Garamond Math) + merriweather, % Merriweather, Merriweather Sans, Hack (Concrete Math) + literata, % Literata, Inter, IBM Plex Mono (Concrete Math) + literata-firamono, % Literata, Inter, Fira Mono Medium (Concrete Math) + literata-robotomono, % Literata, Cabin, Roboto Mono (Concrete Math) + vollkorn, % Vollkorn, Jost, Red Hat Mono (STIX 2 Math) + erewhon, utopia, % Erewhon, Rosario, XXX, (Erewhon Math) + gentium, % Gentium, Alegreya Sans, JetBrains Mono, (Euler Math) + zillaslab, % Zilla Slab, Metropolis, IBM Plex Mono Text, (Concrete Math) + aleo, % Aleo, Lato, IBM Plex Mono Text, (Euler Math) + lora, % Lora, Libre Franklin, Go Mono, (Asana Math) + stix, % STIX 2 Text, Inter, CMU Typewriter Text, (STIX 2 Math) + baskerville, % Libre Baskerville, Metropolis Medium, CMU Typewriter Text, (Euler Math) }{% % Not used for now : store the normalized option value (global and expanded) \xdef\@mdf@fonts{\val}% % Reset all option related font selection flags + \@mdf@NeedUprightUnicodeMathfalse \@mdf@WithDejaVuSansMonofalse \@mdf@WithCMfalse - \@mdf@WithRobotoMonofalse \@mdf@WithIBMPlexfalse \@mdf@WithIBMPlexDejaVuSansMonofalse \@mdf@WithAdobeSourceProfalse @@ -84,13 +132,26 @@ \@mdf@WithLibertinusfalse \@mdf@WithGaramondfalse \@mdf@WithTuftefalse + \@mdf@WithTufteHackfalse + \@mdf@WithTufteFiraMonofalse \@mdf@WithPalatinofalse \@mdf@WithPalatinoKBfalse + \@mdf@WithPalatinoRosariofalse \@mdf@WithCrimsonfalse \@mdf@WithCrimsonCabinfalse \@mdf@WithDejaVufalse \@mdf@WithMerriweatherfalse \@mdf@WithLiteratafalse + \@mdf@WithLiterataFiraMonofalse + \@mdf@WithLiterataRobotoMonofalse + \@mdf@WithVollkornfalse + \@mdf@WithErewhonfalse + \@mdf@WithGentiumfalse + \@mdf@WithZillaSlabfalse + \@mdf@WithAleofalse + \@mdf@WithLorafalse + \@mdf@WithStixfalse + \@mdf@WithBaskervillefalse % Now set the needed font selection flag \ifcase\nr\relax \relax @@ -99,8 +160,6 @@ \or \@mdf@WithCMtrue \or - \@mdf@WithRobotoMonotrue - \or \@mdf@WithIBMPlextrue \or \@mdf@WithIBMPlextrue @@ -125,10 +184,16 @@ \or \@mdf@WithTuftetrue \or + \@mdf@WithTufteHacktrue + \or + \@mdf@WithTufteFiraMonotrue + \or \@mdf@WithPalatinotrue \or \@mdf@WithPalatinoKBtrue \or + \@mdf@WithPalatinoRosariotrue + \or \@mdf@WithCrimsontrue \or \@mdf@WithCrimsonCabintrue @@ -138,6 +203,33 @@ \@mdf@WithMerriweathertrue \or \@mdf@WithLiteratatrue + \or + \@mdf@WithLiterataFiraMonotrue + \or + \@mdf@WithLiterataRobotoMonotrue + \or + \@mdf@WithVollkorntrue + \or + \@mdf@WithErewhontrue + \or + \@mdf@WithErewhontrue + % Normalize the stored string + \gdef\@mdf@fonts{erewhon} + \or + \@mdf@WithGentiumtrue + \@mdf@NeedUprightUnicodeMathtrue + \or + \@mdf@WithZillaSlabtrue + \or + \@mdf@WithAleotrue + \@mdf@NeedUprightUnicodeMathtrue + \or + \@mdf@WithLoratrue + \or + \@mdf@WithStixtrue + \or + \@mdf@WithBaskervilletrue + \@mdf@NeedUprightUnicodeMathtrue \fi } @@ -148,31 +240,115 @@ \ExecuteOptionsX{fonts=dejavusansmono} \ProcessOptionsX\relax +\if@mdf@UseUnicodeMath + \if@mdf@GlobalUnicodeMath + \if@mdf@NeedUprightUnicodeMath + \RequirePackage[math-style=upright]{unicode-math} + \else + \RequirePackage{unicode-math} + \fi + \fi +\fi + \if@mdf@WithDejaVuSansMono % default but with DejaVu Sans Mono as monospaced font %\RequirePackage[DefaultFeatures={Scale=0.92},mono=false]{plex-otf} %\RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available \@mdf@mono@dejavusansmonotrue -\fi + \fi + \if@mdf@WithCM \@mdf@mono@cmmonotrue \fi -\if@mdf@WithRobotoMono - \@mdf@mono@robotomonotrue -\fi -% -% + \if@mdf@WithIBMPlex - \RequirePackage[DefaultFeatures={Scale=0.92}]{plex-otf} - % Dont keep all default font features from plex-otf - \defaultfontfeatures{} + \if@mdf@UseUnicodeMath + \RequirePackage[% + DefaultFeatures={Scale=0.92}, + RMSCfont={},% disable default SC font which uses TeX Gyre Termes + RM={% + %SmallCapsFont=XCharter-Roman, + SmallCapsFont=SourceSerifPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + %BoldFeatures={SmallCapsFont=XCharter-Bold},% + BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},% + %ItalicFeatures={SmallCapsFont=XCharter-Italic},% + ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},% + }, + SSSCfont={},% disable default SC font which uses TeX Gyre Heros + SS={% + SmallCapsFont=SourceSansPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSansPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},% + },% + math=true]{plex-otf} + \else + \RequirePackage[% + DefaultFeatures={Scale=0.92}, + RMSCfont={},% disable default SC font which uses TeX Gyre Termes + RM={% + SmallCapsFont=SourceSerifPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},% + }, + SSSCfont={},% disable default SC font which uses TeX Gyre Heros + SS={% + SmallCapsFont=SourceSansPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSansPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},% + },% + math=false]{plex-otf} + \fi \@mdf@augment@ibmplexmonotrue \fi + \if@mdf@WithIBMPlexDejaVuSansMono - \RequirePackage[DefaultFeatures={Scale=0.92},mono=false]{plex-otf} + \if@mdf@UseUnicodeMath + \RequirePackage[% + DefaultFeatures={Scale=0.92}, + RMSCfont={},% disable default SC font which uses TeX Gyre Termes + RM={% + SmallCapsFont=SourceSerifPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},% + },% + SSSCfont={},% disable default SC font which uses TeX Gyre Heros + SS={% + SmallCapsFont=SourceSansPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSansPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},% + },% + mono=false]{plex-otf} + \else + \RequirePackage[% + DefaultFeatures={Scale=0.92}, + RMSCfont={},% disable default SC font which uses TeX Gyre Termes + RM={% + SmallCapsFont=SourceSerifPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},% + },% + SSSCfont={},% disable default SC font which uses TeX Gyre Heros + SS={% + SmallCapsFont=SourceSansPro-Regular,% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},% + BoldFeatures={SmallCapsFont=SourceSansPro-Bold},% + ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},% + },% + mono=false,% + math=false]{plex-otf} + \fi \@mdf@mono@dejavusansmonotrue \fi + \if@mdf@WithAdobeSourcePro + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} \setmainfont{Source Serif Pro}[ UprightFont = *, @@ -186,10 +362,17 @@ ItalicFont = * Italic, BoldItalicFont = * Bold Italic, ] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{} + \setmathfont{XCharter Math}[% + Scale = MatchLowercase, + ] + \fi \@mdf@mono@sscodetrue \fi + \if@mdf@WithSpectral - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} \setmainfont{Spectral}[ UprightFont = * Regular, @@ -203,59 +386,112 @@ ItalicFont = * Italic, BoldItalicFont = * Bold Italic, ] - \setmathfont{STIX Two Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{STIX Two Math}[Scale=MatchLowercase] + \fi \@mdf@mono@sscodetrue \fi + \if@mdf@WithCharter \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} - \RequirePackage{xcharter-otf}% loads also XCharter Math + \RequirePackage{xcharter-otf}% ALWAYS loads also XCharter Math + \defaultfontfeatures{}% Reset from package \setsansfont{Lato}[ UprightFont = * Regular, BoldFont = * Bold, ItalicFont = * Italic, BoldItalicFont = * Bold Italic, Scale = MatchLowercase, + Numbers = {Lining, Tabular}, + Ligatures = TeX, ] \@mdf@mono@inconsolatatrue \fi + \if@mdf@WithLibertinus \RequirePackage{newunicodechar} - \RequirePackage[lining,tabular]{libertinus-otf} + \if@mdf@UseUnicodeMath + \RequirePackage[lining,tabular]{libertinus-otf} + \defaultfontfeatures{}% Reset from package + \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase] + \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase] + \else + \RequirePackage[lining,tabular,nomath]{libertinus-otf} + \fi \@mdf@augment@libertinusmonotrue \fi \if@mdf@WithGaramond + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \RequirePackage[lining,tabular]{ebgaramond} - \RequirePackage{unicode-math} - \setmathfont{Garamond-Math}[Scale=MatchLowercase] - \setsansfont{Libre Franklin}[Scale=MatchLowercase,Ligatures=TeX] + \defaultfontfeatures{}% Reset from package + \if@mdf@UseUnicodeMath + \setmathfont{Garamond-Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2713},Scale=MatchLowercase] + \setmathfont{Garamond-Math}[range={},Scale=MatchLowercase] + \fi + \setsansfont{Libre Franklin}[Scale=MatchLowercase,Ligatures=TeX,Numbers={Lining,Tabular}] \@mdf@mono@inconsolatatrue \fi -\if@mdf@WithTufte - \RequirePackage{unicode-math} +\if@mdf@WithTufteHack + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} + \setmainfont{ETbb} + \setsansfont{GilliusADFNo2}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{Libertinus Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase] + \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase] + \fi + \@mdf@mono@hackmonotrue +\fi + +\if@mdf@WithTufteFiraMono + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} \setmainfont{ETbb} \setsansfont{GilliusADFNo2}[Scale=MatchLowercase] - \setmathfont{Libertinus Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{Libertinus Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase] + \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase] + \fi + \@mdf@mono@firamonotrue +\fi + +\if@mdf@WithTufte + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} + \setmainfont{ETbb} + \setsansfont{GilliusADFNo2}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{Libertinus Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase] + \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase] + \fi \@mdf@mono@dejavusansmonotrue \fi \if@mdf@WithPalatino - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \linespread{1.06} \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} \setmainfont{TeXGyrePagellaX} \setsansfont{Inter}[Scale=MatchLowercase] %\setsansfont{Rosario}[Scale=MatchLowercase,ScaleAgain=1.013] %\setmathfont{Asana Math}[Scale=MatchLowercase] - \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2AB7},Scale=MatchLowercase] + \setmathfont{TeX Gyre Pagella Math}[range={},Scale=MatchLowercase] + \fi %\@mdf@mono@sscodetrue \@mdf@mono@libertinusmonotrue \fi \if@mdf@WithPalatinoKB - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \linespread{1.06} \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} \setmainfont{TeXGyrePagellaX} @@ -267,29 +503,67 @@ Scale=MatchLowercase] %\setsansfont{Rosario}[Scale=MatchLowercase,ScaleAgain=1.013] %\setmathfont{Asana Math}[Scale=MatchLowercase] - \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase] + \setmathfont{Asana Math}[range={"2AB7},Scale=MatchLowercase] + \setmathfont{TeX Gyre Pagella Math}[range={},Scale=MatchLowercase] + \fi \@mdf@mono@inconsolatatrue \fi +\if@mdf@WithPalatinoRosario + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \linespread{1.06} + \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX} + \setmainfont{TeXGyrePagellaX} + \defaultfontfeatures{Scale=MatchLowercase} + \setsansfont{Rosario}[% + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setmonofont{CMU Typewriter Text} + \if@mdf@UseUnicodeMath + \setmathfont{Asana Math}[Scale=MatchLowercase] + \fi + \@mdf@augment@cmutypewritertexttrue +\fi + \if@mdf@WithCrimson - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{Ligatures=TeX, Numbers={Lining,Tabular}} - \setmainfont{Crimson Pro} - \setsansfont{Open Sans}[Scale=MatchLowercase] - \defaultfontfeatures{}% Erewhon Math needs this here! - \setmathfont{Erewhon Math}[Scale=MatchLowercase] + \setmainfont{Crimson Pro}[% + SmallCapsFont = Erewhon Regular, + SmallCapsFeatures = {Letters = SmallCaps, Scale = MatchLowercase}, + BoldFeatures = {SmallCapsFont = Erewhon Bold}, + ItalicFeatures = {SmallCapsFont = Erewhon Italic}, + ] + %\setsansfont{Open Sans}[Scale=MatchLowercase] + \setsansfont{Clear Sans}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{}% Erewhon Math needs this here! + \setmathfont{Erewhon Math}[Scale=MatchLowercase] + \fi %\@mdf@mono@sscodetrue %\@mdf@mono@inconsolatatrue \@mdf@mono@robotomonotrue \fi \if@mdf@WithCrimsonCabin - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{Ligatures=TeX, Numbers={Lining,Tabular}} - \setmainfont{Crimson Pro} + \setmainfont{Crimson Pro}[% + SmallCapsFont = Erewhon Regular, + SmallCapsFeatures = {Letters=SmallCaps, Scale=MatchLowercase}, + BoldFeatures = {SmallCapsFont = Erewhon Bold}, + ItalicFeatures = {SmallCapsFont = Erewhon Italic}, + ] \setsansfont{Cabin}[Scale=MatchLowercase] - \defaultfontfeatures{}% Erewhon Math needs this here! - \setmathfont{Erewhon Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{}% Erewhon Math needs this here! + \setmathfont{Erewhon Math}[Scale=MatchLowercase] + \fi %\@mdf@mono@sscodetrue \@mdf@mono@inconsolatatrue \fi @@ -297,12 +571,50 @@ \if@mdf@WithDejaVu \RequirePackage{newunicodechar} % automatically applied with Scale=MatchLowercase,... - \RequirePackage[mono=true,serif=true,sans=true,math=true]{dejavu-otf} + \if@mdf@UseUnicodeMath + \RequirePackage[% + RM={% + Scale = 0.92,% as in dejavu-otf + SmallCapsFont = {XCharter-Roman.otf},% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.12},% + ItalicFeatures = {SmallCapsFont = {XCharter-Italic.otf}},% + BoldFeatures = {SmallCapsFont = {XCharter-Bold.otf}},% + BoldItalicFeatures = {SmallCapsFont = {XCharter-BoldItalic.otf}},% + },% + SS={Scale = 0.92},% + mono=true,serif=true,sans=true,math=true]{dejavu-otf} + \setmathfont{XCharter Math}[range={"2713,"2AB7},Scale=MatchLowercase] + \setmathfont{DejaVu Math TeX Gyre}[range={},Scale=MatchLowercase] + %\setmathfont{DejaVu Math TeX Gyre}[range={},version=normal] + %\setmathfont{DejaVu Math TeX Gyre}[range={},FakeBold=3,version=bold] + \else + \RequirePackage[% + RM={% + Scale = 0.92,% as in dejavu-otf + SmallCapsFont = {XCharter-Roman.otf},% + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.12}},% + ItalicFeatures = {SmallCapsFont = {XCharter-Italic.otf}},% + BoldFeatures = {SmallCapsFont = {XCharter-Bold.otf}},% + BoldItalicFeatures = {SmallCapsFont = {XCharter-BoldItalic.otf}},% + },% + SS={Scale = 0.92},% + mono=true,serif=true,sans=true,math=false]{dejavu-otf} + \fi \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + % + % Try to fix for missing \mathrm: + % https://tex.stackexchange.com/questions/669382/latex-error-math-alphabet-identifier-mathrm-is-undefined-in-math-version + % + % DOES NOT WORK! + %\mathversion{normal}\let\mathrm\symup + % THIS WORKS (see also unicode-math.pdf Section 4.4.3 Operator font): + \if@mdf@UseUnicodeMath + \setoperatorfont\symup + \fi \fi \if@mdf@WithMerriweather - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \linespread{1.06} \defaultfontfeatures{% Scale = 0.92, @@ -322,46 +634,334 @@ BoldFont = *-Bold , BoldItalicFont = *-BoldItalic ] - \defaultfontfeatures{} - \setmathfont{STIX Two Math}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \RequirePackage[no-text]{concmath-otf}% for concmath-otf + \fi \@mdf@mono@hackmonotrue \fi \if@mdf@WithLiterata - \RequirePackage{unicode-math} + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi \defaultfontfeatures{% Ligatures = TeX, Numbers = {Lining,Tabular}, } \setmainfont{Literata} \setsansfont{Inter}[Scale=MatchLowercase] - \defaultfontfeatures{} - \setmathfont{Garamond-Math}[Scale=MatchLowercase] \setmonofont{IBMPlexMono}[% + Scale = MatchLowercase, Extension = .otf, - Scale = MatchLowercase, - Ligatures = TeX, UprightFont= *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, SlantedFont = *-Italic, ] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase}% for concmath-otf and Plex Mono + \RequirePackage[no-text]{concmath-otf} + \fi \@mdf@augment@ibmplexmonotrue \fi -\defaultfontfeatures{} +\if@mdf@WithLiterataFiraMono + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{% + Ligatures = TeX, + Numbers = {Lining,Tabular}, + } + \setmainfont{Literata} + \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} + \setsansfont{Inter} + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \RequirePackage[no-text]{concmath-otf}% for concmath-otf + \fi + \@mdf@mono@firamonomediumtrue +\fi + +\if@mdf@WithLiterataRobotoMono + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{% + Ligatures = TeX, + Numbers = {Lining,Tabular}, + } + \setmainfont{Literata} + \setsansfont{Cabin}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \RequirePackage[no-text]{concmath-otf}% for concmath-otf + \fi + \@mdf@mono@robotomonotrue +\fi + +\if@mdf@WithVollkorn + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Vollkorn}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setsansfont{Jost}[% + Scale = MatchLowercase, + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setmonofont{CascadiaMono}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{STIX Two Math} + \fi + \@mdf@augment@cascadiacodetrue +\fi + +\if@mdf@WithErewhon + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Erewhon}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setsansfont{Rosario}[% + Scale = MatchLowercase, + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{Erewhon Math} + \fi + \@mdf@mono@hackmonotrue +\fi + +\if@mdf@WithGentium + \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Gentium}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setsansfont{Alegreya Sans}[% + Scale = MatchLowercase, + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setmonofont{JetBrains Mono}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \RequirePackage[Scale=MatchLowercase]{euler-math} + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{XCharter Math}[range={"03F1,"1D71A}] + \setmathfont{Euler Math}[range={}] + %\setmathfont{Euler Math} + %\renewcommand{\varrho}{\rho} + %\renewcommand{\rho}{\mbfsansrho} + \fi + \@mdf@augment@jetbrainsmonotrue +\fi + +\if@mdf@WithZillaSlab + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Zilla Slab}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setsansfont{Metropolis}[% + Scale=MatchLowercase, + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Regular Italic, + BoldItalicFont = * Bold Italic, + ] +% \defaultfontfeatures{Scale=MatchLowercase} +% \setmonofont{JetBrains Mono}[% +% Ligatures = TeX + % ] + \setmonofont{IBMPlexMonoText}[% + Scale=MatchLowercase, + Extension = .otf, + UprightFont= IBMPlexMono-Text, + BoldFont = IBMPlexMono-Bold, + ItalicFont = IBMPlexMono-TextItalic, + BoldItalicFont = IBMPlexMono-BoldItalic, + SlantedFont = IBMPlexMono-TextItalic, + ] + \@mdf@augment@ibmplexmonotrue + + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \RequirePackage[no-text]{concmath-otf}% for concmath-otf + \fi + %\@mdf@augment@jetbrainsmonotrue +\fi + +\if@mdf@WithAleo + \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Aleo}[ + Extension = .ttf, + UprightFont = {Aleo-VariableFont_wght} , + UprightFeatures = {Instance = Regular} , + ItalicFont = {Aleo-Italic-VariableFont_wght} , + ItalicFeatures = {Instance = Italic} , + BoldFont = {Aleo-VariableFont_wght} , + BoldFeatures = {Instance = Bold} , + BoldItalicFont = {Aleo-Italic-VariableFont_wght} , + BoldItalicFeatures = {Instance = {Bold Italic}} , + SmallCapsFont = {ZillaSlab-Medium.otf} , + SmallCapsFeatures = {Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.1} , + ItalicFeatures = {SmallCapsFont = {ZillaSlab-MediumItalic.otf}} , + BoldFeatures = {SmallCapsFont = {ZillaSlab-Bold.otf}} , + ] + \setsansfont{Lato}[% + Scale = MatchLowercase, + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setmonofont{IBMPlexMonoText}[% + Scale = MatchLowercase, + Extension = .otf, + UprightFont= IBMPlexMono-Text, + BoldFont = IBMPlexMono-Bold, + ItalicFont = IBMPlexMono-TextItalic, + BoldItalicFont = IBMPlexMono-BoldItalic, + SlantedFont = IBMPlexMono-TextItalic, + ] + \@mdf@augment@ibmplexmonotrue + + \if@mdf@UseUnicodeMath + \defaultfontfeatures{} + \RequirePackage[Scale=MatchLowercase]{euler-math} + \setmathfont{XCharter Math}[range={"03F1,"1D71A},Scale=MatchLowercase] + \setmathfont{Euler Math}[range={},Scale=MatchLowercase] + \fi +\fi + +\if@mdf@WithLora + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \linespread{1.02} + \setmainfont{Lora}[% + Scale = 0.98, + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + SmallCapsFont = {STIX Two Text}, + SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05}, + BoldFeatures={SmallCapsFont={STIX Two Text Bold}}, + ItalicFeatures={SmallCapsFont={STIX Two Text Italic}}, + BoldItalicFeatures={SmallCapsFont={STIX Two Text Bold Italic}}, + ] + \setsansfont{Libre Franklin}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{Asana Math} + \fi + %\@mdf@mono@libertinusmonotrue + \@mdf@mono@gomonotrue +\fi + +\if@mdf@WithBaskerville + \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \linespread{1.02} + \setmainfont{Libre Baskerville}[% + Scale=0.92, + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + %BoldItalicFont = * Bold Italic, % no bold italic font for Baskerville + SmallCapsFont = {Erewhon Regular}, + SmallCapsFeatures={% + Letters = SmallCaps, + Scale = MatchLowercase, + ScaleAgain=1.16 + }, + BoldFeatures={SmallCapsFont={Erewhon Bold}}, + ItalicFeatures={SmallCapsFont={Erewhon Italic}}, + BoldItalicFeatures={SmallCapsFont={Erewhon Bold Italic}}, + ] + \setsansfont{Metropolis}[% + Scale = MatchLowercase, + UprightFont= * Medium, + ItalicFont = * Medium Italic, + BoldFont = * Bold, + BoldItalicFont = * Bold Italic, + ] + \setmonofont{CMU Typewriter Text}[% + Scale = MatchLowercase, + ScaleAgain = 0.98, + ] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{} + \RequirePackage[Scale=MatchLowercase]{euler-math} + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{XCharter Math}[range={"03F1,"1D71A}] + \setmathfont{Euler Math}[range={}] + \fi + \@mdf@augment@cmutypewritertexttrue +\fi + +\if@mdf@WithStix + \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{STIX Two Text}[% + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \setsansfont{Inter}[Scale=MatchLowercase] + \setmonofont{CMU Typewriter Text}[Scale=MatchLowercase] + \if@mdf@UseUnicodeMath + \defaultfontfeatures{Scale=MatchLowercase} + \setmathfont{STIX Two Math} + \fi + \@mdf@augment@cmutypewritertexttrue +\fi + +% +% MONO +% + +% Used for most +\defaultfontfeatures{% + Scale=MatchLowercase, + Ligatures=TeX, + Numbers={Lining,Tabular} +} \if@mdf@mono@dejavusansmono \RequirePackage{newunicodechar} % automatically applied with Scale=MatchLowercase,... + \defaultfontfeatures{% + Ligatures=TeX, + Numbers={Lining,Tabular} + } \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % almost all symbols are available \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 \fi \if@mdf@mono@cmmono \RequirePackage{newunicodechar} - \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% UprightFont = *, BoldFont = * Bold, @@ -375,6 +975,7 @@ BoldItalicFont = * Bold Oblique, ] \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 @@ -411,7 +1012,6 @@ \if@mdf@mono@sscode \RequirePackage{newunicodechar} - \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \setmonofont{Source Code Pro}[ UprightFont = *, BoldFont = * Bold, @@ -462,7 +1062,6 @@ \if@mdf@mono@inconsolata \RequirePackage{newunicodechar} - \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \setmonofont{Inconsolata LGC Nerd Font Mono}[% UprightFont = *, BoldFont = * Bold, @@ -481,6 +1080,7 @@ ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, ] + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 @@ -502,11 +1102,15 @@ \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + + %\RequirePackage{pifont} + %\newunicodechar{✓}{\ding{51}} + + %\newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713 \fi \if@mdf@mono@robotomono \RequirePackage{newunicodechar} - \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \setmonofont{Roboto Mono}[% UprightFont = *, BoldFont = * Bold, @@ -526,6 +1130,7 @@ BoldItalicFont = * Bold Oblique, ] \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 @@ -559,7 +1164,6 @@ \fi \if@mdf@mono@hackmono - \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \RequirePackage{newunicodechar} \setmonofont{Hack} \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% @@ -567,16 +1171,12 @@ BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% UprightFont = *, BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 @@ -587,13 +1187,35 @@ \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 + \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713 \PassOptionsToPackage{% verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% {sphinx} \fi +\if@mdf@mono@firamono + \setmonofont{Fira Mono}[% + UprightFont = * Regular, + ItalicFont = * Oblique, + BoldFont = * Bold, + BoldItalicFont = * Bold Oblique, + ] + \@mdf@augment@firamonotrue +\fi + +\if@mdf@mono@firamonomedium + \setmonofont{Fira Mono}[% + UprightFont = * Medium, + ItalicFont = * Medium Oblique, + BoldFont = * Bold, + BoldItalicFont = * Bold Oblique, + ] + \@mdf@augment@firamonotrue +\fi + \if@mdf@mono@libertinusmono + \defaultfontfeatures{} % This is stolen from libertinus-otf.sty! \setmonofont{LibertinusMono}[% Ligatures = TeX, @@ -614,6 +1236,22 @@ \@mdf@augment@libertinusmonotrue \fi +\if@mdf@mono@gomono + \setmonofont{Go Mono}[ScaleAgain = 0.95] + \@mdf@augment@gomonotrue +\fi + +% +% AUGMENT +% + +% Used for all below +\defaultfontfeatures{% + Scale=MatchLowercase, + Ligatures=TeX, + Numbers={Lining,Tabular} +} + \if@mdf@augment@ibmplexmono \RequirePackage{newunicodechar} \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% @@ -621,18 +1259,15 @@ BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% UprightFont = *, BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA @@ -674,18 +1309,15 @@ BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% UprightFont = *, BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA @@ -715,6 +1347,7 @@ \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713 %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423 %\newunicodechar{␣}{\textvisiblespace}% U+2423 %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace} @@ -725,6 +1358,269 @@ {sphinx} \fi +\if@mdf@augment@redhatmono + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 + \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 + \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 + \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 + \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 + \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 + \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 + \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 + \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA + \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F + \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C +% \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260 + \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264 + \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265 + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 + \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA + \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9 + \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7 + \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B + \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + \PassOptionsToPackage{% + verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% + verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% + {sphinx} +\fi + +\if@mdf@augment@cascadiacode + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 + \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 + \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 + \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 + \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 + \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F + \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 + \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA + \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9 + \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7 + \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B + \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + \PassOptionsToPackage{% + verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% + verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% + {sphinx} +\fi + +\if@mdf@augment@jetbrainsmono + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 +% \PassOptionsToPackage{% +% verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% +% verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% +% {sphinx} +\fi + +\if@mdf@augment@firamono + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 + \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 + \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 + \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 + \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 + \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 + \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 + \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F + \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C + \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 + \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA + \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9 + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713 + + \PassOptionsToPackage{% + verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% + verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% + {sphinx} +\fi + +\if@mdf@augment@cmutypewritertext + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 + \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 + \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 + \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA + \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 + \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 + \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 + \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 + \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 + \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C + \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260 + \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F + \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 + \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA + \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9 + \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264 + \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265 + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7 + \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B + \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 +\fi + +\if@mdf@augment@gomono + \RequirePackage{newunicodechar} + \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% + UprightFont = *, + BoldFont = * Bold, + ItalicFont = * Oblique, + BoldItalicFont = * Bold Oblique, + ] + \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 + \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9 + \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 + \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 + \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 + \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 + \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 + \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 + \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 + \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C + \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260 + \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F + \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 + \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA + \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9 + \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264 + \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265 + \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259 + \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7 + \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303 + \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388 + \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325 + \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387 + \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318 + \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF + \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B + \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326 + \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5 + \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4 + + \PassOptionsToPackage{% + verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% + verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% + {sphinx} +\fi + \defaultfontfeatures{} \def\testmdf{
--- a/docs/_latex/my-doc-style.sty Wed May 20 12:57:36 2026 +0200 +++ b/docs/_latex/my-doc-style.sty Tue Jun 02 12:35:24 2026 +0200 @@ -1,13 +1,27 @@ % -*- coding: utf-8 -*- % SPDX-FileCopyrightText: © 2026 Franz Glasner -% SPDX-License-Identifier: BSD-3-Clause +% SPDX-License-Identifier: BSD-3-Clause OR MIT +% +% Some font hacks for my Sphinx PDF documents. % -% Some font hacks for my Sphinx PDF documents +% Options: +% - stdtitle=<bool>: Use the Sphinx standard title when `true' or an +% augmented title (build date, VCS revision id). +% Default: false. +% +% Commands: +% - \vcsrevision#1 +% - \builddate#1 +% - \SuppressSectionNumbering +% - \SuppressSubsectionNumbering +% - \SuppressSubsubsectionNumbering +% - \EndSuppressNumbering % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{my-doc-style}[% - 2026/05/17 v0.3.1 (Franz Glasner) Some style customizations (title et al.)] + 2026/06/02 rv:c7ae4cfc2c5c (Franz Glasner) Some style customizations (title et al.)] \RequirePackage{xkeyval} +\RequirePackage{hologo} % A key compatible with options processing but bool (because DeclareBoolOptionX) % If given than the Sphinx standard titlepage is used without changes. @@ -30,7 +44,7 @@ \csname ifKV@my-doc-style.sty@stdtitle\endcsname \relax \else - % \sphinxmaketitle calls the macro \@thanks: abuse this + % \sphinxmaketitle calls the macro \@thanks: (ab)use this \gdef\@thanks{% \ifx\mds@builddate\@empty\relax% \ifx\mds@vcs@revision\@empty\relax% @@ -102,4 +116,25 @@ \endgroup } +% +% For SmallCaps support and/or custom reST roles: +% see also: https://docutils.sourceforge.io/docs/user/latex.html +% + +% +% SmallCaps role support (:smallcaps:). +% Here without argument declaration because \textsc +% expects one and will consume it instead. +% +\newcommand{\DUrolesmallcaps}{\textsc} + +% Testing sans serif fonts with ":textsf:" role +% Here without argument declaration because \textsf +% expects one and will consume it instead. +\newcommand{\DUroletextsf}{\textsf} + + +% TeX logos using hologo +\newcommand*{\DUrolehologo}{\hologo} + \endinput
