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

Karl Berry karl at freefriends.org
Fri Aug 24 00:27:28 CEST 2018


    This document was generated by a program I am writing
    which generates the latex file.

In that case, it seems like it should be easy to change the program to
generate several (many) files instead of one huge one, and only
recompile more or less what's changed.

Although it would take some time to refactor the program and the
generated LaTeX into parts, at the incredibly long computation times you
are talking about, you'd be well ahead of the game pretty soon.

Related, it also seems to me it might be better to generate the final
PDF and HTML not by doing one tremendously huge run, but by
concatenating parts. Not just faster, but more reliable, because easier
to understand the parts and easier to redo.

As in something like (in Makefile terms, but you get the idea):

final.pdf: part1.pdf part2.pdf ...
	gs -sOutputFile=final.pdf $(gs_args) part1.pdf part2.pdf ...
gs_args = -q -dNOPAUSE -dBATCH -dAutoRotatePages=/None -sDEVICE=pdfwrite

final.html: begin.html end.html part1.html part2.html ...
	cat begin.html part1.html part2.html ... end.html >final.html

The Ghostscript command is just concatenating PDFs. If it doesn't suit,
there are lots of other tools to do it.

Just some ideas FWIW ... -k


More information about the tex4ht mailing list