; TeX output 1995.07.28:1001soN[DtGGcmr17A7tpacqkageformakingstickylabselsinLdKGXQ cmr12AT[-E;gX!", cmsy10WSebastianRahrtz,LeonorBarroSca;oGranrtGustafson37 1995/06/22:ō5Nff cmbx12Contents5"V cmbx101DUsage0Az1 DK`y cmr101.1[PapGerUUSizes...............................V2D1.2[LabGelUUStockSizes[􍍑............................V2D1.3[CustomizingUUforOtherLabGels.....................V3D1.4[UsingUUanExternalLabGelsourceFileiэ.................V4D1.5[LabGelsUUintheMainFile(........................V5D1.6[ControlUUSequencestoMakeLabGels..................V6D1.7[W*rappingUULongLinesandDebugging͍.................V752DTheTmacrossJ753DUserTmacros H1154DHistoryTandac9knowledgementsS14!Kt : cmbx9Abstractэ[o cmr9AڟL5Aacmr6A TuAEXst9yletoprintaregulargridofragged-rightlabAelsonapage, NsuitableNforsheetsoflabAelswhic9hcanbefedthroughalaserprin9ter.nMacrosNarenpro9videdtoalloweasyinputofnamesandaddressesinaformfreeofNTuAEXmarkup.Equallyusefulisafeatureformakingm9ultiplecopiesofaNsingleTlabAel,e.g.,returnaddressstic9kersTtogowiththelabels.!č51MLUsage5This2style lewaswrittentoproGduceasheetoflabelswhichcanbexeroxedonto 5!m#R cmss10Avery!brand5360sticky-labGelmaterial.Thislabelmaterialismadeforaxerox5machinea andithas7rowsand3columnsoflabGelson"'ExXconstruct.F*orexample,you 5mightusethefancyboxpackqagetoproGduceovqal-bGoxorshadow-bGoxnametags5forUUaconference.65$N cmbx121.1SPap`erSizesuT5The#papGersizeissuppliedbythedocumentoptionsfortheclass.2TheEuro-5pGean7defaultisa4paperandtheAmericandefaultisletterpaper,=8 b> cmmi10:5& !", cmsy1011-inch,5inheritedUUfromtheclass le,e.g.,article.cls.5a4papQerbԲ297mmUUby210mm.5a5papQerbԲ210mmUUby148mm.5b5papQerbG250mmUUby176mm.5letterpapQerr`11inUUby8.5in.5legalpapQerm14inUUby8.5in.5executiv9epapQer~ 10.5inUUby7.25in.51.2SLab`elStockSizesuT5AHnumbGeroofdi erentlabelstocksareavqailableforxeroxmachinesandlaserprint- 5ers.9ThetypicalstoGckhasmrowsandncolumnswithvqariousguttersonthepage.5BelowUUisatableofAveryproGductsthatareincommonuseinAmerica.IDs5ff5-E1ͤLτ ff͟1LabAelTSize ff?LabAels 2Lτ ffj7Ro9ws͟Lτ ffCols͟Lτ ff?Gutters͟Lτ ff8Av9eryH Lτ ff ͤLτ ffY1inTinc9hes ff;pAerTpage͟Lτ ffݟLτ ff Lτ ffLτ ff8StoAc9kTNo;gLτ ff5ff5-EͤLτ ffR11P 733&feUN16 cmsy982P 331333&feUN16F ff<21/pageLτ ffr`7=Lτ ff,3 ?ПLτ ffY:esRzLτ ff85360NBLτ ffff5-EͤLτ ff =1284P 33133&fe4N ff<10/pageLτ ffr`5=Lτ ff,2 ?ПLτ ffY:esRzLτ ff85352NBLτ ffff5-EͤLτ ffF1284 ff<10/pageLτ ffr`5=Lτ ff,2 ?ПLτ ffY:esRzLτ ff85327NBLτ ffff5-EͤLτ ffF1184 ff<20/pageLτ ffpXa10 퀟Lτ ff,2 ?ПLτ ffY:esRzLτ ff85161,T52616Lτ ffff5-EͤLτ ff_11P 33333&fe8E82P 331133&feUN16Z ff<21/pageLτ ffr`7=Lτ ff,3 ?ПLτ ffY:esRzLτ ff85329NBLτ ffff5-EͤLτ ff =1182P 33533&fe8N ff<30/pageLτ ffpXa10 퀟Lτ ff,3 ?ПLτ ffY:esRzLτ ff85331,T5160,5260ߟLτ ffff5-EͤLτ ff =11P 33133&fe3E84 ff<14/pageLτ ffr`7=Lτ ff,2 ?ПLτ ffY:esRzLτ ff85162,T52626Lτ ffff5-EͤLτ ff= +1 +&fe2=181P 33333&fe4 ff<80/pageLτ ffpXa20 퀟Lτ ff,4 ?ПLτ ffY:esRzLτ ff85267NBLτ ffff5-EͤLτ ff =1182P 33333&fe4N ff<33/pageLτ ffpXa11 퀟Lτ ff,3 ?ПLτ ffNoLτ ff85332,T5351,5354,5314͟Lτ ffff5-EJdDAnothercommonlabGelstockisDennison37-141,(having3columnsand8rows5of91 33333&fes8ds2 33733&fes8 gutterlesslabGelsonletterpaper.hTheinformationbythemanufacturer5is notpreciselycorrect,:bGecausethe rstcolumnisexactly2 33733&fes8 oincheswide,but5theUUothertwoUUare2 331333&fe16 incheswide.DAcommonproblemwithimplementingthispackqageonanewlabGelstockis5precisionofthelaserprinter,whichprintsthemaster,andthexeroxmachine5which*6printsthemasterontothelabGelstock.kSomeoftheabovearefordirect5use>onalaserprinter,xwhich>removesonesourceoferror,xbutreplacesitbythe5pGossibilityUUthatthelabelstockwilljaminthelaserprinter!2Zso51.3SCustomizingforOtherLab`elsuT5Y*our`olabGelswillverylikelybGedi erentthanAvery5360.So rstyouhaveto 5tailorzyoursource letoaparticulartypGeoflabel.UThelinesbelowmaybGeplaced5in7thepreambleandeditedtosuittheapplicationandtheactualprinterusedfor5output.r䍑C,%ߤN cmtt9\documentclass[12pt]{article} C,\usepackage{labels}C,\LabelCols=3%YNumberofcolumnsoflabelsperpageC,\LabelRows=7%YNumberofrowsoflabelsperpageC,\LeftBorder=8mm%,SpaceaddedtoleftborderofeachlabelC,\RightBorder=8mm% s,SpaceaddedtorightborderofeachlabelC,\TopBorder=9mm%XSpacetoleaveattopofsheetC,\BottomBorder=2mm%SpacetoleaveatbottomofsheetC,\begin{document}% s,Endofpreambler䍑5These 0controlscanalsobGeissuedafterthebeginningofthedocument,Rbutthe 5resultsareunde nedunlessthefollowingexampleisfollowed,JAwhichusesthe5\LabelSetupUUcontrolsequence:C,\begin{document}% s,Endofpreamble C,\LabelCols=3%YNumberofcolumnsoflabelsperpageC,\LabelRows=7%YNumberofrowsoflabelsperpageC,\LeftBorder=8mm%,SpaceaddedtoleftborderofeachlabelC,\RightBorder=8mm% s,SpaceaddedtorightborderofeachlabelC,\TopBorder=9mm%XSpacetoleaveattopofsheetC,\BottomBorder=2mm%SpacetoleaveatbottomofsheetC,\LabelSetup%!Invokenewsettingsr䍑5F*oreexample,iyourgridmaybGehasonlytwocolumnsoftenlabGelseach,irequiring 5thew rsttwowvqariablestobGereset.Thegutterareasonthelabelmaterialdictate5how[tosettheotherparameters,plusofcoursepGersonaladjustmentsoftheamount5ofUUwhitespacearoundeachlabGel.DY*our&printerdriverisexpGectedtoprintthepageexactlyasitshouldinvqanilla5TU>'ExX,i.e.,withtheoriginofthepagedownoneinchandrightoneinchfromthe5topUUlefthandcornerofthepapGer.qIfitdoesn't,adjustyourdriverparameters.DTheusualproblemwithprintersisthatlabGeloutputisquitewide,requiring5thexveryedgesofthepapGer,Aonwhichyourprintermaynotwritecorrectly*.k0Ad-5justGtheparameters\LeftBorder,N\RightBorder,\TopBorder,\BottomBorder5asUUoutlinedbGelowtosolvethiscommonproblem.DFirstYofall,\TopBorderisnotthewhitespaceatthetopofthepage,but5theXamountofspacetoleaveatthetopsothatthe rstlabGeliscenteredonits5grid.Y)This ynumbGerisdeterminedbytrialanderrorusingtheactualprinter,?xerox5machineUUandlabGelstocktobeusedintheproductionrun.DTheesecondvqalue\BottomBorderisdetermineempiricallyalso,&sothatthe5labGelsUUareallcenteredontheirgrids.qAmathematicalformulatobGesatis edisᱍ^Label?Height~=<$Kpaperheight? 8TopBorder38BottomBorderKwfeq\ (֍HLabelRowsl5Thevqalues\LeftBorderand\RightBorderareamountsofwhitespacetobGe5added"totheleftandrightoftheactuallabGelareasothatthelabelitselfdoesnot3%נso5smashintotheedgeofthegrid._BTheactuallabGelwidthisconsiderablysmaller 5than6thegridwidth(physicalwidthofthelabGelstock).jItisdeterminedbythe5formulaNd)LeftBorderI+8Label?Width>1+8RightBorder>ײ=<$KpaperwidthKwfe4 (֍LabelColsЍ5Normally*,ʅtheleftandrightwhitespacedimensionsarethesame,buttherecan5bGe *exceptions.EItisbesttodeterminethedimensionsempiricallyontheactual5equipmenttobGeusedintheproductionrun.\Visualguidesfromadviviewercan5help,butbGeawarethatthelaserprintermayfailtoprintneartheedgeandthe5xeroxUUmachinemayeitherenlargeorshrinktheimageontothelabGelstock.DAn:optiongridoverlaycanbGeproducedwiththelabeloutputfortesting5purpGoses]bythepreamblecontrolsequence\LabelInfotrue.oMostdviviewers5are1capableofshowingtheentiretestgrid.pZOnceprinted,gtheoverlaycanbGe5comparedwiththeactuallabGelstocktoseeifthebordersareintheproperplace.5Byadjustingparameters,themastercopyo thelaserprintershouldbGeableto5goUUthroughthexeroxmachineautomatically*.651.4SUsinganExternalLab`elsourceFileuT5TheUUsimplestformofinputisveryeasy*,asinthefollowingexample:C,\documentclass{article} C,\usepackage{labels}C,\begin{document}C,\labelfile{names.dat}C,\end{document}5where6names.datcontainsnamesandaddressinplainoformat.4Source lesinplain 5format1maycontainextrablanklines(onlyoneblankbGetweenlabGelsisrequired).5SortP eldsshouldbGeginwith%incolumn1,÷sotheydon'tprintaspartofthelabel.5Leadingandtrailingblanksonlinesareignored.Ctrl-L'sseemtobGeacceptable5inthesource.PTheyarenotignored,evenifoneappGearsattheendofthe le.F*or5example,if^LappGearsonalinebyitself,theniteitherproGducesanemptylabel5orTelseablankline,TifithappGenstobeinagroupoflabellines.Thelabeldata5commonlyfappGearsonlines, ushleft,withnointerveningfblanklines,bGecausea5blanklinesignalsanewlabGel.GXT*opurposelycreateblanklabels,|asfor llingouta5pageY=oflabGels,Z7seethecontrolsequence\skiplabels{#1},infr}'a.}Theactualtext5intheexternal lemaycontainL5ffA͉TU>'ExXmarkupcontrols.Thisincludescomment5marksUU%,whichwillbGeignoredduringtypGesetting.!č5SourceffFileCreationandSorting5MostmmailingliststhatalreadyexistcanbGeeditedtocreateanacceptablelistin5theZpropGerformat.RIfyouwantlonglinestowrap,thenforceallthematerialto5bGewrappedontoonelineinthesource.8Otherwise,breakthematerialintolines5ofNthelengthdesired._oAnyspGecialitemsinamailinglabelcanbecodedinL5ffA͉TU>'ExX,5e.g.,UUforeignnameswithaccentedcharacters,trademarksandfontsizechanges.44ZsoDGenerally*,trawsourceshavetobGesearchedforspGecialL5ffA͉TU>'ExXcontrolsand 5brought6uptostandard.jThefollowingcharactersaretroubleinarawsource5 le.qOnlyUUuseforwritingL5ffA͉TU>'ExXcoGdeobeyingL5ffA͉TU>'ExXcodingrules!;5Doublequote s,\"Hash(number)\#UnderscoreX\_ 5Dollar%̰\$Percent!\%Ampersand\&5Lessthan\Verticalbar s,\|5Commercialat\@Backslash\\CircumflexX\^5LeftbraceX\{Rightbrace,\}Tilde*F\~;DAktypicalkcommentlinemightstartwith%andthen^Lk(ctrl-L)followedbya 5sortkey(e.g.,thezipcoGdeorlastname).Theemacseditorsupportsamethod5of)sortingsuchrecords,2therebyrearrangingthesource leintoanewlabGelorder.5TheUUmethoGd:DNMark>>thewhole leasaregion:C^[tomarkthewhole le.DNInvokeemacs'ssort-pagesexternalroutineasfollows.9Press^[xthenenterNsort-pages&Fandpressreturn.bTheregionmarkedwillbGesortedonthe rstNlineUUofeachpage,withapagedelimitedby^L. y'5Generalffpurps3oseL++AnTL32EdXSource5Ifyouwanttosetupageneral-purpGoseL5ffA͉TU>'ExXsource le,thenusethefollowing5source,UUwhichpromptsforthelabGels lename.;GX\documentclass{article} GX\usepackage{labels}GX\begin{document}GX\promptlabelsGX\end{document}e51.5SLab`elsintheMainFileuT5Y*ou6can,oofcourse,justhave6thenamesandaddressesinthemain le,ratherthan 5usingq\labelfiletoincludethem.GThe leformatistobGeexactlyasdescribed5abGove,especially*,followtheadviceaboutblanklines,whichdelimitlabels.]This5exampleUUmakesuseofthelabelsenvironment.C,\documentclass{article} C,\usepackage{labels}C,\begin{document}C,\begin{labels}C,MeC,MyaddressC,MyCity,State,ZipcodeC,MyBrotherC,HisaddressC,HisCity,State,ZipcodeC,\end{labels}C,\end{document}5Bso51.6SControlSequencestoMakeLab`elsuT5ThereUUareotherwaysUUofaccessingthesamesystem.A81.NTheDcontrolsequencecalled\addresslabel[#1]{#2}acceptsforoptional Nargumentʃ#1L5ffA͉TU>'ExXcontrols,e.g.,fontʃsizeandstyle,andforargument#2NtheUUrowsofatabulararrayofonecolumn.`Z\documentclass{article} `Z\usepackage{labels}`Z\begin{document}jY\addresslabel[\small\sf]jY{Me\\mystreet\\mytown\\England}`Z\end{document}A82.NBoxedM=labGelsusethespecialmacrocalled\boxedaddresslabel[#1]{#2}, Nasfollows.]ThisproGducesaframe-boxaroundthelabelitself,$leavinglotsofNwhitespacearoundtheframe.Anoptionalargument[#1]isprovidedforNloGcalsettingofL5ffA͉TU>'ExXcontrols,forexample,[\fboxsep=3pt]willchangetheNwhite/spaceneartheframe.eDThebGoolean/vqariable\LabelInfotrueappGearsNinthepreambleinordertoprintoutadditionalinformation,espGeciallytheNlabGelUUdimensionsandthesettingsofcertainvqariables.`Z\documentclass{article} `Z\usepackage{labels}`Z\LabelInfotrue`Z\begin{document}jY\boxedaddresslabel[\fboxsep=3pt]jY{{\bfMe}\\mystreet\\mytown\\England}`Z\end{document}A83.NT*oyduplic}'atealabGel,thereisacountercalled\numberoflabelswhichyou NcanUUset.qF*orexample,toprintareturnaddress21times,usethissource:`Z\documentclass{article}`Z\usepackage{labels}`Z\numberoflabels=21`Z\begin{document}jY\addresslabel{Me\\mystreet\\mytown\\England}`Z\end{document}A84.NF*or<]moresophisticatedusers,vthereisamacro\genericlabelwhichyou Ncanjcall,'withanargumentofwhateveryouwanttoappGearonthelabelN(e.g.,UUfordisklabGels).qThusyoucouldhave6Mso fZ\genericlabel{% fZ\begin{tabular}{|c|}fZ\hlinefZMyAmazingProgram\\fZ\hlinefZDisk1of1\\fZ\hlinefZ\emWeaimtoserve\\k\hlinefZ\end{tabular}fZ}>toUUproGducea >labGelUUlikethis: 0=r|------------------| 0=r|MyAmazingProgram|0=r|------------------|0=r|Disk1of1!|0=r|------------------|0=r|Weaimtoserve,|0=r|------------------|MǍ5ThisUUfeaturehasbGeenusedtoprintbusinesscardswithgraphicallogo.651.7SWrappingLongLinesandDebugginguT5DebuggingoflabGel lescanbeassistedbytheinternalerrormessageswhichare 5emittedwhenalabGelboxistoohighortoowideforthesetparameters.DThiskind5oferrorisunlikelytooGccurwiththestandardcontrolsandthelabelsenviron-5ment,UUbGecausebydefaulttheyuseraggedrightandwraplonglines.DIndallmoGdes,ayoucanoptforagridaroundeachlabGel eldbysettingaBoGolean5vqariableUUcalled\LabelGridtrue,e.g.,GX\documentclass{article} GX\usepackage{labels}GX\LabelGridtrueGX\numberoflabels=21GX\begin{document}QY\addresslabel{Me\\mystreet\\mytown\\England}GX\end{document}5ByBxdefaultyougetnogrids.k}Thegridsareusefulforjudgingthe`spillover'ofad- 5dresses(ontoadjacentlabGels,1causedbylonglines.bSeealso\boxedaddresslabel,5which drawsatighterbGoxwithmorewhitespacearoundthelabGeltext.XZBothcan5bGeUUusedatthesametime.!č52MLTheffmacros5Firstofall,5Pidentifythepackqagestart,5PandprovidesomecompatibilitycoGdefor5L5ffA͉TU>'ExXX2.09.|ThegeneralagreementisthatmacropackqageswillnotbGeretro tted5toUUthenowobsoleteL5ffA͉TU>'ExX2.09,butthisonehappGenstowork.8s1?h(ow cmss9pack9age#g i 8s2?%8s3?h!latex209"i+widthsthatwillbGeaddedautomaticallybytheboxingroutinelateron.573?\ifLabelGrid% 574?\global\advance\label@heightby-2\fboxsep%575?\global\advance\label@heightby-2\fboxrule%576?\fi%577?\global\half@label=\label@height\divide\half@labelby2\relax578?\global\label@number=1\relax579?}9 kso5ThebGooleanvqariable\LabelInfotrueisusedtotoggletheamountofinformation 5printed8atruntime.pThebGoolean8isplacedinthepreambletoinvokeamore5informativeprintout.V^Thedefaultisnoinformation,butstillechoamessage,5sayingUUhowtoprintmoreinformation.580?\def\LabelSetup{\@LabelSetup% 581?\ifLabelInfo582Mp\typeout{Controlsequencesadjustableinthepreamble:}583Mp\typeout{\LabelRows=\the\LabelRows}584Mp\typeout{\LabelCols=\the\LabelCols}585Mp\TypeoutBlurb{\TopBorder}{\TopBorder}586Mp\TypeoutBlurb{\BottomBorder}{\BottomBorder}587Mp\TypeoutBlurb{\LeftBorder}{\LeftBorder}588Mp\TypeoutBlurb{\RightBorder}{\RightBorder}589Mp\typeout{Computedvalues:}590Mp\TypeoutBlurb{LabelWidth}{\label@width}591Mp\TypeoutBlurb{LabelHeight}{\label@height}592?\else593Mp\typeout{Toprintinfo,put`\protect\LabelInfotrue'inthepreamble}594?\fi595?}DW*emightwanttoprintthesamelabGelseveraltimes,˝so\sticky@labelwill 5repGeatUU\make@labelaspeci ednumberUUoftimes(\numberoflabels)596?\numberoflabels=1%597?\def\sticky@label{\l@so@far=0%598?\loop\ifnum\l@so@far<\numberoflabels\advance\l@so@farby1\make@label%599?\repeat}DThereallabGel-makingmacroappearsbelow.]Itassumestheactualtextisina 5bGoxacalled\this@label./Itisvitaltomakesurespacesarenotincludedattheend5of8$linesinthesemacros,=orallhellbreaksloGose.h InternalchecksaremadeforbGox5widthMandheight,D torepGortviolations.Theenvironmentsandmacrosprovided5bGelowalwaysproGducearaggedrightbGoxof xedwidth.6Use\genericlabelto5defeatUUtheraggedrightbGoxand xedbGoxwidth.1100?\def\make@label{% 1101?\ifLabelGrid%1102DdD\let\boxing@type\framebox%1103?\else%1104DdD\let\boxing@type\makebox%1105?\fi%5ThebGoxesmadebythemethoGdbelowcanover owhorizontallyorvertically*.S=The 5coGdeSbelowemitsanerrormessagewhichpinpGointsthetroubleandthedegreeof5dicultyaencountered.PMostofthetimethetextwrappingandraggedrightcon-5trols[ xtheproblem,]{butsomeextralonglinescanbGetroublesome.UAnessential5part ofthiscoGdeistotesttheboxforzerowidth,whichwillemitanemptylabGel.5IfUUwearedoingitonpurpGose,thenemitthelabel,otherwisediscardit.1106?\settowidth{\LabTmp}{\usebox{\this@label}}% 1107?\ifdim\LabTmp=0cm\let\action=\relax\else\let\action=\BuildB@x\fi%1108?%\TypeoutBlurb{BoxWidth}{\LabTmp}%1109?\advance\LabTmpby-\area@width%1110?\ifdim\LabTmp>0cm\relax%1111?\PkgBlurb{Labeltoowide}{\LabTmp}\fi%10 xso1112?\settoheight{\LabTmp}% 1113?{\begin{tabular}{l}\usebox{\this@label}\end{tabular}}%1114?%\TypeoutBlurb{Boxheight}{\LabTmp}%1115?\advance\LabTmpby-\half@label%1116?\ifdim\LabTmp>0cm\relax%1117?\LabTmp=2\LabTmp\PkgBlurb{Labeltootall}{\LabTmp}\fi%]5Check foranemptybGox.SBuildthebGoxprovidedithassomedimensionorelsewe 5areUUskippinglabGelsonpurpose.qOtherwise,itsemptyandwediscardit. ]1118?\ifnum\skip@labels<\sk@pped\let\action=\BuildB@x\fi%1119?\action1120?}5NowbuildthebGoxfortheactuallabGel.jTheboxhasminimumheight,whichis 5set|byusingaverticalruleofzerowidth.=Atthesametime,setaminimumbGox5width.LSet|apGositiontohalf-way|upastrutoftheheightofthelabel,thusforcing5textDtobGethecorrectheightandverticallycentered.:lApplybGoxmethoGdstoadjust5theUUwhitespaceleftandright,usinghorizontalrulesofzeroheight. ]1121?\def\BuildB@x{% 1122?\boxing@type[\label@width][c]{%1123?\rule{0pt}{\label@height}%1124?\raisebox{\half@label}[0pt][0pt]{%1125?\rule{\LeftBorder}{0pt}%1126?\usebox{\this@label}%1127?\rule{\RightBorder}{0pt}%1128?}}%5Print?+forthislabGeltotargeterrorsbylabGelnumbGer.1EmptylabGelsmadeon 5purpGose4areprintedasx.fStartanewlineandprint|ifwehaveprintedarowof5\LabelColsUUlabGels. ]1129?\ifnum\skip@labels<\sk@pped\message{x}\else\message{+}\fi% 1130?\ifnum\label@number=\LabelCols%1131?\message{|}%1132?\endgraf\nointerlineskip%1133?\global\label@number=1\else\global\advance\label@numberby1\fi%1134?}%5T*oprintoutdimensionsinmoreusualmillimeters,thefollowingmacrosareused, 5whichconvertfromTU>'ExX'sscaledpGointsintomillimeters.@ThecommonTU>'ExXpGoints5areUUalsoprinted. ]1135?\newcount\@Milli 1136?\def\ToMilli#1{\@Milli=#1\advance\@Milliby93225\relax1137?\divide\@Milliby186450\relax}1138?\def\PkgBlurb#1#2{\ToMilli{#2}%1139?\PackageWarning{labels}{#1by\the\@Millimm(\the#2)}%1140?}1141?\def\TypeoutBlurb#1#2{\ToMilli{#2}%1142?\typeout{#1=\the\@Millimm(\the#2)}%1143?} ܍53MLUserffmacros5Thebasiccaseisagenericmacro\genericlabel{#1}whichtakesitsargument 5#1UUandputsitoutonalabGel.qNoraggedright.No xedwidth.V*erybasic.11 so1144?\newcommand{\genericlabel}[1]{% 1145?\iffirst@label\LabelSetup\first@labelfalse\fi%1146?\savebox{\this@label}{#1}\sticky@label\@gobblecr}5Themoreusefulmacro\addresslabel[#1]{#2}isbasedupGonatabularenviron- 5ment,ithereforeeitacceptslinesendingin\\.ItissuppGosedtoreproducewhatis5made"bythelabelsenvironment.`Extraspaceleftandrightisremovedfromthe5tabularenvironmentandthewidthis xedatvqalue\area@width(seeabGovefor5adiscussionofthiscomputeddimension)withraggedrightedge.Theoptional5argumentq<[#1]isprovidedinordertosetloGcalvqaluesofcertainvariables,5for5example,[\fboxrule=2pt] @couldappGearastheoptionalargumentinordertolo-5cally?changebGoxrulesize,Cwithouta ectingthegridlinesizeusedfordebugging.5Theplanistousethecommondenominatorof2.09and2e,so rstwede nesome5doubleUUargumentdouble-talk.1147?\long\def\L@dblarg#1{\@ifnextchar[{#1}{\L@xdblarg{#1}}} 1148?\long\def\L@xdblarg#1#2{#1[]{#2}}5Using~L5ffA͉TU>'ExX2eextensions,vthecommand\addresslabel[#1]{#2}couldbGecoded5asE\newcommand{\addresslabel}[2][]{...}.B{IncoGdingcommontoboth2.095andUU2e,thefollowingworks:1149?\long\def\addresslabel{\L@dblarg{\@addresslabel}} 1150?\long\def\@addresslabel[#1]#2{\genericlabel{#1%1151?\begin{tabular}{@{}p{\area@width}@{}}\raggedright#2\end{tabular}}}5Theamacro\boxedaddresslabel[#1]{#2}addsaframedbGoxaroundtheaddress 5labGelde nedabove.Thetroublehereisindeterminingtheboxwidth,whichis5reducedFfromitsnormalsizebythewidthsofthebGoxruleandruleseparator.5The yoptionalargument[#1]isthesameasforthepreviousmacro,6buthereit5pGerformsjarealservice,becauseitisoftenthecasethatboxruleandboxseparator5sizesUUshouldbGeadjustedlocally*.1152?\long\def\boxedaddresslabel{\L@dblarg{\@boxedaddresslabel}} 1153?\long\def\@boxedaddresslabel[#1]#2{\genericlabel{#1%1154?\addr@width=\area@width\advance\addr@widthby-2\fboxsep%1155?\advance\addr@widthby-2\fboxrule\fbox{%1156?\begin{tabular}{@{}p{\addr@width}@{}}\raggedright#2\end{tabular}}}}5TheUUenvironmentlabels,forverbatimlabGels,willbede ned.1157?\long\def\labels1158?{\iffirst@label\LabelSetup\first@labelfalse\fi\start@@label}1159?\def\endlabels{\end@@label}5The9labGelcontents9aresaved9inaboxcalled\this@label,rformedasaraggedright 5minipagefofwidth\area@width.$Thetrickistomaketheendoflinecharacter5intofamacro^^Mfwhichgetsexecutedeachtimeitisencountered.Bytestingfor5blank_lines,b%wecan ndtheendofaseriesofconsecutiveaddresslinesandcause5the;macrototerminatethelabGelboxde nition,uandpossiblystartanother.zThe5usualactiontakenoninterceptofanendoflinecharacteristoinsert\newline.5It|isonlythecaseofablanklinethatcausesustoendthecurrentlabGel.;Here,5swallowapGending^M,toavoidhavingablanklineatthestartofeachlabGel.70Extra5blankSlinescauseblanklabGels,whicharethrownawaywhenencountered,lateron.1160?\def\start@@label{% 1161?\savebox{\this@label}\bgroup\raggedright%1162?\begin{minipage}{\area@width}\raggedright%1163?\catcode`\^^M=\active\@gobblecr%12 ,so1164?}% 1165?\def\end@@label{%1166?\end{minipage}\egroup%1167?\sticky@label}%DTheYprincipalsuppGortmacrosneededtode nethelabelsenvironmentYwillbe 5de ned}bGelow.Thesemacrosassumenamesandaddressesappearasconsecutive5linesCseparatedbyablankline.=Ifweareinthemiddleofconsecutiveaddress5lines,UUthenjuststartanewline.1168?\def\start@newline{\mbox{}\expandafter\newline}%5IfUUwehavemetablankline,then nishthecurrentlabGelandstartanewlabel.1169?\def\new@label{\end@@label\start@@label}%5Themacro^^Minvokeseither\start@newlineor\new@label.T*ode neit,we 5use~somehackery~fromPhilT*aylor.Steponeistoactivqateacontrolsequenceat5endUUofline.1170?\catcode`\^^M=\active%5Theopaquede nitionrequiredusesfuturelettoselectivelyexpandacontrol5sequenceduringade nition. qThemacro^^MissuppGosedtoreplacecarriage5returns #by\newline,orelseendthislabGelandstartanewonewith\new@label.5TherHideaistode ne^^MrAtobGeacontrolsequence\nexttoken,yactiveonlywhen5^^Mhas+bGeenmadeanactivecontrolsequence.0IThentheexpansionof^^M{#1}5will 3bGe\nexttoken,7jprovidedthenextline#1followingthecurrentonehasno5charactersܗ(exceptcarriagereturnattheend).IOtherwise,wemustbGeatthestart5ofUUanewclusteroflabGellines.1171?\def^^M{\futurelet\nexttoken\isitapar}% 1172?\def\isitapar{\ifx^^M\nexttoken\let\action=\new@label\else%1173?\let\action\start@newline\fi\action}%5De nitionszinvolving^^MTare nished.?~Re-instatetheoriginalcatcoGdeforcarriage- 5return.1174?\catcode`\^^M=5\relax%5ThesyntaxofthelabelsenvironmentcanbGeshortenedtoasingleline,provided5anminput lenameisknownandthecontentshavebGeenpreparedforusewiththe5labelsUUenvironment.1175?\def\labelfile#1{\begin{labels}\input#1\end{labels}}5IntheinterestofageneralengineforlabGelproduction,theprogramcanprompt5forthe lenameatruntime.ThiskindoffeaturemakesitpGossibletorunone5batchUU letocreatelabGels,regardlessofthesource.1176?\def\promptlabels{\typein[\labelfilename]{Whatisthenameofthe 1177?labelfile?}1178?\labelfile{\labelfilename}}5It]aispGossiblethatanumber]aofemptylabelsshouldbeprintedbeforegoingonto 5printthenextsetoflabGels.KThe\skiplabelsmacrotakesanintegerargumentof5theoBnumbGerofemptylabGelstoproduce.Anxisprintedontheterminalforeach5suchUUemptylabGel.qF*orexample:GX\documentclass{article} GX\usepackage{labels}GX\begin{document}GX\numberoflabels=1913zsoQY\boxedaddresslabel{Me\\mystreet\\mytown\\England} QY\skiplabels{2}%Make21onfirstsheetGX\numberoflabels=16QY\boxedaddresslabel{You\\yourstreet\\yourtown\\England}GX\end{document}1179?\newcount\sk@pped1180?\def\skiplabels#1{\sk@pped=#1%1181?\savebox{\this@label}{\rule{0pt}{.5in}}%1182?\skip@labels=0\relax1183?\loop\ifnum\skip@labels<\sk@pped\make@label%1184?\advance\skip@labelsby1\relax\repeat}1185?h=pack9age#g i!č54MLHistoryffandacknowledgementsDN(SPQR)8v.18May9th1989simplyallowedfor\addresslabel{...?\\...\\...}DN(SPQR)v.2July15thpGermittedverbatimstylewithnoexplicitendoflinesDN(SPQR)UUv.3March1991mademoregenericDN(SPQR)Nv.4NJanuary1992checkedandmadetoworkwithemtexdriversto NmyUUsatisfaction,anddoGcumentedtobare-bGoneslevelwith`doGc'system.DN(SPQR)UUv.5March1993allowedfor\skiplabelsDN(SPQR)UUv.6January1994forL5ffA͉TU>'ExX2"DN(SPQR)UUv.7January1994 xesDN(SPQR)UUv.8April1994revised.dtx leDN(GG)Hv.9ZApril1995revised.dtx letoPackqageZsoitworkswitharticle,Nreport˪andbookclasses.Revisionsby7gustafson@math.utah.edu.MadeNsourceD]indepGendentofpapersize(itdependedona4paper).>FixedextraNspacesbugintabulararrayof\addresslabel-itdidnotreproGduceresultsNofthelabelsenvironment. Minipagelinesweren'tragged,=nowtheyare.NNew{?controlstosetspacesaroundlabGels.CorrectedthelabelplacementNcomputations.3DErrorrepGortingforlabelsthataretoobigforthesetdi-Nmensions.SRepGortinmillimeters.InvokedlabGelsetupatruntime.NewN\boxedaddresslabel[#1]{#2}.MicrometerwUplacementoflabGelgridontheNpage.j@IntroGduced>emptylabGelalgorithm.j@Gotridofstrangeerrormessages.DN(GG)v.9UMay1995. Knewenvironment{labels}failedunderL5ffA͉TU>'ExX2.09N(1991),'-butworkedunderlaterversions!^De ning\labelsand\endlabelsN xedUUtheproblem.DN(SPQR)UUv.10June1995.qCheckedUUandissued.5ThecrucialmacroswhichmakethesystembGearableformailinglistsbyrede ning5end.oflinecamefromPhilT*aylor;apGologiestohimforusingtheminaL5ffA͉TU>'ExX5styleUU le!14; + cmmi10K`y cmr10ٓRcmr7