-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsection_body.tex
More file actions
261 lines (227 loc) · 8 KB
/
section_body.tex
File metadata and controls
261 lines (227 loc) · 8 KB
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
\section*{Examples of Various Packages}
\subsection*{TiKZ and PGF}
TiKZ and PGF \citep{website:pgf} allow you to create graphics within \LaTeX.
There are plenty of examples of various figures at \url{http://www.texample.net/tikz/}.
Refer to the PGF \citep{manual:tikz_pgf} manual for a reference and tutorial.
% Definition of circles
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(0:2cm) circle (1.5cm)}
\colorlet{circle edge}{blue!50}
\colorlet{circle area}{blue!20}
\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
outline/.style={draw=circle edge, thick}}
\begin{table}
\centering
\begin{tabular}{ c c }
% Set A and B
\begin{tikzpicture}[scale=2]
\begin{scope}
\clip \firstcircle;
\fill[filled] \secondcircle;
\end{scope}
\draw[outline] \firstcircle node {$A$};
\draw[outline] \secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$A \cap B$};
\end{tikzpicture}
&
%Set A or B but not (A and B) also known a A xor B
\begin{tikzpicture}[scale=2]
\draw[filled, even odd rule] \firstcircle node {$A$}
\secondcircle node{$B$};
\node[anchor=south] at (current bounding box.north) {$\overline{A \cap B}$};
\end{tikzpicture}
\\
% Set A or B
\begin{tikzpicture}[scale=2]
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$A \cup B$};
\end{tikzpicture}
&
% Set A but not B
\begin{tikzpicture}[scale=2]
\begin{scope}
\clip \firstcircle;
\draw[filled, even odd rule] \firstcircle node {$A$}
\secondcircle;
\end{scope}
\draw[outline] \firstcircle
\secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$A - B$};
\end{tikzpicture}
\\
% Set B but not A
\begin{tikzpicture}[scale=2]
\begin{scope}
\clip \secondcircle;
\draw[filled, even odd rule] \firstcircle
\secondcircle node {$B$};
\end{scope}
\draw[outline] \firstcircle node {$A$}
\secondcircle;
\node[anchor=south] at (current bounding box.north) {$B - A$};
\end{tikzpicture}
& \\
\end{tabular}
\captionof{figure}{TiKZ example of set operations and Venn diagrams by \citet{website:example_venndiag}}
\end{table}
\newcommand{\D}{7} % number of dimensions (config option)
\newcommand{\U}{7} % number of scale units (config option)
\newdimen\R % maximal diagram radius (config option)
\R=3.5cm
\newdimen\L % radius to put dimension labels (config option)
\L=4cm
\newcommand{\A}{360/\D} % calculated angle between dimension axes
\begin{centering}
\centering
\hspace{0.5em} % It's centered, but we want the body to be centered, not just the graphic
\begin{tikzpicture}[scale=2]
\path (0:0cm) coordinate (O); % define coordinate for origin
% draw the spiderweb
\foreach \X in {1,...,\D}{
\draw (\X*\A:0) -- (\X*\A:\R);
}
\foreach \Y in {0,...,\U}{
\foreach \X in {1,...,\D}{
\path (\X*\A:\Y*\R/\U) coordinate (D\X-\Y);
\fill (D\X-\Y) circle (1pt);
}
\draw [opacity=0.3] (0:\Y*\R/\U) \foreach \X in {1,...,\D}{
-- (\X*\A:\Y*\R/\U)
} -- cycle;
}
% define labels for each dimension axis (names config option)
\path (1*\A:\L) node (L1) { Security};
\path (2*\A:\L) node (L2) { Content Quality};
\path (3*\A:\L) node (L3) { Performance};
\path (4*\A:\L) node (L4) { Stability};
\path (5*\A:\L) node (L5) { Usability};
\path (6*\A:\L) node (L6) { Generality};
\path (7*\A:\L) node (L7) { Popularity};
% for each sample case draw a path around the web along concrete values
% for the individual dimensions. Each node along the path is labeled
% with an identifier using the following scheme:
%
% D<d>-<v>, dimension <d> a number between 1 and \D (#dimensions) and
% value <v> a number between 0 and \U (#scale units)
%
% The paths will be drawn half-opaque, so that overlapping parts will be
% rendered in a composite color.
% Example Case 1 (red)
%
% D1 (Security): 0/7; D2 (Content Quality): 5/7; D3 (Performance): 0/7;
% D4 (Stability): 6/7; D5 (Usability): 0/7; D6 (Generality): 5/7;
% D7 (Popularity): 0/7
\draw [color=red,line width=1.5pt,opacity=0.5]
(D1-0) --
(D2-5) --
(D3-0) --
(D4-6) --
(D5-0) --
(D6-5) --
(D7-0) -- cycle;
% Example Case 2 (green)
%
% D1 (Security): 2/7; D2 (Content Quality): 2/7; D3 (Performance): 5/7;
% D4 (Stability): 1/7; D5 (Usability): 4/7; D6 (Generality): 1/7;
% D7 (Popularity): 7/7
\draw [color=green,line width=1.5pt,opacity=0.5]
(D1-2) --
(D2-2) --
(D3-5) --
(D4-1) --
(D5-4) --
(D6-1) --
(D7-7) -- cycle;
% Example Case 3 (blue)
%
% D1 (Security): 1/7; D2 (Content Quality): 7/7; D3 (Performance): 4/7;
% D4 (Stability): 4/7; D5 (Usability): 3/7; D6 (Generality): 5/7;
% D7 (Popularity): 2/7
\draw [color=blue,line width=1.5pt,opacity=0.5]
(D1-1) --
(D2-7) --
(D3-4) --
(D4-4) --
(D5-3) --
(D6-5) --
(D7-2) -- cycle;
\end{tikzpicture}
\captionof{figure}{TiKZ example of a spiderweb diagram by \citet{website:example_spiderwebdiagram}}
\end{centering}
\begin{figure}
\centering
\hspace{-4em} % It's centered, but we want the body to be centered, not just the graphic
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=8em,
semithick,scale=2]
\tikzstyle{every state}=[fill=red,draw=none,text=white]
\node[initial,state] (A) {$q_a$};
\node[state] (B) [above right of=A] {$q_b$};
\node[state] (D) [below right of=A] {$q_d$};
\node[state] (C) [below right of=B] {$q_c$};
\node[state] (E) [below of=D] {$q_e$};
\path (A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
(B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
\end{tikzpicture}
\captionof{figure}{TiKZ example of a state machine by \citet{website:example_statemachine}}
\end{figure}
\subsubsection*{TiKZ-QTree}
TiKZ-QTree is a package specifically designed to make parse trees.
For more information see the manual \citep{manual:tiks_qtree}.
\begin{centering}
\begin{tikzpicture}
\tikzset{level distance=60pt, scale=1.5}
\Tree [.S [.NP [.Det the ] [.N cat ] ]
[.VP [.V sat ]
[.PP [.P on ]
[.NP [.Det the ] [.N mat ] ] ] ] ]
\end{tikzpicture}
\captionof{figure}{Parse tree example from \citet{manual:tiks_qtree}}
\end{centering}
\subsection*{PGF Plots}
The \verb+pgfplots+ package \citep{website:pgfplots} is an extension to allow for easy plotting of charts.
\begin{centering}
\begin{tikzpicture}[scale=2,font=\footnotesize]
\begin{axis}[ymin=0,ymax=1,enlargelimits=false]
\addplot
[blue!80!black,fill=blue,fill opacity=0.5]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)}
|- (axis cs:0,0) -- cycle;
\addplot
[red,fill=red!90!black,opacity=0.5]
coordinates
{(0,0.25) (0.1,0.27) (0.2,0.24) (0.3,0.24)
(0.4,0.26) (0.5,0.3) (0.6,0.23) (0.7,0.2)
(0.8,0.15) (0.9,0.1) (1,0.1)}
|- (axis cs:0,0) -- cycle;
\addplot[green!20!black] coordinates
{(0,0.4) (0.2,0.75) (1,0.75)};
\end{axis}
\end{tikzpicture}
\captionof{figure}{Plot example from \citet[p. 21]{manual:pgfplots}}
\end{centering}
\vspace{2em}
\begin{centering}
\begin{tikzpicture}[scale=2,font=\footnotesize]
\begin{axis}
\addplot+[error bars/.cd,y dir=plus,y explicit]
coordinates {
(0,0) +- (0.5,0.1)
(0.1,0.1) +- (0.05,0.2)
(0.2,0.2) +- (0,0.05)
(0.5,0.5) +- (0.1,0.2)
(1,1) +- (0.3,0.1)};
\end{axis}
\end{tikzpicture}
\captionof{figure}{Plot example from \citet[p. 205]{manual:pgfplots}}
\end{centering}