-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdcr-preamble.tex
83 lines (74 loc) · 2.48 KB
/
dcr-preamble.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
74
75
76
77
78
79
80
81
82
83
\newcommand{\crel}{%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
\draw [->, >=stealth] (0,0) -- (0.45,0);
\draw [fill] (0.5,0) circle (0.05);
\end{tikzpicture}
}
\newcommand{\rrel}{%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
\draw [fill] (0,0) circle (0.05);
\draw [->, >=stealth] (0.05,0) -- (0.5,0);
\end{tikzpicture}
}
\newcommand{\mrel}{%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
\draw [->, >=stealth] (0,0) -- (0.4,0);
\draw (0.4,0) -- (0.475,0.075) -- (0.55,0) -- (0.475,-0.075) -- cycle;
\end{tikzpicture}
}
\newcommand{\irel}{%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
\draw [->, >=stealth] (0,0) -- (0.4,0);
\draw (0.41,0) -- (0.55,0);
\draw (0.48,-0.07) -- (0.48, 0.07);
\end{tikzpicture}
}
\newcommand{\erel}{%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
\draw [->, >=stealth] (0,0) -- (0.4,0);
\draw (0.41,0) -- (0.55,0);
\draw (0.48, 0.05) circle (0.02);
\draw (0.48, -0.05) circle (0.02);
\end{tikzpicture}
}
\newcommand{\ev}[2][001]{% {Executed Pending Included} Name
\StrMid{#1}{1}{1}[\posone]%
\StrMid{#1}{2}{2}[\postwo]%
\StrMid{#1}{3}{3}[\posthree]%
\begin{tikzpicture}[baseline={([yshift=-.8ex]current bounding box.center)}]
% Executed tick
\ifthenelse{\equal {\posone} {1}}
{\draw (0.265, 0.085) -- (0.3, 0.05) -- (0.36, 0.11);}
{}
% Pending exclamation
\ifthenelse{\equal {\postwo} {1}}
{\draw (0.31, 0.26) -- (0.31, 0.18);
\draw[fill] (0.31, 0.16) circle [radius=0.005];}
{}
% Box
\ifthenelse{\equal {\posthree} {1}}
{\draw (0, 0) -- (0.4, 0) -- (0.4, 0.3) -- (0, 0.3) -- (0, 0);}
{
\draw (0, 0.2550) -- (0, 0.1950);
\draw (0, 0.1800) -- (0, 0.1200);
\draw (0, 0.1050) -- (0, 0.0450);
\draw (0, 0.27) -- (0, 0.3) -- (0.03, 0.3); % Top left
\draw (0.0450, 0.3) -- (0.11125, 0.3);
\draw (0.12625, 0.3) -- (0.1925, 0.3);
\draw (0.2075, 0.3) -- (0.27375, 0.3);
\draw (0.28875, 0.3) -- (0.355, 0.3);
\draw (0.37, 0.3) -- (0.4, 0.3) -- (0.4, 0.27); % Top right
\draw (0.4, 0.2550) -- (0.4, 0.1950);
\draw (0.4, 0.1800) -- (0.4, 0.1200);
\draw (0.4, 0.1050) -- (0.4, 0.0450);
\draw (0.37, 0) -- (0.4, 0) -- (0.4, 0.03); % Bottom right
\draw (0.0450, 0) -- (0.11125, 0);
\draw (0.12625, 0) -- (0.1925, 0);
\draw (0.2075, 0) -- (0.27375, 0);
\draw (0.28875, 0) -- (0.355, 0);
\draw (0, 0.03) -- (0, 0) -- (0.03, 0); % Bottom left
}
% Name
\node [name] at (0.15, 0.15) {\texttt{#2}};
\end{tikzpicture}%
}