-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtikzmacros.sty
222 lines (201 loc) · 4.59 KB
/
tikzmacros.sty
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
% Package that defines the styles used in Tikz figures exported in GROOVE.
\ProvidesPackage{groove2tikz}
\RequirePackage{tikz}
\usepackage[T1]{fontenc}
% Includes for Tikz
\usetikzlibrary{arrows,automata,positioning,er}
% Dimension styles
\newcommand{\tikzfontsize}{\footnotesize}
\newcommand{\tikzscale}{2}
\newcommand{\nodeinsep}{2.5pt}
\newcommand{\labinsep}{.8pt}
\tikzstyle every node=[
font=\tikzfontsize\sffamily\bfseries,
inner sep=\nodeinsep,
rectangle,
rounded corners=2,
]
\tikzstyle multipart=[
rectangle split,
rectangle split parts=2,
rectangle split ignore empty parts,
]
% Colours
\newcommand{\red}{red}
\newcommand{\redfill}{\red!10}
\newcommand{\green}{green!75!black}
\newcommand{\greenfill}{\green!10}
\newcommand{\blue}{blue!75!white}
\newcommand{\bluefill}{blue!10}
\newcommand{\grey}{black!8}
\newcommand{\thin}{black!10}
\newcommand{\orange}{orange}
\newcommand{\yellow}{yellow!40}
% Ugly hack to allow nodes with multiple lines
\newcommand{\ml}[1]{
\begin{tabular}{@{}l@{}}#1\vspace{-2pt}\end{tabular}
}
% User specified macro that is run at the end of an exported figure. By
% redefining this macro the user can add more stuff to the figure.
\newcommand{\userdefinedmacro}{\relax}
\usetikzlibrary{decorations.pathreplacing,decorations.markings,decorations.text}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{shapes.misc}
\newcommand{\usecolor}{black}
\newcommand{\newcolor}{green!80!black}
\newcommand{\delcolor}{blue!75!white}
\newcommand{\notcolor}{red}
\tikzstyle every box=[
font=\tikzfontsize\sffamily\bfseries,
inner sep=\nodeinsep,
shape=rectangle,
minimum size=9pt,
]
\tikzstyle every lab=[
font=\tikzfontsize\sffamily\mdseries,
inner sep=\labinsep,
fill=white,
]
%%%%%%%%%%%%%%%% Readers %%%%%%%%%%%%%%%%%%
\tikzstyle{usecolor}=[\usecolor]
% Creator nodes
\tikzstyle usebox=[
every box,
draw=\usecolor,
text=\usecolor,
]
\tikzstyle usenode=[
usebox,
multipart,
]
% Creator edges
\tikzstyle{useedge}=[
->,
draw=\usecolor,
text=\usecolor,
usecolor,
]
% Creator labels
\tikzstyle uselab=[
every lab,
text=\usecolor,
]
%%%%%%%%%%%%%%%% Creators %%%%%%%%%%%%%%%%%%
\tikzstyle{newcolor}=[\newcolor]
% Creator outline
\tikzstyle newoutline=[
preaction={-,
draw=\newcolor,
dash pattern=on 0mm off .3mm on .1mm off .6mm,
line width=.7mm,
shorten >=1mm,
},
draw=\newcolor,
dash pattern=on .7mm off .3mm,
shorten >=.3mm,
]
% Creator nodes
\tikzstyle newbox=[
every box,
newoutline,
text=\newcolor,
]
\tikzstyle newnode=[
newbox,
multipart,
]
% Creator edges
\tikzstyle{newedge}=[
->,
newoutline,
]
% Creator labels
\tikzstyle newlab=[
every lab,
text=\newcolor,
]
%%%%%%%%%%%%%%%% Erasers %%%%%%%%%%%%%%%%%%
\tikzstyle{delcolor}=[\delcolor]
% Eraser nodes
\tikzstyle{delbox}=[
every box,
draw=\delcolor,
text=\delcolor,
densely dashed,
]
\tikzstyle{delnode}=[
delbox,
multipart,
]
% Eraser edges
\tikzstyle{deledge}=[
->,
draw=\delcolor,
densely dashed,
]
% Eraser labels
\tikzstyle dellab=[
every lab,
text=\delcolor,
]
%%%%%%%%%%%%%%%% Embargoes %%%%%%%%%%%%%%%%%%
\tikzstyle{notcolor}=[\notcolor]
\tikzstyle{notedgedecoration}=[
decoration=
{ markings,
mark=at position .2
with { \draw[-,notcolor] (-1mm,-1.2mm) -- (1mm, 1.2mm);
\draw[-,notcolor] (-1mm, 1.2mm) -- (1mm,-1.2mm); },
}
]
% Embargo nodes
\tikzstyle{notbox}=[
every box,
draw=\notcolor,
text=\notcolor,
after node path={(\tikzlastnode.south west) edge[notcolor]
(\tikzlastnode.north east)},
]
\tikzstyle notnode=[
notbox,
multipart,
]
% Embargo edges
\tikzstyle{notedge}=[
->,
draw=\notcolor,
text=\notcolor,
preaction={notedgedecoration,decorate},
]
% Embargo labels
\tikzstyle notlab=[
every lab,
text=\notcolor,
]
\newcommand{\n}{\nodepart{two}\sffamily\mdseries}
% Convenience macros
\newcommand{\usenode}{
\node[usenode]
}
\newcommand{\useedge}{
\path[useedge]
}
% Convenience macros
\newcommand{\newnode}{
\node[newnode]
}
\newcommand{\newedge}{
\path[newedge]
}
\newcommand{\delnode}{
\node[delnode]
}
\newcommand{\deledge}{
\path[deledge]
}
\newcommand{\notnode}{
\node[notnode]
}
\newcommand{\notedge}{
\path[notedge]
}