% label.tex, Russell Brown (rbrown@ms.uky.edu) % Change the "\input filename" to whatever you call your % particular file % The following is a format for printing mailing labels. To use, set % the following six 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 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} % % 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 % physical corner in order that the address is not put right at the % edge of the label. %%%%%%%%%%%%%%%%%%%%%%%%%% USER DEFINED LENGTHS %%%%%%%%%%%%%%%%%%%%%% % Everything else is computed using these 6 quantities. \documentstyle{article} \pagestyle{empty} % \newcount\nrows\newcount \ncols \newcount\nrows\newcount\ncols \nrows=10 %Number of rows \ncols=03 %Number of columns. \newdimen\vcorner \newdimen\hcorner \newdimen\vlabel \newdimen\hlabel \vcorner = 1.8in % vertical distance between upper left corner % of page and upper left corner of first label \hcorner = 0.35in % Horizontal distance between page and first % label. \vlabel = 1.0in % Height of label. \hlabel = 2.8in % width of label. \newdimen \vfudge \newdimen \hfudge \vfudge = -0.11 in % experimentally determined quantity which is % addedto 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.25in \setlength{\evensidemargin}{\oddsidemargin} \tempp = \hlabel \advance \tempp by 0.2in \multiply \tempp by \ncols \setlength{\textwidth}{\tempp} \tempp=\vcorner \advance \tempp by -1.60in \setlength{\topmargin}{\tempp}% Physical margin = \topmargin +1.5 in \tempp = \vlabel \multiply\tempp by \nrows \setlength{\textheight}{\tempp} % \showthe \textheight\showthe \textwidth \setlength{\headheight}{-.6in} \setlength{\footheight}{0in} \setlength{\baselineskip}{0in} \setlength{\fboxsep}{0in} %% needed for boxes to come out right %% hgt \setlength{\parskip}{0in} \setlength{\headsep}{0in} \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} {\sf #1} \end{flushleft} \end{minipage} } } \begin{document} \raggedbottom \raggedright \input{test.txt} \end{document}