DVISELECT(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ’– DVISELECT(1) Β· General Commands Manual πŸ’–

✨ NAME ✨

dviselect - extract pages from DVI files πŸŽ€

🧚 SYNOPSIS 🧚

dviselect [ -s ] [ -i infile ] [ -o outfile ] list of pages [ infile [
outfile ] ]

πŸ“– DESCRIPTION πŸ“–

okay so dviselect is the page picker you didn't know you needed πŸ’… It grabs pages out of a DVI file made by TeX and spits out a brand new DVI file. That new file works with any of the TeX conversion programs, or even with dviselect itself, which is literally so iconic 😭

A range is a string shaped like even, odd, or first:last. Both first and last are optional numeric strings, and negative numbers get a leading underscore _. If you leave out both first and last, the colon can disappear too, or you can swap it for an asterisk *. A page range is a bunch of ranges separated by periods. Then a full list of pages is a set of page ranges separated by commas and/or whitespace 🫢

Here's the tea β˜• dviselect actually peeks at the ten count variables TeX writes. \count0 is the page number, and \count1 through \count9 do different jobs depending on which macro packages you're using. Typically \count1 is a chapter or section number, so it's giving organized πŸ“š A page makes the cut if all of its \count values match any one of the ranges you typed. For example, dviselect *.1,35: might grab everything in chapter 1, plus pages 35 and up 🌸 dviselect 10:30 picks pages 10 through 30, inclusive. :43 means everything up to and including page 43, negative-numbered pages too πŸ™ˆ Want all the even pages? Use even. Want all the odd ones? Use odd. If your Table of Contents has negative page numbers, :_1 will snag it 🧚 Also, the * has to be quoted from the shell or it gets messy, so the empty string is more convenient even though it's harder to read πŸ’€

Not into \count vibes? No problem. dviselect can also select by absolute page number, where page 1 is the first page, page 2 is the second, and so on. Absolute page numbers start with an equal sign =. Ranges of absolute pages work too, so dviselect =3:7 extracts the third through seventh pages πŸ¦‹ Dot separators are not legal in absolute ranges, and there are no negative absolute page numbers, so don't even try πŸ™… Even and odd specifiers are still legal, though. dviselect =even gives you every other page, starting with the second πŸ’œ

Let's go over the rules more precisely, bestie πŸ€“ An asterisk or an empty string means no limit. An equal sign means absolute page number instead of \count. A leading colon means everything up to and including the given page. A trailing colon means everything from the given page on. The word even means only even values get accepted, and the word odd means only odd values get accepted. A period says "okay, now examine the next \count." If you specify fewer than 10 ranges, the remaining \counts are left unrestricted, so 1:5 and 1:5.* are equivalent ✨ A single number n gets treated like the range n:n. You can give as many page selectors as you want, separated by commas or whitespace, and a page is selected if any selector matches its \counts or its absolute page number 🌈

By default, dviselect prints the page numbers of the pages it selected. The -s option suppresses that printout 🀫

πŸ‘‘ AUTHOR πŸ‘‘

Chris Torek, University of Maryland πŸŽ“

πŸ¦‹ SEE ALSO πŸ¦‹

dviconcat(1), latex(1), tex(1) MC-TeX User's Guide The TeXbook πŸ“š

πŸ’€ BUGS πŸ’€

⚠️ Heads up, these are the known issues, and they're real.

A leading - ought to be allowed for negative numbers. Right now it's used as a synonym for :, but that's only for backwards compatibility πŸ™ƒ

Section or subsection selection will sometimes fail, because the DVI file only lists the \count values that were active when the page ended. Clever macro packages can help by using other "free" \count registers. Chapters normally begin on new pages, so they don't suffer from this particular problem πŸ“–βœ¨

The heuristic that decides which arguments are page selectors and which are file names is often wrong 😬 Using shell redirection or the -i and -o options is the safest move 🫢

dviselect doesn't adjust the parameters in the postamble. Honestly though, those values are normally only used to size certain structures in the output conversion programs, and the parameters never need to be adjusted upward, so this hasn't turned out to be a problem 🌸


Bye bestie, that's the whole page πŸ’… It's the DVISELECT(1) manual, and I'm obsessed with you reading it πŸ’–πŸŽ€

πŸ“¦ where this page comes from
  • alpine 3.24: texmf-dist-binextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
  • πŸ’– girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms