[tex4ht] what is the fastest way to convert large document to HTML?

Reinhard Kotucha reinhard.kotucha at web.de
Mon Aug 20 02:11:09 CEST 2018

On 2018-08-19 at 13:53:49 +0200, Michal Hoftich wrote:

 > Moreover, if GNU Make is available on the system, it makes a
 > Makefile, which calls dvisvgm only on subset of pages (64 by
 > default) and it calls it in parallel (thanks to Reinhard for this
 > idea). It should speed up the compilation in theory, although I am
 > not sure from my tests that it really works in practise.

Hi Michal,
it was my mistake to mention "GNU make" explicitly though the -j
option should work with any other version of "make" too.  So you
should only check whether a program called "make" is in PATH.

If there is no such program in PATH I think that it's best to ask
users to install GNU make.  It can be installed on Unix systems using
the package manager.  Windows users can download it from


and OS X users can get it via macports or so if it's not already
provided by the system.  I have no experience with OS X.

The advantage of make is not only that it can run processes in
parallel but that it only invokes a program when the source is newer
than the target.  If pages can be processed separately, this saves an
enourmous amount of time.

Furthermore, you can omit the -f option if the name of the file is
"Makefile", all lowercase with a capital "M".  The -f option is
neccesary if non-standard names are involved and, of course, if there
are two makefiles in the same directory.

I don't know how and why the variable "parallel_size" is used in your
script.  Unfortunately I can't run your script because there is no
file "dvireader.lua" on my system.  Where can I get it from?

If you entirely rely on make, you can define rules for all pages in a
particular document and let "make" decide (via the -j option) how many
processes to run at the same time.

Instead of handling the case that there is no "make" in PATH in your
script, it's probably much easier and cleaner to create a Unix shell
script and an MS-DOG batch file while creating the Makefile and then
invoke one of these scripts if necessary.

Since "make" supports conditional compilation (only create an output
file when the source file was changed) and the ability to run
processes in parallel, I think that everything else can only be a last


Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de

More information about the tex4ht mailing list