DVISELECT(1) DVISELECT(1) NAME dviselect−extractpagesfromDVIfiles SYNOPSIS dviselect[−s][−iinfile][−ooutfile]listofpages[infile[outfile]] DESCRIPTION DviselectselectspagesfromaDVIfileproducedbyTeX,creatinganewDVIfileusablebyanyof theTeXconversionprograms,orevenbydviselectitself. Arangeisastringoftheformeven,odd,orfirst:lastwherebothfirstandlastareoptional numericstrings,withnegativenumbersindicatedbyaleadingunderscorecharacter‘‘’’.Ifboth firstandlastareomitted,thecolonmayalsobeomitted,ormaybereplacedwithanasterisk‘‘*’’. Apagerangeisalistofrangesseparatedbyperiods.Alistofpagesisdescribedbyasetofpage rangesseparatedbycommasand/orwhitespace. DviselectactuallylooksatthetencountvariablesthatTeXwrites;thefirstofthese(\count0)is thepagenumber,with\count1through\count9havingvariedusesdependingonwhichmacro packagesareinuse.(Typically\count1mightbeachapterorsectionnumber.)Apageis includedindviselect’soutputifallits\countvaluesmatchanyoneoftherangeslistedonthe commandline.Forexample,thecommand‘‘dviselect*.1,35:’’mightselecteverythinginchapter 1,aswellaspages35andup.‘‘dviselect10:30’’wouldselectpages10through30(inclusive). ‘‘:43’’meanseverythinguptoandincludingpage43(includingnegative-numberedpages).Toget alleven-numberedpages,use‘‘even’’;togetallodd-numberedpages,use‘‘odd’’.IfaTableof Contentshasnegativepagenumbers,‘‘:1’’willselectit.Notethat‘‘*’’mustbequotedfromthe shell;theemptystringismoreconvenienttouse,ifhardertoread. Insteadof\countvalues,dviselectcanalsoselectby‘‘absolutepagenumber’’,wherethefirstpage ispage1,thesecondpage2,andsoforth.Absolutepagenumbersareindicatedbyaleading equalsign‘‘=’’.Rangesofabsolutepagesarealsoallowed:‘‘dviselect=3:7’’willextractthethird throughseventhpages.Dotseparatorsarenotlegalinabsoluteranges,andtherearenonegative absolutepagenumbers.Even/oddspecifiers,however,arelegal;‘‘dviselect=even’’selectsevery otherpage,startingwiththesecond. Moreprecisely,anasteriskoranemptystringimpliesnolimit;anequalsignmeansabsolutepage numberratherthan\counts;aleadingcolonmeanseverythinguptoandincludingthegivenpage; atrailingcolonmeanseverythingfromthegivenpageon;theword‘‘even’’meansonlyevenvalues shallbeaccepted;theword‘‘odd’’meansonlyoddvaluesshallbeaccepted;andaperiodindicates thatthenext\countshouldbeexamined.Iffewerthan10rangesarespecified,theremaining \countsareleftunrestricted(thatis,‘‘1:5’’and‘‘1:5.*’’areequivalent).Asinglenumbernis treatedasifitweretherangen:n.Anarbitrarynumberofpageselectorsmaybegiven,separated bycommasorwhitespace;apageisselectedifanyoftheselectorsmatchesits\countsorabsolute pagenumber. Dviselectnormallyprintsthepagenumbersofthepagesselected;the−soptionsuppressesthis. AUTHOR ChrisTorek,UniversityofMaryland SEEALSO dviconcat(1),latex(1),tex(1) MC-TeXUser’sGuide TheTeXbook BUGS Aleading‘‘-’’oughttobeallowedfornegativenumbers,butitiscurrentlyusedasasynonymfor ‘‘:’’,forbackwardscompatibility. Sectionorsubsectionselectionwillsometimesfail,fortheDVIfilelistsonlythe\countvalues thatwereactivewhenthepageended.Clevermacropackagescanalleviatethisbymakinguseof other‘‘free’’\countregisters.Chaptersnormallybeginonnewpages,anddonotsufferfromthis 1 DVISELECT(1) DVISELECT(1) particularproblem. Theheuristicthatdecideswhichargumentsarepageselectorsandwhicharefilenamesisoften wrong.Usingshellredirectionorthe−iand−ooptionsissafest. Dviselectdoesnotadjusttheparametersinthepostamble;however,sincethesevaluesarenormallyusedonlytosizecertainstructuresintheoutputconversionprograms,andtheparameters neverneedtobeadjustedupward,thishasnotproventobeaproblem.