; TeX output 1996.03.06:1128yiG \advance\interlinepenalty-\linenopenalty<16>\@nobreaktrue<17>\fi<18.\@tempswatrue<19.\ifnum\outputpenalty>-\linenopenaltypar\else<20>\ifnum\outputpenalty>-175000\relax<21N?\@tempswafalse<22>\fi<23.\fi<24.}<25WVeharvetoreturnallthepagetothecurrentpage,andaddabSoxwiththe8lineGnrumbSer,withoutaddingbreakpoinrts,glueorspace.\Thedepthofour9linegnrumbSershouldbeequaltothepreviousdepthofthepage,incasethe10pagebreakshere,andthebSorxhastobemorvedupbrythatdepth.110The\interlinepenaltycomesafterthe\vadjustfroma\linelabel,12so wreincrementthelinenumbSer&@ cmti12after Jprintingit.y%Themacro13\makeLineNumber}proSducesthetextofthelinenrumber, see}section5.|Finally14wreputinthenatural\interlinepenalty,exceptafterthelastline.15Ǎ\def\MakeLineNo{\@tempdima\dp\@cclv?\unvbox\@cclv<26 .\sbox\@tempboxa{\hbox?to\z@{\makeLineNumber}}%<27.\stepcounter{linenumber}%<28.\dp\@tempboxa=\@tempdima\ht\@tempboxa=\z@<29.\nointerlineskip\kern-\@tempdima\box\@tempboxa<30.\ifnum\outputpenalty=-\linenopenaltypar\else<31C\@tempcnta\outputpenalty<323yiC\advance\@tempcnta?-\linenopenalty<33 C\penalty\@tempcnta<34.\fi<35.}<36'3BConutrolzlinenumb=ering1b#The?linenrumbSering?isconrtrolledvia\par.qLDD"A_ٹT UE!XsavedtheT UE!X-primitive2\parnin\@@par.2WVepushitonelevrelfurtherout,andrede ne\@@parto3insertǞthe\interlinepenaltyneededtotriggerthelinenrumbSering.And4wreneedtoallowpagebreaksafteraparagraph.5=\let\@@@par\@@par<37 <38\def\linenumberpar{\ifvmode\@@@par\else\ifinner\@@@par\else<399?\advance\interlinepenalty?\linenopenalty<40H\@@@par<41H\penalty-\linenopenaltypar<42H\kern\z@<439?\advance\interlinepenalty?-\linenopenalty<449?\fi\fi<459?}<46=ThebasiccommandstoenableanddisablelinenrumbSers.>>\@parand\par6areonlytoucrhed,$|whentheyare\letto\@@@par/\linenumberpar.MTheline7nrumbSer[2maybSeresetto1withthestar-form,worsetbyanoptionalargument8[hnumbfferJi].9\def\linenumbers{\let\@@par\linenumberpar<47 9?\ifx\@par\@@@par\let\@par\linenumberpar\fi<489?\ifx\par\@@@par\let\par\linenumberpar\fi<499?\@ifnextchar[{\resetlinenumber}%]<50x?{\@ifstar{\resetlinenumber}{}}%<519?}<52<53\def\nolinenumbers{\let\@@par\@@@par<54)\ifx\@par\linenumberpar\let\@par\@@@par\fi<55)\ifx\par\linenumberpar\let\par\@@@par\fi<56)}<57=WhathappSenswithadisplary?CSince\parisnotexecuted,ĊwhenbreakingthelinesbSeforeadisplaryV,theywillnotgetlinenumbSers.SorryV,butIdonotdaretocrhange\interlinepenaltygloballyV,SnordoIwanttorede nethedisplarymathenvironments.8Dothat,ifyoureallyneedit.Q/displCayXmath4 2yiThefnexttrwofcommandsareprorvidedtoturnonlinenumbSeringinaspeci c1moSde.DGPleaseunotethedi erence:@zforpagewisenrumbering,/h\linenumbers2comes rsttoinhibititfromseeingoptionalargumenrts,sincere-/presetting3thecounrterisuseless.4\def\pagewiselinenumbers{\linenumbers\setpagewiselinenumbers}<58 \def\runninglinenumbers{\setrunninglinenumbers\linenumbers}<59FinallyV,ityisaLDD"A_ٹT UE!Xstryle,sowreprovidefortheuseofenvironments,includ-5ingthesuppressionofthefollorwingparagraphsindentation.6\@namedef{linenumbers*}{\linenumbers*}<60 \@namedef{runninglinenumbers*}{\runninglinenumbers*}<61<62\def\endlinenumbers{\par\@endpetrue}<63\let\endrunninglinenumbers\endlinenumbers<64\let\endpagewiselinenumbers\endlinenumbers<65\expandafter\let\csname?linenumbers*\endcsname\endlinenumbers<66\expandafter\let\csname?runninglinenumbers*\endcsname\endlinenumbers<67(V4BLineznuumb=erreferences7b#TheonlywraytogetalabSeltoalinenrumberinaparagraphistoaskthe8outputroutinetomarkit.90WVeusethemarginparmecrhanismtohoSokto\outputforasecondtime.10Marginpars|are oatswithnrumbSer|1,GwefakemarginparswithNo2.11OriginallyV,evrerynegativenumbSered oatwasconsideredtobSeamarginpar.120The oatbSorxnumbSer\@currboxisusedtotransferthelabelnameina13macrocalled\@LNL@hbffox-numberJi.140A \newlabel oiswrittentotheaux- le.5Thereferenceisto15\theLineNumber,%notP\thelinenumber. J This allorwstohoSokin,asdone16bSelorwforpagewiselinenumbSering.17\let\@LN@addmarginpar\@addmarginpar<68 \def\@addmarginpar{%<69.\ifnum\count\@currbox>-2\relax<709?\@LN@addmarginpar<71.\else<729?\@cons\@freelist\@currbox<739?\protected@write\@auxout{}{%<74N?\string\newlabel<75]{\csname?@LNL@\the\@currbox\endcsname}%<76]{{\theLineNumber}{\thepage}}}%<77.\fi}<785)yi'Nff cmbx124.1ILThefflinelabs3elcommand1@TVoԶrefertoaplaceinline\ref{hfoffoi}atpage\pageref{hfooi}yrouplacea2\linelabel{hfoffoi}꨹atthatplace.35dIf+yrouusethiscommandoutsidea\linenumbersparagraph,youwillAacmr6Itw9orks:Thisparagraphstartsonpage6,line4.4getbXreferencestosomejunkylinenrumbSers,DsorryV.ButbXwedon'tdisablethe5command,bSecauseL+onlythe\parattheendofaparagraphmarydecides6whetherVtoprinrtlinenumbSersonthisparagraphornot.!AD\linelabelmay7appSearearlierthan\linenumbers.80\linelabel,(viaOXafakre oatnumbSer2,(putsa\penaltyintoa9\vadjust,4Mwhicrh_triggersthepagebuilderafterputtingthecurrentlineto10thePmainvrerticallist.A\writeisplacedonthemainverticallist,which11prinrtsareferencetothecurrentvXalueof\thelinenumberand\thepageat12thetimeofthe\shipout.130A\linelabelisallorwedonlyinouterhorizonrtalorverticalmoSdes.140The0argumenrtof\linelabelisputintoamacrowithanamederived15from-thenrumbSer-oftheallocated oatborx.Much-oftherestisdummry oat16setup.17\def\linelabel#1{%<79 .\ifvmode<80C\ifinner?\else\leavevmode\fi<819?\fi<82.\ifhmode<839?\ifinner<84C\@parmoderr<859?\else<86C\@bsphack\@floatpenalty?-\@Mii<87C\@next\@currbox\@freelist<88X{\global\count\@currbox-2%<89]\expandafter\gdef\csname?@LNL@\the\@currbox\endcsname{#1}}%<90X{\@floatpenalty\z@?\@fltovf\def\@currbox{\@tempboxa}}%<91C\begingroup<92X\setbox\@currbox?\color@vbox\vbox\bgroup\end@float<93C\endgroup<94C\global?\@ignorefalse\@esphack<959?\fi<96.\else<979?\@parmoderr<98.\fi<99.}&10064yi5BThezapp=earanceofthelinenuumbersb#TheqVlinenrumbSersqVaresetas\tiny\sffamily\arabic{linenumber},10ptleftofthetext.8YVoumaryaddoptionstoplaceitrightofthetext,or.8..30.8..herearethehoSoks:\def\makeLineNumberLeft{\hss\linenumberfont\LineNumber\hskip\linenumbersep}&101 &102\def\makeLineNumberRight{\linenumberfont\hskip\linenumbersep\hskip\textwidth&103?\hbox?to\linenumberwidth{\hss\LineNumber}\hss}&104&105\def\linenumberfont{\normalfont\tiny\sffamily}&106&107\newdimen\linenumbersep&108\newdimen\linenumberwidth&109&110\linenumberwidth=10pt&111\linenumbersep=10pt&112Ohy%wrell,someofthesuggested`customization'hasbSeendone,particularlytheplacemenrtofthenumbSers.liMarginswitchingrequirespagewisenum-6bSering{mode,PbutcrhoosingtheleftorrighrtmarginforthenumbSersalwayswrorks.\def\switchlinenumbers{\@ifstar&113 3{\let\makeLineNumberOdd\makeLineNumberRight&1149?\let\makeLineNumberEven\makeLineNumberLeft}%&1153{\let\makeLineNumberOdd\makeLineNumberLeft&1169?\let\makeLineNumberEven\makeLineNumberRight}%&1173}&118&119\def\setmakelinenumbers#1{\@ifstar&120){\let\makeLineNumberRunning#1%&121.\let\makeLineNumberOdd#1%&122.\let\makeLineNumberEven#1}%&123){\ifx\c@linenumber\c@runninglinenumber&124>\let\makeLineNumberRunning#1%&125.\else&126>\let\makeLineNumberOdd#1%&127>\let\makeLineNumberEven#1%&128.\fi}%&129)}&130&131\def\leftlinenumbers{\setmakelinenumbers\makeLineNumberLeft}&132\def\rightlinenumbers{\setmakelinenumbers\makeLineNumberRight}&133&134\leftlinenumbers*&1357? yi\LineNumber'-isahoSokwhicrhisusedforthemodulostu .ItisthecommandtoVfuseforthelinenrumbSer,VwhenVfyoucustomizes\makeLineNumber. |Use\thelinenumber꨹tocrhangetheout tofthedigits.30WVewillimplemenrttwomoSdesofoperation:.)0<_nrumbSersrunningthrough(partsof8)thetext0<_pagewise꨹nrumbSersstartingoverwithoneontopofeachpage.6.(Both)moSdesharve)theirorwncountregister,ybutonlyoneisalloScatedasaLDD"A_ٹT UE!Xcounrter,withtheattachedfacilitiesservingbSoth.6\newcounter{linenumber}&136 \newcount\c@pagewiselinenumber&137\let\c@runninglinenumber\c@linenumber&138h6OnlytherunningmoSdecounrtermaybSereset,orpreset,forindividualpara-9graphs.iThepagewisecounrtermustgiveauniqueanonymousnumbSerforeacrhline.\newcommand\resetlinenumber[1][1]{\c@runninglinenumber#1}&139"df5.1ILRunningfflinenumbs3ers12@Running moSdeiseasyV, \LineNumberand\theLineNumberproduce\thelinenumber, 4*whicrhDdefaultsto\arabic{linenumber},usingthe\c@runninglinenumber꨹counrter.8ThisisthedefaultmoSdeofoperation.15\def\makeRunningLineNumber{\makeLineNumberRunning}&140 &141\def\setrunninglinenumbers{%&142.\def\theLineNumber{\thelinenumber}%&143.\let\c@linenumber\c@runninglinenumber&144.\let\makeLineNumber\makeRunningLineNumber&145.}&146&147\setrunninglinenumbers\resetlinenumber&148"df5.2ILPagewisefflinenumbs3ers@Dicult,if_yrouthinkabSoutit.6ThenumbSerhastobeprinrtedwhenthereisnoTmeanstoknorwonwhichpageitwillendup,exceptthroughtheaux- le.18MysolutionisreallyexpSensivre,butquiterobust.0With[vrersionv2.00thehashsizerequirementsarereduced,HbSecausewedo'notneedoneconrtrolsequenceforeachlineanymore.Butthiscostssome21computationtimeto ndoutonwhicrhpageweare.8 Hyi0\makeLineNumbergetsahoSoktologthelineandpagenrumbertotheaux- le.AnotherhoSoktriesto ndoutwhatthepageo setis,{andsubtractsi{itfromthecounrter\c@linenumber. YAdditionallyV, 0theswitch3\ifoddNumberedPage꨹issettrueforoSddnrumberedpages,falseotherwise.\def\setpagewiselinenumbers{%&149 .\let\theLineNumber\thePagewiseLineNumber&150.\let\c@linenumber\c@pagewiselinenumber&151.\let\makeLineNumber\makePagewiseLineNumber&152.}&153&154\def\makePagewiseLineNumber{\logtheLineNumber\getLineNumber&155)\ifoddNumberedPage&1569?\makeLineNumberOdd&157)\else&1589?\makeLineNumberEven&159)\fi&160)}&161EacrhnumbSeredlinegivesalinetotheaux le<_\@LN{hlinei}{hpffagei}6vrery4similartothe\newlabelbusiness,Gexceptthatweneedanarabicrep-resenrtationofthepagenumbSer,notwhattheremightelsebSein\thepage.\def\logtheLineNumber{\protected@write\@auxout{}{%&162 .\string\@LN{\the\c@linenumber}{\noexpand\the\c@page}}}&163FVromtheaux- lewregetonemacro\LN@Phpffageiforeachpagewithline9nrumbSersJonit.:Thismacrocallsfourothermacroswithoneargumenrteach.Thesemacrosaredynamicallyde nedtodotestsandactions,to ndoutonwhicrhpagethecurrentlinenumbSerislocated.120WVeŒneedsortofapSoinrtertothe rstpagewithlinenumbSers,initiallizedtopSoinrttonothing:\def\LastNumberedPage{first}&164 \def\LN@Pfirst{\nextLN\relax}&165TheޘfourdynamicmacrosareinitiallizedtoreproSducethemselvresinan\xdef15\let\lastLN\relax %?comparetolastlineonthispage&166\let\firstLN\relax?%comparetofirstlineonthispage&167\let\pageLN\relax %?getthepagenumber,computethelinenumber&168\let\nextLN\relax %?movetothenextpage&1699 R2yiDuring=theend-doScumenrtrunthroughtheaux- les,wedisable\@LN.Imayputinacrheckherelater,togivrearerunrecommendation.r\AtEndDocument{\let\@LN\@gobbletwo}&170rNorw, {this^isthetrickypart.Firstofall, {thewholede nitionof3\@LNݹisgroupSed,toarvoidaccumulationonthesavestack.Somehow\csnamehcsi\endcsnames>pushesanenrtryV, whichs>staysafteran\xdeftothathcsi.60If\LN@Phpffageiisunde ned,]initializeitwiththecurrenrtpageandlinenrumbSer,f&with thepffointer-to-the-next-page̽poinrting tonothing. .AndthemacroforthepreviouspagewillbSerede nedtopoinrttothecurrentone.90IfXthemacroforthecurrenrtpagealreadyexists,0justrede nethelast-line-numbffer5SenrtryV.0FinallyV,5sarveXthecurrenrtpagenumbSer,5togetthepoinrtertothefollowing12pagelater.\def\@LN#1#2{{\expandafter\@@LN\csname?LN@P#2\endcsname{#1}{#2}}}&171 \def\@@LN#1#2#3{\ifx#1\relax&1723\expandafter\@@@LN\csname?LN@P\LastNumberedPage\endcsname#1&1733\xdef#1{\lastLN{#2}\firstLN{#2}\pageLN{#3}\nextLN\relax}%&174)\else&1753\def\lastLN##1{\noexpand\lastLN{#2}}%&1763\xdef#1{#1}%&177)\fi&178)\gdef\LastNumberedPage{#3}}&179rThepreviouspagemacrogetsitspSoinrtertothecurrentone,replacingthe\relaxwiththecs-tokren\LN@Phpffagei.iIncaseofpagenumbSermismatch,15T UE!X#willtriphere,2bSecausetheargumenrtstringfor\nextLN#isnot\relax.Itthinktit'sdiculttodoareasonableinrtercepthere,>bSecausethisisrunninginan\xdef.8DoSes\PackageError{}wrorkinthere?18\def\@@@LN#1#2{{\def\nextLN\relax{\noexpand\nextLN\noexpand#2}%&180 r\xdef#1{#1}}}&181rNorw,toyprintalinenumbSer,weneedto ndthepage,whereitresides.Thiswill|mostprobablybSetheonewherethelastonecamefromormarybethenext.Horwever,~ it`canbSeacompletelydi erenrtone.WVemainrtainacache,21whicrhnislettothelastaccessedpagesmacro.2ButfornowitisinitializedtoTexpand\LN@first,wherethepSoinertothe rstnrumberedTpagehasbeenstoredin.24\def\NumberedPageCache{\LN@Pfirst}&182 10 [yiTVo ndoutonwhicrhpagethecurrent\c@linenumberis,|wede nethefourdynamicmacrostodosomethingusefullandexecutethecurrenrtcachemacro.\lastLNisrun rst,testingifthelinenrumbSerinquestionmarybeonalater3page.8Ifso,disable\firstLN,andgoontothenextpagevia\nextLN.ᆍ\def\testLastNumberedPage#1{\ifnum#1<\c@linenumber&183 >\let\firstLN\@gobble&184)\fi}&185aElse,if/\firstLN ndsoutthatwreneedanearlierpage,wrestartoverfromthebSeginning.Else,\nextLNɹwillbedisabled,and\pageLNɹwillrun6\gotNumberedPagewithtrwoarguments:othe rstlinenumbSeronthispage,andthepagenrumbSer.\def\testFirstNumberedPage#1{\ifnum#1>\c@linenumber&186 9?\def\nextLN##1{\testNextNumberedPage\LN@Pfirst}%&187)\else&188>\let\nextLN\@gobble&189>\def\pageLN{\gotNumberedPage{#1}}%&190)\fi}&191aWVe}startwith\pageLNsdisabledand\nextLNde nedtoconrtinue}thesearcrh9withthenextpage.\def\testNumberedPage{%&192)\let\lastLN\testLastNumberedPage&193)\let\firstLN\testFirstNumberedPage&194)\let\pageLN\@gobble&195)\let\nextLN\testNextNumberedPage&196)\NumberedPageCache&197)}&198aWhenwreswitchtoanotherpage,‹we rsthavetomakesurethatitisthere.IfDwrearedonewiththelastpage,[sweprobablyneedtorunT UE!Xagain,[sbut12for\MessageBreak rerun?togetitright}%&203.\else&204 11 gyi9?\global\let\NumberedPageCache#1%&205 .\fi&206.\testNumberedPage&207.}&208x"!TVo!separatetheocialhoSoksfromtheinrternalsthereisthisequivXalence,toLet'sseeifit ndsthelab1elonpage6,line4,andbac9khereonpage12,line1.hoSokinlaterforwhatevrerpurpose:7x\let\getLineNumber\testNumberedPage&209So,norw *wegotthepagewherethenumbSerison.fWVeestablishifweareon3anoSddorevrenpage,andcalculatethe nallinenumbSertobeprinrted.7x\newif\ifoddNumberedPage&210 &211\def\gotNumberedPage#1#2{\oddNumberedPagefalse&212)\ifodd#2\relax\oddNumberedPagetrue\fi&213)\advance\c@linenumber?1\relax&214)\subtractlinenumberoffset{#1}%&215)}&216xYVou5mighrtwanttorunthepagewisemoSdewithrunninglinenumbSers,;oryroumightnot.8It'syourchoice:67x\def\runningpagewiselinenumbers{%&217)\let\subtractlinenumberoffset\@gobble&218)}&219&220\def\realpagewiselinenumbers{%&221)\def\subtractlinenumberoffset##1{\advance\c@linenumber-##1\relax}%&222)}&223&224\realpagewiselinenumbers&225xFVorZlinenrumbSerZreferences,6weneedaprotectedcalltothewholeproScedure,withtherequestedlinenrumbSerstoredinthe\c@linenumbercounrter.ҀThisiswhatgetsprinrtedtotheaux- letomakealabSel:97x\def\thePagewiseLineNumber{\protect&226C\getpagewiselinenumber{\the\c@linenumber}}%&227xAndhereiswhathappSenswhenthelabelisreferedto:\def\getpagewiselinenumber#1{{%&228)\c@linenumber?#1\relax\testNumberedPage&229)\thelinenumber&230)}}&231 12 qyiAsummaryofallpSerlineexpenses:CPU:ETheZ\outputroutineiscalledforeacrhline,andthepage-searchis<_done.3DISK:JĹOnelineofoutputtotheaux- leforeacrhnumbSeredlineMEM:KOnexmacropSerpage.Greatimprorvementxoverv1.02,whichhadone<_conrtrolosequencepSerlineinaddition.Itblewthehashtableaftersome6<_ vrethousandlines."M썍5.3ILNumbs3eringffmodulo5@MostJuserswrantJtoharveJonlyonein vrelinesnumbSered.\LineNumberis9suppSosed~toproducetheout tofthelinenrumber~attachedtotheline,while\thelinenumber8isusedalsoforreferences,\whicrhshouldappSeareveniftheyarenotmrultiplesof ve.12:3\newcount\c@linenumbermodulo&232 &233\def\themodulolinenumber{{\@tempcnta\c@linenumber&234)\divide\@tempcnta\c@linenumbermodulo&235)\multiply\@tempcnta\c@linenumbermodulo&236)\ifnum\@tempcnta=\c@linenumber\thelinenumber\fi&237)}}&2383TheusercommandtosetthemoSdulocounrter:\newcommand\modulolinenumbers[1][0]{%&239$?\let\LineNumber\themodulolinenumber&240$?\ifnum#1>1\relax&241.\c@linenumbermodulo#1\relax&242$?\else\ifnum#1=1\relax&243.\def\LineNumber{\thelinenumber}%&244$?\fi\fi&245$?}&246&247\setcounter{linenumbermodulo}{5}&248\modulolinenumbers[1]&249'6BPuackagezoptions14b#ThereisabuncrhofpackXageoptions,mallofthemexecutingonlyusercom-15mands(seebSelorw).160Optionsleft(right)putthelinenrumbSersontheleft(righrt)margin.17ThiswrorksinallmoSdes.8leftisthedefault.18 13{yi\DeclareOption{left}{\leftlinenumbers*}&250 &251\DeclareOption{right}{\rightlinenumbers*}&252Optionmswitch(switch*)putsthelinenrumbSersmontheouter(inner)margin1ofthetext.KThisrequiresrunningthepagewisemoSde,butwreturno the2pageVo setsubtraction,gettingsortofrunningnrumbSersVagain.oThepagewise3optionmaryrestoretruepagewisemoSdelater.4\DeclareOption{switch}{\setpagewiselinenumbers&253 \switchlinenumbers&254\runningpagewiselinenumbers}&255&256\DeclareOption{switch*}{\setpagewiselinenumbers&257\switchlinenumbers*%&258\runningpagewiselinenumbers}&259The? optionspagewiseandrunningselectthemajorlinenrumbSer? mechanism.5runninglinenrumbSersrefertoarealcounrtervXalue,ߒwhichcanbSeresetfor6anry8%paragraph,Kevengettingmultipleparagraphsononepagestartingwith7lined nrumbSerone. pagewiselinenumbSersgetauniquehiddennumbSerwithin8the0doScumenrt,butwiththeopportunitrytoestablishthepageonwhichthey9 nallykcometorest.6Thisallorwsthesubtractionofthepageo set,7getting10thenrumbSersstartingwith1ontopofeachpage,ًandmarginswitchingin11trwosideformatsbSecomespossible.8Thedefaultmodeisrunning.120TheorderofdeclarationoftheoptionsisimpSortanrtherepagewisemust13comeafterswitch,BtoorveriderunningpagewisemoSde.}runningcomeslast,14to,resettherunninglinenrumbSer,mode,} e.g,afterselectingmarginswitcrh15moSde>forpagewiserunning.gOncemore, ifyrouspecifyallthreeoftheoptions16[switch,pagewise,running],-theresultisalmostnothing,butifyroulater17sary\pagewiselinenumbers,Fyougetmarginswitching,Fwithrealpagewise18linenrumbSers.19\DeclareOption{pagewise}{\setpagewiselinenumbers&260 ?\realpagewiselinenumbers}&261&262\DeclareOption{running}{\setrunninglinenumbers}&263And1 nallyV,CtheoptionmodulocausesonlythoselinenrumbSers1tobeprinrted20whicrharemultiplesof ve.21\DeclareOption{modulo}{\modulolinenumbers\relax}&264&265\ProcessOptions&266 14Рyi7BThez naltoucuh1b#ThereisonedeadcycleforeacrhlinenumbSer.2\advance\maxdeadcycles?100&267 &268\endinput&269(V8BThezusercommands3Theusercommandtoturnonando linenrumbSeringare4\linenumbers5<_TVurnonlinenrumbSeringinthecurrenrtmode.6\linenumbers*7WʄandresetthelinenrumbSerto1.8\linenumbers[h(F C cmbxti10numbKerUUi]9WʄandstartwithhnumbfferJi.10\nolinenumbers11<_TVurno linenrumbSering.12\runninglinenumbers*[hnumbKerUUi]13<_TVurnronrunninglinenrumbSers,withrthesameoptionalargumenrtsas14<_\linenumbers.aThe(nrumbSersarerunningthroughthetextoverpage-15<_breaks.HWhen uyrouturnnumbSeringo andonagain,)thenumbSerswill16<_conrtinue,except,ofcause,ifyrouasktoresetorpresetthecounter.17\pagewiselinenumbers18<_TVurnonpagewiselinenrumbSers.ThelinesoneacrhpagearenumbSered19<_bSeginningwithoneatthe rstpagewisenrumberedline.20\resetlinenumber[hnumbKerUUi]21<_Reset[Set]thelinenrumbSerto1[hnumbfferJi].22\setrunninglinenumbers23<_SwitcrhtorunninglinenumbSermode.8Donotturnitonoro .24 15ʠyi\setpagewiselinenumbers1<_SwitcrhtopagewiselinenumbSermode.8Donotturnitonoro .2\switchlinenumbers*3<_CausesmarginswitcrhinginpagewisemoSdes.aWiththestar,putthe4<_linenrumbSersontheinnermargim.5\leftlinenumbers*6\rightlinenumbers*7<_SetuthelinenrumbSersuintheleft/righrtmargin.Withthestarthisworks8<_for]bSothmodesofoperation,4Jwithoutthestaronlyforthecurrenrtly9<_selectedmoSde.10\runningpagewiselinenumbers11<_WhenusingthepagewiselinenrumbSermode,donotsubtractthepage12<_o set.RThisresultsinrunninglinenrumbSersagain,butwiththepossibil-13<_itrytoswitchmargins.wBecarefulwhendoinglinenumbSerreferencing,14<_thisymoSdestatusmrustbethesamewhilesettingtheparagraphand15<_duringreferences.16\realpagewiselinenumbers17<_Revrersesthee ectof\runningpagewiselinenumbers.18\modulolinenumbers[hnumbKerUUi]19<_Givre*anumbSeronlytolineswhicharemultiplesof[hnumbfferJi].20<_IfƮhnumbfferJiisnotspSeci ed, thecurrenrtvXalueinthecounter21<_linenumbermoduloisretained. chnumbfferJi=1turnsthiso without22<_crhanginglinenumbermodulo.8Thecounterisinitializedto5.23\linelabel24<_Setka\linelabel{hfoffoi}tothelinenrumbSerkwherethiscommandsis25<_in.Refer[toitwiththeLDD"A_ٹT UE!Xreferencingcommands\ref{hfoffoi}and26<_\pageref{hfoffoi}.27The9commandscanbSeusedgloballyV,jlocallywithingroupsorasenrviron-28menrts.BItisimpSortanttoknowthattheytakeactiononlywhenthe\paris29executed.kThex\end{hmoffdeilinenumbers}commandsprorvidea\par.Ex-30amples:31 16Nyi<_{\linenumbershtext$Di\par}12<_\begin{linenumbers}3<_htext$Di4<_\end{linenumbers}56<_hpffaragraphi{\linenumbers\par}78<_\linenumbers9<_htext$Di\par10<_\nolinenumbers1112<_\linenumbers13<_hpffaragraphi{\nolinenumbers\par}14"8.1ILCustomizationffhos3oks15@ThereQaresevreralhoSokstocustomizetheappearanceofthelinenrumbers,16andsomelorwlevelhoSoksforspeciale ects.17 \thelinenumber18_<_ThismacroshouldgivretherepresentationofthelinenumbSerinthe19<_LDD"A_ٹT UE!X-counrterlinenumber.8ThedefaultisprovidedbyLDD"A_ٹT UE!X:20Wʄ\arabic{linenumber}21? \makeLineNumberLeft22<_ThismacroisusedtoattacrhalinenumbSertotheleftofthetextpage.23<_Thismacroshould llan\hbox,to0ptwhicrhwillbSeplacedatthe24<_leftJmarginofthepage, rwiththereferencepSoinrtalignedtothelineto25<_whicrh%itshouldgiveanumbSer.VPleaseusethemacro\LineNumberto26<_refertothelinenrumbSer.27<_Thedefaultde nitionis28Wʄ\hss\linenumberfont\LineNumber\hskip\linenumbersep29? \makeLineNumberRight30<_LikreF\makeLineNumberLeft,butforlinenumbSersontherightmargin.31<_Thedefaultde nitionis32Wʄ\linenumberfont\hskip\linenumbersep\hskip\textwidth33Wʄ\hbox,to\linenumberwidth{\hss\LineNumber}\hss34 17yi\linenumberfont1<_Thismacroisinitializedto2Wʄ\normalfont\tiny\sffamily3\linenumbersep4<_ThisIdimensionregistersetstheseparationofthelinenrumbSerItothe5<_text.8DefaultvXalueis10pt.6\linenumberwidth7<_ThisnLdimensionregistersetsthewidthofthelinenrumbSernLborxonthe8<_righrtmargin.DThedistanceoftherightedgeofthetexttotheright9<_edgeMofthelinenrumbSerMis\linenumbersep+\linenumberwidth.lThe10<_defaultvXalueis10pt.11\theLineNumber{S2(forwizards)12<_ThisQlmacroiscalledforprinrtinga\newlabelentrytotheaux- le.13<_Itsde nitiondepSendsonthemode.4FVorrunninglinenrumbersit'sjust14<_\thelinenumber,-pwhile inpagewisemoSde,thepageo setsubtraction15<_isdoneinhere.16\makeLineNumber(forwizards)17<_ThismacroproSducesthelinenrumbers.L Thede nitiondepends18<_onUthemoSde. zIntherunninglinenrumbersUmodeitjustexpands19<_\makeLineNumberLeft.20\LineNumberh˹(forwizards)21<_Thismacroiscalledbry\makeLineNumbertotypSesetthelinenumbSer.22<_ThishoSokiscrhangedbythemoSdulomechanism.23 18;(F C cmbxti10'Nff cmbx12&@ cmti12%t}\cmti7$