-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydice.tex
74 lines (65 loc) · 2.57 KB
/
mydice.tex
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
\newlength{\dicewidth}%
\setlength{\dicewidth}{4mm}%
\newlength{\diceradius}%
\setlength{\diceradius}{1pt}%
\newcommand{\diceI}%
{%
\draw (-0.5\dicewidth, -0.5\dicewidth) rectangle
( 0.5\dicewidth, 0.5\dicewidth);
\fill (0, 0) circle[radius=\diceradius];
}%
\newcommand{\diceII}%
{%
\draw (-0.500\dicewidth, -0.500\dicewidth) rectangle
( 0.500\dicewidth, 0.500\dicewidth);
\fill (-0.165\dicewidth, -0.165\dicewidth) circle[radius=\diceradius];
\fill ( 0.165\dicewidth, 0.165\dicewidth) circle[radius=\diceradius];
}%
\newcommand{\diceIII}%
{%
\draw (-0.500\dicewidth, -0.500\dicewidth) rectangle
( 0.500\dicewidth, 0.500\dicewidth);
\fill (-0.225\dicewidth, -0.225\dicewidth) circle[radius=\diceradius];
\fill ( 0.000\dicewidth, 0.000\dicewidth) circle[radius=\diceradius];
\fill ( 0.225\dicewidth, 0.225\dicewidth) circle[radius=\diceradius];
}%
\newcommand{\diceIV}%
{%
\draw (-0.50\dicewidth, -0.50\dicewidth) rectangle
( 0.50\dicewidth, 0.50\dicewidth);
\fill (-0.19\dicewidth, 0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.19\dicewidth, 0.19\dicewidth) circle[radius=\diceradius];
\fill (-0.19\dicewidth, -0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.19\dicewidth, -0.19\dicewidth) circle[radius=\diceradius];
}%
\newcommand{\diceV}%
{%
\draw (-0.50\dicewidth, -0.50\dicewidth) rectangle
( 0.50\dicewidth, 0.50\dicewidth);
\fill (-0.25\dicewidth, 0.25\dicewidth) circle[radius=\diceradius];
\fill ( 0.25\dicewidth, 0.25\dicewidth) circle[radius=\diceradius];
\fill ( 0.00\dicewidth, 0.00\dicewidth) circle[radius=\diceradius];
\fill (-0.25\dicewidth, -0.25\dicewidth) circle[radius=\diceradius];
\fill ( 0.25\dicewidth, -0.25\dicewidth) circle[radius=\diceradius];
}%
\newcommand{\diceVI}%
{%
\draw (-0.50\dicewidth, -0.50\dicewidth) rectangle
( 0.50\dicewidth, 0.50\dicewidth);
\fill (-0.26\dicewidth, 0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.00\dicewidth, 0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.26\dicewidth, 0.19\dicewidth) circle[radius=\diceradius];
\fill (-0.26\dicewidth, -0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.00\dicewidth, -0.19\dicewidth) circle[radius=\diceradius];
\fill ( 0.26\dicewidth, -0.19\dicewidth) circle[radius=\diceradius];
}%
\newcommand{\dicenum}[1]%
{%
\ifthenelse{\equal{#1}{1}}{\diceI}{%
\ifthenelse{\equal{#1}{2}}{\diceII}{%
\ifthenelse{\equal{#1}{3}}{\diceIII}{%
\ifthenelse{\equal{#1}{4}}{\diceIV}{%
\ifthenelse{\equal{#1}{5}}{\diceV}{%
\ifthenelse{\equal{#1}{6}}{\diceVI}{%
\relax}}}}}}%
}%