Debian Codegraph @

texmf-dist/doc/latex/envlab/elguide.tex

raw
1 \documentclass{ltxguide}
2
3
4
5 \usepackage{shortvrb}
6
7 \newcommand{\EL}{\textsl{EnvLab}}
8 \newcommand{\dvips}{\textsl{dvips}}
9 \newcommand{\PS}{\textsl{PostScript}}
10 \newcommand{\DS}{\textsl{DocStrip}}
11 \newcommand{\mailing}{\textsl{mailing}}
12 \newcommand{\graphics}{\textsl{graphics}}
13 \newcommand{\gs}{\textsl{ghostscript}}
14 \providecommand{\cs}[1]{{\ttfamily\char`\\{}#1}}
15 \MakeShortVerb{\|}
16 \renewcommand\star{{\ttfamily*}}
17 \providecommand\marg[1]{%
18 {\ttfamily\char`\{}{\em#1\/}{\ttfamily\char`\}}}
19 \providecommand\oarg[1]{%
20 {\ttfamily[}{\em#1\/}{\ttfamily]}}
21 \providecommand\parg[1]{%
22 {\ttfamily(}{\em#1\/}{\ttfamily)}}
23
24 \newenvironment{figpage}{%
25 \begin{minipage}{0.8\textwidth}}{\end{minipage}}
26
27 \newcommand{\meta}[1]{$\langle${\em#1\/}$\rangle$}
28
29 \begin{document}
30
31 \title{Printing Envelopes and Labels in \LaTeXe: \EL\ Package.\\
32 User Guide\thanks{\copyright Boris Veytsman, 1996, 1997}}
33 \author{Boris Veytsman}
34 \date{July 16, 1997}
35
36 \maketitle
37
38 \begin{abstract}
39 This package provides a comprehensive and easily customizable system
40 for creating mailing envelopes and labels in \LaTeXe. Includes
41 printing barcodes and address formatting according to the US Postal
42 Service rules.
43 \end{abstract}
44
45 \tableofcontents
46 \listoffigures
47 \listoftables
48
49
50
51
52 \section{Introduction}
53 \label{sec:Intro}
54
55 The standard |\makelabels| command in the \LaTeXe\ |letter.cls|
56 document class typesets labels on Avery 5352 sheets. A typical user
57 may want more. \EL\ redefines |\makelabels| in\footnote{hopefully}
58 a more useful and customizable way. \EL:
59 \begin{itemize}
60 \item Typesets mailing labels or envelopes on a number
61 of pre-defined label sheets \emph{or} envelopes.
62 \item Can be easily configured for any customized label or envelope
63 sizes. The rule of thumb is: if you printer can print this, \EL\ can
64 typeset this.
65 \item Can optionally print barcodes and/or process addresses according
66 to the United States Postal Service Rules.
67 \item Allows you to include your logo in the return address.
68 \item Painlessly interacts with mail merging packages such as
69 |mailing|.
70 \item Does not require special fonts for address and barcodes
71 printing. The typesetting is implemented with standard fonts and
72 \LaTeX\ |\rule| commands.
73 \end{itemize}
74
75 This package was written with US mailing standards in mind. This is
76 not a reflection of the author's americanocentrism: US standard was
77 only one I had official documents about. If you want to add your
78 national standards, please contact me with pointers to the
79 corresponding documents.
80
81 This document describes the basic usage of the package. More
82 sophisticated users would want to typeset and browse |envlab.dtx| as
83 well.
84
85 \section{Installation}
86 \label{sec:Install}
87
88 The distribution of this package includes the following files:
89 \begin{enumerate}
90 \item |envlab.dtx|---fully documented program,
91 \item |envlab.ins|---\DS\ instruction module,
92 \item |elold.ins|---\DS\ instruction module for older
93 versions of \DS,
94 \item |elguide.tex| (this file)---User Guide,
95 \item |readme.|\emph{version\_number}---ReadMe file.
96 \end{enumerate}
97 To install the package
98 \begin{enumerate}
99 \item \LaTeX\ the file |envlab.ins|\footnote{If your |docstrip.tex| is
100 earlier than version 2.3, use |elold.ins| instead of
101 |envlab.ins|.}. It will produce three files: |envlab.drv|,
102 |envlab.sty| and |envlab.cfg|.
103 \item (Optional) Look at the file |envlab.cfg| and change it
104 accordingly to your taste (see Section~\ref{sec:Cust}).
105 \item Move the files |envlab.sty| and |envlab.cfg| to the
106 \LaTeX\ search path\footnote{The users of kpathsea based \TeX---like
107 te\TeX---should also issue |texhash| to update the search database.}
108 \item Produce the documentation by \LaTeX ing the files |elguide.tex|
109 and (optional) |envlab.drv|.
110 \item Enjoy!
111 \end{enumerate}
112
113
114 \section{Usage}
115 \label{sec:Usage}
116
117
118 \subsection{The basics}
119 \label{sec:Basics}
120
121 The package \EL\ is intended to be used with the \LaTeXe\ |letter|
122 document class and similar custom classes. The standard document class
123 defines the environment |letter|, which, among other things, writes to
124 the main |.aux| file the information about mailing address. \EL\
125 retrieves and typesets this information. In general one should not use
126 \EL\ with document classes that do not provide this information. The
127 package types an error message if it cannot find the |makelabels|
128 command in the class it is called from\footnote{If you want to create
129 a custom letter class to be used with \EL, take care to write
130 commands \cs{startlabels} and
131 \cs{mlabel}\marg{from-address}\marg{to-address} to the |.aux| file.
132 Also define a \cs{makelabels} command. The latter can do
133 anything---\EL\ will redefine it anyway, but the package needs to
134 see \cs{makelabels} defined at the start up}.
135
136
137 There are three ways to use \EL:
138
139 \subsubsection{Automatic generation of envelopes or labels}
140 \begin{decl}
141 |\makelabels|
142 \end{decl}
143 Put in the preamble of your document:
144 |\usepackage|\oarg{options}|{envlab}| and |\makelabels|. The package
145 will generate envelopes or labels at the end of your document, ready
146 to be printed. An example of such usage is shown on
147 Fig.~\ref{fig:Auto}.
148
149 An interesting extension of this method is the use of \EL\ with
150 mail-merge packages. If such packages generate |letter|
151 environments, then \EL\ will happily produce envelopes or labels for
152 them. I tested \EL\ with the \mailing\ package available at
153 CTAN with excellent results. See an example on Fig.~\ref{fig:Merge}.
154
155 \begin{figure}[tbp]
156 \begin{center}
157 \leavevmode
158 \begin{figpage}
159 \begin{verbatim}
160 \documentclass[12pt]{letter}
161
162 \usepackage[personalenvelope]{envlab}
163 \makelabels
164
165 \address{%
166 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}
167 \signature{Joe}
168
169 \begin{document}
170 \begin{letter}{%
171 Mary McKeen\\2 Alpha Street\\Otherplace, NY 12346}
172 \opening{Dear Mary:}
173 I love only you
174 \closing{With love,}
175 \end{letter}
176
177 \begin{letter}{%
178 Lisa O'Hara\\2 Beta Street\\Anotherplace, NY 12347}
179 \opening{Dear Lisa:}
180 I love only you
181 \closing{With love,}
182 \end{letter}
183 \end{document}
184
185 \end{verbatim}
186 \end{figpage}
187 \caption{Automatic generation of envelopes}
188 \label{fig:Auto}
189 \end{center}
190 \end{figure}
191
192 \begin{figure}[tbp]
193 \begin{center}
194 \leavevmode
195 \begin{figpage}
196 \begin{verbatim}
197 \documentclass[12pt]{letter}
198
199 \usepackage[avery5061label,alwaysbarcodes]{envlab}
200 \makelabels
201
202 \address{%
203 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}
204 \signature{Joe}
205
206 \usepackage{mailing}
207 \addressfile{lovers.dat}
208 \mailingtext{%
209 I love only you
210 \closing{With love,}}
211
212 \begin{document}
213 \makemailing
214 \end{document}
215 \end{verbatim}
216 \end{figpage}
217 \caption[\EL\ and \textsl{mailing} package.]{\EL\ and
218 \textsl{mailing} package. The file |lovers.dat| contains the
219 address data in the format described in the documentation for
220 \textsl{mailing} package.}
221 \label{fig:Merge}
222 \end{center}
223 \end{figure}
224
225
226 \subsubsection{Manual generation of envelopes or labels}
227 \begin{decl}
228 |\startlabels|, |\mlabel|\marg{from-address}\marg{to-address}
229 \end{decl}
230 Sometimes you need to generate only mailing labels or envelopes, but
231 not letters themselves. In this case prepare a separate document of
232 |letter| document class. Put in the preamble of your document
233 |\usepackage|\oarg{options}|{envlab}| and |\makelabels|, and in the
234 body of your document the command |\startlabels|\footnote{It sets up
235 page parameters for envelopes and letters}, and commands
236 |\mlabel|\marg{from-address}\marg{to-address} for each label you want
237 to generate (see Fig.~\ref{fig:Manual})
238
239 \begin{figure}[tbp]
240 \begin{center}
241 \leavevmode
242 \begin{figpage}
243 \begin{verbatim}
244 \documentclass[12pt]{letter}
245
246 \usepackage[businessenvelope]{envlab}
247 \makelabels
248
249 \begin{document}
250 \startlabels
251 \mlabel{%
252 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}{%
253 Mary McKeen\\2 Alpha Street\\Otherplace, NY 12346}
254 \mlabel{%
255 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}{%
256 Lisa O'Hara\\2 Beta Street\\Anotherplace, NY 12347}
257 \end{document}
258 \end{verbatim}
259 \end{figpage}
260 \caption{Manual generation of envelopes}
261 \label{fig:Manual}
262 \end{center}
263 \end{figure}
264
265
266 \subsubsection{Printing of return labels}
267 \begin{decl}
268 |\printreturnlabels|\marg{number}\marg{text}
269 \end{decl}
270
271 Sometimes you need to print only return labels. To print \marg{number}
272 of labels with the \marg{text} on each use the command
273 |\printreturnlabels|\marg{number}\marg{text}. It is better to put it in
274 a separate document (see Fig.~\ref{fig:Return}).
275
276 \begin{figure}[tbp]
277 \begin{center}
278 \leavevmode
279 \begin{figpage}
280 \begin{verbatim}
281 \documentclass[12pt]{letter}
282
283 \usepackage[avery5160label,noprintbarcodes,%
284 nocapaddress]{envlab}
285 \makelabels
286
287 \begin{document}
288 \printreturnlabels{180}{%
289 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}
290 \end{document}
291 \end{verbatim}
292 \end{figpage}
293 \caption{Printing of return labels}
294 \label{fig:Return}
295 \end{center}
296 \end{figure}
297
298
299 \subsection{Sizes of labels and envelopes}
300
301 \NEWdescription{Version 1.2} \EL\ package recognizes three kinds of media:
302 envelopes, labels and \NEWfeature{Version 1.2}``big labels''. Envelopes are
303 printed one per physical page, they could be rotated (i.~e.\ inserted
304 in the printer sidewise) and could carry both the shipping address and
305 return address. Labels and big labels are peel-off labels that are
306 printed several per physical page, they could not be rotated. The
307 difference between labels and big labels is that labels have only
308 shipping address while big labels have both return \emph{and} shipping
309 addresses. These differences are summarized in Table~\ref{tab:diff}.
310 The kind and the size of the media are set either by package options
311 or by the corresponding commands.
312 \begin{table}[tbp]
313 \begin{center}
314 \leavevmode
315 \begin{tabular}{cccc}
316 \hline
317 Media & Number per page & Rotation & Return address \\
318 \hline
319 Envelopes & One & Settable & Yes\\
320 Labels & Several & Not rotated & No\\
321 Big Labels & Several & Not rotated & Yes\\
322 \hline
323 \end{tabular}
324 \caption{Differences between envelopes, labels and big labels}
325 \label{tab:diff}
326 \end{center}
327 \end{table}
328
329
330 \begin{decl}
331 |businessenvelope|,
332 |executiveenvelope|,
333 |bookletenvelope|,
334 |personalenvelope|,\\
335 |c6envelope|,
336 |c65envelope|,
337 |c5envelope|, |dlenvelope|
338 \end{decl}
339 \EL\ knows about a number of standard envelopes. The options listed in
340 Table~\ref{tab:Env} are used to typeset the addresses for envelopes
341 with the given width and height. For example, if you have
342 $9.5''\times4.125''$ envelopes, use the command
343 |\usepackage[businessenvelope]{envlab}|.
344
345 \begin{table}[tbp]
346 \begin{center}
347 \leavevmode
348 \begin{tabular}{ccc}
349 \hline
350 Package option & Width & Height\\
351 \hline
352 businessenvelope & 9.5$''$ & 4.125$''$\\
353 executiveenvelope & 7.5$''$ & 3.875$''$\\
354 bookletenvelope & 10.5$''$ & 7.5$''$\\
355 personalenvelope & 6.5$''$ & 3.625$''$\\
356 c6envelope & 162 mm & 114 mm\\
357 c65envelope & 224 mm & 114 mm\\
358 c5envelope & 229 mm & 162 mm\\
359 dlenvelope & 220 mm & 110 mm\\
360 \hline
361 \end{tabular}
362 \caption{Standard envelope sizes}
363 \label{tab:Env}
364 \end{center}
365 \end{table}
366
367 \begin{decl}
368 |\SetEnvelope|\oarg{top margin}\marg{width}\marg{height}
369 \end{decl}
370 If your envelope is not listed in Table~\ref{tab:Env}, put in the
371 preamble of your document the command
372 |\SetEnvelope|\marg{width}\marg{height}\footnote{The optional first
373 argument of this command is described in Section~\ref{sec:Print}}.
374 Its arguments are dimensions of your envelope (together with the
375 units!). For example, if you have $8''\times4''$ envelopes, use the
376 command |\SetEnvelope{8in}{4in}|.
377
378 \begin{decl}
379 |avery5160label|,
380 |avery5161label|,
381 |avery5162label|,
382 |avery5163label|,\\
383 |avery5164label|,
384 |avery5262label|,
385 |herma4625label|
386 \end{decl}
387 \EL\ knows also about a number of commercially available labels.
388 They are listed in Table~\ref{tab:Lab}. The dimensions $W$ and $H$ are
389 the label total width and height, $t$ and $l$ are the distance between
390 the edge of the paper and the label (see Fig.~\ref{fig:Labels}). The
391 numbers $N_c$ and $N_r$ are correspondingly the numbers of columns and
392 rows of labels on a sheet.
393
394 \begin{figure}[tbp]
395 \begin{center}
396 \leavevmode
397 \setlength{\unitlength}{0.00083300in}%
398 %
399 \begingroup\makeatletter\ifx\SetFigFont\undefined%
400 \gdef\SetFigFont#1#2#3#4#5{%
401 \reset@font\fontsize{#1}{#2pt}%
402 \fontfamily{#3}\fontseries{#4}\fontshape{#5}%
403 \selectfont}%
404 \fi\endgroup%
405 \begin{picture}(5169,4051)(76,-3305)
406 \thicklines
407 \put(1201,-2761){\framebox(1700,900){}}
408 \put(901,539){\line( 0,-1){975}}
409 \put(1201,539){\line( 0,-1){1200}}
410 \put(301,-361){\line( 1, 0){675}}
411 \put(301,-661){\line( 1, 0){1125}}
412 \put(301,-1861){\line( 1, 0){1200}}
413 \put(376,-361){\vector( 0, 1){ 0}}
414 \put(376,-361){\vector( 0,-1){300}}
415 \put(376,-661){\vector( 0, 1){ 0}}
416 \put(376,-661){\vector( 0,-1){1200}}
417 \put(901,464){\vector(-1, 0){ 0}}
418 \put(901,464){\vector( 1, 0){300}}
419 \put(901,-361){\line( 0,-1){2900}}
420 \put(1201,-1561){\framebox(1700,900){}}
421 \put(3201,-1561){\framebox(1700,900){}}
422 \put(3201,-2761){\framebox(1700,900){}}
423 \put(901,-361){\line( 1, 0){4300}}
424 \put(2901,239){\line( 0,-1){975}}
425 \put(3201,539){\line( 0,-1){1275}}
426 \put(2901,164){\vector(-1, 0){ 0}}
427 \put(2901,164){\vector( 1, 0){300}}
428 \put(1201,464){\vector(-1, 0){ 0}}
429 \put(1201,464){\vector( 1, 0){2000}}
430 \put( 76,-1336){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}$H$}}}
431 \put(976,614){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}$l$}}}
432 \put(151,-586){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}$t$}}}
433 \put(2976,239){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}$r$}}}
434 \put(2051,614){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}$W$}}}
435 \end{picture}
436 \caption{Labels parameters}
437 \label{fig:Labels}
438 \end{center}
439 \end{figure}
440
441 \begin{table}[tbp]
442 \begin{center}
443 \leavevmode
444 \begin{tabular}{ccccccccc}
445 \hline
446 Package option & $W$ & $H$ & $t$ & $l$ & $r$ & $N_c$ & $N_r$\\
447 \hline
448 avery5160label & 2.75$''$ & 1$''$ & 0.5$''$ & 0.19$''$ &
449 0.12$''$ & 3 & 10\\
450 avery5161label & 4.19$''$ & 1$''$ & 0.5$''$ & 0.16$''$ &
451 0.19$''$ & 2 & 10\\
452 avery5162label & 4.19$''$ & 1.33$''$ & 0.83$''$ & 0.16$''$ &
453 0.19$''$ & 2 & 7\\
454 avery5163label & 4.19$''$ & 2$''$ & 0.5$''$ & 0.16$''$ &
455 0.19$''$ & 2 & 5\\
456 avery5164label & 4.19$''$ & 3.33$''$ & 0.5$''$ & 0.16$''$ &
457 0.19$''$ & 2 & 3\\
458 avery5262label & 110 mm & 34 mm & 21 mm & 4 mm &
459 5 mm & 2 & 7\\
460 herma4625label & 105 mm & 42.3 mm & 0 mm & 5 mm &
461 5 mm & 2 & 7\\
462 \hline
463 \end{tabular}
464 \caption{Standard label sizes}
465 \label{tab:Lab}
466 \end{center}
467 \end{table}
468
469 \begin{decl}
470 |\SetLabel|%
471 \marg{$W$}\marg{$H$}\marg{$t$}\marg{$l$}\marg{$r$}\marg{$N_c$}\marg{$N_r$}
472 \end{decl}
473 If your label size is not listed in Table~\ref{tab:Lab}, put in the
474 preamble of your document the command |\SetLabel|\marg {$W$}\marg
475 {$H$}\marg {$t$}\marg {$l$}\marg {$r$}\marg {$N_c$} \marg{$N_r$}. This
476 command is completely analogous to the command |\SetEnvelope|
477 described above.
478
479 \begin{decl}
480 |avery5163biglabel|,
481 |avery5164biglabel|
482 \end{decl}
483 \NEWfeature{Version 1.2}
484 ``Big labels'' are big enough to carry both shipping and return
485 addresses, otherwise their dimensions are completely analogous to the
486 ones of labels. The predefined big labels are listed in
487 Table~\ref{tab:BigLab}. Note the difference between package options,
488 say, |avery5163label| and |avery5163biglabel|: while the physical
489 media is same, the formatting of addresses is quite different.
490
491 \begin{table}[tbp]
492 \begin{center}
493 \leavevmode
494 \begin{tabular}{ccccccccc}
495 \hline
496 Package option & $W$ & $H$ & $t$ & $l$ & $r$ & $N_c$ & $N_r$\\
497 \hline
498 avery5163biglabel & 4.19$''$ & 2$''$ & 0.5$''$ & 0.16$''$ &
499 0.19$''$ & 2 & 5\\
500 avery5164biglabel & 4.19$''$ & 3.33$''$ & 0.5$''$ & 0.16$''$ &
501 0.19$''$ & 2 & 3\\
502 \hline
503 \end{tabular}
504 \caption{Standard big label sizes}
505 \label{tab:BigLab}
506 \end{center}
507 \end{table}
508
509 \begin{decl}
510 |\SetBigLabel|%
511 \marg{$W$}\marg{$H$}\marg{$t$}\marg{$l$}\marg{$r$}\marg{$N_c$}\marg{$N_r$}
512 \end{decl}
513 \NEWfeature{Version 1.2}
514 If your label size is not listed in Table~\ref{tab:BigLab}, put in the
515 preamble of your document the command |\SetBigLabel|\marg {$W$}\marg
516 {$H$}\marg {$t$}\marg {$l$}\marg {$r$}\marg {$N_c$} \marg{$N_r$}.
517
518
519 \subsection{Printing details}\label{sec:Print}
520
521 \EL\ typesets envelopes or sheets of labels just after the main text
522 of all letters in the documents. Most printers that have paper tray
523 and manual feeding slot use manual slot if it is not empty and tray
524 otherwise. When printing envelopes or labels on such printers, you
525 wait until the text of letters is printed, and then insert envelopes
526 or label sheets one by one in the manual feeding slot.
527
528 \begin{decl}
529 |\AtBeginLabels|\marg{Printer specific commands}\\
530 |\AtBeginLabelPage|\marg{Printer specific commands}
531 \end{decl}
532 However some printers have several paper trays and even paper trays
533 for envelopes. Moreover, sometimes the switching between trays can be
534 performed automatically by software commands. If you know such
535 commands for your printer and know how to insert them in the |.dvi| file
536 (e.g. through |\special|s), you can use the hook
537 |\AtBeginLabels|. Put the printer specific commands in the
538 argument of |\AtBeginLabels|. If you succeed, please e-mail me these
539 commands and the specifications of your printer, so I can include them
540 in the future releases of \EL. \NEWfeature{Version 1.1} Note that the
541 command |\AtBeginLabels| is cumulative: if you use it several times in
542 the same document, the new commands will be appended without overwriting
543 the previous definitions.
544
545 \NEWfeature{Version 1.1}
546 The command |\AtBeginLabelPage| works in the
547 same way, but its argument will be inserted at the beginning of each
548 \emph{page} of \EL\ output, i.e. before printing each envelope or
549 label sheet.
550
551 The code for \PS{} printers is described in Section~\ref{sec:PS}.
552
553 There are differences in the handling of the text close to paper edges
554 from printer to printer. Since envelopes and label sheets have text
555 near the edges, you might need to tune the offsets. For labels you
556 can use the command |\SetLabel| to do this. The optional first
557 argument of the command |\SetEnvelope| sets the distance between the
558 leading edge of ``logical paper'' and the physical leading edge of the
559 envelope (0 pt by default).
560
561 \begin{decl}
562 |rotateenvelopes|, |norotateenvelopes| \\
563 Options for \graphics\ package
564 \end{decl}
565 Usually envelopes are printed in the landscape mode, i.e. rotated by
566 $90^\circ$. The package options |rotateenvelopes| (default) and
567 |norotateenvelopes| control the rotation. Note that if you want to
568 rotate envelopes, you need the standard package \graphics\
569 installed on your system. Also, you need a |dvi| driver that
570 understands rotation commands of the \graphics\ package. (I
571 think currently only \dvips\ does this). The package
572 \graphics\ is called internally by \EL. If you need to pass
573 specific options to the \graphics\ package, include it in the
574 list of options of \EL. For example, the command
575 |\usepackage[personalenvelope,dvips]{envlab}| calls \graphics\
576 with the option |dvips|.
577
578 \begin{decl}
579 |centerenvelopes|, |leftenvelopes|,
580 |rightenvelopes|,\\
581 |customenvelopes|, |\EnvelopeLeftMargin|
582 \end{decl}
583 Most of manual feeding slots accept non-standard paper (like
584 envelopes) \emph{centered}. However there are some printers that
585 require non-standard paper to be pushed to the left or right end of
586 the slot. The package options |centerenvelopes| (this is the default
587 option), |leftenvelopes|, |rightenvelopes| and |customenvelopes|
588 control the position of the envelope with respect to the slot. The
589 first three options are self-explanatory. The fourth gives the control
590 over the envelope positioning to the user. If you choose this option,
591 you must set the length |\EnvelopeLeftMargin| before printing the
592 envelopes. For example to shift the envelope for $2''$ from the left
593 edge use |\setlength{\EnvelopeLeftMargin}{2in}|
594
595 \begin{decl}
596 |\FirstLabel|\marg{Row}\marg{Col}
597 \end{decl}
598 \NEWdescription{Version 1.2} Sometimes you need to print labels on a
599 partially used sheet. \NEWfeature{Version 1.1} The command
600 |\FirstLabel|\marg{Row}\marg{Col} allows you to start printing of
601 labels from the given position. For example, the command
602 |\FirstLabel{3}{2}| causes \EL\ to start printing labels beginning
603 with the second label in the third row. Note that labels are printed
604 row by row (\emph{not} column by column, like in the standard \LaTeXe\
605 |letter| class).
606
607
608 \subsection{Formatting of the address (barcodes and capitalization)}
609
610 In the United States (and many other countries as well) the mailing
611 pieces are sorted by machines. This process is greatly facilitated if
612 the addresses typesetting is enhanced for machine readability.
613
614
615 USPS standards \cite{Pub25} establish two ways for making the addresses
616 machine readable: barcodes and special printing of addresses for
617 optical character recognition (OCR) devices. In principle any method
618 would be sufficient, but it seems reasonable to play it safe using
619 \emph{both} methods. Therefore \EL\ by default both prints barcodes
620 and prepares addresses for OCR. This behavior can be controlled
621 through package options.
622
623 Note that only ``To-Address'' should be machine-readable. The return
624 address can be formatted more freely. You can, for example, include
625 your logo in the \emph{return} address (see Section~\ref{sec:Cust})
626
627 \begin{decl}
628 |printbarcodes|, |noprintbarcodes|
629 \end{decl}
630 The addresses in the US contain ``zipcodes''---strings of five digits
631 (5-code) or 9 digits divided by dash (5+4 code). The 5+4 code is
632 actually a detalization\footnote{There is an even finer detalization
633 provided by the so called DPC numbers \cite{Pub25}. \EL\ does not
634 support it yet}, so the zipcode 12345-6789 can be written as just
635 12345. This code is converted into a series of long and short bars and
636 printed on a label or envelope. If the option |printbarcodes|
637 (default) is selected, \EL\ tries to extract zipcode from the address
638 and print it. It defines zipcode as a sequence of digits that:
639 \begin{enumerate}
640 \item Has no characters other than digits and dashes (-) inside it
641 \item Has no groups in braces (|{}|)inside it and is not braced itself
642 \item \label{item:Last} Is the last in the address field
643 \end{enumerate}
644 The option |noprintbarcodes| suppresses the typesetting of barcodes.
645
646 \begin{decl}
647 |alwaysbarcodes|, |noalwaysbarcodes|
648 \end{decl}
649 Sometimes the rule~\ref{item:Last} is too harsh. Consider, for example,
650 the following address:
651 \begin{quote}
652 Mr. A. B. User\\
653 32 Omega Road\\
654 Palo Alto Ca 12345\\
655 USA
656 \end{quote}
657 Obviously it has a zipcode, however \EL\ normally will not see it. The
658 option |alwaysbarcodes| lifts this restriction, and \EL\ typesets barcodes
659 for the last number met in the address even if it is followed by some other
660 characters. Be careful with this option! If you select it, all addresses
661 must actually have zipcodes. Otherwise \EL\ will happily convert to bars a
662 street or apartment number.
663
664 This option is especially useful if the addresses are not typed in
665 manually, but are prepared by some mail merge program like
666 \mailing\ package. Then they can contain spaces at the end, and
667 \EL\ will not recognize zipcodes unless |alwaysbarcodes| is selected.
668 The option |noalwaysbarcodes| (default) suppresses this behavior.
669
670 \begin{decl}
671 |capaddress|, |nocapaddress|
672 \end{decl}
673 To facilitate OCR \EL\ typesets addresses in \textsf{\large 12pt sans
674 serif} font. The machine readability of the addresses is increased
675 if the following recommendations of US Postal service are followed:
676 \begin{itemize}
677 \item Converting the addresses to uppercase
678 \item Stripping punctuation from the addresses
679 \item Inserting 1 pt kern between the letters
680 \end{itemize}
681 The result looks rather ugly for human eye. However, it is intended not for
682 humans, but for machines. We will call this processing \emph{address
683 capitalization}. \EL\ performs capitalization of the
684 ``To-addresses'' automatically if the option |capaddress| (default) is
685 selected. The option |nocapaddress| suppresses capitalization of the
686 addresses.
687
688 If you decide to capitalize the addresses, be careful with the
689 accented letters. Since \EL\ processes the address letter by
690 letter\footnote{Rather, token by token}, it tries to insert kern
691 between |\"| and |u| in the word |M\"uller| causing an
692 error. Therefore all accented letters should be enclosed in
693 braces. The correct way to typeset Herr.~M{\"u}ller is
694 |Herr.~M{\"u}ller|\footnote{I probably should strip all accents since
695 they might confuse OCR. However USPS says nothing about accents, and
696 I decided to preserve them.}.
697
698 \subsection{Printing of return addresses}
699
700
701 \begin{decl}
702 |printreturnaddress|, |noprintreturnaddress|
703 \end{decl}
704 \NEWfeature{Version 1.1}
705 The return addresses are printed on the envelopes if the package option
706 |printreturnaddress| (default) is chosen. Alternatively, the package
707 option |noprintreturnaddress| suppresses the printing of the return
708 address. Section~\ref{sec:Cust} describes how to customize your return
709 address.
710
711
712 \subsection{Change of settings for some labels}
713
714 \begin{decl}
715 |\suppresslabels|, |\resumelabels|,\\
716 |\suppressonelabel|, |\resumeonelabel|
717 \end{decl}
718 \NEWfeature{Version 1.2} In many cases your |.tex| file contains many
719 |letter| environments. By default, if the command |\makelabels|
720 appears in the preamble, all them will generate mailing labels.
721 Sometimes you may want to override this behavior. \EL{} provides four
722 handy commands for this. The command |\suppresslabels| issued anywhere
723 before |\end{letter}| will suppress printing of mailing labels for the
724 current and subsequent letters---until the command |\resumelabels| is
725 issued. The commands |\suppressonelabel| and |\resumeonelabel| are
726 similar, but act only on the current label.
727
728
729
730
731 \begin{decl}
732 |\ChangeEnvelope|, |\ChangeLabel|, |\ChangeBigLabel|
733 \end{decl}
734 \NEWfeature{Version 1.2} The commands |\SetEnvelope|, |\SetLabel|,
735 |\SetBigLabel| have immediate effect: they set the sizes of all
736 following mailing labels. The mailing labels, automatically generated
737 by |letter| environments, are written to the |.aux| file, and
738 therefore they all will be printed for the envelope or labels size set
739 by the last |\Set| command. Sometimes, however, one needs to print
740 envelopes for the different |letter| environments at different sizes.
741 The commands |\ChangeEnvelope|, |\ChangeLabel| and |\ChangeBigLabel|
742 have the same meaning and arguments as the corresponding |\Set|
743 commands. However, instead of setting the media, they write the
744 information into the |.aux| file, and the actual change is delayed
745 until the |.aux| file is read (i.~e.~at the end of the document).
746 Therefore they act only on the mailing labels, extracted from the
747 |letter| environments, that follow this command.
748
749
750
751 \subsection{Enhancements for the \texttt{letter} environment}
752
753 \NEWfeature{Version 1.2}
754 Some people letters contain below the address the subject like this
755 \begin{quote}
756 Re: our recent talk
757 \end{quote}
758 A way to do this is to include it in the address (see
759 Figure~\ref{fig:wrong}). However, this additional info will be put in
760 the mailing label, which is wrong. The package \EL{} defines a command
761 |\re| to cope with this.
762
763 \begin{figure}[tbp]
764 \leavevmode
765 \begin{figpage}
766 \begin{verbatim}
767 \documentclass[12pt]{letter}
768
769 \address{%
770 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}
771 \signature{Joe}
772
773 \begin{document}
774
775 \begin{letter}{%
776 Mary McKeen\\
777 2 Alpha Street\\
778 Otherplace, NY 12346\\[2ex]
779 Re: Our love}
780 \opening{Dear Mary:}
781 I love only you
782 \closing{With love,}
783 \end{letter}
784 \end{document}
785 \end{verbatim}
786 \end{figpage}
787 \caption{A wrong way to include subject information in the letter}
788 \label{fig:wrong}
789 \end{figure}
790
791 \begin{decl}
792 |re|, |nore|
793 \end{decl}
794 This command poses the following problem. The rest of the \EL{}
795 package meant to work not only with the standard |letter| class, but
796 with any other letter classes that write address information to the
797 |.aux| file in the standard format. However, if a package makes a
798 change to the formatting of the letter itself, we cannot be guaranteed
799 that it will work with all letter classes. Therefore we chose the
800 following solution: the additional features are enabled only if the
801 package option |re| is selected. If the option |nore| (default) is
802 selected, the package works in the ``compatibility mode'', and the
803 additional features are disabled\footnote{For \TeX perts: if the
804 option |re| is chosen, \EL{} redefines the \cs{opening} command. See
805 the file |envlab.dtx| for additional information.}.
806
807
808
809
810 \begin{decl}
811 |\re|
812 \end{decl}
813 \NEWfeature{Version 1.2}
814 The command |\re| defines additional subject information to be put
815 between the address and opening. It is very simple: just put
816 |\re|\marg{Subject} anywhere before the |\opening| command (see
817 Figure~\ref{fig:right}).
818
819 \begin{figure}[tbp]
820 \leavevmode
821 \begin{figpage}
822 \begin{verbatim}
823 \documentclass[12pt]{letter}
824
825 \usepackage[avery5160label,re]{envlab}
826 \makelabels
827
828 \address{%
829 Joe Casanova\\1 Lambda Street\\Anyplace, NY 12345}
830 \signature{Joe}
831
832 \begin{document}
833
834 \begin{letter}{%
835 Mary McKeen\\
836 2 Alpha Street\\
837 Otherplace, NY 12346}
838 \re{Our love}
839 \opening{Dear Mary:}
840 I love only you
841 \closing{With love,}
842 \end{letter}
843 \end{document}
844 \end{verbatim}
845 \end{figpage}
846 \caption{The \EL{} way to include subject information in the letter}
847 \label{fig:right}
848 \end{figure}
849
850 Actually the scope of the |\re| command is the same as the scope of
851 the commands like |\address| or |\signature|: if it is issued outside
852 the |letter| environment, it affect all subsequent letters. If it is
853 issued inside the |letter| environment (but before the |\opening|
854 command), it is local to the current letter. To disable global |\re|,
855 just issue this command with empty argument: |\re{}|.
856
857
858 \section{Customization}
859 \label{sec:Cust}
860
861 \begin{decl}
862 |\returnaddress|
863 \end{decl}
864 Many people and companies want to print their logos on the
865 envelopes. You can include any image in your return address. The macro
866 |\returnaddress| controls the contents of the ``From-address'' field
867 on your envelope. \EL\ takes it from the |\address| command in your
868 document. However you can easily redefine it. For example, if the file
869 |mylogo.eps| contains your logo, you put in the preamble
870 |\renewcommand{\returnaddress}{\protect\includegraphics{mylogo}}| to
871 customize your envelopes. If you want return labels with your logo,
872 use command like
873 |\printreturnlabels{180}{{\protect\includegraphics{mylogo}}|.
874 \NEWdescription{Version 1.1} You can
875 include both logos and textual information into the |\returnaddress| macro.
876 While customizing return address, it is useful to know that
877 \LaTeX\ |letter| document class stores the contents of the |\address|
878 command in the |\fromaddress| macro, so the default definition of the
879 return address implemented in \EL\ is
880 |\renewcommand{\returnaddress}{\fromaddress}|.
881
882 \begin{decl}
883 Customization of lengths
884 \end{decl}
885 All lengths (heights, widths, margins) are user-customizable. Consult
886 the file |envlab.dtx| for their definitions and use.
887
888 \begin{decl}
889 |\ReName|
890 \end{decl}
891 \NEWfeature{Version 1.2}
892 The subject name for the |\re| command is stored in the |\ReName|
893 macro. Normally it is defined as plain style ``Re: ''. To
894 |\newcommand{\ReName}{Re: }| (note the space after semicolon!). To
895 change this, use |\renewcommand|, for example
896 |\renewcommand{\ReName}{\textbf{Subject: }}|.
897
898
899 \begin{decl}
900 |envlab.cfg|
901 \end{decl}
902 If you use \EL\ for some time, you probably would have a number of
903 options and commands that you execute in most documents prepared with
904 the package. You can save the typing by putting such commands in the
905 configuration file |envlab.cfg|. A sample configuration file is
906 included in the \EL\ distribution. You are free to hack it in any way
907 you like\footnote{\emph{Important:} |envlab.cfg| is the only file you
908 should modify. You are \emph{not} allowed to modify any other files
909 in the \EL\ distribution.}. This file consists of two parts:
910 |\ExecuteOptions|\marg{options} and
911 |\AtEndOfPackage|\marg{customization commands}. The options listed in
912 the first part supersede the default options of \EL. However the
913 options explicitly listed as the arguments of the |\usepackage|
914 command supersede the options in the configuration file. The commands
915 listed in the second part of the configuration file---as the arguments
916 of the |\AtEndOfPackage| command---supersede all definitions in the
917 package itself. Therefore by hacking |envlab.cfg| you can completely
918 change the behavior of the package without modifying \EL.
919
920
921 \section{Commands for \PS{} printers}
922 \label{sec:PS}
923
924
925 I myself know next to nothing about programming of \PS{} printers, and
926 the following is based on contributions of \EL{} users.
927
928 \begin{decl}
929 |pswait|, |nopswait|
930 \end{decl}
931 \NEWfeature{Version 1.1}
932 If you use \dvips, you can ask it to switch your printer to manual
933 mode just before printing envelopes and labels. The printer will print the
934 main body of the letter(s) using the paper tray, and then stop, waiting for
935 envelopes or label sheets to be fed in the manual slot. The option
936 |pswait|, based on the code by \emph{William Slough}
937 \texttt{<[email protected]>},
938 inserts the corresponding \PS\ |special|s in your output.
939 The option |nopswait| (default) suppresses this behavior.
940
941 \begin{decl}
942 |\PSwait|
943 \end{decl}
944 \NEWfeature{Version 1.1} William Slough's code can be useful in
945 other situations when you need to switch to manual mode in the
946 middle of the document. The command |\PSwait| inserts the
947 corresponding \PS\ code in the \dvips\ output. (An attentive reader
948 has probably already guessed that the |pswait| option is implemented
949 through the command |\AtBeginLabels{\PSwait}|).
950
951 \begin{decl}
952 |psautotray|, |nopsautotray|
953 \end{decl}
954 \NEWfeature{Version 1.2}
955 \emph{Uri Blumenthal} \texttt{<[email protected]>} wrote code for automatic
956 switching to other trays For example, if your envelopes are loaded
957 into \texttt{/otherenvelopetray}, try the following code:
958 \begin{verbatim}
959 \AtBeginLabels{%
960 \special{ps:clear grestore
961 statusdict begin false setduplexmode
962 /manualfeed true def
963 /otherenvelopetray end 0 0 bop }}
964 \end{verbatim}
965 If the package option |psautotray| is selected, \EL{} will try to
966 guess the proper tray from the envelope you chose. The option
967 |nopsautotray| (default) disables this feature. At present this
968 mechanism is rather experimental; I would be grateful for
969 failure/success reports as well as for suggestions. Note that |pswait|
970 and |psautotray| options are not compatible (|psautotray| switches the
971 printer to the manual mode anyway). If you selected them both, only
972 the one selected last will be chosen.
973
974 \NEWdescription{Version 1.2}
975 Another solution by \emph{Robert Estes}
976 \texttt{<[email protected]>} works for Optra R+ printers:
977 \begin{verbatim}
978 \AtBeginLabels{\special{ps:
979 clear grestore
980 1 dict dup /MediaPosition null put setpagedevice
981 1 dict dup /ManualFeed true put setpagedevice
982 1 dict dup /Policies 1 dict dup /PageSize 2 put put setpagedevice
983 2 dict dup /PageSize [297 684] put dup /ImagingBBox null put setpagedevice
984 0 0 bop
985 }}
986 \end{verbatim}
987
988 \NEWdescription{Version 1.2}
989 The code by \emph{Greg Jumper} \texttt{<[email protected]>} works
990 for HP LaserJet 4MV:
991 \begin{verbatim}
992 \special{! <</ManualFeed true /DeferredMediaSelection true
993 /PageSize [297 684] /ImagingBBox null>> setpagedevice}
994 \end{verbatim}
995
996
997
998 \section{Bugs and limitations}
999 \label{sec:Bugs}
1000
1001 \NEWdescription{Version 1.1}
1002 The most important limitation of \EL\ is related to an essential
1003 limitation of \TeX\ itself. People usually want their envelopes printed
1004 rotated $90^\circ$, so the envelopes are inserted in the printed by the
1005 short side. Unfortunately \TeX\ was not designed with the text rotation
1006 in mind. Therefore ``basic'' \TeX\ does not allow to typeset envelopes in
1007 this manner. The standard \LaTeXe\ package \graphics\ uses \PS\ to add
1008 this functionality to \TeX. \EL\ uses \graphics\ internally if the option
1009 |rotateenvelopes| (default) is in effect. Therefore to typeset rotated
1010 envelopes you need \graphics\ and either a \PS\ printer or \gs. Otherwise
1011 use |norotatenvelopes| option if your printed can process envelopes
1012 inserted by the long side. I understand that there is a problem with
1013 printing rotated text on non-\PS\ printers. Probably the authors of
1014 |dvi| drivers should be urged to address it.
1015
1016 \NEWdescription{Version 1.1}
1017 \EL\ thinks that all options it cannot understand belong to the
1018 \graphics\ package and sends them there. Therefore if you misspell
1019 an option of the \EL\ package, you will receive an error message from the
1020 \graphics\ package rather than from \EL.
1021
1022
1023 Please send bug reports to |[email protected]|. You can find
1024 experimental versions of \EL\ at my homepage
1025 (|http://planck.psu.edu/~boris|).
1026
1027
1028
1029 \section{Acknowledgements}
1030
1031 \NEWdescription{Version 1.2} Since the first version of \EL{} was
1032 released, many users helped me with bug reports, suggestions and code
1033 contributions to enhance it. I would like to express my gratitude to
1034 Uri Blumenthal, Arnie Ostebee, William Slough, Ed Reingold, Jos
1035 Jansen, Juergen Schlegelmilch, Jim Hill, Greg Jumper, Robert Estes,
1036 Genick Bar-Meir and many others for their help.
1037
1038
1039 \section{Legalese}
1040
1041 The package \EL\ is provided ``as is'' and comes with absolutely no
1042 warranty of any kind, either expressed or implied, including, but not
1043 limited to, the implied warranties of merchantability and fitness for
1044 a particular purpose. The entire risk as to the quality and
1045 performance of the program is with you. Should the program prove
1046 defective, you assume the cost of all necessary servicing, repair or
1047 correction.
1048
1049 In no event unless required by applicable law will the author of the
1050 program be liable to you for damages, including any general, special,
1051 incidental or consequential damages arising out of any use of the
1052 program or out of inability to use the program (including but not
1053 limited to loss of data or data being rendered inaccurate or losses
1054 sustained by you or by third parties as a result of a failure of the
1055 program to operate with any other programs), even if such holder or
1056 other party has been advised of the possibility of such damages.
1057
1058 In particular, while every effort was made to provide typesetting of
1059 mailing pieces accordingly to the United States Postal Service
1060 recommendations, the author of the package does not warrant neither
1061 successful delivery of mail nor granting of mailing discounts in the
1062 USA or any other countries.
1063
1064
1065
1066
1067 \EL\ package is covered by the same license as the current \LaTeXe\
1068 package (see the files |legal.txt| and |modguide.tex| in the \LaTeXe\
1069 distribution).
1070
1071 Avery and all Avery codes are trademarks of Avery Dennison Corporation.
1072 \bigskip
1073
1074
1075
1076 \begin{thebibliography}{1}
1077 \addcontentsline{toc}{section}{\protect\refname}
1078 \bibitem{Pub25}
1079 USPS.
1080 \newblock {\em Designing Business Letter Mail (Pub 25)}, August 1995.
1081 \end{thebibliography}
1082
1083
1084
1085
1086
1087
1088
1089 \end{document}
1090
1091 %%% Local Variables:
1092 %%% mode: latex
1093 %%% TeX-master: t
1094 %%% End:
1095
1096
1097
1098
1099
1100
1101
1102
1103