From 1b90bf669b52bef59f3cf152a5de3e6bfe97ae21 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 18 Jan 2025 15:14:34 +0000 Subject: [PATCH] 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 43adcf52..dffea80e 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 aa159215..f236b6e6 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