| 1 |
% labels.doc --- version 1.0 (24 October 1991) |
| 2 |
% This is the documentation for labels.tex. |
| 3 |
% To read this file, process it with (plain) TeX: tex labels.doc |
| 4 |
% (To do that, you need manmac.tex, which has |
| 5 |
% the macros for typesetting the TeXbook, as explained in appendix E. |
| 6 |
% It comes free with the standard distribution of TeX.) |
| 7 |
% |
| 8 |
% NOTE: Processing this file with TeX will create empty files |
| 9 |
% index.tex and answers.tex in your directory. And if you |
| 10 |
% have a file pages.tex in your directory, TeX will probably |
| 11 |
% get very confused. |
| 12 |
% The manmac format will try to load a font called cmman; if |
| 13 |
% TeX complains that it cannot find that font you can savely |
| 14 |
% ignore that, since the font is not actually used. |
| 15 |
% |
| 16 |
% This file: copyright (c) 1991 Marcel van der Goot. |
| 17 |
% You may redistribute this file and printed versions of it. |
| 18 |
% |
| 19 |
% original: csvax.cs.caltech.edu [131.215.131.131] in pub/tex |
| 20 |
% (use anonymous ftp). Also in various archives. |
| 21 |
% |
| 22 |
% Marcel van der Goot |
| 23 |
% [email protected] |
| 24 |
% Caltech 256--80 |
| 25 |
% Pasadena, CA 91125 |
| 26 |
% (818) 356--4603 |
| 27 |
|
| 28 |
% Doc history: |
| 29 |
% 10 Sep 1991: Added paragraph about centering labels. |
| 30 |
% 22 Apr 1991: First version |
| 31 |
|
| 32 |
% ------ definitions for manual pages: |
| 33 |
% The documentation is typeset using Knuth's ``manmac'' macros, with a |
| 34 |
% few additional things defined here. You are free to use or adapt these |
| 35 |
% extra definitions. |
| 36 |
|
| 37 |
\input manmac % the macros used for typesetting The TeXbook (appendix E) |
| 38 |
\catcode`^=7 % manmac makes ^ active for creating an index |
| 39 |
% we don't make an index, and we need ^ to be non-active |
| 40 |
|
| 41 |
{\catcode`\^^M=12 \endlinechar=-1 % 12 = other |
| 42 |
\long\gdef\manpagehead#1^^M#2^^M#3^^M^^M% tex-file, description, version |
| 43 |
{\egroup % matches \bgroup in \manpage |
| 44 |
\par\vfill\eject |
| 45 |
\edef\rhead{\manualname: #1\unskip}% |
| 46 |
\setbox1=\hbox{\titlefont #1\quad}% |
| 47 |
\setbox3=\vtop{\advance\hsize by-\wd1 \parindent=0pt \raggedright |
| 48 |
#2\par |
| 49 |
#3\par |
| 50 |
\cnotice |
| 51 |
}% |
| 52 |
\line{\box1\box3}% |
| 53 |
\bigskip\bigskip\bigskip\noindent |
| 54 |
}% |
| 55 |
} % restore \catcode`\^^M |
| 56 |
|
| 57 |
\outer\def\manpage |
| 58 |
{\bgroup\catcode`\^^M=12 |
| 59 |
\manpagehead |
| 60 |
} |
| 61 |
|
| 62 |
\hsize=6.5in\vsize=8.9in % default plain TeX values |
| 63 |
\pagewidth=\hsize \pageheight=\vsize |
| 64 |
|
| 65 |
\def\cnotice{Copyright \copyright\ 1991 Marcel R. van der Goot} |
| 66 |
\def\manualname{Midnight Macros} |
| 67 |
|
| 68 |
% LaTeX logo, from latex.tex (except for the capital `A': manmac |
| 69 |
% doesn't have a real smallcaps font) |
| 70 |
\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em |
| 71 |
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} |
| 72 |
|
| 73 |
\tenpoint |
| 74 |
|
| 75 |
% (end of extra definitions) |
| 76 |
|
| 77 |
% -------------------- labels.doc: |
| 78 |
|
| 79 |
\pageno=12 % follows dolines.doc |
| 80 |
|
| 81 |
\manpage labels.tex |
| 82 |
Macros to print address labels and bulk letters. |
| 83 |
Version: 1.0 (24 October 1991) (doc: 10 Sep 1991) |
| 84 |
|
| 85 |
The macros defined in labels.tex can be used to print address labels. Such |
| 86 |
labels can be printed on normal paper, if you want to cut them yourself, |
| 87 |
or on peel-off labels. (Peel-off labels are available in various sizes for |
| 88 |
most types of printers and photo-copiers.) |
| 89 |
In order to use the macros |
| 90 |
you always have to start with |\input labels|, which reads |
| 91 |
labels.tex\footnote*{To use labels.tex you also need Midnight/dolines.tex and |
| 92 |
Midnight/loop.tex, which are input automatically.}. |
| 93 |
We will first explain how to |
| 94 |
typeset labels, then how to print bulk letters. |
| 95 |
|
| 96 |
There are two slightly different ways to print labels. The first one is to say |
| 97 |
\begintt |
| 98 |
\beginlabels |
| 99 |
... |
| 100 |
\endlabels |
| 101 |
\endtt |
| 102 |
where in place of `|...|' you type the labels separated by empty lines. |
| 103 |
The second is to simply say |
| 104 |
\begintt |
| 105 |
\labelfile{...} |
| 106 |
\endtt |
| 107 |
where `|...|' is the name of a file that contains the labels. In either case |
| 108 |
a label consists of several lines, and labels are separated by one |
| 109 |
or more empty lines. You end your file as usual, with |\bye|. |
| 110 |
Labels.tex does not specify which font to use, which |
| 111 |
in plain \TeX\ means that by default a 10 points Roman font is used. |
| 112 |
However, for legibility |
| 113 |
it is usually better to use a sans-serif font, for instance by writing |
| 114 |
\begintt |
| 115 |
\font\sf=cmss12 |
| 116 |
\sf \baselineskip=14pt |
| 117 |
\endtt |
| 118 |
In order to typeset labels, you must define the size and other attributes |
| 119 |
of labels. (There are default values, but they are |
| 120 |
unlikely to suit your needs, especially if you want to print on |
| 121 |
peel-off labels.) These attributes must be set before you call |
| 122 |
|\beginlabels| or |\labelfile|; therefore, a typical input file has the form |
| 123 |
\beginlines |
| 124 |
|\input labels| |
| 125 |
\nobreak |
| 126 |
|\vlbls=5 \hlbls=2| |
| 127 |
\goodbreak |
| 128 |
|\vlblsize=5cm| |
| 129 |
|\labelfile{customers.lbl}| |
| 130 |
\nobreak |
| 131 |
|\bye| |
| 132 |
\endlines |
| 133 |
where file `customers.lbl' has the addresses that must be typeset. The |
| 134 |
assignments to |\vlbls|, |\hlbls|, and |\vlblsize| define certain attributes. |
| 135 |
Next we describe which attributes there are. |
| 136 |
|
| 137 |
First you have to tell \TeX\ how labels must appear on a page. |\vlbls| |
| 138 |
must denote the vertical number of labels per page, |\hlbls| the horizontal |
| 139 |
number. |\vfirst| specifies the amount of white space between the top of the |
| 140 |
page and the top of the first label; |\hfirst| is the amount of white space |
| 141 |
to the left of the first label. Dimensions |\vinter| and |\hinter| specify |
| 142 |
the white space between labels. |
| 143 |
|
| 144 |
Then you have to specify the size of each label. |\vlblsize| and |\hlblsize| |
| 145 |
specify the vertical and horizontal sizes of a single label. |\vindent| is |
| 146 |
the white space between the top of the label and the baseline of the first |
| 147 |
line. (|\vindent| is similar to \TeX's |\topskip| parameter.) |\hindent| |
| 148 |
is the amount of white space between the left edge of a label and the |
| 149 |
text of the label. |
| 150 |
|
| 151 |
The parameters mentioned above are sufficient to typeset labels. There |
| 152 |
are however a few special parameters that are sometimes useful. |
| 153 |
By default, there is no outline around the labels. That is suitable for |
| 154 |
printing on peel-off labels, but inconvenient for use with previewers or |
| 155 |
plain paper. You can set |\lbloutline| to the thickness of the lines |
| 156 |
you want around your labels, e.g., |\lbloutline=0.5pt|. The outlines |
| 157 |
are drawn at the outside of the label (i.e., in the space between the |
| 158 |
labels). |
| 159 |
|
| 160 |
If there is too much text on a label, an error message is given; for reference, |
| 161 |
the message contains the input text corresponding to the label. A label |
| 162 |
with an error is not typeset. |
| 163 |
When you typeset labels, by default a file `lblerror.tex' is created, which |
| 164 |
has the text of all the labels that did not fit. This makes it convenient to |
| 165 |
process those labels again, e.g., with |\labelfile|. |
| 166 |
However, if you set |\erroraction=0| before you start typesetting labels, |
| 167 |
file `lblerror.tex' is not created. Setting |\erroraction=1| does not only |
| 168 |
suppress generation of the error file, it also forces printing of the labels |
| 169 |
that have errors. Any other value of |\erroraction| causes the default |
| 170 |
behavior. |
| 171 |
|
| 172 |
\danger The error messages refer to the natural size of a label. If |
| 173 |
|\vindent| and |\hindent|, which are glue parameters, have shrink components, |
| 174 |
it is possible that the text will actually fit on the label. However, usually |
| 175 |
these indentations have no stretch or shrink components. |
| 176 |
|
| 177 |
\danger There are two token registers, |\beforelbl| and |\afterlbl|, that |
| 178 |
can be used to put additional text on each label. |
| 179 |
They contain \<vertical material> that is inserted just before and after |
| 180 |
the text of the label, respectively. By default, these sequences are empty. |
| 181 |
One can for instance specify |
| 182 |
\begintt |
| 183 |
\beforelbl={\line{---Confidential---\hfil}\smallskip} |
| 184 |
\endtt |
| 185 |
to put ``---Confidential---'' at the beginning of each address. {\sl Note:\/} |
| 186 |
Since addresses are normally read from bottom to top, the post office |
| 187 |
prefers it if you don't put text after the address, unless it is part |
| 188 |
of the address. E.g., using |\afterlbl={\noindent USA}| is ok, but use |
| 189 |
|\beforelbl| if you want to add an ``attention:\dots'' line to each label. |
| 190 |
|
| 191 |
\danger If you want to use the labels for something else than addresses, you |
| 192 |
may want to center the text on the label. Horizontal centering can be obtained |
| 193 |
with |\hindent=0pt plus1fil|. Note that this centers the text according to |
| 194 |
the widest line; it does not center each line separately. |
| 195 |
Vertical centering is a bit more complicated, because of the way \TeX\ stacks |
| 196 |
boxes vertically. The following centers the label text vertically: |
| 197 |
\begintt |
| 198 |
\count255=\baselineskip |
| 199 |
\vindent=\count255sp plus1fil |
| 200 |
\endtt |
| 201 |
This works because the actual vertical indentation is |\vindent| minus |
| 202 |
|\baselineskip|, since \TeX\ automatically inserts |\baselineskip| glue. |
| 203 |
|
| 204 |
Within a label, you can type `|&|' and `|#|' for |
| 205 |
`\&' and `\#'. (In \TeX, you usually have to type `|\&|' and `|\#|' to get |
| 206 |
these symbols.) You can use macros in a label, for instance for font changes. |
| 207 |
A line of a label must contain balanced braces; a `|%|' sign |
| 208 |
will concatenate the next line. (Usually, labels do not contain macros, nor |
| 209 |
braces, nor percentage-signs.) |
| 210 |
If for some reason you want an empty line in the middle of a label, |
| 211 |
write a `tie' (`|~|') on that line. (The |~| is replaced by a space in the |
| 212 |
output.) |
| 213 |
|
| 214 |
Address labels are often used to send an identical letter to each addressee. |
| 215 |
The command |\bulk| makes it easy to print the address on each letter. You |
| 216 |
need two files, one with all the addresses, and one with the standard letter. |
| 217 |
Say that they are called `addr.tex' and `letter.tex', respectively. The command |
| 218 |
\begintt |
| 219 |
\bulk{addr}{letter} |
| 220 |
\endtt |
| 221 |
will typeset a copy of the letter for each address. In the letter you can |
| 222 |
use the control sequence |\bulkaddress|. This stands for a vbox that contains |
| 223 |
the address to which the letter corresponds. (The vbox contains an hbox for |
| 224 |
each line of the address; parameters like |\vindent| and |\hlblsize| are not |
| 225 |
important when |\bulk| is used.) Since `letter.tex' is processed many times, |
| 226 |
it is best to put any definitions that apply to all letters in the file |
| 227 |
that contains the |\bulk| command, rather than in the letter itself. |
| 228 |
Each letter is read within a group, so all non-global definitions and |
| 229 |
assignments in the letter are local to the letter. Also note that the |
| 230 |
vbox containing the address is typeset before the letter is read. |
| 231 |
The |\bulk| command does not generate address labels; for that you have |
| 232 |
to use |\labelfile{addr}|. |
| 233 |
|
| 234 |
\bye |