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
This commit is contained in:
Cedric
2025-01-18 15:14:34 +00:00
parent e73b0f331a
commit 2c86529981
2 changed files with 16 additions and 0 deletions

View File

@@ -11,4 +11,12 @@
\Configure{AddCss}{book-ebook.css} \Configure{AddCss}{book-ebook.css}
\Configure{CoverMimeType}{image/jpeg} \Configure{CoverMimeType}{image/jpeg}
\CoverMetadata{cover/cover-page.jpg} \CoverMetadata{cover/cover-page.jpg}
\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont}
\Configure{@HEAD}{\HCode{
<style type="text/css">
@import url('https://fonts.cdnfonts.com/css/open-sans');
body{
font-family: 'Open Sans';
}
</style>}}
\EndPreamble \EndPreamble

View File

@@ -9,6 +9,14 @@
}} }}
\Configure{AddCss}{style.css} \Configure{AddCss}{style.css}
\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont}
\Configure{@HEAD}{\HCode{
<style type="text/css">
@import url('https://fonts.cdnfonts.com/css/open-sans');
body{
font-family: 'Open Sans';
}
</style>}}
\ConfigureEnv{titlepage}{\ifvmode\IgnorePar\fi\EndP\HCode{<main class="titlepage">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</main>}}{}{} \ConfigureEnv{titlepage}{\ifvmode\IgnorePar\fi\EndP\HCode{<main class="titlepage">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</main>}}{}{}
% Mini TOC % Mini TOC