%CSLIS Technical report 92-645-001 %The mailing label problem %Russell Brown %12/7/92 % %Modified from macros written by K. Herron to produce name tags. %The following is a skeleton for printing mailing labels. To use, set %the following eight variables. The first two are integers and the %rest are dimensions. % %\nrows = number of rows %\ncols = number of columns %\vcorner= vertical distance from top of page to top of first label %\hcorner = horizontal distance from left edge of page to left edge of label %\hlabel = horizontal width of label %\vlabel = vertical height of label % %\hfudge = correction to make the horizontal alignment to work out correctly %\vfudge = correction to make the vertical alignment to work out correctly % %These last two lengths may require some experimenting. % %To type the labels, use the macro \lb which takes one argument, the %entire address with lines separated by \\. %Example \lb{line1 \\line2\\line3} % %Do not leave blank lines between labels. A blank line in the input %file will cause the next label to begin on a new row. % %If a label has too many lines, %it will throw off the alignment of subsequent labels. % %In practice, you will want vcorner and hcorner to be larger than the %coordinates of the corner of the label so that the address %is not put right at the edge of the label. % \documentstyle{article} \pagestyle{empty} %User defined lengths. Everything else is computed using these 6 %quantities. The values below work with Avery Laser printer labels %#5162 (1.33 in x 4 in, 14 labels/page). \newcount\nrows\newcount \ncols \nrows=7 %Number of rows \ncols=2 %Number of columns. \newdimen\vcorner \newdimen\hcorner \newdimen\vlabel \newdimen\hlabel \vcorner =1in %vertical distance between upper left corner %of page and upper left corner of first label \hcorner =0.5in %Horizontal distance between page and first %label. \vlabel=1.4in %Height of label. \hlabel= 4in %width of label. \newdimen \vfudge \newdimen \hfudge \vfudge = -0.11 in %experimentally determined quantity which is %added to vlabel to obtain physical %spacing equal to vlabel. It turns out to %equal the height of a line. \hfudge = -0.25in \newdimen \tempp \tempp = \hcorner \advance\tempp by -1.125in \setlength{\oddsidemargin}{\tempp} %physical %margin = %\..sidemargin + 1.125in \setlength{\evensidemargin}{\oddsidemargin} \tempp = \hlabel \advance \tempp by 0.2in \multiply \tempp by \ncols \setlength{\textwidth}{\tempp} \tempp=\vcorner \advance \tempp by -1in \setlength{\topmargin}{\tempp}% Physical margin = \topmargin +1.5 in \tempp = \vlabel \multiply\tempp by \nrows \setlength{\textheight}{\tempp} \setlength{\headheight}{0in} \setlength{\footheight}{0in} \setlength{\baselineskip}{0in} \setlength{\fboxsep}{0in} %% needed for boxes to come out right %% hgt \setlength{\parskip}{0in} \setlength{\headsep}{0in} \setlength{\topskip}{0in} %% My attempt to get the topmargin correct. \advance \vlabel by \vfudge \advance \hlabel by \hfudge \newcommand{\lb}[1]{ \fill 0.1in \mbox{ \rule[-\vlabel]{0in}{\vlabel} %distance between labels is %1 in+height of 1 line. \begin{minipage}[t]{\hlabel} \begin{flushleft} {#1} \end{flushleft} \end{minipage} } } \begin{document} \raggedbottom \raggedright %Addresses should be typed as shown in the above example. Do not %leave blank lines between addresses. This will result in blank %labels. \input{label-file.tex} %Here is where you put in your list of addresses. \end{document}