Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!mips!ptimtc!nntp-server.caltech.edu!marcel From: marcel@cs.caltech.edu (Marcel van der Goot) Newsgroups: comp.text.tex Subject: Re: Indexing multi-part page numbers Summary: page number in dvi file = \count0 Keywords: \count0, page numbers, dvi files Message-ID: <1991May3.225402.24923@nntp-server.caltech.edu> Date: 3 May 91 22:54:02 GMT References: <2155@seti.inria.fr> Sender: news@nntp-server.caltech.edu Organization: California Institute of Technology (CS Dept) Lines: 42 Mark James (mark@motown.altair.fr) asked about page numbers: > This suggests that other aspects of TeX/LaTeX might also depend > upon sequential, numeric page numbers. For example, how are page > numbers stored in .dvi files, so that programs such as dvips know > where to find page 137 when I give the "-p 137" option? What > horrors await me as I proceed with this effort? When TeX (and therefore LaTeX) ships out a page to the dvi file, one of the things it stores are the values of registers \count0, ..., \count9. If these are non-zero, their value is also displayed on your screen as [1], [1.2], etc. Programs that work on dvi files get the page number by assuming that \count0 contained the pagenumber. Indeed, in plain TeX, \pageno is equal to \count0. Exactly how that number is interpreted depends on the program; e.g., if you tell a program to find page 137 it will probably look for the first page with \count0=137, but a program might also just take the 137th page, regardless of the number stored as \count0. However, the characters you print on the page to be interpreted by the reader as ``page number'' do not need to correspond to the value stored in register \count0. So, for instance, one could reserve a new counter \mypage which holds the pagenumber that is printed, and is different from the value in \count0. Then the dvi file will look just as if \count0 was the pagenumber. Unfortunately, although that method might solve your problems, it probably requires changing the \output routine. That is a lot easier in plain TeX than in LaTeX. Whether you want to do that depends on how experienced you are with TeX/LaTeX. If you can just store every chapter in a separate file, the problems with selecting a page in dvi drivers would go away, since each page number occurs only once. But probably this method gives you bigger problems in return, if you want to have references in one chapter to another chapter. Sorry, no instant solutions here; hope it helped anyway. Marcel van der Goot .---------------------------------------------------------------- | Blauw de viooltjes, marcel@vlsi.cs.caltech.edu | Rood zijn de rozen; | Een rijm kan gezet | Met plaksel en dozen. |