; TeX output 1997.02.18:1031soQDtGGcmr17Creating7tamailingeFXQ cmr12JohannesBraamsseptemrbSer7,1994:ōINff cmbx121aLIntros3ductionIK`y cmr10This=packqageisintendedtobGeusedwhenyouwanttosendalargenumbGerof Iletters,UUallwith(almost)thesametext.XThispackqageisbasedontheformerstyleoption'ExX,theuserwillbeaskedtosupplyadi erentname.XTheUUaddress leshouldhaveUUthefollowingformat:INameofaddressee IStreet\\townIOpeningtextoftheletterI(optionaldefinitions)IINameofaddresseeIStreet\\townIOpeningtextoftheletterI(optionaldefinitions)II...IThevqariousaddressesareseparatedbyablanklineinthe le(multipleblanklines IinYbGetweenaddressesareallowed).ItisalsopGossibletohavemultiplelineswithIde nitions;UUtheywillallbGeexecuted.XThe Etextofthemailingisenteredastheargumentof\mailingtext.YA 2di er-L\mailingtextIence_hwiththeoriginalmerge.styisthatthispackqageallowscontrolsequencesinItheiargumentof\mailingtext.ThesecontrolsequencesshouldthenbGede nedIinUUthe lewiththeaddressinformation.XWhen\makemailingiscalledthelettersareproGduced,combiningtheinfor-L\makemailingImationUUfoundintheaddress lewiththetextofthemailing.1*sIp0J cmsl10mailingUUpackqageversionv1.0aasof1994/09/0712oI3aLTheffimplementationIN cmbx123.1gUserinterfaceuTb\addressfileIThepargumentto\adressfileisthenameofthe lewiththeaddressinformation.Ls1S\newcommand{\addressfile}[1]{% Ls2]\def\M@filename{#1}}b\mailingtextITheargumenttothismacrocontainstheentiretextofthemailing.PThetextmay IcontainUUcontrolsequencestobGeabletomakevqariationsinthetext.Ls3S\long\def\mailingtext#1{\global\mailing@text={#1}}b\makemailingIThegcommand\makemailingwillproGducethemailing,lreadingaddresses,opGen- IingsUUandoptionalde nitionsofvqariabletextpartsfromanexternal le.Ls4S\def\makemailing{% Ls5]\M@openadrfileLs6]\loopLs7f\read@infoLs8f\if@notreadyLs9p2\begin{letter}{\M@toname\\\M@toaddress}%I10yw^\opening{\M@opening}%I11yw^\vskip\baselineskipI12yw^\the\mailing@textI13p2\end{letter}I14f\fiI15f\if@notreadyI16]\repeat}6I3.2gAllo`cationsuT\M@adrfileIW*eUUneedtoalloGcateaninputstreamforthe lewiththeaddressinformation.I17S\newread\M@adrfile\mailing@textITheUUcontentsoftheletterarestoredinatokenregisterI18S\newtoks\mailing@textb\if@notreadyIAUUswitchwhichindicatesifthe le\M@adrfilehasbGeenexhausted.I19S\newif\if@notready I20S\newif\if@notemptyoreof6I3.3gInternalmacrosuT 6\M@openadrfileIThemacro\M@openadrfiletriestoopGen\M@filename.ecItthatdoesn'tsucceed IitUUaskstheusertosupplyanewname.qThisisdoneuntilla leisfound.I21S\def\M@openadrfile{%I22]\openin\M@adrfile\M@filename\relaxI23]\ifeof\M@adrfileI24f\loopI25p2%\PackageWarning{mailing}{Ican'tfindthefile\M@filename}I26p2\typeout{Ican'tfindthefile\M@filename!}I27p2\closein\M@adrfileI28p2\typein[\M@filename]{Enteranewname}sImailingUUpackqageversionv1.0aasof1994/09/0713oI29p2\openin\M@adrfile\M@filename I30p2\ifeof\M@adrfileI31f\repeatI32]\fi}ٚ\read@infoIThe macro\read@infotakescareofthereadingofalltheinformationfrom I\M@adrfile,UUneededtoformatanotherletter. 3I33S\def\read@info{%I34]\skip@empty@lines3IThemacro\skip@empty@linesleavesthenon-emptylineitfoundin\M@lines.IIfitfoundanendof leconditionthe\if@notready agwillbGesetto\iffalse. 3I35]\if@notreadyI36f\let\M@toname\M@lineI37f\read\M@adrfileto\M@toaddressI38f\read\M@adrfileto\M@openingI39f\test@eofI40f\if@notready\read@defs\fiI41]\fiI42]}ٚ\read@defsIReadsZde nitionsofcontrolsequencesfromthe le\M@adrfileuntileitheranIemptylineisfoundortheendof leisreached.EachlineisstoredinacontrolIsequenceUUanditisexecutedafterallde nitionsareread. 3I43S\def\read@defs{%I44]\def\M@defns{}%I45]{\loopI46f\endlinechar=-1I47f\read\M@adrfileto\M@lineI48f\endlinechar=`\^^M3IW*enneedtogettheexpansionof\M@lineintothede nitionof\M@defns,2notI\M@lineUUitself.qTherefore\M@lineisexpandedbGefore\M@defns. 3I49f\expandafter\toks@\expandafter\expandafterI50p2\expandafter{\expandafter\M@defns\M@line}%I51f\xdef\M@defns{\the\toks@}%I52f\test@emptyoreofI53f\if@notemptyoreofI54f\repeat}%I55]\M@defnsI56]}ٚ$\test@eofITheUUmacro\test@eofteststhestatusofoftheinput le.I57S\def\test@eof{%I58]\ifeof\M@adrfileI59f\@notreadyfalseI60]\elseI61f\@notreadytrueI62]\fi}ٚ \test@emptyoreofIThemacro\test@emptyoreofcheckswhetherwereachedanemptyline': cmti10or\the IendUUofthe le.I63S\def\test@emptyoreof{%I64]\@notemptyoreoftruesImailingUUpackqageversionv1.0aasof1994/09/0714oI65]\ifx\M@line\@empty I66f\global\@notemptyoreoffalseI67]\fiI68]\ifeof\M@adrfileI69f\global\@notemptyoreoffalseI70f\global\@notreadyfalseI71]\fi}t\skip@empty@linesIThismacroskipsemptylinesuntilit ndseitheranon-emptylineortheendof ItheK le.0Ifnecessaryitsetsthe\if@notready ag.ThelastlinereadisleftinI\M@line.I72S\def\skip@empty@lines{% I73]{\loopI74f\endlinechar=-1I75f\ifeof\M@adrfileI76p2\global\@notreadyfalseI77p2\@tempswafalseI78f\elseI79p2\global\@notreadytrueI80p2\global\read\M@adrfileto\M@lineI81p2\ifx\M@line\@emptyI82yw^\@tempswatrueI83p2\elseI84yw^\@tempswafalseI85p2\fiI86f\fiI87f\if@tempswaI88f\repeat}%I89]}D;': cmti10p0J cmsl10N cmbx12ߤN cmtt9