summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/make-env/make-env.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/plain/contrib/make-env/make-env.tex')
-rw-r--r--macros/plain/contrib/make-env/make-env.tex117
1 files changed, 117 insertions, 0 deletions
diff --git a/macros/plain/contrib/make-env/make-env.tex b/macros/plain/contrib/make-env/make-env.tex
new file mode 100644
index 0000000000..886ffeb3f8
--- /dev/null
+++ b/macros/plain/contrib/make-env/make-env.tex
@@ -0,0 +1,117 @@
+% make-env.tex
+%
+% J. Daniel Smith
+% 12 January 1990
+%
+% Print an address on an envelope according to strict USPS standards.
+%
+% Usage:
+% Place the address in a file with an extension of .adr. The
+% address is set with the \setaddress command, and \\ is used to
+% break lines. The \setattn command can be used if desired to
+% direct the letter to someones attention.
+%
+% Since this file is also ususally included into a letter, it is
+% also an easy spot to set other things that pertain to the letter
+% itself such as \firstname, etc.
+%
+% These macros use the "landscape" \special of dvips. The exact
+% syntax for other drivers might be slightly different.
+%
+% Bugs:
+% The \fontdimen parameters aren't restored after the address is
+% set, so the Attn: line also uses the strict USPS spacing which I
+% don't think is really necesary. The paremeters should be reset so
+% that the Attn: line will look better.
+%
+% various macros for setting up the information to appear on the
+% envelope. These are place in the lettermac.tex file so that the
+% same .adr file can be used with both letters and envelopes. The
+% ones of primary importance for envelopes are \setaddress and \attn
+%
+\input lettermac
+\input zip % ZIP code barcodes. This *must* be after lettermac.tex
+%
+% Hacks to get the size of the envelope right. These are for a legal
+% size envelope.
+\hsize=9.5true in\hoffset=0.5true in
+\vsize=4.125true in\voffset=1.1875true in
+%
+\special{landscape} % envelopes are printed in landscape mode
+%
+% The USPS has very specific guidelines about printing the address on
+% an envelope. Of course, they will take just about anything, but
+% they like it if the address is in ALL CAPS with no punctuation.
+% 10 point Helvetica (cmss) is one of the recommended fonts with a
+% 14 point baseline. If you want to override the default setting, the
+% \envfont can be specified in the .adr file.
+\font\envfont=cmss10 at 10.95true pt % cmss10 is smaller than 10pt Helvetica
+%\font\envfont=helv at 10true pt % PostScript font Helvetica
+\baselineskip=14true pt
+%
+% Remove punctuation. This is done by making the punctuation
+% characters to be TeX's ignored characters.
+% Hopefully setting TeX's font parameters right will increase the
+% interword spaces to the 1em that the USPS likes.
+%
+% the \catcodes have to be set before the address is read in, since once it is
+% read in, the \catcodes are fixed and can not be changed.
+\catcode`.=9 \catcode`,=9 % 9 = ignored character
+% read in the address
+\getaddress{Letter address file}
+% restore the \catcodes changed above
+\catcode`\.=12 \catcode`\,=12
+%
+% uppercase the address (from page 331 of the TeXbook) to make it the
+% way the USPS likes it. \Xaddress where the lettermac macros store
+% the address when it is read in.
+\def\next#1\endname{\uppercase{\def\Xaddress{#1}}}
+\expandafter\next\Xaddress\endname
+%
+%% for testing....
+%%\vbox to \vsize{\hrule
+%% \centerline{top}
+%% \vfil
+%% \centerline{\vrule left\hfill right\vrule}
+%% \vfil
+%% \centerline{bottom}
+%% \hrule}
+%%\eject\end
+%
+% put the address on the envelope in the correct font.
+% The USPS wants the address in a box that extends from 5/8" from the
+% bottom of the envelope to 2 1/4" from the bottom. This works out to
+% be 1.625 inches total. With the font and baseline skip defined above,
+% this is more than 8 lines (9 is too many).
+%
+% \leftline{\returnaddress} % some type of return address
+\ \vfil % fill up with blank space
+\vbox to 2.25true in{
+\vbox to 1.625true in{\envfont\leftskip=4.5true in
+ % the \fontdimen parameters need to be changed
+ % here in case a different \envfont has been
+ % loaded.
+ \fontdimen6\envfont=10true pt % size of an em
+ \fontdimen2\envfont=10true pt % interword space
+ \fontdimen3\envfont=1true pt % interword stretch
+ \fontdimen4\envfont=1true pt % interword shrink
+ \fontdimen7\envfont=0pt % extra space
+ % the address
+ \address\vfil}
+%
+% The USPS wants the start of the barcode no further than 4" from the
+% right edge of the envelope and no less than than 3 1/4". It
+% prefers between 3 7/8" and 4". In addition it must be 1/4" up
+% from the bottom (plus/minus 1/16"). This 0.25" is provided by the
+% Attn: line below.
+\vfil
+\rightline{\hbox to 4true in{\box\zipbarcode\hfil}}
+%
+% The \attn line if used. This is also set in the \envfont so
+% that everything will be consistant (except perhaps the return
+% address, but that should follow the format of the letterhead.)
+% This is put in a 0.25in \vbox, so that the barcode will be up 0.25
+% in from the bottom of the envelope.
+\vbox to 0.25true in{\vfil\leftline{\envfont\enspace\Xattn}\vskip0.1true in}
+} % \vbox to 2.25true in
+\eject\end % not \bye, it has a \vfill in it