[tex4ht] Fontspec and tex4ht

Michal Hoftich michal.h21 at gmail.com
Tue May 14 17:34:17 CEST 2013

Hi all,

I am playing with fontspec and tex4ht. Because tex4ht binary doesn't
support opentype fonts (or fonts without tfm file), I tried to modify
fontspec package so it doesn't include opentype fonts when tex4ht is

At first, I tried to collect changes to file fontspec.4ht, but I found
that these changes take place after \begin{document}, which is
problem, as font loading commands like \setmainfont are placed in the
preamble. Because of this, I created package fontspec-4ht.sty and
modified fontspec code to include this file when tex4ht is running.
But if there is some option to use commands from fontspec.4ht file in
the preamble, I would prefer it.

If anyone want to try the package, it is placed at github:
There is also some example and more info:

At this moment, this is more proof of concept than ready to use
package, but I am curious what do you think about this approach.


More information about the tex4ht mailing list