]> projects.mako.cc - bmh-jobmarket_coverletter/blob - envlab.sty
added link to README file
[bmh-jobmarket_coverletter] / envlab.sty
1 %%
2 %% This is file `envlab.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% envlab.dtx  (with options: `package')
8 %% 
9 %% IMPORTANT NOTICE:
10 %% 
11 %% For the copyright see the source file.
12 %% 
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from envlab.sty.
15 %% 
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file envlab.dtx.
18 %% 
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 \ProvidesPackage{envlab}
24 [1997/07/16 v1.2 Envelopes and Labels]
25 %%
26 %% Copyright Boris Veytsman 1996, 1997
27 %%
28 %%
29 %% \CharacterTable
30 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
31 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
32 %%   Digits        \0\1\2\3\4\5\6\7\8\9
33 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
34 %%   Dollar        \$     Percent       \%     Ampersand     \&
35 %%   Acute accent  \'     Left paren    \(     Right paren   \)
36 %%   Asterisk      \*     Plus          \+     Comma         \,
37 %%   Minus         \-     Point         \.     Solidus       \/
38 %%   Colon         \:     Semicolon     \;     Less than     \<
39 %%   Equals        \=     Greater than  \>     Question mark \?
40 %%   Commercial at \@     Left bracket  \[     Backslash     \\
41 %%   Right bracket \]     Circumflex    \^     Underscore    \_
42 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
43 %%   Right brace   \}     Tilde         \~}
44 %% \changes{v1.2}{1996/07/16}{Updated User Guide}
45 \NeedsTeXFormat{LaTeX2e}
46 \def\envlab@oops{%
47   \PackageError{envlab}%
48   {Envlab is used outside of \MessageBreak%
49    a letter-compatible documentclass}%
50   {You are trying to use Envelopes & Labels\MessageBreak%
51    package, but your documentclass does not\MessageBreak%
52    understand address formatting commands.\MessageBreak%
53    Try standard document class letter\MessageBreak}}
54 \def\envlab@ok{%
55   \PackageInfo{envlab}%
56   {Envelopes & Labels package: found makelabels...\MessageBreak%
57   Seems everything is OK. Good luck.}}
58 \@ifundefined{makelabels}{\envlab@oops}{\envlab@ok}
59 \newif\if@envelope
60 \@envelopetrue
61 \newif\if@biglabel
62 \@biglabelfalse
63 \newif\if@rotateenvelopes
64 \@rotateenvelopestrue
65 \newif\if@printreturnaddress
66 \@printreturnaddresstrue
67 \newcount\@envelopeposition
68 \@envelopeposition=0\relax
69 \newif\if@pswait
70 \@pswaitfalse
71 \newif\if@psautotray
72 \@psautotrayfalse
73 \newtoks\PSEnvelopeTray
74 \PSEnvelopeTray={/otherenvelopetray }
75 \newif\if@barcodes
76 \newif\if@alwaysbarcodes
77 \@barcodestrue
78 \@alwaysbarcodesfalse
79 \newif\if@EL@redefine@opening
80 \@EL@redefine@openingfalse
81 \newif\if@capitalizeaddress
82 \@capitalizeaddresstrue
83 \newlength{\EnvelopeWidth}
84 \newlength{\EnvelopeHeight}
85 \newlength{\EnvelopeTopMargin}
86 \newlength{\EnvelopeLeftMargin}
87 \setlength{\EnvelopeLeftMargin}{0pt}
88 \newlength{\LabelWidth}
89 \newlength{\LabelHeight}
90 \newlength{\LabelTopMargin}
91 \newlength{\LabelLeftMargin}
92 \newlength{\LabelRightMargin}
93 \newcounter{LabelMaxCol}
94 \newcounter{LabelMaxRow}
95 \newlength{\FromAddressTopMargin}
96 \newlength{\FromAddressLeftMargin}
97 \newlength{\FromAddressHeight}
98 \newlength{\FromAddressWidth}
99 \newlength{\ToAddressTopMargin}
100 \newlength{\ToAddressLeftMargin}
101 \newlength{\ToAddressWidth}
102 \DeclareRobustCommand{\SetEnvelope}[3][0pt]{%
103   \@envelopetrue%
104   \@biglabelfalse%
105   \setlength{\EnvelopeTopMargin}{#1}%
106   \setlength{\EnvelopeWidth}{#2}%
107   \setlength{\EnvelopeHeight}{#3}%
108   \setlength{\FromAddressTopMargin}{0.5in}%
109   \setlength{\FromAddressLeftMargin}{0.5in}%
110   \setlength{\FromAddressHeight}{0.33\EnvelopeHeight}%
111   \setlength{\FromAddressWidth}{0.5\EnvelopeWidth}%
112   \setlength{\ToAddressTopMargin}{0.5in}%
113   \setlength{\ToAddressLeftMargin}{0.5in}%
114   \setlength{\ToAddressWidth}{3in}}
115 \DeclareRobustCommand{\SetLabel}[7]{%
116   \@envelopefalse%
117   \@biglabelfalse%
118   \setlength{\LabelWidth}{#1}%
119   \setlength{\LabelHeight}{#2}%
120   \setlength{\LabelTopMargin}{#3}%
121   \setlength{\LabelLeftMargin}{#4}%
122   \setlength{\LabelRightMargin}{#5}%
123   \setcounter{LabelMaxCol}{#6}%
124   \setcounter{LabelMaxRow}{#7}%
125   \setlength{\ToAddressTopMargin}{0.1in}%
126   \setlength{\ToAddressLeftMargin}{0.2in}%
127   \setlength{\ToAddressWidth}{\LabelWidth}%
128   \addtolength{\ToAddressWidth}{-\ToAddressLeftMargin}%
129   \addtolength{\ToAddressWidth}{-\LabelRightMargin}}
130 \DeclareRobustCommand{\SetBigLabel}[7]{%
131   \@envelopefalse%
132   \@biglabeltrue%
133   \setlength{\LabelWidth}{#1}%
134   \setlength{\LabelHeight}{#2}%
135   \setlength{\LabelTopMargin}{#3}%
136   \setlength{\LabelLeftMargin}{#4}%
137   \setlength{\LabelRightMargin}{#5}%
138   \setcounter{LabelMaxCol}{#6}%
139   \setcounter{LabelMaxRow}{#7}%
140   \setlength{\FromAddressTopMargin}{0.0in}%
141   \setlength{\FromAddressLeftMargin}{0.5in}%
142   \setlength{\FromAddressHeight}{0.33\LabelHeight}%
143   \setlength{\ToAddressTopMargin}{0.1in}%
144   \setlength{\ToAddressLeftMargin}{0.5in}%
145   \setlength{\ToAddressWidth}{\LabelWidth}%
146   \addtolength{\ToAddressWidth}{-\ToAddressLeftMargin}%
147   \addtolength{\ToAddressWidth}{-\LabelRightMargin}%
148   \setlength{\FromAddressWidth}{\ToAddressWidth}}
149 \DeclareOption{businessenvelope}{\SetEnvelope{9.5in}{4.125in}%
150   \PSEnvelopeTray={/com10envelopetray }}
151 \DeclareOption{executiveenvelope}{\SetEnvelope{7.5in}{3.875in}%
152   \PSEnvelopeTray={/monarcenvelopetray }}
153 \DeclareOption{bookletenvelope}{\SetEnvelope{10.5in}{7.5in}}
154 \DeclareOption{personalenvelope}{\SetEnvelope{6.5in}{3.625in}}
155 \DeclareOption{c6envelope}{\SetEnvelope{162mm}{114mm}}
156 \DeclareOption{c65envelope}{\SetEnvelope{224mm}{114mm}}
157 \DeclareOption{c5envelope}{\SetEnvelope{229mm}{162mm}%
158   \PSEnvelopeTray={/162x229cenvelopetray }}
159 \DeclareOption{dlenvelope}{\SetEnvelope{220mm}{110mm}%
160   \PSEnvelopeTray={/dlenvelopetray }}
161 \DeclareOption{avery5160label}{%
162   \SetLabel{2.75in}{1in}{0.5in}{0.19in}{0.12in}{3}{10}}
163 \DeclareOption{avery5161label}{%
164   \SetLabel{4.19in}{1in}{0.5in}{0.16in}{0.19in}{2}{10}}
165 \DeclareOption{avery5162label}{%
166   \SetLabel{4.19in}{1.33in}{0.83in}{0.16in}{0.19in}{2}{7}}
167 \DeclareOption{avery5163label}{%
168   \SetLabel{4.19in}{2in}{0.5in}{0.16in}{0.19in}{2}{5}}
169 \DeclareOption{avery5164label}{%
170   \SetLabel{4.19in}{3.33in}{0.5in}{0.16in}{0.19in}{2}{3}}
171 \DeclareOption{herma4625label}{%
172   \SetLabel{105mm}{42.3mm}{0mm}{5mm}{5mm}{2}{7}}
173 \DeclareOption{avery5262label}{%
174   \SetLabel{110mm}{34mm}{21mm}{4mm}{5mm}{2}{7}}
175 \DeclareOption{avery5163biglabel}{%
176   \SetBigLabel{4.19in}{2in}{0.5in}{0.16in}{0.19in}{2}{5}%
177   \setlength{\ToAddressTopMargin}{0.1in}}%
178 \DeclareOption{avery5164biglabel}{%
179   \SetBigLabel{4.19in}{3.33in}{0.5in}{0.16in}{0.19in}{2}{3}}%
180 \DeclareOption{rotateenvelopes}{\@rotateenvelopestrue}
181 \DeclareOption{norotateenvelopes}{\@rotateenvelopesfalse}
182 \DeclareOption{centerenvelopes}{\@envelopeposition=0\relax}
183 \DeclareOption{leftenvelopes}{\@envelopeposition=1\relax}
184 \DeclareOption{rightenvelopes}{\@envelopeposition=2\relax}
185 \DeclareOption{customenvelopes}{\@envelopeposition=3\relax}
186 \DeclareOption{printbarcodes}{\@barcodestrue}
187 \DeclareOption{noprintbarcodes}{\@barcodesfalse\@alwaysbarcodesfalse}
188 \DeclareOption{alwaysbarcodes}{\@alwaysbarcodestrue\@barcodestrue}
189 \DeclareOption{noalwaysbarcodes}{\@alwaysbarcodesfalse}
190 \DeclareOption{capaddress}{\@capitalizeaddresstrue}
191 \DeclareOption{nocapaddress}{\@capitalizeaddressfalse}
192 \DeclareOption{printreturnaddress}{\@printreturnaddresstrue}
193 \DeclareOption{noprintreturnaddress}{\@printreturnaddressfalse}
194 \DeclareOption{pswait}{\@pswaittrue\@psautotrayfalse}
195 \DeclareOption{nopswait}{\@pswaitfalse}
196 \DeclareOption{psautotray}{\@psautotraytrue\@pswaitfalse}
197 \DeclareOption{nopsautotray}{\@psautotrayfalse}
198 \DeclareOption{re}{\@EL@redefine@openingtrue}
199 \DeclareOption{nore}{\@EL@redefine@openingfalse}
200 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}
201 \ExecuteOptions{businessenvelope,rotateenvelopes,centerenvelopes}
202 \ExecuteOptions{printbarcodes,capaddress}
203 \ExecuteOptions{nopswait,printreturnaddress,nopsautotray,nore}
204 \InputIfFileExists{envlab.cfg}{%
205   \typeout{Loading configuration file envlab.cfg}}{%
206   \typeout{Configuration file envlab.cfg is not found}}
207 \ProcessOptions
208 \IfFileExists{graphics.sty}{%
209   \RequirePackage{graphics}}{%
210   \PackageWarning{envlab}{%
211     You don't have the graphics package!\MessageBreak
212     Probably you will not be able to print\MessageBreak
213     envelopes sidewise. \MessageBreak}}
214 \def\@beginlabelshook{\relax}
215 \def\@beginlabelpagehook{\relax}
216 \def\AtBeginLabels{\g@addto@macro\@beginlabelshook}
217 \def\AtBeginLabelPage{\g@addto@macro\@beginlabelpagehook}
218 \def\PSwait{\special{ps: clear grestore @manualfeed 0 0 bop}}
219 \edef\PSautotray{%
220   \special{ps:clear grestore
221     statusdict begin false setduplexmode
222     /manualfeed true def
223     \the\PSEnvelopeTray end 0 0 bop }}
224 \if@pswait
225   \AtBeginLabels{\PSwait}%
226 \else
227   \if@psautotray
228     \AtBeginLabels{\PSautotray}%
229   \fi
230 \fi
231 \newcounter{LabelCountCol}
232 \newcounter{LabelCountRow}
233 \newcounter{LabelOffsetCol}
234 \newcounter{LabelOffsetRow}
235 \setcounter{LabelOffsetCol}{1}
236 \setcounter{LabelOffsetRow}{1}
237 \DeclareRobustCommand{\FirstLabel}[2]{%
238   \setcounter{LabelOffsetRow}{#1}%
239   \setcounter{LabelOffsetCol}{#2}}
240 \def\@toaddressfont{%
241   \ifcase\@ptsize \normalsize\or\small\fi%
242   \rmfamily\selectfont}
243 \def\@fromaddressfont{%
244   \ifcase\@ptsize \normalsize\or\small\or\footnotesize\fi%
245   \normalfont}
246 \def\returnaddress{\fromaddress}
247 \def\startlabels{%
248   \clearpage%
249   \pagestyle{empty}%
250   \setlength{\topmargin}{-1.0in}%
251   \if@envelope%
252     \addtolength{\topmargin}{\EnvelopeTopMargin}%
253     \else \addtolength{\topmargin}{\LabelTopMargin}%
254   \fi%
255   \setlength{\headheight}{0pt}%
256   \setlength{\headsep}{0pt}%
257   \setlength{\footskip}{0pt}%
258   \setlength{\textheight}{200in}%
259   \setlength\paperheight{\textheight}%
260   \global\vsize=200in\relax%
261   \addtolength{\textheight}{-\topmargin}%
262   \addtolength{\textheight}{-1.0in}%
263   \setlength{\oddsidemargin}{-1.0in}%
264   \if@envelope\relax%
265   \else%
266      \addtolength{\oddsidemargin}{\LabelLeftMargin}%
267   \fi%
268   \setlength{\evensidemargin}{\oddsidemargin}%
269   \setlength{\textwidth}{20in}%
270   \hsize=20in%
271   \baselineskip=0pt%
272   \lineskip=0pt%
273   \parindent=0pt%
274   \if@envelope
275     \ifcase\the\@envelopeposition%
276       \setlength{\EnvelopeLeftMargin}{\paperwidth}%
277       \if@rotateenvelopes%
278         \addtolength{\EnvelopeLeftMargin}{-\EnvelopeHeight}%
279       \else%
280         \addtolength{\EnvelopeLeftMargin}{-\EnvelopeWidth}%
281       \fi%
282       \setlength{\EnvelopeLeftMargin}{0.5\EnvelopeLeftMargin}%
283     \or%
284       \setlength{\EnvelopeLeftMargin}{0pt}%
285     \or%
286       \setlength{\EnvelopeLeftMargin}{\paperwidth}%
287       \if@rotateenvelopes%
288         \addtolength{\EnvelopeLeftMargin}{-\EnvelopeHeight}%
289       \else%
290         \addtolength{\EnvelopeLeftMargin}{-\EnvelopeWidth}%
291       \fi%
292     \else%
293       \relax%
294     \fi%
295   \else%
296     \setcounter{LabelCountCol}{\theLabelOffsetCol}%
297     \setcounter{LabelCountRow}{\theLabelOffsetRow}%
298     \ifnum\theLabelOffsetRow>1%
299       \null%
300       \loop \vspace*{\LabelHeight}%
301         \addtocounter{LabelOffsetRow}{-1} \ifnum\theLabelOffsetRow>1%
302       \repeat%
303     \fi%
304     \ifnum\theLabelOffsetCol>1%
305       \loop \hspace*{\LabelWidth}\nolinebreak%
306         \addtocounter{LabelOffsetCol}{-1} \ifnum\theLabelOffsetCol>1%
307       \repeat%
308     \fi%
309     \nopagebreak%
310   \fi%
311   \spaceskip0pt\relax%
312   \xspaceskip 0pt\relax%
313   \clubpenalty=0%
314   \widowpenalty=0%
315   \raggedbottom%
316   \sloppy%
317   \setlength\hfuzz{5in}%
318   \setlength\vfuzz{5in}%
319   \ignorespaces%
320   \@beginlabelshook%
321   \@beginlabelpagehook%
322   \nopagebreak}%
323 \newcommand{\PrintReturnAddress}[1]{%
324   \vspace*{\FromAddressTopMargin}
325   \null\hspace{\FromAddressLeftMargin}
326   \parbox[t][\FromAddressHeight]{\FromAddressWidth}%
327     {\@fromaddressfont \lineskip=1pt
328       \if@printreturnaddress #1\else\relax\fi}}
329 \newcommand{\PrintAddress}[1]{%
330   \vspace*{\ToAddressTopMargin}
331   \leavevmode
332   \null\hspace*{\ToAddressLeftMargin}
333   \parbox[t]{\ToAddressWidth}{%
334     \lineskip=1pt
335     \if@barcodes \PrintBarCode{#1} \fi
336     \@toaddressfont
337     \if@capitalizeaddress \@make@capitalize{#1} \else #1 \fi}}
338 \newcommand{\PrintLabel}[1]{%
339   \parbox[t][\LabelHeight]{\LabelWidth}{%
340     \PrintAddress{#1}}}
341 \newcommand{\PrintBigLabel}[2]{%
342   \begin{minipage}[t][\LabelHeight]{\LabelWidth}%
343     \baselineskip=0pt%
344     \lineskip=0pt%
345     \parindent=0pt%
346     \begin{center}%
347       \PrintReturnAddress{#1}\\%
348       \rule{\ToAddressWidth}{0.1pt}%
349       \PrintAddress{#2}%
350     \end{center}%
351   \end{minipage}}
352 \newcommand{\PrintEnvelope}[2]{%
353   \begin{minipage}[t][\EnvelopeHeight]{\EnvelopeWidth}%
354     \baselineskip=0pt%
355     \lineskip=0pt%
356     \parindent=0pt%
357     \PrintReturnAddress{#1}\\%
358     \begin{center}%
359       \PrintAddress{#2}%
360     \end{center}%
361   \end{minipage}}
362 \newcommand{\@PrintEnvelope}[2]{%
363   \if@rotateenvelopes\rotatebox{90}{\PrintEnvelope{#1}{#2}}%
364   \else\PrintEnvelope{#1}{#2}%
365   \fi}
366 \renewcommand{\mlabel}[2]{\ignorespaces%
367   \spaceskip 0pt\relax%
368   \xspaceskip 0pt\relax%
369   \if@envelope%
370     \leavevmode%
371     \hspace*{\EnvelopeLeftMargin}%
372     \@PrintEnvelope{#1}{#2}%
373     \clearpage%
374     \@beginlabelpagehook%
375   \else%
376     \ignorespaces%
377     \ifnum\theLabelCountCol>\theLabelMaxCol%
378       \\\nopagebreak%
379       \stepcounter{LabelCountRow}%
380       \setcounter{LabelCountCol}{1}%
381     \fi%
382     \ifnum\theLabelCountRow>\theLabelMaxRow%
383       \vfill\eject\@beginlabelpagehook%
384       \setcounter{LabelCountRow}{1}%
385       \setcounter{LabelCountCol}{1}%
386     \fi%
387     \if@biglabel%
388         \PrintBigLabel{#1}{#2}%
389     \else%
390         \PrintLabel{#2}%
391     \fi%
392     \ignorespaces\nolinebreak%
393     \stepcounter{LabelCountCol}%
394   \fi}%
395 \newcount\@numreturnlabels
396 \newcommand{\printreturnlabels}[2]{%
397   \@numreturnlabels=#1
398   \def\@toaddressfont{\@fromaddressfont}
399   \@capitalizeaddressfalse
400   \@barcodesfalse
401   \startlabels
402   \loop \mlabel{\relax}{#2} \advance\@numreturnlabels by -1
403     \ifnum\@numreturnlabels>0\repeat}
404 \newcommand{\PrintBarCode}[1]{%
405   \@extractbarcode{#1}
406   \@printbarcode}
407 \newtoks\@zipcode
408 \newcount\@zipcodesum
409 \newif\if@zipcodefound
410 \long\def\@finishzipcode#1{}
411 \long\def\@firstzipcode#1{%
412   \@zipcode{#1}
413   \@zipcodesum=#1\relax
414   \@zipcodefoundtrue
415   \@zipcodeloop}
416 \long\def\@continuezipcode#1{%
417   \@zipcode=\expandafter{\the\@zipcode#1}
418   \advance\@zipcodesum by #1
419   \@zipcodeloop}
420 \long\def\@dashzipcode#1{\@zipcodeloop}
421 \def\@spacezipcode{%
422   \@zipcodefoundfalse
423   \afterassignment\@zipcodeloop\let\EL@temp= }
424 \long\def\@abortzipcode#1{%
425   \@zipcodefoundfalse
426   \@zipcodeloop}
427 \def\@zipcodeloop{\futurelet\EL@temp\@zipcodeloop@}
428 \def\@zipcodeloop@{%
429   \ifx \@endaddress\EL@temp      \def\EL@tempa{\@finishzipcode}    \else
430   \ifx 0\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
431                \else           \def\EL@tempa{\@firstzipcode} \fi \else
432   \ifx 1\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
433                \else           \def\EL@tempa{\@firstzipcode} \fi \else
434   \ifx 2\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
435                \else           \def\EL@tempa{\@firstzipcode} \fi \else
436   \ifx 3\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
437                \else           \def\EL@tempa{\@firstzipcode} \fi \else
438   \ifx 4\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
439                \else           \def\EL@tempa{\@firstzipcode} \fi \else
440   \ifx 5\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
441                \else           \def\EL@tempa{\@firstzipcode} \fi \else
442   \ifx 6\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
443                \else           \def\EL@tempa{\@firstzipcode} \fi \else
444   \ifx 7\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
445                \else           \def\EL@tempa{\@firstzipcode} \fi \else
446   \ifx 8\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
447                \else           \def\EL@tempa{\@firstzipcode} \fi \else
448   \ifx 9\EL@temp \if@zipcodefound \def\EL@tempa{\@continuezipcode}
449                \else           \def\EL@tempa{\@firstzipcode} \fi \else
450   \ifx -\EL@temp \if@zipcodefound \def\EL@tempa{\@dashzipcode}
451                \else           \def\EL@tempa{\@abortzipcode} \fi \else
452   \ifx \@sptoken\EL@temp         \def\EL@tempa{\@spacezipcode}     \else
453                                \def\EL@tempa{\@abortzipcode}
454   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
455   \EL@tempa}
456 \long\def\@extractbarcode#1{%
457   \@zipcodefoundfalse
458   \@zipcodeloop#1\@endaddress
459   \if@alwaysbarcodes \@zipcodefoundtrue \fi
460   \if@zipcodefound
461     \ifnum\the\@zipcodesum>0
462       \loop \advance \@zipcodesum by -10 \ifnum\the\@zipcodesum>0
463       \repeat
464     \fi
465     \multiply\@zipcodesum by -1
466   \fi}
467 \newlength{\@barcodewidth}
468 \newlength{\@barcodeLheight}
469 \newlength{\@barcodeSheight}
470 \newlength{\@barcodeskip}
471 \setlength{\@barcodewidth}{0.020in}
472 \setlength{\@barcodeLheight}{0.125in}
473 \setlength{\@barcodeSheight}{0.050in}
474 \setlength{\@barcodeskip}{0.026in}
475 \DeclareRobustCommand{\@barL}{%
476   \rule{\@barcodewidth}{\@barcodeLheight}\hspace{\@barcodeskip}}
477 \DeclareRobustCommand{\@barS}{%
478   \rule{\@barcodewidth}{\@barcodeSheight}\hspace{\@barcodeskip}}
479 \def\@printonezip#1{%
480   \ifx1#1\@barS\@barS\@barS\@barL\@barL\else
481   \ifx2#1\@barS\@barS\@barL\@barS\@barL\else
482   \ifx3#1\@barS\@barS\@barL\@barL\@barS\else
483   \ifx4#1\@barS\@barL\@barS\@barS\@barL\else
484   \ifx5#1\@barS\@barL\@barS\@barL\@barS\else
485   \ifx6#1\@barS\@barL\@barL\@barS\@barS\else
486   \ifx7#1\@barL\@barS\@barS\@barS\@barL\else
487   \ifx8#1\@barL\@barS\@barS\@barL\@barS\else
488   \ifx9#1\@barL\@barS\@barL\@barS\@barS\else
489   \ifx0#1\@barL\@barL\@barS\@barS\@barS\else
490   \ifx S#1\def\EL@tempa{\relax}%
491   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
492   \EL@tempa}
493 \def\@printbarcode{%
494   \if@zipcodefound
495    \mbox{%
496     \@barL%
497     \def\EL@tempa{\@printonezip}%
498     \expandafter\EL@tempa\the\@zipcode S%
499     \def\EL@tempa{\@printonezip}%
500     \expandafter\EL@tempa\the\@zipcodesum S%
501     \@barL}
502     \\[1ex]
503   \fi}
504 \newtoks\@addr@cap
505 \long\def\@finishaddrcap#1{}
506 \long\def\@dotcommaaddrcap#1{%
507   \@addrcaploop}
508 \long\def\@newlineaddrcap#1{%
509   \@addr@cap=\expandafter{\the\@addr@cap #1}
510   \@addrcaploop}
511 \long\def\@bgroupaddrcap#1{%
512   \@addr@cap=\expandafter{\the\@addr@cap {\MakeUppercase{#1}}}
513   \@addrcaploop}
514 \def\@spaceaddrcap{%
515   \@addr@cap=\expandafter{\the\@addr@cap\hspace{0.6em}}
516   \afterassignment\@addrcaploop\let\EL@temp= }
517 \def\@otheraddrcap#1{%
518   \@addr@cap=\expandafter{\the\@addr@cap%
519      \MakeUppercase{#1}\kern1pt\relax}
520   \@addrcaploop}
521 \def\@addrcaploop{\futurelet\EL@temp\@addrcaploop@}
522 \def\@addrcaploop@{%
523   \ifx \@endaddress\EL@temp      \def\EL@tempa{\@finishaddrcap}    \else
524   \ifx .\EL@temp                 \def\EL@tempa{\@dotcommaaddrcap}  \else
525   \ifx ,\EL@temp                 \def\EL@tempa{\@dotcommaaddrcap}  \else
526   \ifx \voidb@x\EL@temp          \def\EL@tempa{\@dotcommaaddrcap}  \else
527   \ifx \unhbox\EL@temp            \def\EL@tempa{\@dotcommaaddrcap} \else
528   \ifx \\\EL@temp                \def\EL@tempa{\@newlineaddrcap}   \else
529   \ifx \bgroup\EL@temp           \def\EL@tempa{\@bgroupaddrcap}    \else
530   \ifx \@sptoken\EL@temp         \def\EL@tempa{\@spaceaddrcap}     \else
531                                \def\EL@tempa{\@otheraddrcap}
532   \fi\fi\fi\fi\fi\fi\fi\fi
533   \EL@tempa}
534 \long\def\@make@capitalize#1{%
535   \@addr@cap={\relax}
536   \@addrcaploop#1\@endaddress
537   \the\@addr@cap}
538 \let\@@mlabel=\@gobbletwo
539 \AtEndDocument{\let\@@mlabel=\@mlabel}
540 \def\suppresslabels{\if@filesw\immediate\write\@auxout{%
541   \string\@suppresslabels}\fi}
542 \def\@suppresslabels{\let\@mlabel=\@gobbletwo}
543 \def\resumelabels{\if@filesw\immediate\write\@auxout{%
544   \string\@resumelabels}\fi}
545 \def\@resumelabels{\let\@mlabel=\@@mlabel}
546 \def\suppressonelabel{\if@filesw\immediate\write\@auxout{%
547   \string\@suppressonelabel}\fi}
548 \def\@suppressonelabel{\let\@old@mlabel=\@mlabel%
549   \def\@mlabel{%
550     \let\@mlabel=\@old@mlabel%
551     \@gobbletwo}}
552 \def\printonelabel{\if@filesw\immediate\write\@auxout{%
553   \string\@printonelabel}\fi}
554 \def\@printonelabel{\let\@old@mlabel=\@mlabel%
555   \def\@mlabel{%
556     \let\@mlabel=\@old@mlabel%
557     \@@mlabel}}
558 \def\ChangeEnvelope{\@ifstar{\@ChangeEnvelopeStar}{\@ChangeEnvelope}}
559 \newcommand\@ChangeEnvelopeStar[3][0pt]{%
560   \if@filesw\immediate\write\@auxout{%
561        \string\@SetEnvelope[#1]{#2}{#3}}%
562    \fi}
563 \newcommand\@ChangeEnvelope[3][0pt]{%
564   \if@filesw\immediate\write\@auxout{%
565        \string\@SetEnvelope[#1]{#2}{#3}}
566      \immediate\write\@auxout{\string\@startlabels}
567   \fi}
568 \def\@SetEnvelope[#1]#2#3{}
569 \AtEndDocument{\let\@SetEnvelope=\SetEnvelope}
570 \def\ChangeLabel{\@ifstar{\@ChangeLabelStar}{\@ChangeLabel}}
571 \newcommand\@ChangeLabelStar[7]{%
572   \if@filesw\immediate\write\@auxout{%
573        \string\@SetLabel{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
574    \fi}
575 \newcommand\@ChangeLabel[7]{%
576   \if@filesw\immediate\write\@auxout{%
577        \string\@SetLabel{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
578      \immediate\write\@auxout{\string\@startlabels}
579   \fi}
580 \def\@SetLabel#1#2#3#4#5#6#7{}
581 \AtEndDocument{\let\@SetLabel=\SetLabel}
582 \def\ChangeBigLabel{\@ifstar{\@ChangeBigLabelStar}{\@ChangeBigLabel}}
583 \newcommand\@ChangeBigLabelStar[7]{%
584   \if@filesw\immediate\write\@auxout{%
585        \string\@SetBigLabel{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
586    \fi}
587 \newcommand\@ChangeBigLabel[7]{%
588   \if@filesw\immediate\write\@auxout{%
589        \string\@SetBigLabel{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
590      \immediate\write\@auxout{\string\@startlabels}
591   \fi}
592 \def\@SetBigLabel#1#2#3#4#5#6#7{}
593 \AtEndDocument{\let\@SetBigLabel=\SetBigLabel}
594 \if@EL@redefine@opening
595   \newcommand*{\re}[1]{\def\recontents{#1}}%
596   \def\ReName{Re: }%
597   \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
598     \thispagestyle{firstpage}%
599       {\raggedleft\@date\par}%
600     \else  % home address
601       \thispagestyle{empty}%
602       {\raggedleft\begin{tabular}{l}\ignorespaces
603           \fromaddress \\*[2\parskip]%
604           \@date \end{tabular}\par}%
605     \fi
606     \vspace{2\parskip}%
607     {\raggedright \toname \\ \toaddress \par}%
608     \ifx\@empty\recontents\relax
609     \else
610        {\raggedright \ReName \recontents \par}%
611     \fi
612     \vspace{2\parskip}%
613     #1\par\nobreak}%
614 \fi
615 \endinput
616 %%
617 %% End of file `envlab.sty'.

Benjamin Mako Hill || Want to submit a patch?