Skip to content

Commit

Permalink
Use sans-serif fonts with tex4ht
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cedounet committed Jan 18, 2025
1 parent 427dcbf commit 1b90bf6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions book/tex4ebook.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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{
<style type="text/css">
@import url('https://fonts.cdnfonts.com/css/open-sans');
body{
font-family: 'Open Sans';
}
</style>}}
\EndPreamble
8 changes: 8 additions & 0 deletions book/website.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
}}

\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>}}{}{}

% Mini TOC
Expand Down

0 comments on commit 1b90bf6

Please sign in to comment.