1 %% Macros for typesetting of labels
3 % Default page parameters. You can change them before calling \setuplabels.
7 % Do we want rules around each label?
11 % Do we want cropmarks?
12 \newif\iflabelcropmarks
14 \def\labelcropm{\iflabelcropmarks\hbox to 0pt{\hss\vbox to \labelh{\crosshair{5pt}\vss\crosshair{5pt}}}\fi}
16 % Margins of each label
17 \newdimen\labelhmargin
20 \newdimen\labelvmargin
28 % Prepare of typesetting of #2 rows per #1 labels
35 \multiply\labelnum by #2
39 \rightskip=0pt plus 0.1pt
42 % Typeset one label as a box (in most cases, you want to use \label instead)
43 \long\def\labelbox#1{\hbox to \labelw{%
45 \iflabelrules\vrule\fi
48 \iflabelrules\hrule\fi
55 \advance\dimen0 by -2\labelvmargin
58 \advance\hsize by -2\labelhmargin
67 \iflabelrules\hrule\fi
71 \iflabelrules\vrule\fi
75 % Typeset one label (#1 is expected to have the exact height, so it usually ends with a \vfil)
76 \long\def\label#1{\leavevmode\labelbox{#1}\penalty -100}
78 % Typeset #1 copies of label #2
80 \long\def\labels#1#2{{\leavevmode\setbox0=\labelbox{#2}%
85 \advance\labelcount by -1
86 \ifnum\labelcount>0\repeat
89 % Fill the whole page with copies of a label
90 \long\def\labelfill#1{\labels\labelnum{#1}}