Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!purdue!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.text Subject: page selection in dvi files (was Help! What do these options mean?) Message-ID: <18907@mimsy.UUCP> Date: 4 Aug 89 23:17:53 GMT References: <66475@yale-celray.yale.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 82 [This refers to TeX .dvi files, not ditroff output files] In article <66475@yale-celray.yale.UUCP> leichter@CS.YALE.EDU (Jerry Leichter) writes: >Page ranges [in dvijep] are selected with the -o option, whose syntax is: > > -o:: > >where is the PHYSICAL page number of the first page to print, >is the corresponding last page, and is the inter-page increment. >... (In case you are wondering why is there: If foo is two-sided, >then you do dvijep -o1:9999:2 to print the "odd pages", stick the paper >back into the printer, and do dvijep -o2:9999:2 to print the corresponding >even pages.) ... By a "physical page number", I mean just that: Count >pages, don't look at TeX's page numbers. I might as well post this now. . . : Last night (or rather, this morning, around 2 or 3 AM) I added `even' and `odd' selection to dviselect. The syntax for dviselect is now dviselect list-of-pages [ infile [ outfile ] ] (Unix redirection is normally used for the in and out files). A list of pages is a whitespace-separated list of selectors. An individual selector has one of the following forms: =range range range.range range.range.range (etc., up to ten ranges). Each range is one of the forms first:last (the numbers first through last, inclusive) first: (first through infinity) :last (-infinity through last) * (-infinity through +infinity, i.e., any value) even (all even values) odd (all odd values) A bare colon or an empty string (between two periods) is the same as a range of `*'. All numbers are 32 bit integers, and may be negative, but negative numbers must be given with `_' instead of `-' (this is a historic artifact). Each value is applied to the corresponding \count register, except that a range in an `=' selector applies to the physical page number. A page is selected if all of its \count registers (or its physical page number) matches at least one selector. Thus, if you add \makeatletter \countdef\c@chapter=1 \makeatother to a LaTeX file that uses the `book' or `report' styles, dviselect .1:3 selects everything in chapters 1 through 3 (since \count1 holds the chapter number). To get the *physically* even-numbered pages, use dviselect =even If you want the pages whose \count0 value is even, use dviselect even Since `even' is just another range, you can get the odd numbered chapters with dviselect .odd given the \countdef above. I have never actually come across a need for selecting every n'th page (other than even/odd, for two-sided printing), but if enough people want it, I will add it to dviselect before the next release. Note that it would fit into any slot (to be matched against any of the ten \count registers or against the physical page number). The likely syntax is an optional third `:number'. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris