annotate docs/_latex/my-doc-fonts.sty @ 205:c80b430fdc0f

***** my-doc-fonts.sty v0.2
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 13 May 2026 14:35:43 +0200
parents afecfdcfd288
children ad57aaf87799
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
1 % -*- coding: utf-8 -*-
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
2 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
3 % Some font hacks for my Sphinx PDF documents
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
4 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
5 \NeedsTeXFormat{LaTeX2e}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
6 \ProvidesPackage{my-doc-fonts}[%
205
c80b430fdc0f ***** my-doc-fonts.sty v0.2
Franz Glasner <fzglas.hg@dom66.de>
parents: 204
diff changeset
7 2026/05/13 v0.2 (Franz Glasner) Fonts for Sphinx generated PDFs]
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
8 \RequirePackage{xkeyval}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
9 \RequirePackage{fontspec}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
10 \IfFileExists{xcolor.sty}{%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
11 % Should Sphinx load xcolor with its dvipsnames and svgnames options?
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
12 \RequirePackage{xcolor}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
13 }{%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
14 \RequirePackage{color}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
15 }
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
16
203
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
17 \newif\if@mdf@@sscode\@mdf@@sscodefalse
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
18 \newif\if@mdf@@inconsolata\@mdf@@inconsolatafalse
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
19
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
20 \newif\if@mdf@WithDejaVuSansMono
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
21 \newif\if@mdf@WithPlexMono
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
22 \newif\if@mdf@WithAdobeSource
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
23 \newif\if@mdf@WithSpectral
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
24 \newif\if@mdf@WithCharter
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
25
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
26 \def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse\@mdf@WithAdobeSourcefalse\@mdf@WithCharterfalse}
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
27
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
28 \DeclareOptionX{dejavusansmono}[true]{\@mdf@reset@font@options\csname @mdf@WithDejaVuSansMono#1\endcsname}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
29 \DeclareOptionX{plexmono}[true]{\@mdf@reset@font@options\csname @mdf@WithPlexMono#1\endcsname}
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
30 \DeclareOptionX{adobesource}[true]{\@mdf@reset@font@options\csname @mdf@WithAdobeSource#1\endcsname}
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
31 \DeclareOptionX{spectral}[true]{\@mdf@reset@font@options\csname @mdf@WithSpectral#1\endcsname}
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
32 \DeclareOptionX{charter}[true]{\@mdf@reset@font@options\csname @mdf@WithCharter#1\endcsname}
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
33
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
34 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
35 % By default use the safe option dejavusansmono because is contains
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
36 % all characters without any hacks.
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
37 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
38 \ExecuteOptionsX{dejavusansmono}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
39 \ProcessOptionsX*\relax
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
40
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
41 \if@mdf@WithDejaVuSansMono
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
42 \RequirePackage[DefaultFeatures={Scale=0.92},mono=false]{plex-otf}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
43 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
44 \fi
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
45 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
46 %
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
47 \if@mdf@WithPlexMono
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
48 \RequirePackage{newunicodechar}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
49 \RequirePackage[DefaultFeatures={Scale=0.92}]{plex-otf}
189
91e8fb8cf67b FIX: Reset defaultfontfeatures because plex-otf.sty doesn't do it internally
Franz Glasner <fzglas.hg@dom66.de>
parents: 181
diff changeset
50 % Dont keep all default font features from plex-otf
91e8fb8cf67b FIX: Reset defaultfontfeatures because plex-otf.sty doesn't do it internally
Franz Glasner <fzglas.hg@dom66.de>
parents: 181
diff changeset
51 \defaultfontfeatures{}
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
52 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
53 UprightFont = *,
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
54 BoldFont = * Bold,
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
55 ItalicFont = * Oblique,
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
56 BoldItalicFont = * Bold Oblique,
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
57 Scale=MatchLowercase,
189
91e8fb8cf67b FIX: Reset defaultfontfeatures because plex-otf.sty doesn't do it internally
Franz Glasner <fzglas.hg@dom66.de>
parents: 181
diff changeset
58 Ligatures=TeX,
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
59 ]
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
60 \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
61 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
62 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
63 \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
64 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
65 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
66 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
67 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
68 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
69 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
70 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
71 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
72 %\newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 Missing!
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
73 %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
74 %\newunicodechar{␣}{\textvisiblespace}% U+2423
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
75 %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
76
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
77 \PassOptionsToPackage{%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
78 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
79 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
80 {sphinx}
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
81 \fi
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
82 \if@mdf@WithAdobeSource
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
83 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
84 \setmainfont{Source Serif Pro}[
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
85 UprightFont = *,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
86 BoldFont = * Bold,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
87 ItalicFont = * Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
88 BoldItalicFont = * Bold Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
89 ]
203
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
90 \setsansfont{Source Sans Pro}[
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
91 UprightFont = *,
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
92 BoldFont = * Bold,
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
93 ItalicFont = * Italic,
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
94 BoldItalicFont = * Bold Italic,
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
95 ]
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
96 \@mdf@@sscodetrue
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
97 \fi
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
98 \if@mdf@WithSpectral
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
99 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
100 \setmainfont{Spectral}[
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
101 UprightFont = * Regular,
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
102 BoldFont = * Bold,
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
103 ItalicFont = * Italic,
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
104 BoldItalicFont = * Bold Italic,
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
105 ]
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
106 \setsansfont{Source Sans Pro}[
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
107 UprightFont = *,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
108 BoldFont = * Bold,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
109 ItalicFont = * Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
110 BoldItalicFont = * Bold Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
111 ]
203
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
112 \@mdf@@sscodetrue
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
113 \fi
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
114 \if@mdf@WithCharter
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
115 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
116 \setmainfont{XCharter}
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
117 \setsansfont{Lato}[
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
118 UprightFont = * Regular,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
119 BoldFont = * Bold,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
120 ItalicFont = * Italic,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
121 BoldItalicFont = * Bold Italic,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
122 Scale = MatchLowercase,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
123 ]
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
124 \@mdf@@inconsolatatrue
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
125 \fi
203
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
126
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
127 \defaultfontfeatures{}
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
128
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
129 \if@mdf@@sscode
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
130 \RequirePackage{newunicodechar}
ede8b44f6faf Refactor the PDF font style: select only the mono font by internal flag
Franz Glasner <fzglas.hg@dom66.de>
parents: 196
diff changeset
131 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase}
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
132 \setmonofont{Source Code Pro}[
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
133 UprightFont = *,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
134 BoldFont = * Bold,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
135 ItalicFont = * Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
136 BoldItalicFont = * Bold Italic,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
137 ]
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
138 \defaultfontfeatures{}
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
139 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
140 UprightFont = *,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
141 BoldFont = * Bold,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
142 ItalicFont = * Oblique,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
143 BoldItalicFont = * Bold Oblique,
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
144 ]
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
145 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
146 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
147 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
148 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
149 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
150 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
151 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
152 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
153 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
191
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
154 \PassOptionsToPackage{%
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
155 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
156 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
157 {sphinx}
c10b2092c48f Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
158 \fi
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
159
204
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
160 \if@mdf@@inconsolata
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
161 \RequirePackage{newunicodechar}
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
162 \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase}
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
163 \setmonofont{Inconsolata LGC Nerd Font Mono}[%
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
164 UprightFont = *,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
165 BoldFont = * Bold,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
166 ItalicFont = * Italic,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
167 BoldItalicFont = * Bold Italic,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
168 ]
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
169 \defaultfontfeatures{}
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
170 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
171 UprightFont = *,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
172 BoldFont = * Bold,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
173 ItalicFont = * Oblique,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
174 BoldItalicFont = * Bold Oblique,
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
175 ]
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
176 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
177 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
178 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
179 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
180 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
181 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
182 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
183 \fi
afecfdcfd288 A new style "charter" for PDFs with "XCharter", "Lato" and "Inconsolata".
Franz Glasner <fzglas.hg@dom66.de>
parents: 203
diff changeset
184
196
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
185 \defaultfontfeatures{}
d57cf1bb96d6 A new PDF style using "Spectral" with Source Sans/Code
Franz Glasner <fzglas.hg@dom66.de>
parents: 191
diff changeset
186
181
dcbc66f851eb A style file for (Lua)LaTeX that loads the required fonts.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
187 \endinput