; TeX output 1996.03.06:1127sob[DtGGcmr17A7tpacqkageformakingstickylabselsinLdKGXQ cmr12AT[-E;gX!", cmsy10kSebastianRahrtz,LeonorBarroSca3;oGranrtGustafson37 1995/06/22:ōINff cmbx12ContentsI"V cmbx101XUsage0Az1 XK`y cmr101.1oPapGerUUSizes...............................V2X1.2oLabGelUUStockSizes[􍍑............................V2X1.3oCustomizingUUforOtherLabGels.....................V3X1.4oUsingUUanExternalLabGelsourceFileiэ.................V4X1.5oLabGelsUUintheMainFile(........................V5X1.6oControlUUSequencestoMakeLabGels..................V6X1.7oW*rappingUULongLinesandDebugging͍.................V7I2XTheTmacrossJ7I3XUserTmacros H11I4XHistoryTandac9knowledgementsS14!Kt : cmbx9Abstractэoo cmr9AڟL5Aacmr6A TuAEXst9yletoprintaregulargridofragged-rightlabAelsonapage, bsuitableNforsheetsoflabAelswhic9hcanbefedthroughalaserprin9ter.nMacrosbarenpro9videdtoalloweasyinputofnamesandaddressesinaformfreeofbTuAEXmarkup.Equallyusefulisafeatureformakingm9ultiplecopiesofabsingleTlabAel,e.g.,returnaddressstic9kersTtogowiththelabels.!čI1aLUsageIThis2style lewaswrittentoproGduceasheetoflabelswhichcanbexeroxedonto I!m#R cmss10Avery!brand5360sticky-labGelmaterial.ThislabelmaterialismadeforaxeroxImachinea andithas7rowsand3columnsoflabGelson"'ExXconstruct.F*orexample,you ImightusethefancyboxpackqagetoproGduceovqal-bGoxorshadow-bGoxnametagsIforUUaconference.6I$N cmbx121.1gPap`erSizesuTIThe#papGersizeissuppliedbythedocumentoptionsfortheclass.2TheEuro-IpGean7defaultisa4paperandtheAmericandefaultisletterpaper,=8 b> cmmi10:5& !", cmsy1011-inch,IinheritedUUfromtheclass le,e.g.,article.cls.Ia4papQervԲ297mmUUby210mm.Ia5papQervԲ210mmUUby148mm.Ib5papQervG250mmUUby176mm.IletterpapQer`11inUUby8.5in.IlegalpapQer14inUUby8.5in.Iexecutiv9epapQer~ 10.5inUUby7.25in.I1.2gLab`elStockSizesuTIAHnumbGeroofdi erentlabelstocksareavqailableforxeroxmachinesandlaserprint- Iers.9ThetypicalstoGckhasmrowsandncolumnswithvqariousguttersonthepage.IBelowUUisatableofAveryproGductsthatareincommonuseinAmerica.IXs5ff5-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-EJdXAnothercommonlabGelstockisDennison37-141,(having3columnsand8rowsIof91 33333&fes8ds2 33733&fes8 gutterlesslabGelsonletterpaper.hTheinformationbythemanufacturerIis notpreciselycorrect,:bGecausethe rstcolumnisexactly2 33733&fes8 oincheswide,butItheUUothertwoUUare2 331333&fe16 incheswide.XAcommonproblemwithimplementingthispackqageonanewlabGelstockisIprecisionofthelaserprinter,whichprintsthemaster,andthexeroxmachineIwhich*6printsthemasterontothelabGelstock.kSomeoftheabovearefordirectIuse>onalaserprinter,xwhich>removesonesourceoferror,xbutreplacesitbytheIpGossibilityUUthatthelabelstockwilljaminthelaserprinter!2ZsoI1.3gCustomizingforOtherLab`elsuTIY*our`olabGelswillverylikelybGedi erentthanAvery5360.So rstyouhaveto Itailorzyoursource letoaparticulartypGeoflabel.UThelinesbelowmaybGeplacedIin7thepreambleandeditedtosuittheapplicationandtheactualprinterusedforIoutput.r䍑W,%ߤN cmtt9\documentclass[12pt]{article} W,\usepackage{labels}W,\LabelCols=3%YNumberofcolumnsoflabelsperpageW,\LabelRows=7%YNumberofrowsoflabelsperpageW,\LeftBorder=8mm%,SpaceaddedtoleftborderofeachlabelW,\RightBorder=8mm% s,SpaceaddedtorightborderofeachlabelW,\TopBorder=9mm%XSpacetoleaveattopofsheetW,\BottomBorder=2mm%SpacetoleaveatbottomofsheetW,\begin{document}% s,Endofpreambler䍑IThese 0controlscanalsobGeissuedafterthebeginningofthedocument,Rbutthe Iresultsareunde nedunlessthefollowingexampleisfollowed,JAwhichusestheI\LabelSetupUUcontrolsequence:W,\begin{document}% s,Endofpreamble W,\LabelCols=3%YNumberofcolumnsoflabelsperpageW,\LabelRows=7%YNumberofrowsoflabelsperpageW,\LeftBorder=8mm%,SpaceaddedtoleftborderofeachlabelW,\RightBorder=8mm% s,SpaceaddedtorightborderofeachlabelW,\TopBorder=9mm%XSpacetoleaveattopofsheetW,\BottomBorder=2mm%SpacetoleaveatbottomofsheetW,\LabelSetup%!Invokenewsettingsr䍑IF*oreexample,iyourgridmaybGehasonlytwocolumnsoftenlabGelseach,irequiring Ithew rsttwowvqariablestobGereset.ThegutterareasonthelabelmaterialdictateIhow[tosettheotherparameters,plusofcoursepGersonaladjustmentsoftheamountIofUUwhitespacearoundeachlabGel.XY*our&printerdriverisexpGectedtoprintthepageexactlyasitshouldinvqanillaITU>'ExX,i.e.,withtheoriginofthepagedownoneinchandrightoneinchfromtheItopUUlefthandcornerofthepapGer.qIfitdoesn't,adjustyourdriverparameters.XTheusualproblemwithprintersisthatlabGeloutputisquitewide,requiringIthexveryedgesofthepapGer,Aonwhichyourprintermaynotwritecorrectly*.k0Ad-IjustGtheparameters\LeftBorder,N\RightBorder,\TopBorder,\BottomBorderIasUUoutlinedbGelowtosolvethiscommonproblem.XFirstYofall,\TopBorderisnotthewhitespaceatthetopofthepage,butItheXamountofspacetoleaveatthetopsothatthe rstlabGeliscenteredonitsIgrid.Y)This ynumbGerisdeterminedbytrialanderrorusingtheactualprinter,?xeroxImachineUUandlabGelstocktobeusedintheproductionrun.XTheesecondvqalue\BottomBorderisdetermineempiricallyalso,&sothattheIlabGelsUUareallcenteredontheirgrids.qAmathematicalformulatobGesatis edisᱍrLabel?Height~=<$Kpaperheight? 8TopBorder38BottomBorderKwfeq\ (֍HLabelRowslIThevqalues\LeftBorderand\RightBorderareamountsofwhitespacetobGeIadded"totheleftandrightoftheactuallabGelareasothatthelabelitselfdoesnot3%٠soIsmashintotheedgeofthegrid._BTheactuallabGelwidthisconsiderablysmaller Ithan6thegridwidth(physicalwidthofthelabGelstock).jItisdeterminedbytheIformulaNx)LeftBorderI+8Label?Width>1+8RightBorder>ײ=<$KpaperwidthKwfe4 (֍LabelColsЍINormally*,ʅtheleftandrightwhitespacedimensionsarethesame,buttherecanIbGe *exceptions.EItisbesttodeterminethedimensionsempiricallyontheactualIequipmenttobGeusedintheproductionrun.\VisualguidesfromadviviewercanIhelp,butbGeawarethatthelaserprintermayfailtoprintneartheedgeandtheIxeroxUUmachinemayeitherenlargeorshrinktheimageontothelabGelstock.XAn:optiongridoverlaycanbGeproducedwiththelabeloutputfortestingIpurpGoses]bythepreamblecontrolsequence\LabelInfotrue.oMostdviviewersIare1capableofshowingtheentiretestgrid.pZOnceprinted,gtheoverlaycanbGeIcomparedwiththeactuallabGelstocktoseeifthebordersareintheproperplace.IByadjustingparameters,themastercopyo thelaserprintershouldbGeabletoIgoUUthroughthexeroxmachineautomatically*.6I1.4gUsinganExternalLab`elsourceFileuTITheUUsimplestformofinputisveryeasy*,asinthefollowingexample:W,\documentclass{article} W,\usepackage{labels}W,\begin{document}W,\labelfile{names.dat}W,\end{document}Iwhere6names.datcontainsnamesandaddressinplainoformat.4Source lesinplain Iformat1maycontainextrablanklines(onlyoneblankbGetweenlabGelsisrequired).ISortP eldsshouldbGeginwith%incolumn1,÷sotheydon'tprintaspartofthelabel.ILeadingandtrailingblanksonlinesareignored.Ctrl-L'sseemtobGeacceptableIinthesource.PTheyarenotignored,evenifoneappGearsattheendofthe le.F*orIexample,if^LappGearsonalinebyitself,theniteitherproGducesanemptylabelIorTelseablankline,TifithappGenstobeinagroupoflabellines.ThelabeldataIcommonlyfappGearsonlines, ushleft,withnointerveningfblanklines,bGecauseaIblanklinesignalsanewlabGel.GXT*opurposelycreateblanklabels,|asfor llingoutaIpageY=oflabGels,Z7seethecontrolsequence\skiplabels{#1},infr}'a.}TheactualtextIintheexternal lemaycontainL5ffA͉TU>'ExXmarkupcontrols.ThisincludescommentImarksUU%,whichwillbGeignoredduringtypGesetting.!čISourceffFileCreationandSortingIMostmmailingliststhatalreadyexistcanbGeeditedtocreateanacceptablelistinItheZpropGerformat.RIfyouwantlonglinestowrap,thenforceallthematerialtoIbGewrappedontoonelineinthesource.8Otherwise,breakthematerialintolinesIofNthelengthdesired._oAnyspGecialitemsinamailinglabelcanbecodedinL5ffA͉TU>'ExX,Ie.g.,UUforeignnameswithaccentedcharacters,trademarksandfontsizechanges.44\soXGenerally*,trawsourceshavetobGesearchedforspGecialL5ffA͉TU>'ExXcontrolsand Ibrought6uptostandard.jThefollowingcharactersaretroubleinarawsourceI le.qOnlyUUuseforwritingL5ffA͉TU>'ExXcoGdeobeyingL5ffA͉TU>'ExXcodingrules!;IDoublequote s,\"Hash(number)\#UnderscoreX\_ IDollar%̰\$Percent!\%Ampersand\&ILessthan\Verticalbar s,\|ICommercialat\@Backslash\\CircumflexX\^ILeftbraceX\{Rightbrace,\}Tilde*F\~;XAktypicalkcommentlinemightstartwith%andthen^Lk(ctrl-L)followedbya Isortkey(e.g.,thezipcoGdeorlastname).TheemacseditorsupportsamethodIof)sortingsuchrecords,2therebyrearrangingthesource leintoanewlabGelorder.ITheUUmethoGd:XbMark>>thewhole leasaregion:C^[tomarkthewhole le.XbInvokeemacs'ssort-pagesexternalroutineasfollows.9Press^[xthenenterbsort-pages&Fandpressreturn.bTheregionmarkedwillbGesortedonthe rstblineUUofeachpage,withapagedelimitedby^L. y'IGeneralffpurps3oseL++AnTL32EdXSourceIIfyouwanttosetupageneral-purpGoseL5ffA͉TU>'ExXsource le,thenusethefollowingIsource,UUwhichpromptsforthelabGels lename.;[X\documentclass{article} [X\usepackage{labels}[X\begin{document}[X\promptlabels[X\end{document}eI1.5gLab`elsintheMainFileuTIY*ou6can,oofcourse,justhave6thenamesandaddressesinthemain le,ratherthan Iusingq\labelfiletoincludethem.GThe leformatistobGeexactlyasdescribedIabGove,especially*,followtheadviceaboutblanklines,whichdelimitlabels.]ThisIexampleUUmakesuseofthelabelsenvironment.W,\documentclass{article} W,\usepackage{labels}W,\begin{document}W,\begin{labels}W,MeW,MyaddressW,MyCity,State,ZipcodeW,MyBrotherW,HisaddressW,HisCity,State,ZipcodeW,\end{labels}W,\end{document}5BsoI1.6gControlSequencestoMakeLab`elsuTIThereUUareotherwaysUUofaccessingthesamesystem.U81.bTheDcontrolsequencecalled\addresslabel[#1]{#2}acceptsforoptional bargumentʃ#1L5ffA͉TU>'ExXcontrols,e.g.,fontʃsizeandstyle,andforargument#2btheUUrowsofatabulararrayofonecolumn.tZ\documentclass{article} tZ\usepackage{labels}tZ\begin{document}~Y\addresslabel[\small\sf]~Y{Me\\mystreet\\mytown\\England}tZ\end{document}U82.bBoxedM=labGelsusethespecialmacrocalled\boxedaddresslabel[#1]{#2}, basfollows.]ThisproGducesaframe-boxaroundthelabelitself,$leavinglotsofbwhitespacearoundtheframe.Anoptionalargument[#1]isprovidedforbloGcalsettingofL5ffA͉TU>'ExXcontrols,forexample,[\fboxsep=3pt]willchangethebwhite/spaceneartheframe.eDThebGoolean/vqariable\LabelInfotrueappGearsbinthepreambleinordertoprintoutadditionalinformation,espGeciallytheblabGelUUdimensionsandthesettingsofcertainvqariables.tZ\documentclass{article} tZ\usepackage{labels}tZ\LabelInfotruetZ\begin{document}~Y\boxedaddresslabel[\fboxsep=3pt]~Y{{\bfMe}\\mystreet\\mytown\\England}tZ\end{document}U83.bT*oyduplic}'atealabGel,thereisacountercalled\numberoflabelswhichyou bcanUUset.qF*orexample,toprintareturnaddress21times,usethissource:tZ\documentclass{article}tZ\usepackage{labels}tZ\numberoflabels=21tZ\begin{document}~Y\addresslabel{Me\\mystreet\\mytown\\England}tZ\end{document}U84.bF*or<]moresophisticatedusers,vthereisamacro\genericlabelwhichyou bcanjcall,'withanargumentofwhateveryouwanttoappGearonthelabelb(e.g.,UUfordisklabGels).qThusyoucouldhave6Mso zZ\genericlabel{% zZ\begin{tabular}{|c|}zZ\hlinezZMyAmazingProgram\\zZ\hlinezZDisk1of1\\zZ\hlinezZ\emWeaimtoserve\\\hlinezZ\end{tabular}zZ}>toUUproGducea >labGelUUlikethis: D=r|------------------| D=r|MyAmazingProgram|D=r|------------------|D=r|Disk1of1!|D=r|------------------|D=r|Weaimtoserve,|D=r|------------------|MǍIThisUUfeaturehasbGeenusedtoprintbusinesscardswithgraphicallogo.6I1.7gWrappingLongLinesandDebugginguTIDebuggingoflabGel lescanbeassistedbytheinternalerrormessageswhichare IemittedwhenalabGelboxistoohighortoowideforthesetparameters.DThiskindIoferrorisunlikelytooGccurwiththestandardcontrolsandthelabelsenviron-Iment,UUbGecausebydefaulttheyuseraggedrightandwraplonglines.XIndallmoGdes,ayoucanoptforagridaroundeachlabGel eldbysettingaBoGoleanIvqariableUUcalled\LabelGridtrue,e.g.,[X\documentclass{article} [X\usepackage{labels}[X\LabelGridtrue[X\numberoflabels=21[X\begin{document}eY\addresslabel{Me\\mystreet\\mytown\\England}[X\end{document}IByBxdefaultyougetnogrids.k}Thegridsareusefulforjudgingthe`spillover'ofad- Idresses(ontoadjacentlabGels,1causedbylonglines.bSeealso\boxedaddresslabel,Iwhich drawsatighterbGoxwithmorewhitespacearoundthelabGeltext.XZBothcanIbGeUUusedatthesametime.!čI2aLTheffmacrosIFirstofall,5Pidentifythepackqagestart,5PandprovidesomecompatibilitycoGdeforIL5ffA͉TU>'ExXX2.09.|ThegeneralagreementisthatmacropackqageswillnotbGeretro ttedItoUUthenowobsoleteL5ffA͉TU>'ExX2.09,butthisonehappGenstowork.Ls1Sh(ow cmss9pack9age#g i Ls2S%Ls3Sh!latex209"i+widthsthatwillbGeaddedautomaticallybytheboxingroutinelateron.I73S\ifLabelGrid% I74S\global\advance\label@heightby-2\fboxsep%I75S\global\advance\label@heightby-2\fboxrule%I76S\fi%I77S\global\half@label=\label@height\divide\half@labelby2\relaxI78S\global\label@number=1\relaxI79S}9 ksoIThebGooleanvqariable\LabelInfotrueisusedtotoggletheamountofinformation Iprinted8atruntime.pThebGoolean8isplacedinthepreambletoinvokeamoreIinformativeprintout.V^Thedefaultisnoinformation,butstillechoamessage,IsayingUUhowtoprintmoreinformation.I80S\def\LabelSetup{\@LabelSetup% I81S\ifLabelInfoI82ap\typeout{Controlsequencesadjustableinthepreamble:}I83ap\typeout{\LabelRows=\the\LabelRows}I84ap\typeout{\LabelCols=\the\LabelCols}I85ap\TypeoutBlurb{\TopBorder}{\TopBorder}I86ap\TypeoutBlurb{\BottomBorder}{\BottomBorder}I87ap\TypeoutBlurb{\LeftBorder}{\LeftBorder}I88ap\TypeoutBlurb{\RightBorder}{\RightBorder}I89ap\typeout{Computedvalues:}I90ap\TypeoutBlurb{LabelWidth}{\label@width}I91ap\TypeoutBlurb{LabelHeight}{\label@height}I92S\elseI93ap\typeout{Toprintinfo,put`\protect\LabelInfotrue'inthepreamble}I94S\fiI95S}XW*emightwanttoprintthesamelabGelseveraltimes,˝so\sticky@labelwill IrepGeatUU\make@labelaspeci ednumberUUoftimes(\numberoflabels)I96S\numberoflabels=1%I97S\def\sticky@label{\l@so@far=0%I98S\loop\ifnum\l@so@far<\numberoflabels\advance\l@so@farby1\make@label%I99S\repeat}XThereallabGel-makingmacroappearsbelow.]Itassumestheactualtextisina IbGoxacalled\this@label./ItisvitaltomakesurespacesarenotincludedattheendIof8$linesinthesemacros,=orallhellbreaksloGose.h InternalchecksaremadeforbGoxIwidthMandheight,D torepGortviolations.TheenvironmentsandmacrosprovidedIbGelowalwaysproGducearaggedrightbGoxof xedwidth.6Use\genericlabeltoIdefeatUUtheraggedrightbGoxand xedbGoxwidth.E100S\def\make@label{% E101S\ifLabelGrid%E102XdD\let\boxing@type\framebox%E103S\else%E104XdD\let\boxing@type\makebox%E105S\fi%IThebGoxesmadebythemethoGdbelowcanover owhorizontallyorvertically*.S=The IcoGdeSbelowemitsanerrormessagewhichpinpGointsthetroubleandthedegreeofIdicultyaencountered.PMostofthetimethetextwrappingandraggedrightcon-Itrols[ xtheproblem,]{butsomeextralonglinescanbGetroublesome.UAnessentialIpart ofthiscoGdeistotesttheboxforzerowidth,whichwillemitanemptylabGel.IIfUUwearedoingitonpurpGose,thenemitthelabel,otherwisediscardit.E106S\settowidth{\LabTmp}{\usebox{\this@label}}% E107S\ifdim\LabTmp=0cm\let\action=\relax\else\let\action=\BuildB@x\fi%E108S%\TypeoutBlurb{BoxWidth}{\LabTmp}%E109S\advance\LabTmpby-\area@width%E110S\ifdim\LabTmp>0cm\relax%E111S\PkgBlurb{Labeltoowide}{\LabTmp}\fi%10 xsoE112S\settoheight{\LabTmp}% E113S{\begin{tabular}{l}\usebox{\this@label}\end{tabular}}%E114S%\TypeoutBlurb{Boxheight}{\LabTmp}%E115S\advance\LabTmpby-\half@label%E116S\ifdim\LabTmp>0cm\relax%E117S\LabTmp=2\LabTmp\PkgBlurb{Labeltootall}{\LabTmp}\fi%]ICheck foranemptybGox.SBuildthebGoxprovidedithassomedimensionorelsewe IareUUskippinglabGelsonpurpose.qOtherwise,itsemptyandwediscardit. ]E118S\ifnum\skip@labels<\sk@pped\let\action=\BuildB@x\fi%E119S\actionE120S}INowbuildthebGoxfortheactuallabGel.jTheboxhasminimumheight,whichis Iset|byusingaverticalruleofzerowidth.=Atthesametime,setaminimumbGoxIwidth.LSet|apGositiontohalf-way|upastrutoftheheightofthelabel,thusforcingItextDtobGethecorrectheightandverticallycentered.:lApplybGoxmethoGdstoadjustItheUUwhitespaceleftandright,usinghorizontalrulesofzeroheight. ]E121S\def\BuildB@x{% E122S\boxing@type[\label@width][c]{%E123S\rule{0pt}{\label@height}%E124S\raisebox{\half@label}[0pt][0pt]{%E125S\rule{\LeftBorder}{0pt}%E126S\usebox{\this@label}%E127S\rule{\RightBorder}{0pt}%E128S}}%IPrint?+forthislabGeltotargeterrorsbylabGelnumbGer.1EmptylabGelsmadeon IpurpGose4areprintedasx.fStartanewlineandprint|ifwehaveprintedarowofI\LabelColsUUlabGels. ]E129S\ifnum\skip@labels<\sk@pped\message{x}\else\message{+}\fi% E130S\ifnum\label@number=\LabelCols%E131S\message{|}%E132S\endgraf\nointerlineskip%E133S\global\label@number=1\else\global\advance\label@numberby1\fi%E134S}%IT*oprintoutdimensionsinmoreusualmillimeters,thefollowingmacrosareused, IwhichconvertfromTU>'ExX'sscaledpGointsintomillimeters.@ThecommonTU>'ExXpGointsIareUUalsoprinted. ]E135S\newcount\@Milli E136S\def\ToMilli#1{\@Milli=#1\advance\@Milliby93225\relaxE137S\divide\@Milliby186450\relax}E138S\def\PkgBlurb#1#2{\ToMilli{#2}%E139S\PackageWarning{labels}{#1by\the\@Millimm(\the#2)}%E140S}E141S\def\TypeoutBlurb#1#2{\ToMilli{#2}%E142S\typeout{#1=\the\@Millimm(\the#2)}%E143S} ܍I3aLUserffmacrosIThebasiccaseisagenericmacro\genericlabel{#1}whichtakesitsargument I#1UUandputsitoutonalabGel.qNoraggedright.No xedwidth.V*erybasic.11 soE144S\newcommand{\genericlabel}[1]{% E145S\iffirst@label\LabelSetup\first@labelfalse\fi%E146S\savebox{\this@label}{#1}\sticky@label\@gobblecr}IThemoreusefulmacro\addresslabel[#1]{#2}isbasedupGonatabularenviron- Iment,ithereforeeitacceptslinesendingin\\.ItissuppGosedtoreproducewhatisImade"bythelabelsenvironment.`ExtraspaceleftandrightisremovedfromtheItabularenvironmentandthewidthis xedatvqalue\area@width(seeabGoveforIadiscussionofthiscomputeddimension)withraggedrightedge.TheoptionalIargumentq<[#1]isprovidedinordertosetloGcalvqaluesofcertainvariables,5forIexample,[\fboxrule=2pt] @couldappGearastheoptionalargumentinordertolo-Ically?changebGoxrulesize,Cwithouta ectingthegridlinesizeusedfordebugging.ITheplanistousethecommondenominatorof2.09and2e,so rstwede nesomeIdoubleUUargumentdouble-talk.E147S\long\def\L@dblarg#1{\@ifnextchar[{#1}{\L@xdblarg{#1}}} E148S\long\def\L@xdblarg#1#2{#1[]{#2}}IUsing~L5ffA͉TU>'ExX2eextensions,vthecommand\addresslabel[#1]{#2}couldbGecodedIasE\newcommand{\addresslabel}[2][]{...}.B{IncoGdingcommontoboth2.09IandUU2e,thefollowingworks:E149S\long\def\addresslabel{\L@dblarg{\@addresslabel}} E150S\long\def\@addresslabel[#1]#2{\genericlabel{#1%E151S\begin{tabular}{@{}p{\area@width}@{}}\raggedright#2\end{tabular}}}ITheamacro\boxedaddresslabel[#1]{#2}addsaframedbGoxaroundtheaddress IlabGelde nedabove.Thetroublehereisindeterminingtheboxwidth,whichisIreducedFfromitsnormalsizebythewidthsofthebGoxruleandruleseparator.IThe yoptionalargument[#1]isthesameasforthepreviousmacro,6buthereitIpGerformsjarealservice,becauseitisoftenthecasethatboxruleandboxseparatorIsizesUUshouldbGeadjustedlocally*.E152S\long\def\boxedaddresslabel{\L@dblarg{\@boxedaddresslabel}} E153S\long\def\@boxedaddresslabel[#1]#2{\genericlabel{#1%E154S\addr@width=\area@width\advance\addr@widthby-2\fboxsep%E155S\advance\addr@widthby-2\fboxrule\fbox{%E156S\begin{tabular}{@{}p{\addr@width}@{}}\raggedright#2\end{tabular}}}}ITheUUenvironmentlabels,forverbatimlabGels,willbede ned.E157S\long\def\labelsE158S{\iffirst@label\LabelSetup\first@labelfalse\fi\start@@label}E159S\def\endlabels{\end@@label}IThe9labGelcontents9aresaved9inaboxcalled\this@label,rformedasaraggedright Iminipagefofwidth\area@width.$ThetrickistomaketheendoflinecharacterIintofamacro^^Mfwhichgetsexecutedeachtimeitisencountered.BytestingforIblank_lines,b%wecan ndtheendofaseriesofconsecutiveaddresslinesandcauseIthe;macrototerminatethelabGelboxde nition,uandpossiblystartanother.zTheIusualactiontakenoninterceptofanendoflinecharacteristoinsert\newline.IIt|isonlythecaseofablanklinethatcausesustoendthecurrentlabGel.;Here,IswallowapGending^M,toavoidhavingablanklineatthestartofeachlabGel.70ExtraIblankSlinescauseblanklabGels,whicharethrownawaywhenencountered,lateron.E160S\def\start@@label{% E161S\savebox{\this@label}\bgroup\raggedright%E162S\begin{minipage}{\area@width}\raggedright%E163S\catcode`\^^M=\active\@gobblecr%12 .soE164S}% E165S\def\end@@label{%E166S\end{minipage}\egroup%E167S\sticky@label}%XTheYprincipalsuppGortmacrosneededtode nethelabelsenvironmentYwillbe Ide ned}bGelow.ThesemacrosassumenamesandaddressesappearasconsecutiveIlinesCseparatedbyablankline.=IfweareinthemiddleofconsecutiveaddressIlines,UUthenjuststartanewline.E168S\def\start@newline{\mbox{}\expandafter\newline}%IIfUUwehavemetablankline,then nishthecurrentlabGelandstartanewlabel.E169S\def\new@label{\end@@label\start@@label}%IThemacro^^Minvokeseither\start@newlineor\new@label.T*ode neit,we Iuse~somehackery~fromPhilT*aylor.SteponeistoactivqateacontrolsequenceatIendUUofline.E170S\catcode`\^^M=\active%ITheopaquede nitionrequiredusesfuturelettoselectivelyexpandacontrolIsequenceduringade nition. qThemacro^^MissuppGosedtoreplacecarriageIreturns #by\newline,orelseendthislabGelandstartanewonewith\new@label.ITherHideaistode ne^^MrAtobGeacontrolsequence\nexttoken,yactiveonlywhenI^^Mhas+bGeenmadeanactivecontrolsequence.0IThentheexpansionof^^M{#1}Iwill 3bGe\nexttoken,7jprovidedthenextline#1followingthecurrentonehasnoIcharactersܗ(exceptcarriagereturnattheend).IOtherwise,wemustbGeatthestartIofUUanewclusteroflabGellines.E171S\def^^M{\futurelet\nexttoken\isitapar}% E172S\def\isitapar{\ifx^^M\nexttoken\let\action=\new@label\else%E173S\let\action\start@newline\fi\action}%IDe nitionszinvolving^^MTare nished.?~Re-instatetheoriginalcatcoGdeforcarriage- Ireturn.E174S\catcode`\^^M=5\relax%IThesyntaxofthelabelsenvironmentcanbGeshortenedtoasingleline,providedIanminput lenameisknownandthecontentshavebGeenpreparedforusewiththeIlabelsUUenvironment.E175S\def\labelfile#1{\begin{labels}\input#1\end{labels}}IIntheinterestofageneralengineforlabGelproduction,theprogramcanpromptIforthe lenameatruntime.ThiskindoffeaturemakesitpGossibletorunoneIbatchUU letocreatelabGels,regardlessofthesource.E176S\def\promptlabels{\typein[\labelfilename]{Whatisthenameofthe E177Slabelfile?}E178S\labelfile{\labelfilename}}IIt]aispGossiblethatanumber]aofemptylabelsshouldbeprintedbeforegoingonto IprintthenextsetoflabGels.KThe\skiplabelsmacrotakesanintegerargumentofItheoBnumbGerofemptylabGelstoproduce.AnxisprintedontheterminalforeachIsuchUUemptylabGel.qF*orexample:[X\documentclass{article} [X\usepackage{labels}[X\begin{document}[X\numberoflabels=1913|soeY\boxedaddresslabel{Me\\mystreet\\mytown\\England} eY\skiplabels{2}%Make21onfirstsheet[X\numberoflabels=16eY\boxedaddresslabel{You\\yourstreet\\yourtown\\England}[X\end{document}E179S\newcount\sk@ppedE180S\def\skiplabels#1{\sk@pped=#1%E181S\savebox{\this@label}{\rule{0pt}{.5in}}%E182S\skip@labels=0\relaxE183S\loop\ifnum\skip@labels<\sk@pped\make@label%E184S\advance\skip@labelsby1\relax\repeat}E185Sh=pack9age#g i!čI4aLHistoryffandacknowledgementsXb(SPQR)8v.18May9th1989simplyallowedfor\addresslabel{...?\\...\\...}Xb(SPQR)v.2July15thpGermittedverbatimstylewithnoexplicitendoflinesXb(SPQR)UUv.3March1991mademoregenericXb(SPQR)Nv.4NJanuary1992checkedandmadetoworkwithemtexdriversto bmyUUsatisfaction,anddoGcumentedtobare-bGoneslevelwith`doGc'system.Xb(SPQR)UUv.5March1993allowedfor\skiplabelsXb(SPQR)UUv.6January1994forL5ffA͉TU>'ExX2"Xb(SPQR)UUv.7January1994 xesXb(SPQR)UUv.8April1994revised.dtx leXb(GG)Hv.9ZApril1995revised.dtx letoPackqageZsoitworkswitharticle,breport˪andbookclasses.Revisionsby7gustafson@math.utah.edu.MadebsourceD]indepGendentofpapersize(itdependedona4paper).>Fixedextrabspacesbugintabulararrayof\addresslabel-itdidnotreproGduceresultsbofthelabelsenvironment. Minipagelinesweren'tragged,=nowtheyare.bNew{?controlstosetspacesaroundlabGels.Correctedthelabelplacementbcomputations.3DErrorrepGortingforlabelsthataretoobigforthesetdi-bmensions.SRepGortinmillimeters.InvokedlabGelsetupatruntime.Newb\boxedaddresslabel[#1]{#2}.MicrometerwUplacementoflabGelgridonthebpage.j@IntroGduced>emptylabGelalgorithm.j@Gotridofstrangeerrormessages.Xb(GG)v.9UMay1995. Knewenvironment{labels}failedunderL5ffA͉TU>'ExX2.09b(1991),'-butworkedunderlaterversions!^De ning\labelsand\endlabelsb xedUUtheproblem.Xb(SPQR)UUv.10June1995.qCheckedUUandissued.IThecrucialmacroswhichmakethesystembGearableformailinglistsbyrede ningIend.oflinecamefromPhilT*aylor;apGologiestohimforusingtheminaL5ffA͉TU>'ExXIstyleUU le!14; + cmmi10K`y cmr10ٓRcmr7