Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/_latex/my-doc-fonts.sty @ 181:dcbc66f851eb
A style file for (Lua)LaTeX that loads the required fonts.
Also defined character substitutions for characters that are not in the
wished font.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 12 May 2026 14:58:14 +0200 |
| parents | |
| children | 91e8fb8cf67b |
comparison
equal
deleted
inserted
replaced
| 180:63b52570795f | 181:dcbc66f851eb |
|---|---|
| 1 % -*- coding: utf-8 -*- | |
| 2 % | |
| 3 % Some font hacks for my Sphinx PDF documents | |
| 4 % | |
| 5 \NeedsTeXFormat{LaTeX2e} | |
| 6 \ProvidesPackage{my-doc-fonts}[% | |
| 7 2026/05/12 v0.1 (Franz Glasner) Fonts for Sphinx generated PDFs] | |
| 8 \RequirePackage{xkeyval} | |
| 9 \RequirePackage{fontspec} | |
| 10 \IfFileExists{xcolor.sty}{% | |
| 11 % Should Sphinx load xcolor with its dvipsnames and svgnames options? | |
| 12 \RequirePackage{xcolor} | |
| 13 }{% | |
| 14 \RequirePackage{color} | |
| 15 } | |
| 16 | |
| 17 \newif\if@mdf@WithDejaVuSansMono | |
| 18 \newif\if@mdf@WithPlexMono | |
| 19 | |
| 20 \def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse} | |
| 21 | |
| 22 \DeclareOptionX{dejavusansmono}[true]{\@mdf@reset@font@options\csname @mdf@WithDejaVuSansMono#1\endcsname} | |
| 23 \DeclareOptionX{plexmono}[true]{\@mdf@reset@font@options\csname @mdf@WithPlexMono#1\endcsname} | |
| 24 | |
| 25 % | |
| 26 % By default use the safe option dejavusansmono because is contains | |
| 27 % all characters without any hacks. | |
| 28 % | |
| 29 \ExecuteOptionsX{dejavusansmono} | |
| 30 \ProcessOptionsX*\relax | |
| 31 | |
| 32 \if@mdf@WithDejaVuSansMono | |
| 33 \RequirePackage[DefaultFeatures={Scale=0.92},mono=false]{plex-otf} | |
| 34 \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf} % all symbols are available | |
| 35 \fi | |
| 36 % | |
| 37 % | |
| 38 \if@mdf@WithPlexMono | |
| 39 \RequirePackage{newunicodechar} | |
| 40 \RequirePackage[DefaultFeatures={Scale=0.92}]{plex-otf} | |
| 41 \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% | |
| 42 UprightFont = *, | |
| 43 BoldFont = * Bold, | |
| 44 ItalicFont = * Oblique, | |
| 45 BoldItalicFont = * Bold Oblique, | |
| 46 Scale=MatchLowercase, | |
| 47 ] | |
| 48 \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7 | |
| 49 \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 | |
| 50 \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6 | |
| 51 \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA | |
| 52 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 | |
| 53 \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6 | |
| 54 \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7 | |
| 55 \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2 | |
| 56 \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 | |
| 57 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F | |
| 58 \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 | |
| 59 \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C | |
| 60 %\newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423 Missing! | |
| 61 %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423 | |
| 62 %\newunicodechar{␣}{\textvisiblespace}% U+2423 | |
| 63 %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace} | |
| 64 | |
| 65 \PassOptionsToPackage{% | |
| 66 verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% | |
| 67 verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% | |
| 68 {sphinx} | |
| 69 \fi | |
| 70 \endinput |
