Hi Karl! You write:
Hi Nasser - it turns out the problem is simple: DVI format only supports 65,536 pages -- the postamble item that reports the total number of pages is two bytes (t[2] as shown on for example, page 12 of dvitype.pdf). How does dvitype know the actual number of pages? 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? :-) What would groff, which also can write DVI, have done with a document having more than 2^16 pages? -- Bill William F Hammond Email: gel...@gmail.com https://www.facebook.com/william.f.hammond http://www.albany.edu/~hammond/ 𝑻𝒉𝒆 𝒕𝒊𝒎𝒆 𝒕𝒐 𝒔𝒂𝒗𝒆 𝒂 𝒅𝒆𝒎𝒐𝒄𝒓𝒂𝒄𝒚 𝒊𝒔 𝒃𝒆𝒇𝒐𝒓𝒆 𝒊𝒕 𝒊𝒔 𝒍𝒐𝒔𝒕. -- 𝐊𝐞𝐧 𝐁𝐮𝐫𝐧𝐬 On Sun, Dec 17, 2023 at 10:03 AM Karl Berry <k...@freefriends.org> wrote: > Hi Nasser - it turns out the problem is simple: DVI format only supports > 65,536 pages -- the postamble item that reports the total number of > pages is two bytes (t[2] as shown on for example, page 12 of > dvitype.pdf). > > Your document is larger than that, namely 74193 pages. That's why tex4ht > (the binary) quits at page 8657 (total_pages mod 65536). > > TeX itself does not check when it is outputting such a semi-corrupt dvi, > although dvitype reports it, even at level 0 (minimal) output: > > $ dvitype -output-level 0 report.dvi >r0 > $ grep really r0 > there are really 74193 pages, not 8657! > > I cannot imagine any feasible way to change this limit. So you'll have > to arrange your workflow to keep your files smaller than that, as far as > I can see. > > I'll ask Luigi about changing luatex to emit an error if there are more > than 2^16 pages in dvi mode. As far as I can see, there's no use in > creating such a dvi. --best, karl. >