!  ==> Fatal error occurred: total_pages>=65536, bad output DVI file 
produced!

We introduced that fatal error in LuaTeX precisely because of your case.
Otherwise the DVI file could not be read but there was no error.

You can omit the fatal error by using the luatex option
--no-check-dvi-total-pages.  But that won't help actually get the job
done.

    https://tug.org/pipermail/tex4ht/2023q4/003515.html
    "it should be possible to remove the 2^16 page limit in tex4ht.
    Sure, most likely it is possible. And if you want to rearrange the logic
    in tex4ht-c.tex / tex4ht.c so it doesn't use the stated postamble value,
    patches are welcome :). As I said, it's just not something I think is
    crucial enough to spend time on."

Yes, and I think what I wrote then is still accurate.

1) The TeX engines can output more than 64K DVI pages. (Plain test file
below.)

2) But then the "pages" value in the postamble will be wrong, since it
is a two-byte value. That cannot be changed without breaking every
DVI-reading program in existence, so we won't do that.

3) So instead the DVI-reading program intended to process these >64K DVI
files, here tex4ht, has to be changed not to read the postamble value,
but instead process all the pages regardless.

4) This is not something I want to work on. So someone else will
have to figure out the necessary changes. I doubt anyone will
spontaneously choose to work on it. Maybe you could hire STMDocs or VTeX
or some consultant to do it.

5) As many people have said before, I think the more robust solution is
for you to break up your gargantuan document so that you do not have to
process the whole thing at once. It is no wonder that you are
continually running up against limits with documents of this size. If
you can build it in parts and then put them together, all these problems
would go away. (And what human will ever read a 64K page document
anyway? Or is it a machine that reads it? Just wondering.)

Best,
Karl

% test file to generate more than 64K pages.
\count255=0
\loop\ifnum\count255 < 65600
  \advance\count255 by 1
    x\vfil\eject
\repeat
\end

Reply via email to