; TeX output 2002.05.04:0916s\ȍ88GlDtGGcmr17DqVIsI:7tAT[-E;gXdviinformationutility2User7tManqual(vqersion7t0.44)9]XQ cmr12AdamH.LewrenbSerg"Mary4,2002*s\ȍ88G9>NH cmbx12Con8tentsC>"V cmbx101MIn9troQduction3MK`y cmr101.1dDesignUUGoalsx.............................3M1.2dSomeUUexamplesofuse........................4d1.2.1BasicUUusage(..........................4d1.2.2DisplayUUasummaryofinformation? .............4d1.2.3ListUUallinformationɍ......................5M1.3dTheUU2MInstalling-6M2.1dWhereUUtogetexecutables......................6M2.2dWhereUUtogetthesourcecoGde....................6>3MAllTthecommandlineoptions7M3.1d-c:qpGerformUUsimplevqaliditycheck=..................7M3.2d-C:UUpGerformmorerigorous(andslower)UUvqaliditycheckT0......7M3.3d-d:qdumpUUopGcodes..........................8M3.4d-f:qdisplayUUfontsލ...........................8M3.5d-F:UUdisplayfontsoneachpage....................9M3.6d-g:qsuppressUUcontrolcharacterswhenshowingspGecialtextA....9M3.7d-h:qshowUUmainhelpscreen񍍑......................10M3.8d-H:UUshowoptionshelpscreenx>.....................11M3.9d-m#:qaddUUmessagedigestinformationwhendisplayingpages...11M3.10d-M#:qaddUUmessagedigestinformationbutignorecertainopGcodes\.11M3.11d-n#:qdisplayUU#bytesofspGecialtext?9.................13K1_s\ȍ8>p0J cmsl10CONTENTS128GM3.12d-p:qdisplayUUpageinformation?K....................13M3.13d-P:UUsuppressthedisplayofphysicalpagesۈ.............14M3.14d-s:qdisplayUUspGecials󍍑..........................14M3.15d-S:UUcountnumbGerofspecials?X.....................15M3.16d-T:UUgivetiminginformationፍ.....................15M3.17d-u:qdisplayUUsummary1=.........................16>4MP9ages!ϴ17M4.1dPhysicalUUpagesversusTU>'ExXpages5..................17>5MF on9ts#e18>6MSpQecials19>7MMessageTdigest/20M7.1dWhatUUisamessagedigest?T......................20M7.2dWhyUUuseamessagedigestwithTU>'ExX?................21>AMAc9knowledgementsW23>BMSourceT les24>CMP9erlTscripts26MC.1dfontdiff.pl\-.............................26dC.1.1IntroGductionxV.........................26dC.1.2HowUUarefonts\di erent"?Ԑ..................27MC.2dspecials.pl\-.............................28MC.3ddetails.pl..............................29Vs\ȍ88G4>Nq cmbx12Chapter 17>In8tro duction9>dvii`isautilitywritteninC`AthatextractsinformationfromaTU>'ExXdvi le. >InformationUUdisplayedcanincludeasummary:M !", cmsy10WFileUUcomment(usuallythedatethe lewascompiled)2ʍMWFileUUsizeMWNumbGerUUof(physical)pagesMWNumbGerUUoffonts>asUUwellasmoredetailedinformation:eMWF*ontUUnamesforallfontsusedMWListUUofphysicalpagenumbGer/T*eXpagenumbGerpairsMWListUUofall\specialsandthepageonwhichtheyappGearMWListUUofallfontsusedonagivenpagee>F*orpexample,krunningthecommanddvii?-utest.dvipgeneratesthesummary>File?size:1500bytes(1K) >Comment?string: TeXoutput1999.12.05:1951>Page?count:6>Number?offonts:3%j> Nff cmbx121.1bcDesignffGoals>IUUhavedesignedthisutilitywiththefollowinggoalsinmind:K3&s\ȍ8>CHAPTERUU1.INTRODUCTION 48GJ81.WItUUshouldbGe!': cmti10fast,fasterthandvitype.tJ82.WItVEshouldbGeeasytousetheoutputasabackendtoPERL,enablingthe WeasyUUmanipulationofthedataformorespGeci cpurposes.J83.WItUUshouldbGeusefultotheT*eXcommunity.J84.WItUUshouldbGeportable.d荑>In8lightofthesegoals,=I8 encourageallthosewhouseittosendmebugrepGorts,>comments,jandfsuggestionsonhowitcanbGeimproved. [I@canbGereachedat>adam@macrotex.net. Inparticular,4Iaminterestedinmakingthisprogram>compileX9onasmanydi erentplatformsaspGossible,soifyouhavecompiling>problems,UUpleaseletmeknow.%a>1.2bcSomeffexamplesofuse>Thefollowingexamplesusethe letest.dviwhosesourcecanbGefoundin>AppGendixUUB. Ӎ>"N cmbx121.2.1g@BasicusageuT>TheUUsyntaxforuseis>dvii?[options]dvifile>whereXdvifileisthenameofthedvi lethatyouwantinformationabGout.>Y*ou!canleave!o theextensiondvi;݈thus,dvii?testanddviitest.dviare>equivqalent.(Unlessbyoualsohavea lenamedsimplytestinwhichcasedvii>willcomplainthattestisnotavqaliddvi le.9Insuchcases, bGesuretoexplicitly>supplyUUtheextension.dvi.) Ӎ>1.2.2g@DisplayasummaryofinformationuT>dvii?-utest.dvi>File?size:1500bytes(1K)>Comment?string: TeXoutput1999.12.05:1951>Page?count:6>Number?offonts:3>">The3summarytellsus:`thedvi letest.dviis1500byteslong(roughly1kilo->byte),^wascompiledonDecembGer5,1999at7:51PM,has6pages,andcontains>3UUfonts.+s\ȍ8>CHAPTERUU1.INTRODUCTION 58G>1.2.3g@ListallinformationuT>dvii?test.dvi >File?size:1500bytes(1K)>Comment?string: TeXoutput1999.12.05:1951>Page?count:6>Number?offonts:3>f:[50/cmr10/1200]::4bf16079>f:[23/cmbx10/1000]::1af22256>f:[0/cmr10/1000]::4bf16079>p:[1/1]>p:[2/2]>p:[3/3]>p:[4/4]>p:[5/-1]>p:[6/-3]>s:[2/2]::?Ashortspecial>s:[3/3]::?abcdefghijklmnopqrstuvwxyzABCDE...>s:[4/4]::?PSfile1.eps>s:[4/4]::?PSfile2.eps>s:[4/4]::?PSfile3.EPS>s:[4/4]::?PSfiledog1.gif>s:[4/4]::?PSfilecat.eps>s:[6/-3]::?Somecontrolcharacters:[]N>Withnooptions,8dvii rstdisplaysasummaryofthedvi le(seesection1.2.2).>TheUUnext3lineslistthethreefontsusedbythedvi le.>Thesucceding6lineslistpageinformation.KTheformatp:[ b> cmmi10m/n]meansthat>this[zisphysicalpagemcorrespGondingtoTU>'ExXpagen.6Thephysicalpageisthe>pageintheorderthatitwouldbGedisplayedorprintedoutonaprinter.The>TU>'ExXpageisthepagenumbGerthatwouldappear(innormalcircumstances)at>thebGottomofthepage.F*ormoreonthedi erencebetweenphysicalandTU>'ExX>pages,UUseesection4.1.>Thelast6lineslistallthe\special'sincludedinthedvi le.>Notethatnot>everydvi lewillcontain\special's.KTheformatisthesameasthatforpages;>the6Ytextfollowingthedoublecolon::isthe rst128bytesofthe\special>text.%>1.3bcTheff#߆Tff cmtt12dviihomepage>TheUUdviihomepagecanbGefoundatd>9http://www.macrotex.net/dvii/dvii.html4s\ȍ88G4>Chapter 27>Installing:Vw>T*o yinstall,6copythe ledvii(or,intheDOS/Windowsenvironment,6the le >dvii.exe)UUtoadirectoryinyourP*ATH.>T*oUUuninstall,removeUUthe ledviifromwhereeveryouputit.&č>2.1bcWherefftogetexecutables>Y*ouwill ndseveralexecutablesatthedviihomepage.Currently*,thereare>executables^fortheMS-DOS,Windows95/98/ME/NT/2000,\Linux,and^Solaris>(SparcUUandIntel)platforms.qPleaseletmeknowofanythatdonotwork.>Afteryoudownloadtheexecutable,Ayouneedtorenamethe letodvii.exe>(underODOSOgorWindows),yourUUP*ATH.&č>2.2bcWherefftogetthesourcecos3de>dviirJiswritteninpGortableCrBcodewhosesourceisasingle lenameddvii.c.>ItshouldcompileonanysystemwithanANSICcompiler.TrT*ogetthesource> le,UUgotothedviihomepageatwww.macrotex.net/dvii/dvii.html.K6<s\ȍ88G4>Chapter 37>All T{thecommandline>options?>3.1bc-c:32ps3erformffsimplevaliditycheck>The-coptiondoGesasimplevqaliditycheckofthedvi le:;h(a)the rsttwobytes >shouldbGe247?2,f(b)thereshouldbeatleastfour233'sattheendofthe le>immediatelyUUprecededbya2.>Thisoisnotmuchoofacheck:Gitowillcertainlynotcatchdvi leswhosemiddle>bytes.)havebGecomecorrupted,5butitwillatleastcatch lesthatareclearlynot>dviUU les(suchastext les).>Notethatthe-coptionisimplicitinalmosteveryotheroption, Ksoitsmainuse>isUUtodetect lesthatareprobablynotdvi les.>SesUUsection15ofdvitype.webformoreinformation.>ExampleUUofuse:>dvii?-ctest.dvi>dvi?file'test.dvi'passedvalidationcheck(level0).&č>3.2bc-C:ps3erformmorerigorous(andslower)va-bclidityffcheck>(Note:thisisac}'apitalq'C'.)Thiscommandcausesdviitotraversetheentire>dviv leparsingeachopGcode.xIfvthedvi leiscorrupted,Ithiscommandwill>detectUUit.K7As\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSYq88G>However,UUyoupayforthis:q-Cismuchslowerthan-c.>dvii?-Ctest >dvi?file'test.dvi'passedvalidationcheck(level1).&č>3.3bc-d:32dumpffops3codes>(Thisroptionisavqailableinversion0.42andlater.)Thisoption(whichimplies>the-C̲option)displaysalltheopGcodestoprintedstartingwithpr}'e.rHereisa>sample:>dvii?-dtest>o:247>o:139>o:141>o:159>o:142>...>o:248>dvi?file'test.dvi'passedvalidationcheck(level1).>whereK...aremanyopGcodes..TheKscriptdetails.plusesthismoGdetocreatean>opGcodeUTsummaryofthe le;seesectionC.3formoreinformationondetails.pl.&č>3.4bc-f:32displayfffonts>IfvVyouwanttolistallthefontsusedinadvi le,~usethe-foption.Notethat>di erentUUsizesofthesamefontwilllistseparately*.>dvii?-ftest>f:[50/cmr10/1200]::4bf16079>f:[23/cmbx10/1000]::1af22256>f:[0/cmr10/1000]::4bf16079>The letest.dvicalls3fonts:WfontnumbGer50iscmr10atsize1200,font>numbGerʶ23iscmr10atsize1000,pandfontnumbGer0iscmbx10atsize1000.C(F*or>moreUUinformationonfonts,seechapter5.) Fs\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSYq98G>3.5bc-F:ffdisplayfontsoneachpage>This3option(whichimpliesthe-pand-foptions)liststhefontsusedoneach >page._>dvii?-Ftest>f:[50/cmr10/1200]::4bf16079>f:[23/cmbx10/1000]::1af22256>f:[0/cmr10/1000]::4bf16079>p:[1/1]Hstart?offontlistHFont?[0/cmr10/1000]Hend?offontlist>p:[2/2]Hstart?offontlistHFont?[0/cmr10/1000]Hend?offontlist>p:[3/3]Hstart?offontlistHFont?[0/cmr10/1000]HFont?[23/cmbx10/1000]Hend?offontlist>p:[4/4]Hstart?offontlistHFont?[0/cmr10/1000]Hend?offontlist>p:[5/-1]Hstart?offontlistHFont?[0/cmr10/1000]HFont?[50/cmr10/1200]Hend?offontlist>p:[6/-3]Hstart?offontlistHFont?[0/cmr10/1000]Hend?offontlist%Zk>3.6bc-g:suppresscontrolcharacterswhenshow-bcingffsps3ecialtext>The<-goptioncanbGeusedwhendisplaying\specialinformation.KIfa\special>contains8textwithunprintablecharacters,qitmaycorruptsomecomputerscreens.>So,0instead~'oftryingtoprinttheseunpleasantcharacters,0dviiwillinsteadprint>aUU`.'. Ls\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq108G>HereUUiswhatthe\specialtextloGokslikewithoutH-the-goption::>dvii?-stest.dvi >s:[2/2]::?Ashortspecial>s:[3/3]::?abcdefghijklmnopqrstuvwxyzABCDE...>s:[4/4]::?PSfile1.eps>s:[4/4]::?PSfile2.eps>s:[4/4]::?PSfile3.EPS>s:[4/4]::?PSfiledog1.gif>s:[4/4]::?PSfilecat.eps>s:[6/-2]::?Somecontrolcharacters:[]>(Note:n therexarefourcontrolcharactersbGetweenthesquarebrackets;bGecause>TU>'ExXUUdoGesnotliketheseparticularcharacters,youcannotseethemhere.)>NowUUwiththe-goption:>dvii?-s-gtest.dvi>s:[2/2]::?Ashortspecial>s:[3/3]::?abcdefghijklmnopqrstuvwxyzABCDE...>s:[4/4]::?PSfile1.eps>s:[4/4]::?PSfile2.eps>s:[4/4]::?PSfile3.EPS>s:[4/4]::?PSfiledog1.gif>s:[4/4]::?PSfilecat.eps>s:[6/-2]::?Somecontrolcharacters:[....]%>3.7bc-h:32showffmainhelpscreen>ThisUUoptionshowsthemainhelpscreenwhichbGegins>dvii?-h>This?isdvii0.??(DVIfileinformation)byAdamLewenberg>Send?bugreportstoadam@macrotex.net>dvii?-hD?(Printhelpscreen)>dvii?dvifile)(Printdviinformation)>dvii?[manypossibleoptions]dvifile>-------------------------------------------C?-H?:showcompletelistofoptionsC?-h?:showthishelpscreenC?-u?:displaydvisummary Rݠs\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq118G>...o]>etc.%i>3.8bc-H:ffshowoptionshelpscreen>ThisUUoptiondisplaysallthecommandlineoptions:>dvii?-H >All?thecommandlineoptions:H-c?:performsimplevaliditycheckH-C?:performmorerigorous(andslower)validitycheckH-f?:displayfonts>...o]>etc.>3.9bc-m#: addΘmessagedigestinformationwhenbcdisplayingffpages>(Seem2Chapter7onmessagedigests.)^Displaya16-bytemessagedigestforeach>page.o]>dvii?-mtest>[message?digest:simplesum]>p:[1/1]::D8C977816A091771A3A631E7592DAE6D>p:[2/2]::16E5A31EF87F926DB1F86CAD165C5453>p:[3/3]::1139D12267E3D60267CC788905909170>p:[4/4]::68E5A2E9D7320743CB85769CAAE9B023>p:[5/-1]::DE72BC3345FFDF7E779C8C667DCE3F97>p:[6/-3]::12808C9489FD3430C3C8EDAD8A4EC760>3.10j-M#: addmessagedigestinformationbutjignoreffcertainops3codes>(Seem2Chapter7onmessagedigests.)^Displaya16-bytemessagedigestforeach>page,UUbutignorecertaindviiopGcodes.>DepGendingǢuponthevqalueof#,5certainofthedviinformationwillbeignored>whenUUcomputingthemessagedigest. Ys\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq128GB@ -M0WDoUUnotignoreanyoftheopGcodes;UUequivqalentto-m.JB@ -M1WIgnoreUUallfontassignmentsandfontde nitions.B@ -M2WIgnoreUUallNOPS(noops).B@ -M4WIgnoreUUall\special's.B@ -M8WIgnoreUUallpushesandpGops.m>ThesedoptionscanbGecombinedbyadding;lforexample,toignorefontsand >\special's,use--M5.OA rationaleastowhyyoumightwanttoignorecertain>dviiUUpageinformationwhencomputingamessagedigestfollows.>If youusepagemessagedigeststodetectwhenapagehaschanged,youmay>get8falsealarmswhentheonlythingthatchangesinthedvi leistheorder>offontde nitions:Sthepagelo}'oks׼thesamebutwillhaveadi erentmessage>digestUUbGecausethemessagedigesthaschanged.>F*orUUexample,considerthetwoUU les$>%?FileAs%FileB>\font\a=cmr10?at11pt/?\font\b=cmr10at12pt>\font\b=cmr10?at12pt/?\font\a=cmr10at11pt>\a?A\aA>\b?A\bA>\end\end>Thesentwo lesgenerateidenticalloGokingoutputbutdi erentdvicoGdebecause>theifontnumbGeringisdi erent.Z#Ifyouusedvii?-myouwillseedi erent nger->prints:>[message?digest:simplesum]>A:?p:[1/1]::6676847979940C046D093C93789A1812>B:?p:[1/1]::6676837979940B056D093C94789A1812?^>But,UUifyouusedvii?-M1youget>[message?digest:simplesum(ignorefont)]>A:?p:[1/1]::B42E10A601774236B86D11CE2F8C25E4>B:?p:[1/1]::B42E10A601774236B86D11CE2F8C25E4>Byexaminingthefontswiththe-foptionyoucanseewherethetwodvi les>di er:m>dvii?-ffileaxdvii-ffileb>f:[51/cmr10/1200]::4bf16079/?f:[51/cmr10/1100]::4bf16079>f:[50/cmr10/1100]::4bf16079/?f:[50/cmr10/1200]::4bf16079>f:[0/cmr10/1000]::4bf160794f:[0/cmr10/1000]::4bf16079 _Is\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq138G>TheUUfontcmr10at1200isfont51infilea,whereasitisfont50infileb.&č>3.11j-n#:32displayff#bytesofsps3ecialtext>Normally*,8^dvii?-stest1!willdisplayamaximumof128bytesofthe\special >text.qF*orUUexample,letfilec.texbGethe le>\special{0123456789abcdefghijklmnopqrstuvwxyzABCDE...}>\bye>(NoteCthatthe'...'indicatesmorespGecialtextwhichweomitduetospace>limitationsUUinthismanual.)>dvii?-sfilec>s:[1/1]::?0123456789abcdefghijklmnopqrstuvwxyzABCDE...>However,UUyoucantelldviihowmanybytestodisplaybyusingthe-noption:>dvii?-s-n20filec>s:[1/1]::?0123456789abcdefghij>Finally*,UUifyouwanttodisplayall]޲the\specialtext,use-n-1:>dvii?-s-n-1test>s:[1/1]::?0123456789abcdefghijklmnopqrstuvwxyzABCDE...>Here,7the00outputofdvii?-s-n-1test00loGokslikedvii?-stest00onlybecause>weMdonothaveenoughpagetoshowtheentire\specialtext,O&butbGelieveme,>dvii?-s-n-1testUUwilldisplayallthe\specialtext.&č>3.12j-p:32displayffpageinformation>T*oUUdisplayalistofphysicalpage/TU>'ExXpagepairs,usethe-poption:>dvii?-ptest>p:[1/1]>p:[2/2]>p:[3/3]>p:[4/4]>p:[5/-1]>p:[6/-3]hHs\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq148G>The~ rstnumbGer~indicatesthephysicalpageandthesecondnumbGerindicates >theUUTU>'ExXpage.qF*orexample,thesixthphysicalpagehasTU>'EXpage3.>F*orKmoreinformationonthedi erencebGetweenKphysicalpagesandTU>'ExXpages,>seeUUsection4.1.%d>3.13j-P:ffsuppressthedisplayofphysicalpages>(Thiszoptionisavqailableinversion0.43andlater.)Thisoptiononlymakes>sensetwhenyouarelistingpageinformation(e.g.,|whenusingthe-porthe-M>option.qHereUUiswhatyougetwithdvii?-ptest:n>dvii?-ptest>p:[1/1]>p:[2/2]>p:[3/3]>p:[4/4]>p:[5/-1]>p:[6/-3]>andUUhereiswhatyougetwhenyouaddthe-Poption:>dvii?-p-Ptest>p:[XX/1]>p:[XX/2]>p:[XX/3]>p:[XX/4]>p:[XX/-1]>p:[XX/-3]>So,whyomightyouwanttodosomethingsosilly?%LThisismostusefulwhenusnig>themessagedigestfeaturetodetectpagechanges(seeChapter7).:Imaginethat>youhavemessagedigestinformationforyourentire1000-pagebGook.FDLater,you>compile0onlyonechapter.Ifyoucreateamessagedigestofthechapter,gthe>physical2PpageswillnolongeragreewiththemessagedigestfortheentirebGook.>So,dsuppressingathephysicalpagesistheonlywayyoucanreliablytellifthere>hasUUbGeenachange.%d>3.14j-s:32displayffsps3ecials>The-slistseach\specialinthe leandthepageonwhichitappGears. "F*or>example:ns\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq158G>dvii?-stest >s:[2/2]::?Ashortspecial>s:[3/3]::?abcdefghijklmnopqrstuvwxyzABCDE...>s:[4/4]::?PSfile1.eps>s:[4/4]::?PSfile2.eps>s:[4/4]::?PSfile3.EPS>s:[4/4]::?PSfiledog1.gif>s:[4/4]::?PSfilecat.eps>s:[6/-3]::?Somecontrolcharacters:[]n>Thus,qthere8isa\specialon(physical)page2consistingofthetext`A?shortspecial'.>Theګ\specialtextonpage6/-3containssomecontrolcharacterswhichdonot>show_upontheprintedpagebGecausetheydonotcorrespondtoanyprintable>characters.q(Actually*,UUthetextis[^A^B^C^D].)%d>3.15j-S:ffcountnumbs3erofspecials>Normally*,{>the@vsummarythatthe-uoptiongeneratesincludesthenumbGer@vof>pagesandthenumbGeroffonts,NbutnotthenumbGerofspecials.hIfyouwanta>countUUofthenumbGerofspecials,use-S;notethat-Simplies-u>dvii?-Stest>File?size:1500bytes(1K)>Comment?string: TeXoutput2001.01.25:0933>Page?count:6>Number?offonts:3>Number?ofspecials:8%d>3.16j-T:ffgivetiminginformation>T*oUUseehowlongxdviitoGoktorun,usethe-Toption:>dvii?-T-Ctest>dvi?file'test.dvi'passedvalidationcheck(level1).>User?time:0.0seconds>Real?time:0.0seconds>ThevH`Usertime'isthetimeexternaltothecomputertorun;thatis,ifyou>startedpastopwatchpbGeforeexecutingthecommandandthenstoppeditafter>theUUcommand nished,theelapsedtimecorrespGondstothe`Usertime'.vs\ȍ8>CHAPTERUU3.ALLTHECOMMANDLINEOPTIONSTq168G>Onh{theotherhand,mostmoGdernoperatingsystemsarecapableofrunningmany >programsfatonce,khswitchingfromonetotheother.So,whileitmayappGearto>you]thatacommandtakes5minutestorun, thecomputeritselfmayhaveonly>spGent;1minuteofthe5minutesonyourprogram, spGendingtheother4minutes>onUUothertasks.qHence,1minutewouldbGe`Realtime'.>IfWthe leissmallenough(asitisinthecastoftest.dviabGove),XlyouWmaysee>bGothUUtimeslistedas0.0?seconds.&č>3.17j-u:32displayffsummary>T*oUUdisplayasummaryofadvi le,usethe-uoption:>dvii?-utest.dvi>File?size:1500bytes(1K)>Comment?string: TeXoutput1999.12.05:1951>Page?count:6>Number?offonts:3>The3summarytellsus:`thedvitest.dvi leis1500byteslong(roughly1kilo->byte),wascompiledonDecembGer5,1999at7:51AM,has6pages,andcontains>3UUfonts.>SeeUUalsothe-Soption.~Hs\ȍ88G4>Chapter 47>P8ages?>4.1bcPhysicalffpagesversusTL32EdXpages>Every#timeTU>'ExXwritesapagetoadvi leitinsertscoGdesindicatingthebegin- >ning (BOP) andend(EOP)ofthepage.YThenumbGer ofphysic}'alOpages*is thusthe>numbGerUUofBOP'sinthedvi le.>Atathestartofeachphysicalpage,nTU>'ExXrecordsadditionalinformationindicating>whatpagenumbGerwillappearwhenthedvi leisprinted.6(Moreprecisely*,it>stores#Xthecontents#Xofthe rstten\countregisters,-Xthe rstofwhichisusually>thed registerusedtostorethepagenumbGerd printedatthebGottomofthepage.)>ThisUUpagenumbGerUUistheTKß'E-Xp}'age.>Thus,itispGossibletohaveadvi lethatwhenprintedconsistsof10physical>piecesofpapGerswhereeachpagehasthenumbGer'1'printedatthebGottomof>theUUpage.>F*orexample,mthe letest.dviconsistsof6physicalpages,withTU>'ExXpage>numbGersUU1,2,3,4,1,3.r>dvii?-ptest>p:[1/1]>p:[2/2]>p:[3/3]>p:[4/4]>p:[5/-1]>p:[6/-3]>Theئ rstnumbGerئinthebracketئisthephysicalpagewhilethesecondistheTU>'ExX>page.>If,@youwanttosuppr}'essathedisplayofphysicalpages,ausethe-P, option(see>sectionUU3.13).K17ts\ȍ88G4>Chapter 57>Fon8ts9>Internally*,TU>'ExX%referstoeachfontviaafontnumbGer.-8EachfontnumbGercor- >respGondstoanexternalfontnameandascalingfactor.jF*orexample,the le>test.dvi1ڲcallsupGon3fonts:` fonts10,823,and50.eInthiscase,font0referstoa>fontUUnamedcmr10scaledatmagni cation1000.>dviiUUouputsfontinformationinthefollowingformat:|f:[nc/ lename[/sc}'ale]::checksum>The>$nreferstothefontnumbGer(e.g.,0),xX lenamereferstotheexternal le >nameJe(e.g.,cmr10),Lsc}'ale referstothescalingfactor(e.g.,1000),andche}'cksum>toUUthechecksumUUofthefont'sTFM le(e.g.,4bf16079).>HereUUarethefontsintest.dviasdisplayedbyxdvii:>dvii?-ftest>f:[50/cmr10/1200]::4bf16079>f:[23/cmbx10/1000]::1af22256>f:[0/cmr10/1000]::4bf16079>NotethatTU>'ExXviewstwofontswiththesameexternalfontnamebutwithdif->ferentUUscalingfactorsasdi erentfonts.K18[s\ȍ88G4>Chapter 67>Sp ecials9>Asnoteverypublishingfeatureisbuilt-intoTU>'ExX,thecreatorofTU>'EX,DonaldE. >Knuth,URmadesurethatafacilitytoinsert\hoGoks"intoadvi lewasavqailable.>These,hoGoksarecalledsp}'ecialsand,areinvoked,viatha\specialcommand.>F*orOexample,?Mifyouputthecommand\special{Hello}inaTU>'ExX le,the>resultingdvi lewillcontaina\specialopGcodewithargumentHello.TU>'ExX>pGostprocessors-=(suchasdviviewersorprinterdrivers)cantheninterpretthe>\special'sUUandtaketheappropriateaction.>OneŖofthemorecommonusesofthe\specialistoinsert gure lesinto>a.TU>'ExXdoGcument. MF*orexample,theL5ffٓRcmr7A͉TU>'EXgraphicspackqageprovidesthe>\includegraphicscommandwhichwilltakeasanargumentthenameof gure> leandplacea\specialcommandinthedvi lelistingthenameofthe le,>itsUdimensions, Uandotherinformation.RAltoughTU>'ExXitselfknowsnothingabGout> gureY les,Zmostdviprinterdrivers(suchasdvips)knowhowtointerpretthe>\specialUUinformationandwillinsertthe gure.>Y*oukcantelldviitogothroughadvi leandlisttheloGcationandcontentskof>each \special.AThiscanbGeuseful,forinstance,ifyouwanttoseeonwhich>pageUUaparticular gureappGearswithoutactuallyviewingorprintingthe le.>dvii?-stest>s:[2/2]::?Ashortspecial>s:[3/3]::?abcdefghijklmnopqrstuvwxyzABCDE...>s:[4/4]::?PSfile1.eps>s:[4/4]::?PSfile2.eps>s:[4/4]::?PSfile3.EPS>s:[4/4]::?PSfiledog1.gif>s:[4/4]::?PSfilecat.eps>s:[6/-3]::?Somecontrolcharacters:[]K19s\ȍ88G4>Chapter 77>Message T{digest?>7.1bcWhatffisamessagedigest?>AIshortIanswer:lamessageedigestgivenUUsetofdata(suchasadata leore-mailmessage).>Aplongerpanswer.ËAcomputer leisreallyjustasequenceofnumbGers.ËF*orex->ample,the lecontainingthesingleword\Hello"isreallyjustthethesequence>72101108108111.The lecontainingthe le\Goodbye"isthesequence71>111Y11110098121101.Ofcourse,ؚmostcomputer lesaremuchYbiggerwith>correspGondinglyUUlongersequences.>ImaginetNthata lewithonemillioncharactersneedstobGesentfromonecom->puter2toanothercomputerthousandsofmilesaway*.^How2cantherecipientbGe>assuredMthatthedatareceivedisinfactthedatathatwassent?HOnewaywould>bGeӗtosendthedatatwiceandcomparethetwotransmissions.FThismightwork,>butPwouldbGeratherslow:%Ditwouldtaketwiceaslongtosendthemessagetwice.>So,~insteadI^ofsendingthemessageagainasecondtimewesendashortermessage>thatgivesasummaryoftheoriginalmessage.DThissummaryiscalculatedat>bGothends,Rtransmitter.qIfUUtheymatch,thisisevidencethatthe lewasreceivedintact.>Of\course,^theformofthissummarywilla ecthowreliablethesummaryisat>detectingUUifthedatawassentcorrectly*.>Onesortofsummaryiscalledap}'arity7&check:ԩaddupallthenumbGersinthe> le andseeifthissumisoGddoreven.)Themessagedigestistheneither0(if>the sumiseven)or1(ifthesumisoGdd).oAsyoumayimagine,:[thisformof> ngerprintUUisnotveryusefulwhenthe lesgetlong.>ThusonedesirableaspGectofamessagedigestisthatdi erentdatasetswhich>di erCinasmallnumbGerCofplacesgeneratedi erentmessagedigests.kThisway*,K20&s\ȍ8>CHAPTERUU7.MESSAGEDIGESTѲ218G>changesUUtothedataarereadilydetected.>Onea-systemthatdoGesthiswellistheMD5messagedigest.NItis\cryptograph- >ically(secure",]thatis,ifone legeneratesagivenMD5messagedigest,itis>hardtoconstructadi erent lewiththesameMD5messagedigest.{Thus,it>isUUsuitablefor\digitalsignatures"thatarehardtoforge.%ҩ>7.2bcWhyffuseamessagedigestwithTL32EdX?>Thelast(andoftentrickiest)stepinsettingabGookis\pagelayout".Inthe>TU>'ExX!worldthiscorrespGondstooptimizing gureplacementand xingbadpage>breaks.[Thisaisoftendelicate:Pchangingonelineoftextcanchangenotjustthe>pageUUonwhichthelineappGears,butthepagesfollowing(\textre ow").>Thus,jitwouldbGeverynicetodetermine,jaftermakingasmallchange,jwhich>p}'ages>havechanged.q-OneSwaytodeterminethisistoloGokataprintoutofeach>page Jandseewhichpageshavechanged.This,7however,is Jnotverypractical>exceptUUforthesmallestdoGcuments.>My9lapproachistotakeeachpage's\ ngerprint"(viaamessagedigest)bGe->foremakingachange,Êmakethechange,andthentakeeachpage's ngerprint>again$aftermakingthechange.aThen,.justcheckwhichpages' ngerprintshave>changed.>HereUUisanexample.qLetfilex.texcontainthefollowingsource:ٍ>a\eject?b\ejectc\ejectd\ejecte\ejectf\end>TheUUsummaryofthis leis>dvii?-ufilex >File?size:628bytes(1K)>Comment?string: TeXoutput1999.12.17:0937>Page?count:6>Number?offonts:1ٍ>W*ecansaveanddisplaythepageinformationalongwithamessagedigestof>eachUUpageifweusethe-M1option:>dvii?-p-M1filex>before.md>cat?before.md>[message?digest:simplesum(ignorefont)]>p:[1/1]::9C8E26458F1B019011D2F28DA18B18CC>p:[2/2]::9C8E26468F1B029011D2F28DA18B18CC>p:[3/3]::9C8E26478F1B039011D2F28DA18B18CC>p:[4/4]::9C8E26488F1B049011D2F28DA18B18CCs\ȍ8>CHAPTERUU7.MESSAGEDIGESTѲ228G>p:[5/5]::9C8E26498F1B059011D2F28DA18B18CC >p:[6/6]::9C8E264A8F1B069011D2F28DA18B18CC>W*eKnoweditfilex.texandchangethe'b'thatappGearsonpage2toa'B';we>nowUUhave>a\eject?B\ejectc\ejectd\ejecte\ejectf\end>W*ednextTU>'ExXthe le,C(savedthenew ngerprints,andseewhichpageshave>changedUUusingthediffutility:>tex?filex>dvii?-p-M1filex>after.md>diff?before.mdafter.md>3c3><?p:[2/2]::9C8E26468F1B029011D2F28DA18B18CC>--->>?p:[2/2]::9C8E26468F1AE29011D2F28DA18B18CC>NoteUUthatpage2istheonlypagewithadi erentmessagedigest.os\ȍ88G4>Appendix A7>Ac8knowledgements8MWHeikoObGerdiekmadesigni cantsuggestionsonimprovingthepGerfor- WmanceUUofthecoGde,andpointedoutseveralerrors.MWT*omUUKacvinskyhelpGedmakethecodeworkon64-bitmachines.MWKarstenTinnefeldmadesomehelpfulsuggestionsongettingthecoGdetoWcompileUUonolderSuns,andcontributedsomeLinuxandSunbinaries.K23Ӡs\ȍ88G4>Appendix B7>Source T{ les9>HereUUisthesourcefortest.tex:>$Cscmtt8%@test.tex >%@Testfilefordvii(lastchanged:5December1999)>%>%@Ablankpage>\eject>This@ispage2/2.>\eject>This@ispage3/3withashortspecial.Also,arule.\vrulewidth1cm>depth1cm@height1cm\relax>\special{A@shortspecial}>\eject>This@ispage4/4witha{\bflong}special.Notethecontrol>character;@thisismeanttoconfusedviiwhenitcutsofthelong>special@text.>\special{%>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%>3.141592653589793238462643383279502884197169399375105820974944592%>The@quickbrownfoxjumpedoverthelazydog.%>}>\eject>This@ispage5/5with5specials.>\special{PSfile@1.eps}>\special{PSfile@2.eps}>\special{PSfile@3.EPS}>\special{PSfile@dog1.gif}>\special{PSfile@cat.eps}>\eject>\pageno@=-1>\font\a=cmr10@scaled1200>{\a@Thisispage6/-1withfontcmr10scaled1200.}K24#s\ȍ8>APPENDIXUUB.SOURCEFILES258G>\eject >\pageno@=-3>This@pagehasaspecialwithcontrolcharacters.(Oooh!)>\special{Some@controlcharacters:[]}>Followed@byseveralblankpages.>\eject\eject\eject\eject>\bye)s\ȍ88G4>Appendix C7>P8erl T{scripts8d>|{Ycmr8HereXIdescribC.1ffontdiff.pl>C.1.1j@Intro`duction>ThePÎerlscriptfontdiff.pllothe02di erences.ׯThiscanbcomputertDsystemsandyÎouareworriedthatthefontsonthetwosystemsmaybdi erenÎtlyJ.>LetXusloWJevhaÎvetwodvi les: mtest1.dviandtest2.dvi.Herearethefontslistingsforthesetwo > les:T>d:\tex\dvii>dvii@-ftest1.dvi>f:[50/cmbx10/1100]::1af22256>f:[33/cmsl10/1000]::70ae304a>f:[0/cmr10/1000]::4bf16079>d:\tex\dvii>dvii@-ftest2.dvi>f:[51/cmbx10/1100]::1af22256>f:[50/cmr10/1100]::4bf16079>f:[0/cmr10/1000]::4bf16079>IfXwÎerunthePerlscriptfontdiff.plonthesetwo leswegetthefollowing:>d:\tex\dvii>perl@fontdiff.pltest1.dvitest2.dvi>Fonts@intest1.dviNOTintest2.dvi:>------------------------------Ff:[NN/cmsl10/1000]::70ae304a>------------------------------>Fonts@intest2.dviNOTintest1.dvi:K26s\ȍ8>APPENDIXUUC.PERLSCRIPTS278G>------------------------------ Ff:[NN/cmr10/1100]::4bf16079>------------------------------>Fonts@incommonthathaveDIFFERENTchecksums:>------------------------------>------------------------------9>NotethatbÎydefaultthefontdiff.plscriptignoresfontnumbences. IfXyÎouwanttoseewhichfontsareincommonaddthe-loption:>d:\tex\dvii>perl@fontdiff.pl-ltest1.dvitest2.dvi>Fonts@intest1.dviNOTintest2.dvi:>NOTE:@fontsmarkedwith*areinBOTHfiles>------------------------------>*@f:[NN/cmbx10/1100]::1af22256Ff:[NN/cmsl10/1000]::70ae304a>*@f:[NN/cmr10/1000]::4bf16079>------------------------------>Fonts@intest2.dviNOTintest1.dvi:>NOTE:@fontsmarkedwith*areinBOTHfiles>------------------------------>*@f:[NN/cmbx10/1100]::1af22256Ff:[NN/cmr10/1100]::4bf16079>*@f:[NN/cmr10/1000]::4bf16079>------------------------------>Fonts@incommonthathaveDIFFERENTchecksums:>------------------------------>------------------------------>C.1.2j@Howarefonts\di erent"?>What dofonÎtXcalledfroma.dvi le:.}Kc1.WnameX(e.g.,cmr10orptmÎb) Kc2.WfonÎtXnumbThePÎerlscriptfontdiff.plcanignoreanyoftheseparameters(exceptfontname)when > ndingXfonÎtdi erences. Herearetheoptions:9>-c@:ignorechecksumwhenfindingfontdifferences>-C@:doNOTignorechecksumwhenfindingfontdifferences(DEFAULT)>-n@:ignorefontnumberwhenfindingfontdifferences(DEFAULT)>-N@:doNOTignorefontnumberwhenfindingfontdifferences>-s@:ignorefontscalingwhenfindingfontdifferences>-S@:doNOTignorefontscalingwhenfindingfontdifferences(DEFAULT)>-l@:listfontsforeachfile>ConÎtinuingtheexamplestartedintheabwÎeXwouldusethe-Noption:}s\ȍ8>APPENDIXUUC.PERLSCRIPTS288G>d:\tex\dvii>perl@fontdiff.pl-Ntest1.dvitest2.dvi >Fonts@intest1.dviNOTintest2.dvi:>------------------------------Ff:[50/cmbx10/1100]::1af22256Ff:[33/cmsl10/1000]::70ae304a>------------------------------>Fonts@intest2.dviNOTintest1.dvi:>------------------------------Ff:[51/cmbx10/1100]::1af22256Ff:[50/cmr10/1100]::4bf16079>------------------------------>Fonts@incommonthathaveDIFFERENTchecksums:>------------------------------>------------------------------׍>NotebthatmorefonÎtsareconsidereddi erentthanbscaledatmagni cation1000hasfonÎtnumbnÎumbNote.s?IfyÎoulowill;}seethatthefonÎtsarelistedwiththeirfontnumboÎverridden̽bythe-N̻option,vfontnumbthem.>HereistheoutputwhenwÎeignoreeverythingwecanignore:wchecksum,scaling,andfont>nÎumbd:\tex\dvii>perl@fontdiff.pl-n-s-ctest1.dvitest2.dvi>Fonts@intest1.dviNOTintest2.dvi:>------------------------------Ff:[NN/cmsl10/SSSS]::70ae304a>------------------------------>Fonts@intest2.dviNOTintest1.dvi:>------------------------------>------------------------------"e>C.2fspecials.pll>ThisPÎerlscripttakesasitsingleargumentadvi leandoutputsaadvips-stylelistofpages>conÎtainingX\special's.>LetXuslod:\tex\dvii>dvii@-stest.dvi>s:[2/2]::@Ashortspecial>s:[3/3]::>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567893.141592>653589793238462643383279502884197169399375105820974944592>s:[4/4]::@PSfile1.eps>s:[4/4]::@PSfile2.eps>s:[4/4]::@PSfile3.EPS>s:[4/4]::@PSfiledog1.gif>s:[4/4]::@PSfilecat.eps>s:[6/-3]::@Somecontrolcharacters:[]ǘs\ȍ8>APPENDIXUUC.PERLSCRIPTS298G>andXhereistheoutputfromthespecials.plscript:>d:\tex\dvii>perl@specials.pltest.dvi >-pp2,3,4,-3>YJou'couldthentakÎethisstringandprintjustthepagescontainingthe\special'susingdvips:>d:\tex\dvii>dvips@-pp2,3,4,-3test.dvi>AlthoughGthemostcommon\special'sencounÎteredarethoseforincludinganEPSGs(Encapsu->latedJPÎostscriptFile) gures,fandinmostcasesthosearetheonly\specials's,itmaÎyhappthat:therearepagesconÎtainingotherkindsof\specials's(forexamplewhenthedoincorpTheanswÎeristousethe--grepoptiontodisplayonlythose\special'sthatcontainthe>stringTPSfile(thestandardindicatorofanincludedEPSN le). So,toprinÎtonlythosepages>thatXconÎtainanincludedEPS gure:>d:\tex\dvii>perl@specials.pl--grepPSfiletest.dvi>-pp4#8>C.3fdetails.pll>ThePÎerlscriptdetails.plusesthedumpopopasXinthisexample:>details.pl@-dtest>o:pre>o:bop>o:push>o:down3>...>o:post>whereX...aretheinÎterveningXopTJoXgetstatisticsonhoÎwmanytimeseachopdetails.pl@-Dtest>set_char_0:0>set_char_1:0>...>pop:25>right1:0>right2:7>...>(IXhaÎveonlyshownafewofthe255opFinallyJ,ifyÎouwantasuccintsummaryoftheopatXall:ђs\ȍ8>APPENDIXUUC.PERLSCRIPTS308G>details.pl@-utest >SUMMARY>Number@ofcharactersset(total):314Fat@orbelowposition127:314Fabove@position1277@4:0>Number@ofrulesLH:1>Number@ofnopsPL:0>Number@ofbopsPL:6>Number@ofeopsPL:6>Number@offontchanges.,:9>Number@ofspecials?<:8>Number@offontdefinitions:3>Number@ofundefinedopcodes:0>TheXh\NumÎbto@stÎypof.)>NoteDthatstrictlyspbutXwhereisthefuninthat?;s\%#fcmti8$Cscmtt8#߆Tff cmtt12"N cmbx12!': cmti10 Nff cmbx12Nq cmbx12p0J cmsl10 cmmi10K`y cmr10ٓRcmr7