<div dir="ltr"><div>Hi Karl!</div><div><br></div><div>You write:</div><div><br></div><div style="margin-left:40px">Hi Nasser - it turns out the problem is simple: DVI format only supports<br>
65,536 pages -- the postamble item that reports the total number of<br>
pages is two bytes (t[2] as shown on for example, page 12 of<br>
dvitype.pdf).</div><div style="margin-left:40px"><br></div><div>How does dvitype know the actual number of pages?<br></div><div><br></div><div>I've never thought much about TeX, the program. I assume that some variant (luatex, was it?) of that program decided to write pgs mod 2^16 in the postamble item when pgs >= 2^16 rather write (2^16)-1 -- or perhaps 0 for "ignore me" -- and yell loudly. Is that a feature? :-)</div><div><br></div><div>What would groff, which also can write DVI, have done with a document having more than 2^16 pages?<br></div><div dir="ltr"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br></div><div> -- Bill<br></div><div><br></div><br></div><div dir="ltr">William F Hammond<br>Email: <a href="mailto:gellmu@gmail.com" target="_blank">gellmu@gmail.com</a><br><a href="https://www.facebook.com/william.f.hammond" target="_blank">https://www.facebook.com/william.f.hammond</a><br><a href="http://www.albany.edu/~hammond/" target="_blank">http://www.albany.edu/~hammond/</a><div><br></div><div>𝑻𝒉𝒆 𝒕𝒊𝒎𝒆 𝒕𝒐 𝒔𝒂𝒗𝒆 𝒂 𝒅𝒆𝒎𝒐𝒄𝒓𝒂𝒄𝒚 𝒊𝒔 𝒃𝒆𝒇𝒐𝒓𝒆 𝒊𝒕 𝒊𝒔 𝒍𝒐𝒔𝒕. -- 𝐊𝐞𝐧 𝐁𝐮𝐫𝐧𝐬<br></div><div><br><br></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 17, 2023 at 10:03 AM Karl Berry <<a href="mailto:karl@freefriends.org">karl@freefriends.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Nasser - it turns out the problem is simple: DVI format only supports<br>
65,536 pages -- the postamble item that reports the total number of<br>
pages is two bytes (t[2] as shown on for example, page 12 of<br>
dvitype.pdf).<br>
<br>
Your document is larger than that, namely 74193 pages. That's why tex4ht<br>
(the binary) quits at page 8657 (total_pages mod 65536).<br>
<br>
TeX itself does not check when it is outputting such a semi-corrupt dvi,<br>
although dvitype reports it, even at level 0 (minimal) output:<br>
<br>
$ dvitype -output-level 0 report.dvi >r0<br>
$ grep really r0<br>
there are really 74193 pages, not 8657!<br>
<br>
I cannot imagine any feasible way to change this limit. So you'll have<br>
to arrange your workflow to keep your files smaller than that, as far as<br>
I can see.<br>
<br>
I'll ask Luigi about changing luatex to emit an error if there are more<br>
than 2^16 pages in dvi mode. As far as I can see, there's no use in<br>
creating such a dvi. --best, karl.<br>
</blockquote></div></div>