From 427dcbfa372574f69b85bf3c873195d23215c206 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sun, 12 Jan 2025 15:17:12 +0000 Subject: [PATCH 1/3] Use a sans-serif math font for pgfplots pgfplots uses math fonts for graphs ticks... and it looks weird when building sans serif. Not sure Fira is necessarily a great choice with open-sans but we have very little math so that should do... --- book/sourdough.sty | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/book/sourdough.sty b/book/sourdough.sty index fe2f1ca..d38a7cd 100644 --- a/book/sourdough.sty +++ b/book/sourdough.sty @@ -52,8 +52,9 @@ \DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont} % Fonts for accessibility \ifdefined\isaccessible - \setmainfont{Open Sans}[ - Scale=MatchLowercase] + \usepackage[mathrm=sym]{unicode-math} + \setmathfont{Fira Math}[Scale=MatchLowercase] + \setmainfont{Open Sans}[Scale=MatchLowercase] \else \setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc. % TODO not available on github CI From 1b90bf669b52bef59f3cf152a5de3e6bfe97ae21 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 18 Jan 2025 15:14:34 +0000 Subject: [PATCH 2/3] Use sans-serif fonts with tex4ht This has to be done in the config file..: All fonts are suppressed in the --lua mode of TeX4ht, because we need to prevent the loading of OpenType fonts, which causes a fatal error.: https://tex.stackexchange.com/questions/705948/change-font-of-tikz-diagrams-in-html-produced-by-make4ht --- book/tex4ebook.cfg | 8 ++++++++ book/website.cfg | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/book/tex4ebook.cfg b/book/tex4ebook.cfg index 43adcf5..dffea80 100644 --- a/book/tex4ebook.cfg +++ b/book/tex4ebook.cfg @@ -11,4 +11,12 @@ \Configure{AddCss}{book-ebook.css} \Configure{CoverMimeType}{image/jpeg} \CoverMetadata{cover/cover-page.jpg} +\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont} +\Configure{@HEAD}{\HCode{ +}} \EndPreamble diff --git a/book/website.cfg b/book/website.cfg index aa15921..f236b6e 100644 --- a/book/website.cfg +++ b/book/website.cfg @@ -9,6 +9,14 @@ }} \Configure{AddCss}{style.css} +\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont} +\Configure{@HEAD}{\HCode{ +}} \ConfigureEnv{titlepage}{\ifvmode\IgnorePar\fi\EndP\HCode{
}}{\ifvmode\IgnorePar\fi\EndP\HCode{
}}{}{} % Mini TOC From 1b5d23a348ee5b6680fdf7914d189db5741312dd Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Mon, 20 Jan 2025 11:23:55 +0100 Subject: [PATCH 3/3] Fix duplicate font loading --- book/style.css | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/book/style.css b/book/style.css index b0ee324..ad0a49e 100644 --- a/book/style.css +++ b/book/style.css @@ -1,5 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;800&display=swap'); - :root{ --ff-sans: 'Open Sans', sans-serif; --fw-regular: 400; @@ -147,7 +145,6 @@ nav.TOC a, nav.TOC a:visited{ /* *** Colors *** */ /* ************** */ - body{ background-color: var(--c-beige); } @@ -254,6 +251,10 @@ figcaption.caption { display: block; } +.chapterToc a, .chapterToc, .likechapterToc a, .likechapterToc, .appendixToc a, .appendixToc, .addchapToc a { + font-weight: var(--fw-bold); +} + @media (max-width: 768px) { .toggle-menu-label { display: block; @@ -317,7 +318,7 @@ figcaption.caption { display: block; color: #000; font-size: 20px; - font-weight: bold; + font-weight: var(--fw-bold); } .chapterToc a, .sectionToc a, .subsectionToc a, .likechapterToc a { @@ -498,7 +499,7 @@ blockquote { border: 2px solid var(--c-black); color: var(--c-black); padding: 4px; - font-weight: bold; + font-weight: var(--fw-bold); text-decoration: none; } .crosslinks-bottom a.prev {