DVISELECT(1)
π 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: texlive-doc 2026.0-r0 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian bookworm: texlive-binaries 2022.20220321.62855-5.1+deb12u2
- debian trixie: texlive-binaries 2024.20240313.70630+ds-6 Β· TeX-Live
- fedora 43: texlive-seetexk 11:svn57972-93.fc43 Β· MIT
- fedora 43: texlive-seetexk 11:svn57972-95.fc43.1 Β· MIT
- fedora 44: texlive-seetexk 12:svn57972-105.fc44 Β· MIT
- fedora 44: texlive-seetexk 12:svn57972-111.fc44 Β· MIT
- opensuse-leap 16.0: texlive-seetexk 2025.221.svn57972-160000.3.1 Β· LPPL-1.0
- ubuntu jammy: texlive-binaries 2021.20210626.59705-1build1
- ubuntu jammy: texlive-binaries 2021.20210626.59705-1ubuntu0.3
- ubuntu noble: texlive-binaries 2023.20230311.66589-9build3 Β· TeX-Live
- ubuntu questing: texlive-binaries 2024.20240313.70630+ds-6ubuntu2 Β· TeX-Live
- ubuntu resolute: texlive-binaries 2025.20250727.75242+ds-5build1 Β· TeX-Live
- ubuntu stonking: texlive-binaries 2026.20260303.78225+ds-5ubuntu1 Β· TeX-Live
- Copyright (c) 1987-2012 UMD-CS, released under the X11 license
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms