; TeX output 1996.10.01:1457soe pDtGGcmr17Prinqting7tEnvelopsesandLabelsinLdKGXQ cmr12AT[-E;gX`2gG cmmi12"@\:}h!G cmsl12EnvLabPqackage7t!", cmsy10 nykBorisVVeytsman37 1996/07/15:ōINff cmbx12ContentsI"V cmbx101XIn9troQduction2I2XIden9ti cation 2I3XPreliminaryTcoQde3 XK`y cmr103.1oSwitches,UUetc.$..............................V3X3.2oLengthsUUandnumbGers.........................V4X3.3oMainUUsettingcommands&........................V4I4XDe ningToptions55X4.1oEnvelopGeUUSizesō.............................V5X4.2oLabGelsUUsizes1e...............................V5X4.3oOptionalUUswitches ............................V6X4.4oUnknownUUoptions8c............................V6X4.5oDefaultUUoptionsxl.............................V6I5XCon gurationT leuu6I6XProQcessingToptionsandloadingpac9k\ragesr7I7XDoQcumen9tTlayoutY7X7.1oPrinterUUspGeci ccommands?Y.......................V7X7.2oSomeUUusefulcountersforlabGels덍....................V8X7.3oEnvelopGeUUPlacement..........................V9X7.4oF*ontsjg...................................V9X7.5oReturnUUaddressxp.............................V10X7.6oMargins,UUpagestyles,etc........................V10X7.7oPrintingUUoftheaddresses........................V11X7.8oLabGelUUsetupMԍ...............................V11X7.9oEnvelopGeUUsetup.............................V12IX-ffr @ -:q% cmsy6L|{Ycmr8ThisX lehasvÎersionnumb'ExX2 b> cmmi10"+pletter.clsdoGcumentclassItypGesets5labelsonAvery5352sheets. A5typicalusermaywantmore. p0J cmsl10EnvLabIrede nesUU\makelabelsin^1ȲamoreusefulandcustomizablewayXThedetailedusageofthepackqageisdescribGedinthe leelguide.tex.KHereIweUUjustcommentthemacros.I2aLIdenti cationIFirst,UUwemustsay\Helloworld."Ls1S# cmsy9h$ow cmss9pack9age#g i Ls2S ߤN cmtt9\NeedsTeXFormat{LaTeX2e}Ls3S\ProvidesPackage{envlab}[1996/07/15v1.1EnvelopesandLabels]Ls4Sh"5" cmmi9=pack9age#g i\envlab@ok b\envlab@oopsINowletuscheckwhetherweintheletterdoGcumentclass.^Actuallywewillaccept IanyUUclassthathas\makelabelsde ned(customletterclasses,etc.)Ls5Shpack9age#g iLs6S\def\envlab@oops{%Ls7]\PackageError{envlab}%Ls8]{Envlabisusedoutsideof\MessageBreak%Ls9apaletter-compatibledocumentclass}%I10]{YouaretryingtouseEnvelopes&Labels\MessageBreak%I11appackage,butyourdocumentclassdoesnot\MessageBreak%I12apunderstandaddressformattingcommands.\MessageBreak%I13apTrystandarddocumentclassletter\MessageBreak}}I14S\def\envlab@ok{%I15]\PackageInfo{envlab}%I16]{Envelopes&Labelspackage:foundmakelabels...\MessageBreak%I17]SeemseverythingisOK.Goodluck.}}I18S\expandafter\ifx\csnamemakelabels\endcsname\relax%I19]\envlab@oops\else\envlab@ok\fiI20Sh=pack9age#g iIfffr J= "5-:Aacmr61LhopXbEnvelopGesUUmighthavereturnaddress,labGelsmightnotXbEnvelopGesUUarerotatedbydefault,labelsareneverrotated~I21Shpack9age#g i I22S\newif\if@envelopeI23S\@envelopetrueI24Sh=pack9age#g i?XNowb\wemustdeterminewhetherwewanttorotateenvelopGesandwhetherto9\if@rotateenvelopes \if@printreturnaddressIincludeUUreturnaddress(bGothyesbydefault). tI25Shpack9age#g iI26S\newif\if@rotateenvelopesI27S\@rotateenvelopestrueI28S\newif\if@printreturnaddressI29S\@printreturnaddresstrueI30Sh=pack9age#g itXNowjletusdecidehowtoprintenvelopGes.vTheycanbeeithercentered(de-t\@envelopepositionIfault)[_*': cmti10ornshiftedtotheleftortotherightofthepapGertray*. ThecounterI\@envelopepositionpcanbGe,wcorrespondingly*,eitherp0or1or2.&Thevqalueof3IcorrespGondstothe\customplacing",*whentheusersets\EnvelopeLeftMarginImanually*.?I31Shpack9age#g iI32S\newcount\@envelopeposition\@envelopeposition=0\relaxI33Sh=pack9age#g i?XThexswitch\if@pswaitcontrolsoptionalmanualfeedingofenvelopGesand$\if@pswaitIlabGelsUUinPostscript printersUU(seeSection7.1fordetails). tI34Shpack9age#g iI35S\newif\if@pswaitI36S\@pswaitfalseI37Sh=pack9age#g itXW*e caneitherprintbarcoGdes(default)ornot.ThesecondswitchforcestoL\if@barcodest\if@alwaysbarcodesIprintUUbarcoGdeseveniftheyarenotlastintheaddress(likePa?16801\\USA) tI38Shpack9age#g iI39S\newif\if@barcodesI40S\newif\if@alwaysbarcodesI41S\@barcodestrueI42S\@alwaysbarcodesfalseI43Sh=pack9age#g itXAlso,UUwecaneithercapitalizetheaddress(default)ornot.Ʋ\if@capitalizeaddressI44Shpack9age#g iI45S\newif\if@capitalizeaddressI46S\@capitalizeaddresstrueI47Sh=pack9age#g i3,qsoI3.2gLengthsandnumb`ersuTIW*eUUwantalllengthstobGeusersettable,sono@inthenames. XAn$envelopGehasfourbasiclengths.P The rsttwoareself-evident.P Thethirdis\EnvelopeWidth 6\EnvelopeHeightt\EnvelopeTopMargin$9\EnvelopeLeftMarginIthehdistancebGetweenhtheedgeofthepaperandtheleadingedgeoftheenvelope.IAll;`pre-de nedenvelopGe;`sizessetthistozero.i ThefourthisthedistancebetweenIthe7-leftedgeofthepapGerandtheenvelope.gIts7-vqaluedependsonthevqalueoftheI\@envelopepositionUUvqariable.qW*ewillpresetittozero I48Shpack9age#g i I49S\newlength{\EnvelopeWidth}I50S\newlength{\EnvelopeHeight}I51S\newlength{\EnvelopeTopMargin}I52S\newlength{\EnvelopeLeftMargin}I53S\setlength{\EnvelopeLeftMargin}{0pt}I54Sh=pack9age#g iXA;labGel;hasmoreparameters.i>The rsttwo;arethesameasfortheenvelopes. \LabelWidth L\LabelHeight 6\LabelTopMargin$f\LabelLeftMargin0 \LabelRightMargin IThenexttwode nethedistancesfromthepapGeredgestothebeginningoftheIlabGels.qTheUUlastonedescribesthedistancebetweenUUthelabels.I55Shpack9age#g i I56S\newlength{\LabelWidth}I57S\newlength{\LabelHeight}I58S\newlength{\LabelTopMargin}I59S\newlength{\LabelLeftMargin}I60S\newlength{\LabelRightMargin}I61Sh=pack9age#g iXThenfollowingnumbGersde ne,6howmanylabGelsareineachrowandhowmany LabelMaxCol LabelMaxRow IrowsUUareoneachpageI62Shpack9age#g iI63S\newcounter{LabelMaxCol}I64S\newcounter{LabelMaxRow}I65Sh=pack9age#g iXThe'lengthsabGove'areexternal0{parametersthatdetermineanenvelope'ora IlabGel.u'ExX2". hoGoksI\AtBeginDocument,\AtBeginDvi,etc.LIntheimplementationweusetheinternalIL5ffA͉TU>'ExX2"qܲcommand02\g@addto@macro.efInthecurrent(June1996)L5ffA͉TU>'ExX2"+releaseIitUUisde nedas:\g@addto@macroM\long\def\g@addto@macro#1#2{{% W,\toks@\expandafter{#1#2}%W,\xdef#1{\the\toks@}}}IW*eUUquotethisde nitionincaseThey7ҲchangeTheirminds... GǍE183Shpack9age#g iE184S\def\AtBeginLabels{\g@addto@macro\@beginlabelshook}E185S\def\AtBeginLabelPage{\g@addto@macro\@beginlabelpagehook}E186Sh=pack9age#g i3P\PSwaitIPostScript. GǍE187Shpack9age#g iE188S\def\PSwait{\special{ps:cleargrestore@manualfeed00bop}}E189Sh=pack9age#g iGǍITheUUauthorexplainshiscoGdeinthefollowingway:qHereUUisapGossibleexplanation:qTheBclearremovesBopGerandsfromthePostScriptstack,=whichhasbthee ectofreversingsomeactionsfromthe*previous*bGop.RUnfortu-bnately*,gitd)reversesotherimpGortantactionstoGo(suchasfontsize),gbutbthegrestoreseemstogettheseback. jThenthedesired@manualfeed,bfollowedױbythe\bGop"forthebeginningofpage.Thepairof0'sarebusedyforbGopandarecompletelybogus.4However,BfromywhatI[couldbdetect,20'sareasgoGodasanything.?ThevqaluesthatDVIPSprovidesbforUUbGopseemtoberelatedtoDVIpagenumbGers.qI~ymake~noguaranteeabGoutthereliabilityofthissolution,butinitialbtestsUUindicateitwillworkformyenvironment.UXTheUUoptionpswaitputsthe\PSwaitcoGdeinthebeginningofeachpage. GǍE190Shpack9age#g iE191S\if@pswaitE192]\AtBeginLabels{\PSwait}%E193S\fiE194Sh=pack9age#g i_I7.2gSomeusefulcountersforlab`elsuTITheseUUcountersstorethepGositionofthecurrentlyprintedlabGel:bLabelCountColbLabelCountRow GǍE195Shpack9age#g iE196S\newcounter{LabelCountCol}E197S\newcounter{LabelCountRow}E198Sh=pack9age#g i8 gsoXAndSthesecountersprovidetheo setforthelabGelprintedonapartiallyusedLabelOffsetCol LabelOffsetRow Isheet:E199Shpack9age#g i E200S\newcounter{LabelOffsetCol}E201S\newcounter{LabelOffsetRow}E202S\setcounter{LabelOffsetCol}{1}E203S\setcounter{LabelOffsetRow}{1}E204Sh=pack9age#g i L\FirstLabelITheHicommand\FirstLabel{hR}'owid}{hColi}setsthecountersLabelOffsetRowIandUULabelOffsetCol.E205Shpack9age#g iE206S\DeclareRobustCommand{\FirstLabel}[2]{%E207]\setcounter{LabelOffsetRow}{#1}%E208]\setcounter{LabelOffsetCol}{#2}}E209Sh=pack9age#g i6I7.3gEnvelop`ePlacementuTINowUUwecancalculate\EnvelopeLeftMarginE210Shpack9age#g iE211S\ifcase\the\@envelopepositionE212]\setlength{\EnvelopeLeftMargin}{\paperwidth}E213]\if@rotateenvelopesE214f\addtolength{\EnvelopeLeftMargin}{-\EnvelopeHeight}E215]\elseE216f\addtolength{\EnvelopeLeftMargin}{-\EnvelopeWidth}E217]\fiE218]\setlength{\EnvelopeLeftMargin}{0.5\EnvelopeLeftMargin}E219S\orE220]\setlength{\EnvelopeLeftMargin}{0pt}E221S\orE222]\setlength{\EnvelopeLeftMargin}{\paperwidth}E223]\if@rotateenvelopesE224f\addtolength{\EnvelopeLeftMargin}{-\EnvelopeHeight}E225]\elseE226f\addtolength{\EnvelopeLeftMargin}{-\EnvelopeWidth}E227]\fiE228S\elseE229]\relaxE230S\fiE231Sh=pack9age#g i6I7.4gFontsuTf\@toaddressfont t\@fromaddressfontIW*ewanttheaddresstobGeprintedin+R6 cmss1212ptO sansserif{font.rThereturnaddress IwillUUbGeprintedin10ptnormalfont.E232Shpack9age#g iE233S\def\@toaddressfont{%E234]\ifcase\@ptsize\large\or\normalsize\or\small\fi%E235]\sffamily\selectfont}E236S\def\@fromaddressfont{%9 t\soE237]\ifcase\@ptsize\normalsize\or\small\or\footnotesize\fi% E238]\normalfont}E239Sh=pack9age#g i6I7.5gReturnaddressuTIThestandardletterclassde nes\returnaddresstobGenull.%Thisissensibleif\returnaddress IweC#areprintinglabGels,Fbutnotsogoodifweareprintingenvelop}'es.kThereforeletIusUUrede neit:E240Shpack9age#g i E241S\def\returnaddress{\if@envelope\fromaddress\else\relax\fi}E242Sh=pack9age#g iI7.6gMargins,pagestyles,etc.uTb\startlabelsIThe–command\startlabelsistheinternalcommandthatpreparesthepapGerfor IlabGelsUUorenvelopes,UUresetstheinternalcountersandcalls\@beginlabelshook.E243Shpack9age#g iE244S\def\startlabels{%E245]\pagestyle{empty}E246]\setlength{\topmargin}{-1.0in}E247]\if@envelopeE248f\addtolength{\topmargin}{\EnvelopeTopMargin}E249f\else\addtolength{\topmargin}{\LabelTopMargin}E250]\fiE251]\setlength{\headheight}{0pt}E252]\setlength{\headsep}{0pt}E253]\setlength{\footskip}{0pt}E254]\setlength{\textheight}{200in}E255]\setlength\paperheight{\textheight}E256]\global\vsize=200in\relaxE257]\addtolength{\textheight}{-\topmargin}E258]\addtolength{\textheight}{-1.0in}E259]\setlength{\oddsidemargin}{-1.0in}E260]\setlength{\evensidemargin}{\oddsidemargin}E261]\setlength{\textwidth}{20in}E262]\hsize=20inE263]\baselineskip=0ptE264]\lineskip=0ptE265]\parindent=0ptE266]\if@envelope\relax\elseE267f\setcounter{LabelCountCol}{\theLabelOffsetCol}E268f\setcounter{LabelCountRow}{\theLabelOffsetRow}E269f\ifnum\theLabelOffsetRow>1E270p2\nullE271p2\loop\vspace*{\LabelHeight}E272yw^\addtocounter{LabelOffsetRow}{-1}\ifnum\theLabelOffsetRow>1E273p2\repeatE274f\fiE275f\ifnum\theLabelOffsetCol>1E276p2\loop\hspace*{\LabelWidth}\nolinebreakE277yw^\addtocounter{LabelOffsetCol}{-1}\ifnum\theLabelOffsetCol>1E278p2\repeat10 ~soE279f\fi E280f\nopagebreakE281]\fiE282]\spaceskip0pt\relaxE283]\xspaceskip0pt\relaxE284]\clubpenalty=0E285]\widowpenalty=0E286]\raggedbottomE287]\sloppyE288]\setlength\hfuzz{5in}E289]\setlength\vfuzz{5in}E290]\ignorespacesE291]\@beginlabelshookE292]\@beginlabelpagehookE293]\nopagebreak}E294Sh=pack9age#g i6I7.7gPrintingoftheaddressesuTIThisTNmacrousesthetextasanargumentandprintsitaccordingtotheconventions.9\PrintReturnAddressE295Shpack9age#g iE296S\newcommand{\PrintReturnAddress}[1]{%E297]\vspace*{\FromAddressTopMargin}E298]\null\hspace{\FromAddressLeftMargin}E299]\parbox[t][\FromAddressHeight]{\FromAddressWidth}%E300f{\@fromaddressfont\lineskip=1ptE301p2\if@printreturnaddress#1\else\relax\fi}}E302Sh=pack9age#g iXThismacroworkslike\PrintReturnAddress,5uwithseveralimpGortantdi er-b\PrintAddress Iences:qitUUprintsbarcoGdesifnecessaryand]޲capitalizestheaddress.E303Shpack9age#g iE304S\newcommand{\PrintAddress}[1]{%E305]\vspace*{\ToAddressTopMargin}E306]\leavevmodeE307]\null\hspace*{\ToAddressLeftMargin}E308]\parbox[t]{\ToAddressWidth}{%E309f\lineskip=1ptE310f\if@barcodes\PrintBarCode{#1}\fiE311f\@toaddressfontE312f\if@capitalizeaddress\@make@capitalize{#1}\else#1\fi}}E313Sh=pack9age#g i6I7.8gLab`elsetupuTIThisUUmacroprintsalabGelinaparbox \PrintLabelE314Shpack9age#g iE315S\newcommand{\PrintLabel}[1]{%E316]\parbox[t][\LabelHeight]{\LabelWidth}{%E317f\PrintAddress{#1}}}E318Sh=pack9age#g i11 UsoI7.9gEnvelop`esetupuTILabGelsvincludeoneboxperlabel,Isotheirsetupissimple.xThesituationwith IenvelopGesEisdi erent:jtheycontainseveralbGoxes,HandcouldbGerotated,centered,Ietc.XThisUUmacromakesaminipagewithaddressesonit.\PrintEnvelopeE319Shpack9age#g i E320S\newcommand{\PrintEnvelope}[2]{%E321]\begin{minipage}[t][\EnvelopeHeight]{\EnvelopeWidth}E322f\baselineskip=0ptE323f\lineskip=0ptE324f\parindent=0ptE325f\PrintReturnAddress{#1}\\E326f\begin{center}E327p2\PrintAddress{#2}E328f\end{center}E329]\end{minipage}}E330Sh=pack9age#g iXTheUUfollowingmacrochecksforrotation: 6\@PrintEnvelopeE331Shpack9age#g iE332S\newcommand{\@PrintEnvelope}[2]{%E333]\if@rotateenvelopes\rotatebox{90}{\PrintEnvelope{#1}{#2}}E334]\else\PrintEnvelope{#1}{#2}E335]\fi}E336Sh=pack9age#g i!čI8aLPrintingffofenvelops3esandlabelsI8.1gMainCommanduT3P\mlabelINowwearepreparedtoprintactualenvelopGesandlabels.Itisdonebythe I\mlabelUUcommand.qIthastwoUUforms:forlabGelsandenvelopes.E337Shpack9age#g iE338S\renewcommand{\mlabel}[2]{\ignorespaces%E339]\spaceskip0pt\relax%E340]\xspaceskip0pt\relax%E341Sh=pack9age#g i6I8.2gPrintingofoneenvelop`euTE342Shpack9age#g iE343]\if@envelope%E344f\leavevmode%E345f\hspace*{\EnvelopeLeftMargin}%E346f\@PrintEnvelope{#1}{#2}%E347f\clearpage%E348f\@beginlabelpagehook%E349Sh=pack9age#g iI8.3gPrintingofonelab`eluTE350Shpack9age#g i12 GsoE351]\else% E352f\ignorespaces%E353f\ifnum\theLabelCountCol>\theLabelMaxCol%E354p2\\\nopagebreak%E355p2\stepcounter{LabelCountRow}%E356p2\setcounter{LabelCountCol}{1}%E357f\fi%E358f\ifnum\theLabelCountRow>\theLabelMaxRow%E359p2\vfill\eject\@beginlabelpagehook%E360p2\setcounter{LabelCountRow}{1}%E361p2\setcounter{LabelCountCol}{1}%E362f\fi%E363f\PrintLabel{#2}\ignorespaces\nolinebreak%E364f\stepcounter{LabelCountCol}%E365]\fi}E366Sh=pack9age#g i6I8.4gPrintingofreturnlab`elsuTIW*e-printonlymailingaddressesonlabGels.,eTheuserissupposedtohave-preprinted IreturnFlabGels.lHerewedescribeautilityforprintingthem.lThisutilityshouldbGeIusedUUinaseparatedoGcument.XThecounter\@numreturnlabelsstoresthenumbGerofreturnlabelstobe \@numreturnlabelsIprinted.qNoteUUthatitisaTU>'ExXcounter,notaL5ffA͉TU>'ExXone.E367Shpack9age#g i E368S\newcount\@numreturnlabelsE369Sh=pack9age#g iXThismacrohastwoparameters:'thenumbGeroflabelstobeprintedandthet\printreturnlabels ItextUUthatisprinted.qItisthesameonalllabGels.E370Shpack9age#g iE371S\newcommand{\printreturnlabels}[2]{%E372]\@numreturnlabels=#1E373]\def\@toaddressfont{\@fromaddressfont}E374]\@capitalizeaddressfalseE375]\@barcodesfalseE376]\startlabelsE377]\loop\mlabel{\relax}{#2}\advance\@numreturnlabelsby-1E378f\ifnum\@numreturnlabels>0\repeat}E379Sh=pack9age#g i!čI9aLBarcos3desI9.1gMaincommanduTITheUSPSPostnetcoGdesareprintedaccordinglytothespGeci cationsRef.[2]./The IscanningUUalgorithmisstolenfromDavidCarlisle's(m#R cmss10enumeratepackqage[1].XFirst,we}extractbarcoGdesbythecommand\@extractbarcode.)Thenweprintb\PrintBarCodeIthemUUby\@printbarcode.E380Shpack9age#g i E381S\newcommand{\PrintBarCode}[1]{%E382]\@extractbarcode{#1}13%soE383]\@printbarcode} E384Sh=pack9age#g iI9.2gExtractionofbarco`desuTIW*eUUde nezipGcodeUUasasequenceofdigits(0{9)that: XbHasUUnocharactersotherthandigitsanddashes(-)insideit؍XbHasUUnobracketedUUgroupsinsideitandisnotbracketedUUitselfXbIsUUthelastintheaddress eldunless\if@alwaysbarcodes=trueXW*ebprintthissequenceplusthec}'ontrolOcharacter. Theblatterisde nedas Iminus#msumofdigitsofthezipcoGdemodulo10(thatis,VthecomplementoftheIsumUUofdigitstoamultipleof10).XFirst,someRinternalregisters.hetokenlist\@zipcodecontainsbarcoGdefoundy\@zipcodeL\@zipcodesum\@zipcodefoundIso5far.g5Theregister\@zipcodesum rstcontainsthesumofdigitsofthebarcoGde,Iandthenthecontrolcharacter.XTheswitch\@zipcodefoundshowswhetherweIfoundUUzipcoGdesofar. lE385Shpack9age#g i E386S\newtoks\@zipcodeE387S\newcount\@zipcodesumE388S\newif\if@zipcodefoundE389Sh=pack9age#g ilXThereUUaretwoUUmoGdesforgobblingtokens:IXStateUUA:rvW*efareoutsideapGotentialzipcodesequence(\if@zipcodefound=false)؍IÍStateUUB:rvW*eUUareinsideapGotentialzipcodesequence(\if@zipcodefound=true)XbIfwemeetinanystatethespGecialtoken\@endaddress,kwegobbleitandL\@endaddress 6\@finishzipcode b nishUUtheloGop.؍E390lhpack9age#g iE391l\long\def\@finishzipcode#1{}E392lh=pack9age#g iXbIfZwemeetanumbGer(0{9)instateA,weinitializeregisters,proGcessthe\@firstzipcode btokenUUandgotostateB؍E393lhpack9age#g iE394l\long\def\@firstzipcode#1{%E395v\global\@zipcode{#1}E396v\global\@zipcodesum=#1\relaxE397v\global\@zipcodefoundtrueE398v\@zipcodeloop}E399lh=pack9age#g iXbIfUUwemeetanumbGer(0{9)instateB,wejustproGcessit. \@continuezipcode؍E400lhpack9age#g iE401l\long\def\@continuezipcode#1{%E402v\global\@zipcode=\expandafter{\the\@zipcode#1}E403v\global\advance\@zipcodesumby#1E404v\@zipcodeloop}E405lh=pack9age#g i14ɠsoXbIfUUwemeetadashinstateB,wegobbleit.b\@dashzipcodeE406lhpack9age#g i E407l\long\def\@dashzipcode#1{\@zipcodeloop}E408lh=pack9age#g iXbIfwemeetaspaceinanystate,+wegobbleitandgotothestateA.sThe\@spacezipcode btrickUUisfromCarlisle'senumeratepackqage.E409lhpack9age#g iE410l\def\@spacezipcode{%E411v\global\@zipcodefoundfalseE412v\afterassignment\@zipcodeloop\let\@temp=}E413lh=pack9age#g iXbIfUUwemeetanythingelseinanymoGde,wegobbleitandgotostateA\@abortzipcodeE414lhpack9age#g iE415l\long\def\@abortzipcode#1{%E416v\global\@zipcodefoundfalseE417v\@zipcodeloop}E418lh=pack9age#g i*XThismacroissimple.!W*ejustputthenexttokeninto\@tempandproGcessitb\@zipcodeloop !|\@temp IthroughUU\@zipcodeloop@. UE419Shpack9age#g iE420S\def\@zipcodeloop{\futurelet\@temp\@zipcodeloop@}E421Sh=pack9age#g iUXThis`macropGerformsactualprocessing...W*e`putthecommandthatgobbles\@zipcodeloop@\@tempaItheUUnexttokeninto\@tempa UE422Shpack9age#g iE423S\def\@zipcodeloop@{%E424]\ifx\@endaddress\@tempY\def\@tempa{\@finishzipcode}X\elseE425]\ifx0\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E426x\else3r\def\@tempa{\@firstzipcode}\fi\elseE427]\ifx1\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E428x\else3r\def\@tempa{\@firstzipcode}\fi\elseE429]\ifx2\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E430x\else3r\def\@tempa{\@firstzipcode}\fi\elseE431]\ifx3\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E432x\else3r\def\@tempa{\@firstzipcode}\fi\elseE433]\ifx4\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E434x\else3r\def\@tempa{\@firstzipcode}\fi\elseE435]\ifx5\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E436x\else3r\def\@tempa{\@firstzipcode}\fi\elseE437]\ifx6\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E438x\else3r\def\@tempa{\@firstzipcode}\fi\elseE439]\ifx7\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E440x\else3r\def\@tempa{\@firstzipcode}\fi\elseE441]\ifx8\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E442x\else3r\def\@tempa{\@firstzipcode}\fi\elseE443]\ifx9\@temp\if@zipcodefound\def\@tempa{\@continuezipcode}E444x\else3r\def\@tempa{\@firstzipcode}\fi\elseE445]\ifx-\@temp\if@zipcodefound\def\@tempa{\@dashzipcode}E446x\else3r\def\@tempa{\@abortzipcode}\fi\else158soE447]\ifx\@sptoken\@temp*F\def\@tempa{\@spacezipcode}\else E448#\def\@tempa{\@abortzipcode}E449]\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fiE450]\@tempa}E451Sh=pack9age#g iXThemcommand\@extractbarcodeputsbarcoGdeintothe\@zipcode,tandcal-f\@extractbarcode IculatesUUthecontrolcharacter(10minussumofthedigitsofthebarcoGde).E452Shpack9age#g iE453S\long\def\@extractbarcode#1{%E454]\@zipcodefoundfalseE455]\@zipcodeloop#1\@endaddressE456]\if@alwaysbarcodes\@zipcodefoundtrue\fiE457]\if@zipcodefoundE458f\ifnum\the\@zipcodesum>0E459p2\loop\global\advance\@zipcodesumby-10\ifnum\the\@zipcodesum>0E460p2\repeatE461f\fiE462f\global\multiply\@zipcodesumby-1E463]\fi}E464Sh=pack9age#g i6I9.3gPrintingbarco`desuTIFirst,qsomelengths.C\L"wand\S"bGelowreferto\long"and\short"barscorre-\@barcodewidthf\@barcodeLheightf\@barcodeSheight$b\@barcodeskipIspGondingly*.E465Shpack9age#g iE466S\newlength{\@barcodewidth}E467S\newlength{\@barcodeLheight}E468S\newlength{\@barcodeSheight}E469S\newlength{\@barcodeskip}E470S\setlength{\@barcodewidth}{0.020in}E471S\setlength{\@barcodeLheight}{0.125in}E472S\setlength{\@barcodeSheight}{0.050in}E473S\setlength{\@barcodeskip}{0.026in}E474Sh=pack9age#g iXTheUUfollowingmacrosprintlongandshortbars.!|\@barL!|\@barSE475Shpack9age#g iE476S\DeclareRobustCommand{\@barL}{%E477]\rule{\@barcodewidth}{\@barcodeLheight}\hspace{\@barcodeskip}}E478S\DeclareRobustCommand{\@barS}{%E479]\rule{\@barcodewidth}{\@barcodeSheight}\hspace{\@barcodeskip}}E480Sh=pack9age#g iXTheJscanningof\@zipcodeissimplerthanthescanningoftheaddress:theb\@printonezip\@printbarcodeIonlyBtokenswecanmeetaredigits.'W*ell, wewilladdanendmarkingtokentoItheUUlist.qLetitbGetheletter\S"(from\Stop").E481Shpack9age#g iE482S\def\@printonezip#1{%E483]\ifx1#1\@barS\@barS\@barS\@barL\@barL\elseE484]\ifx2#1\@barS\@barS\@barL\@barS\@barL\elseE485]\ifx3#1\@barS\@barS\@barL\@barL\@barS\elseE486]\ifx4#1\@barS\@barL\@barS\@barS\@barL\else16soE487]\ifx5#1\@barS\@barL\@barS\@barL\@barS\else E488]\ifx6#1\@barS\@barL\@barL\@barS\@barS\elseE489]\ifx7#1\@barL\@barS\@barS\@barS\@barL\elseE490]\ifx8#1\@barL\@barS\@barS\@barL\@barS\elseE491]\ifx9#1\@barL\@barS\@barL\@barS\@barS\elseE492]\ifx0#1\@barL\@barL\@barS\@barS\@barS\elseE493]\ifxS#1\def\@tempa{\relax}%E494]\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%E495]\@tempa}E496S\def\@printbarcode{%E497]\if@zipcodefoundE498ap\mbox{%E499f\@barL%E500f\def\@tempa{\@printonezip}%E501f\expandafter\@tempa\the\@zipcodeS%E502f\def\@tempa{\@printonezip}%E503f\expandafter\@tempa\the\@zipcodesumS%E504f\@barL}E505f\\[1ex]E506]\fi}E507Sh=pack9age#g i!čI10ifdCapitalizationIThese)macrosproGcesstheaddress(actually*,^anystring)accordingtotheUSPS Irecommendations.qSpGeci cally*,UUthey:XbStrip6dots(.)jandcommas(,)nfromtheaddressunlesstheyareenclosedinbbracketsXbMakeUUalllettersuppGercaseXbAddUU1ptspacebGetweenUUlettersXbAddUU1emspacebGetweenUUwordsIAn%interestingquestioniswhetherweshouldde-accentaccentedletters.USPSIsays_nothingabGoutit.Inthepresentversionaccentsarenot7strippGed.HoweverIduetothescanningalgorithmtheyshouldbGeenclosedbybrackets,Olikethis:I{\u?S}andor{\cC}edi.XW*eUUstorethecapitalizedaddressinthetokenlist\@addr@cap.$\@addr@capE508Shpack9age#g i E509S\newtoks\@addr@capE510Sh=pack9age#g iXTheUUfollowingmacrosproGcessthetokensonebyone. XIfUUwemeetthespGecialtoken\@endaddress,wegobbleitandstop. 6\@finishaddrcapE511Shpack9age#g iE512S\long\def\@finishaddrcap#1{}E513Sh=pack9age#g iXIfpwemeetcommaordot, wwegobbleitanddonotHstop."Thismacroisalso \@dotcommaaddrcap IusefulUUforgobblingL5ffA͉TU>'ExX2"+Tletterxcommandslike\voidb@xand\unhbox.E514Shpack9age#g i17#soE515S\long\def\@dotcommaaddrcap#1{% E516]\@addrcaploop}E517Sh=pack9age#g iXIfUUwemeet\\,weaddittothelistf\@newlineaddrcap E518Shpack9age#g iE519S\long\def\@newlineaddrcap#1{%E520]\global\@addr@cap=\expandafter{\the\@addr@cap#1}E521]\@addrcaploop}E522Sh=pack9age#g iXIfUUwemeet\bgroup,weaddittothelistthecompletegroup(uppGercase) 6\@bgroupaddrcap E523Shpack9age#g iE524S\long\def\@bgroupaddrcap#1{%E525]\global\@addr@cap=\expandafter{\the\@addr@cap{\MakeUppercase{#1}}}E526]\@addrcaploop}E527Sh=pack9age#g iXIfUUwemeetaspacewegobbleit(oh-oh)andaddittothelist.\@spaceaddrcap E528Shpack9age#g iE529S\def\@spaceaddrcap{%E530]\global\@addr@cap=\expandafter{\the\@addr@cap\hspace{0.6em}}E531]\afterassignment\@addrcaploop\let\@temp=}E532Sh=pack9age#g iXAndUUifwemeetanythingelse,wemakeituppGercaseandaddtothelist\@otheraddrcap E533Shpack9age#g iE534S\def\@otheraddrcap#1{%E535]\global\@addr@cap=\expandafter{\the\@addr@cap%E536kJ\MakeUppercase{#1}\kern1pt\relax}E537]\@addrcaploop}E538Sh=pack9age#g iXThismacroissimple.!W*ejustputthenexttokeninto\@tempandproGcessitb\@addrcaploop IthroughUU\@addrcaploop@. E539Shpack9age#g iE540S\def\@addrcaploop{\futurelet\@temp\@addrcaploop@}E541Sh=pack9age#g iXThisUUmacropGerformsactualprocessing...\@addrcaploop@ E542Shpack9age#g iE543S\def\@addrcaploop@{%E544]\ifx\@endaddress\@tempY\def\@tempa{\@finishaddrcap}X\elseE545]\ifx.\@tempPR\def\@tempa{\@dotcommaaddrcap} s,\elseE546]\ifx,\@tempPR\def\@tempa{\@dotcommaaddrcap} s,\elseE547]\ifx\voidb@x\@temp/?\def\@tempa{\@dotcommaaddrcap} s,\elseE548]\ifx\unhbox\@temp8\def\@tempa{\@dotcommaaddrcap}\elseE549]\ifx\\\@tempK`\def\@tempa{\@newlineaddrcap},\elseE550]\ifx\bgroup\@temp3r\def\@tempa{\@bgroupaddrcap}X\elseE551]\ifx\@sptoken\@temp*F\def\@tempa{\@spaceaddrcap}\elseE552#\def\@tempa{\@otheraddrcap}E553]\fi\fi\fi\fi\fi\fi\fi\fiE554]\@tempa}E555Sh=pack9age#g i \@make@capitalize E556Shpack9age#g i18ӷsoE557S\long\def\@make@capitalize#1{% E558]\global\@addr@cap={\relax}E559]\@addrcaploop#1\@endaddressE560]\the\@addr@cap}E561Shpack9age#g i19csoIReferencesI[1]X;DavidUUCarlisle.nThe-U cmssi10enumeratep}'ackage.CT*AN,UUv2.02,January1994.I[2]X;USPS.nDesigningBusinessL}'etterMail(Pub25),UUAugust1995.20soIIndexINumbGerswritteninitalicrefertothepagewherethecorrespondingentryisde- IscribGed,Dthe onesunderlinedtothecodelineofthede nition,DtheresttothecodeIlinesUUwheretheentryisused.ǍI!o cmr9abAelCoun9tCol=X\subitem*+LabelCountCol+,\usage{8} hIabAelCoun9tRow=X\subitem*+LabelCountRow+,\usage{8}IabAelMaxCol=X\subitem*+LabelMaxCol+,\usage{4}IabAelMaxRo9w=X\subitem*+LabelMaxRow+,\usage{4}IabAelO setCol=X\subitem*+LabelOffsetCol+,\usage{9}IabAelO setRo9w=X\subitem*+LabelOffsetRow+,\usage{9}IA9tBeginLabAelPage=X\subitem*+\AtBeginLabelPage+,\main{183}IA9tBeginLabAels=X\subitem*+\AtBeginLabels+,\main{183},192:.IEn9velopAeHeight=X\subitem*+\EnvelopeHeight+,\usage{4},50,80,83,214,224,321IEn9velopAeLeftMargin=X\subitem*+\EnvelopeLeftMargin+,\usage{4},52,53,212,214,216,218, g220,!*222,g224,s226,345 hIEn9velopAeT:opMargin=X\subitem*+\EnvelopeTopMargin+,\usage{4},51,78,248IEn9velopAeWidth=X\subitem*+\EnvelopeWidth+,\usage{4},49,79,84,216,226,321Iok=X\subitemok+,\main{5}IoAops=X\subitemoops+,\main{5}IFirstLabAel=X\subitem*+\FirstLabel+,\main{205}IF:romAddressHeigh9t=X\subitem*+\FromAddressHeight+,\usage{4},69,83,299IF:romAddressLeftMargin=X\subitem*+\FromAddressLeftMargin+,\usage{4},68,82,298IF:romAddressTopMargin=X\subitem*+\FromAddressTopMargin+,\usage{4},67,81,297IF:romAddressWidth=X\subitem*+\FromAddressWidth+,\usage{4},70,84,299ªalw9aysbarcoAdes=X\subitemalwaysbarcodes+,\usage{3},40,456 ªbarcoAdes=X\subitembarcodes+,\usage{3},39,310ªcapitalizeaddress=X\subitemcapitalizeaddress+,\usage{3},45,312ªen9velopAe=X\subitemenvelope+,\usage{3},22,241,247,266,343ªprin9treturnaddress=X\subitemprintreturnaddress+,\usage{3},28,301ªpsw9ait=X\subitempswait+,\usage{3},35,191ªrotateen9velopAes=X\subitemrotateenvelopes+,\usage{3},26,213,223,333ªzipAcodefound=X\subitemzipcodefound+,388,425,427,429,431,433,435,437,439,441,બ443,'%445,457,497ªIfFileExists=X\subitem*+\IfFileExists+,170ªLabAelHeigh9t=X\subitem*+\LabelHeight+,\usage{4},57,93,271,316ªLabAelLeftMargin=X\subitem*+\LabelLeftMargin+,\usage{4},59,95ªLabAelRigh9tMargin=X\subitem*+\LabelRightMargin+,\usage{4},60,96,103ªLabAelT:opMargin=X\subitem*+\LabelTopMargin+,\usage{4},58,94,249ªLabAelWidth=X\subitem*+\LabelWidth+,\usage{4},56,92,101,276,316ªmlabAel=X\subitem*+\mlabel+,\main{337},377ªP9ack|rageW:arning=X\subitem*+\PackageWarning+,172ªPrin9tAddress=X\subitem*+\PrintAddress+,\usage{11},304,317,327ªPrin9tBarCoAde=X\subitem*+\PrintBarCode+,\usage{13},310,381ªPrin9tEnvelopAe=X\subitem*+\PrintEnvelope+,\usage{12},320,333,334ªPrin9tLabAel=X\subitem*+\PrintLabel+,\usage{11},315,363 cmmi10K`y cmr10ٓRcmr78