-
Notifications
You must be signed in to change notification settings - Fork 0
/
tikz-thesis.tex
125 lines (124 loc) · 6.27 KB
/
tikz-thesis.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
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
% Flowcharting techniques for easy maintenance
% Author: Brent Longborough
% http://www.texample.net/media/tikz/examples/TEX/flexible-flow-chart.tex
% Start the picture
\begin{tikzpicture}[%
>=triangle 60, % Nice arrows; your taste may be different
start chain=going below, % General flow is top-to-bottom
node distance=10mm and 60mm, % Global setup of box spacing
every join/.style={author}, % Default linetype for connecting boxes
]
% -------------------------------------------------
% A few box styles
% <on chain> *and* <on grid> reduce the need for manual relative
% positioning of nodes
\tikzset{
base/.style={draw, on chain, on grid, align=center, minimum height=4ex},
activity/.style={base, rectangle, text width=8em, minimum height=2em},
agent/.style={base, diamond, aspect=2, text width=5em},
entity/.style={base, ellipse,fill=ncentity!25,minimum height=2em,minimum width=8em,align=center},
legend/.style={base, draw=none,rectangle},
% coord node style is used for placing corners of connecting lines
coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm},
% nmark node style is used for coordinate debugging marks
nmark/.style={draw, cyan, circle, font={\sffamily\bfseries}},
% -------------------------------------------------
% Connector line styles for different parts of the diagram
author/.style={->, draw, lcauthor},
adivsor/.style={->, draw, lcadvisor},
use/.style={->, draw, lcuse},
it/.style={font={\small\itshape}}
}
% -------------------------------------------------
% Legend
\node [legend] (l1) {Role:};
\node [legend, below=of l1, yshift=1.5em ] (l3) {Role:};
\node [legend, below=of l3, yshift=1.5em ] (l5) {Link:};
\node [legend, below=of l5, yshift=1.5em ] (l7) {Link:};
\node [legend, right= 30mm of l1] (l2) {Advisor};
\node [legend, right= 30mm of l3] (l4) {Author};
\node [legend, right= 30mm of l5] (l6) {Attribution};
\node [legend, right= 30mm of l7] (l8) {Association};
% Start by placing the nodes
\node [entity, below=of l7, densely dotted, it] (e0) {Thesis pab175};
% Use join to connect a node to the previous one
\node [activity] (a1) {Ph.D. pab175};
\node [agent] (p2) {pab175};
% We position the next block explicitly as the first block in the
% second column. The chain 'comes along with us'. The distance
% between columns has already been defined, so we don't need to
% specify it.
\node [agent, fill=lcadvisor!25, right=of a1] (p4) {phe22};
\node [agent, fill=lcadvisor!25] (p5) {pze9};
% -------------------------------------------------
% Now we place the coordinate nodes for the connectors with angles, or
% with annotations. We also mark them for debugging.
%\node [coord, right=20mm of l0] (c0) {}; \cmark{0}
%\node [coord, right=10mm of c0] (c1) {}; \cmark{1}
%\node [coord, right=20mm of l1] (c2) {}; \cmark{2}
%\node [coord, right=10mm of c2] (c3) {}; \cmark{3}
% -------------------------------------------------
% A couple of boxes have annotations
%\node [above=0mm of p4, it] {(Queue was empty)};
%\node [above=0mm of p8, it] {(Queue was not empty)};
% -------------------------------------------------
% All the other connections come out of tests and need annotating
% First, the straight north-south connections. In each case, we first
% draw a path with a (consistently positioned) annotation node, then
% we draw the arrow itself.
\path (e0.south) to node [left] {wasGeneratedBy} (a1);
\draw [->,lcuse] (e0.south) -- (a1);
\path (a1.south) to node [left] {wasAssociatedWith} (p2);
\draw [->,lcauthor,densely dotted] (a1.south) -- (p2);
\path (a1.east) to node [above] {wasAssociatedWith} (p4);
\draw [->,lcadvisor,densely dotted] (a1.east) -- (p4);
\path (a1.east) to node [above] {wasAssociatedWith} (p5);
\draw [->,lcadvisor,densely dotted] (a1.east) -- (p5);
% Legend
% Legend
\path (l1.east) to node {} (l2);
\draw [->,lcauthor,densely dotted] (l1.east) -- (l2);
\path (l3.east) to node {} (l4);
\draw [->,lcattr,densely dotted] (l3.east) -- (l4);
\path (l5.east) to node {} (l6);
\draw [->] (l5.east) -- (l6);
\path (l7.east) to node {} (l8);
\draw [->,densely dotted] (l7.east) -- (l8);
%\path (t2.south) to node [near start, xshift=1em] {$y$} (t3);
% \draw [*->,lcauthor] (t2.south) -- (t3);
%\path (t3.south) to node [near start, xshift=1em] {$y$} (t4);
% \draw [*->,lcauthor] (t3.south) -- (t4);
%\path (t5.south) to node [near start, xshift=1em] {$y$} (t6);
% \draw [*->,lcadivsor] (t5.south) -- (t6);
%\path (t6.south) to node [near start, xshift=1em] {$y$} (t7);
% \draw [*->,lcadivsor] (t6.south) -- (t7);
%% -------------------------------------------------
%% Now the straight east-west connections. To provide consistent
%% positioning of the test exit annotations, we have positioned
%% coordinates for the vertical part of the connectors. The annotation
%% text is positioned on a path to the coordinate, and then the whole
%% connector is drawn to its destination box.
%\path (t3.east) to node [near start, yshift=1em] {$n$} (c3);
% \draw [o->,lccong] (t3.east) -- (p8);
%\path (t4.east) to node [yshift=-1em] {$k \leq 0$} (c4r);
% \draw [o->,lcauthor] (t4.east) -- (p9);
%% -------------------------------------------------
%% Finally, the twisty connectors. Again, we place the annotation
%% first, then draw the connector
%\path (t1.east) to node [near start, yshift=1em] {$n$} (c1);
% \draw [o->,lcadivsor] (t1.east) -- (c1) |- (p4);
%\path (t2.east) -| node [very near start, yshift=1em] {$n$} (c1);
% \draw [o->,lcadivsor] (t2.east) -| (c1);
%\path (t4.west) to node [yshift=-1em] {$k>0$} (c4);
% \draw [*->,lcauthor] (t4.west) -- (c4) |- (p3);
%\path (t5.east) -| node [very near start, yshift=1em] {$n$} (c6);
% \draw [o->,lcadivsor] (t5.east) -| (c6);
%\path (t6.east) to node [near start, yshift=1em] {$n$} (c6);
% \draw [o->,lcadivsor] (t6.east) -| (c7);
%\path (t7.east) to node [yshift=-1em] {$k \leq 0$} (c7);
% \draw [o->,lcadivsor] (t7.east) -- (c7) |- (p9);
%\path (t7.west) to node [yshift=-1em] {$k>0$} (c5);
% \draw [*->,lcadivsor] (t7.west) -- (c5) |- (p5);
% -------------------------------------------------
% -------------------------------------------------
\end{tikzpicture}