[tex4ht] BUG: xcolor tex4ht

Michal Hoftich michal.h21 at gmail.com
Wed Apr 10 16:36:25 CEST 2019

> I would really appreciate that!  The main difficulty I have is that TeX4ht
> hooks into all kinds of macros which results in altered expansion behaviour
> which blows up all over the place.  For the xcolor problems I have found some
> workarounds, prior to your patches, which can be found on my tex4ht branch.
> https://github.com/hmenke/pgf/tree/tex4ht

Ah, there seems to be lot of issues. The compilation fails with fatal
error, but most of the document had been generated, up to section "94
Mathematical Expressions".

You definitely want to replace htlatex with make4ht in the Makefile.
It has much more features. I would add the following line to the

make4ht -u $(doc).tex "2"

I  would also remove the \CutAt command from the config file, as it
doesn't work correctly.

With the alternative driver mentioned in my TeX.sx answer, I can get
1144 SVG images. I don't think it is all, as some code samples lack
the images. Some samples seems wrong, for example the cover image. The
SVG conversion step is quite slow because of the huge number of
images. Because we experienced such slow compilations in the past,
I've created the `dvisvgm_hashes` extension for make4ht.
Unfortunately, it hangs for some reason, so I was not able to speed up
the compilation. I will need to explore this issue more.

It will be really necessary to create new configurations for  custom
commands used in the manual. in order to insert custom HTML code. Here
is some information how it can be done:


Some custom CSS will be necessary as well, but that can be added  when
everything works.

> Hm, that might or might not be the case.  Since the problem seems to be
> driver-dependent it indicates a PGF/TikZ problem, but I agree, it will be
> difficult to isolate.

It uses the dvips driver and dvisvgm for the conversion, all the
driver does is to add the tex4ht instruction that requires DVI to
image conversion. That part of the DVI file is then extracted as a new
page to a separate DVI file with a .idv extension, which is then
processed using dvisvgm.

Best regards,

More information about the tex4ht mailing list