summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/stickers/stickers.sty
blob: 01fd0943bd28f0eabe9d5290816e5217d9eff637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
\input{ifthen.sty}
\evensidemargin -20mm
\oddsidemargin -20mm
\topmargin -14mm
%
\sloppy
\raggedright
\pagestyle{empty}
%
\newcounter{count1}
\newcounter{count2}
\newcounter{xpos}
\newcounter{ypos}
\newcommand{\xsep}{68}
\newcommand{\ysep}{35}
\newcommand{\xbox}{60}
\newcommand{\xnumb}{3}
\newcommand{\ynumb}{8}
\newcommand{\xtop}{0}
\newcommand{\ytop}{0}
%
\newcommand{\StartPage}{
\setcounter{count1}{0}
\setcounter{count2}{0}
\setcounter{xpos}{0}
\setcounter{ypos}{0}
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(-\xtop,\ytop)
}
%
\newcommand{\EndPage}{ \end{picture} }
%
\newcommand{\NextSticker}{
\addtocounter{xpos}{\xsep}
\addtocounter{count1}{1}
\ifthenelse{\value{count1}=\xnumb}
    {\setcounter{count1}{0}
     \setcounter{xpos}{0}
     \addtocounter{count2}{1}
     \addtocounter{ypos}{\ysep}
    }{}
\ifthenelse{\value{count2}=\ynumb}
    {\EndPage
     \newpage
     \StartPage
    }{}
}
%
% NOW FOLLOW THE REAL COMMANDS FOR THE USER
%
\newenvironment{stickers}{\StartPage}{\EndPage}
%
\newcommand{\Sticker}[1]{
\put (\value{xpos},-\value{ypos})
     {\parbox{\xbox mm}{#1}}
\NextSticker
}
%
\newcommand{\Label}[6]{
\put (\value{xpos},-\value{ypos})
     {\parbox{\xbox mm}{\raggedright#1\mbox{}\\#2\mbox{}\\#3\mbox{}\\#4\mbox{}\\
   #5\mbox{}\\#6}}
\NextSticker
}
%
\newcommand{\SetTop}[2]{
\renewcommand{\xtop}{#1}
\renewcommand{\ytop}{#2}
}
%
\newcommand{\SetSticker}[5]{
\renewcommand{\xnumb}{#1}
\renewcommand{\ynumb}{#2}
\renewcommand{\xsep}{#3}
\renewcommand{\ysep}{#4}
\renewcommand{\xbox}{#5}
}