[tex4ht] What would it take to fix tex4ht limitation of 65536 DVI pages?

Nasser M. Abbasi nma at 12000.org
Sun Feb 9 06:33:32 CET 2025


This is not new issue.

Whenever I have a document that grows in size, I hit the fatal error

!  ==> Fatal error occurred: total_pages>=65536, bad output DVI file produced!
  8846 words of node memory still in use:
    118 hlist, 13 vlist, 2 rule, 29 disc, 26 local_par, 1 dir, 2 math, 260 glue,
  32 kern, 72 penalty, 463 glyph, 123 attribute, 117 glue_spec, 123 attribute_li
st, 1 temp, 3 if_stack, 21 write, 168 special nodes
    avail lists: 1:4,2:31569,3:18547,4:101,5:89647,6:2307,7:44188,8:18,9:11413,1
0:97,11:1321
Output written on index.dvi (65536 pages, 395294948 bytes).

Because the web page has grown in size.

So I have to spend days and even weeks rewriting things and the builds code
so that the HTML part is split in physically separate folders and web pages.

There is no problem with PDF. I've build pdf files with 200,000 pages with
no problem. It is only HTML/tex4ht which can't handle large web pages.

At this day of 100's of GB memory and multi terabytes of disk storage,
I was wondering how hard it is to finally fix this limitation
of DVI with tex4ht so it can handle much larger DVI pages?

It seems 65536 pages limit is something in the 1980's might
be required, but still in 2025?  And why is there a limit
in the first place? Can not DVI file just grow in size as needed?

Is it just a matter of changing some hardcoded number
in tex4ht source code somewhere? I will be happy to help in anyway
myself, but I have to idea how tex4ht works from the inside.

If at least someone would be kind to explain what the real issue is
and hard is it to change  it.

I also was wondering if such limitation exist with other software
such as latexml and lwarp, or do those not use DVI?

Thank you,
--Nasser




More information about the tex4ht mailing list.