| 1 |
% Copyright 2019 by Till Tantau |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Free Documentation License. |
| 7 |
% |
| 8 |
% See the file doc/generic/pgf/licenses/LICENSE for more details. |
| 9 |
|
| 10 |
|
| 11 |
\section{Tutorial: A Lecture Map for Johannes} |
| 12 |
|
| 13 |
In this tutorial we explore the tree and mind map mechanisms of \tikzname. |
| 14 |
|
| 15 |
Johannes is quite excited: For the first time he will be teaching a course all |
| 16 |
by himself during the upcoming semester! Unfortunately, the course is not on |
| 17 |
his favorite subject, which is of course Theoretical Immunology, but on |
| 18 |
Complexity Theory, but as a young academic Johannes is not likely to complain |
| 19 |
too loudly. In order to help the students get a general overview of what is |
| 20 |
going to happen during the course as a whole, he intends to draw some kind of |
| 21 |
tree or graph containing the basic concepts. He got this idea from his old |
| 22 |
professor who seems to be using these ``lecture maps'' with some success. |
| 23 |
Independently of the success of these maps, Johannes thinks they look quite |
| 24 |
neat. |
| 25 |
|
| 26 |
|
| 27 |
\subsection{Problem Statement} |
| 28 |
|
| 29 |
Johannes wishes to create a lecture map with the following features: |
| 30 |
% |
| 31 |
\begin{enumerate} |
| 32 |
\item It should contain a tree or graph depicting the main concepts. |
| 33 |
\item It should somehow visualize the different lectures that will be |
| 34 |
taught. Note that the lectures are not necessarily the same as the |
| 35 |
concepts since the graph may contain more concepts than will be |
| 36 |
addressed in lectures and some concepts may be addressed during more |
| 37 |
than one lecture. |
| 38 |
\item The map should also contain a calendar showing when the individual |
| 39 |
lectures will be given. |
| 40 |
\item The aesthetical reasons, the whole map should have a visually nice |
| 41 |
and information-rich background. |
| 42 |
\end{enumerate} |
| 43 |
|
| 44 |
As always, Johannes will have to include the right libraries and set up the |
| 45 |
environment. Johannes is going to use the |mindmap| library and since he wishes |
| 46 |
to show a calendar, he will also need the |calendar| library. In order to put |
| 47 |
something on a background layer, it seems like a good idea to also include the |
| 48 |
|backgrounds| library. |
| 49 |
|
| 50 |
|
| 51 |
\subsection{Introduction to Trees} |
| 52 |
|
| 53 |
The first choice Johannes must make is whether he will organize the concepts as |
| 54 |
a tree, with root concepts and concept branches and leaf concepts, or as a |
| 55 |
general graph. The tree implicitly organizes the concepts, while a graph is |
| 56 |
more flexible. Johannes decides to compromise: Basically, the concepts will be |
| 57 |
organized as a tree. However, he will selectively add connections between |
| 58 |
concepts that are related, but which appear on different levels or branches of |
| 59 |
the tree. |
| 60 |
|
| 61 |
Johannes starts with a tree-like list of concepts that he feels are important |
| 62 |
in Computational Complexity: |
| 63 |
% |
| 64 |
\begin{itemize} |
| 65 |
\item Computational Problems |
| 66 |
\begin{itemize}\itemsep=0pt\parskip=0pt |
| 67 |
\item Problem Measures |
| 68 |
\item Problem Aspects |
| 69 |
\item Problem Domains |
| 70 |
\item Key Problems |
| 71 |
\end{itemize} |
| 72 |
\item Computational Models |
| 73 |
\begin{itemize}\itemsep=0pt\parskip=0pt |
| 74 |
\item Turing Machines |
| 75 |
\item Random-Access Machines |
| 76 |
\item Circuits |
| 77 |
\item Binary Decision Diagrams |
| 78 |
\item Oracle Machines |
| 79 |
\item Programming in Logic |
| 80 |
\end{itemize} |
| 81 |
\item Measuring Complexity |
| 82 |
\begin{itemize}\itemsep=0pt\parskip=0pt |
| 83 |
\item Complexity Measures |
| 84 |
\item Classifying Complexity |
| 85 |
\item Comparing Complexity |
| 86 |
\item Describing Complexity |
| 87 |
\end{itemize} |
| 88 |
\item Solving Problems |
| 89 |
\begin{itemize}\itemsep=0pt\parskip=0pt |
| 90 |
\item Exact Algorithms |
| 91 |
\item Randomization |
| 92 |
\item Fixed-Parameter Algorithms |
| 93 |
\item Parallel Computation |
| 94 |
\item Partial Solutions |
| 95 |
\item Approximation |
| 96 |
\end{itemize} |
| 97 |
\end{itemize} |
| 98 |
|
| 99 |
Johannes will surely need to modify this list later on, but it looks good as a |
| 100 |
first approximation. He will also need to add a number of subtopics (like |
| 101 |
\emph{lots} of complexity classes under the topic ``classifying complexity''), |
| 102 |
but he will do this as he constructs the map. |
| 103 |
|
| 104 |
Turning the list of topics into a \tikzname-tree is easy, in principle. The |
| 105 |
basic idea is that a node can have \emph{children}, which in turn can have |
| 106 |
children of their own, and so on. To add a child to a node, Johannes can simply |
| 107 |
write |child {|\meta{node}|}| right after a node. The \meta{node} should, in |
| 108 |
turn, be the code for creating a node. To add another node, Johannes can use |
| 109 |
|child| once more, and so on. Johannes is eager to try out this construct and |
| 110 |
writes down the following: |
| 111 |
% |
| 112 |
\begin{codeexample}[] |
| 113 |
\tikz |
| 114 |
\node {Computational Complexity} % root |
| 115 |
child { node {Computational Problems} |
| 116 |
child { node {Problem Measures} } |
| 117 |
child { node {Problem Aspects} } |
| 118 |
child { node {Problem Domains} } |
| 119 |
child { node {Key Problems} } |
| 120 |
} |
| 121 |
child { node {Computational Models} |
| 122 |
child { node {Turing Machines} } |
| 123 |
child { node {Random-Access Machines} } |
| 124 |
child { node {Circuits} } |
| 125 |
child { node {Binary Decision Diagrams} } |
| 126 |
child { node {Oracle Machines} } |
| 127 |
child { node {Programming in Logic} } |
| 128 |
} |
| 129 |
child { node {Measuring Complexity} |
| 130 |
child { node {Complexity Measures} } |
| 131 |
child { node {Classifying Complexity} } |
| 132 |
child { node {Comparing Complexity} } |
| 133 |
child { node {Describing Complexity} } |
| 134 |
} |
| 135 |
child { node {Solving Problems} |
| 136 |
child { node {Exact Algorithms} } |
| 137 |
child { node {Randomization} } |
| 138 |
child { node {Fixed-Parameter Algorithms} } |
| 139 |
child { node {Parallel Computation} } |
| 140 |
child { node {Partial Solutions} } |
| 141 |
child { node {Approximation} } |
| 142 |
}; |
| 143 |
\end{codeexample} |
| 144 |
|
| 145 |
Well, that did not quite work out as expected (although, what, exactly, did one |
| 146 |
expect?). There are two problems: |
| 147 |
% |
| 148 |
\begin{enumerate} |
| 149 |
\item The overlap of the nodes is due to the fact that \tikzname\ is not |
| 150 |
particularly smart when it comes to placing child nodes. Even though |
| 151 |
it is possible to configure \tikzname\ to use rather clever placement |
| 152 |
methods, \tikzname\ has no way of taking the actual size of the child |
| 153 |
nodes into account. This may seem strange but the reason is that the |
| 154 |
child nodes are rendered and placed one at a time, so the size of the |
| 155 |
last node is not known when the first node is being processed. In |
| 156 |
essence, you have to specify appropriate level and sibling node |
| 157 |
spacings ``by hand''. |
| 158 |
\item The standard computer-science-top-down rendering of a tree is |
| 159 |
rather ill-suited to visualizing the concepts. It would be better to |
| 160 |
either rotate the map by ninety degrees or, even better, to use some |
| 161 |
sort of circular arrangement. |
| 162 |
\end{enumerate} |
| 163 |
|
| 164 |
Johannes redraws the tree, but this time with some more appropriate options |
| 165 |
set, which he found more or less by trial-and-error: |
| 166 |
% |
| 167 |
\begin{codeexample}[ |
| 168 |
preamble={\usetikzlibrary{trees}}, |
| 169 |
render instead={ |
| 170 |
\tikz [font=\footnotesize, |
| 171 |
grow=right, level 1/.style={sibling distance=6em}, |
| 172 |
level 2/.style={sibling distance=1em}, level distance=5cm] |
| 173 |
\node {Computational Complexity} % root |
| 174 |
child { node {Computational Problems} |
| 175 |
child { node {Problem Measures} } child { node {Problem Aspects} } |
| 176 |
child { node {Problem Domains} } child { node {Key Problems} } |
| 177 |
} |
| 178 |
child { node {Computational Models} |
| 179 |
child { node {Turing Machines} } child { node {Random-Access Machines} } |
| 180 |
child { node {Circuits} } child { node {Binary Decision Diagrams} } |
| 181 |
child { node {Oracle Machines} } child { node {Programming in Logic} } |
| 182 |
} |
| 183 |
child { node {Measuring Complexity} |
| 184 |
child { node {Complexity Measures} } child { node {Classifying Complexity} } |
| 185 |
child { node {Comparing Complexity} } child { node {Describing Complexity} } |
| 186 |
} |
| 187 |
child { node {Solving Problems} |
| 188 |
child { node {Exact Algorithms} } child { node {Randomization} } |
| 189 |
child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } |
| 190 |
child { node {Partial Solutions} } child { node {Approximation} } |
| 191 |
}; |
| 192 |
}, |
| 193 |
] |
| 194 |
\tikz [font=\footnotesize, |
| 195 |
grow=right, level 1/.style={sibling distance=6em}, |
| 196 |
level 2/.style={sibling distance=1em}, level distance=5cm] |
| 197 |
\node {Computational Complexity} % root |
| 198 |
child { node {Computational Problems} |
| 199 |
child { node {Problem Measures} } |
| 200 |
child { node {Problem Aspects} } |
| 201 |
... % as before |
| 202 |
\end{codeexample} |
| 203 |
|
| 204 |
Still not quite what Johannes had in mind, but he is getting somewhere. |
| 205 |
|
| 206 |
For configuring the tree, two parameters are of particular importance: The |
| 207 |
|level distance| tells \tikzname\ the distance between (the centers of) the |
| 208 |
nodes on adjacent levels or layers of a tree. The |sibling distance| is, as the |
| 209 |
name suggests, the distance between (the centers of) siblings of the tree. |
| 210 |
|
| 211 |
You can globally set these parameters for a tree by simply setting them |
| 212 |
somewhere before the tree starts, but you will typically wish them to be |
| 213 |
different for different levels of the tree. In this case, you should set styles |
| 214 |
like |level 1| or |level 2|. For the first level of the tree, the |level 1| |
| 215 |
style is used, for the second level the |level 2| style, and so on. You can |
| 216 |
also set the sibling and level distances only for certain nodes by passing |
| 217 |
these options to the |child| command as options. (Note that the options of a |
| 218 |
|node| command are local to the node and have no effect on the children. Also |
| 219 |
note that it is possible to specify options that do have an effect on the |
| 220 |
children. Finally note that specifying options for children ``at the right |
| 221 |
place'' is an arcane art and you should peruse |
| 222 |
Section~\ref{section-tree-options} on a rainy Sunday afternoon, if you are |
| 223 |
really interested.) |
| 224 |
|
| 225 |
The |grow| key is used to configure the direction in which a tree grows. You |
| 226 |
can change growth direction ``in the middle of a tree'' simply by changing this |
| 227 |
key for a single child or a whole level. By including the |trees| library you |
| 228 |
also get access to additional growth strategies such as a ``circular'' growth: |
| 229 |
% |
| 230 |
\begin{codeexample}[ |
| 231 |
preamble={\usetikzlibrary{trees}}, |
| 232 |
render instead={ |
| 233 |
\tikz [text width=2.7cm, align=flush center, |
| 234 |
grow cyclic, |
| 235 |
level 1/.style={level distance=2.5cm,sibling angle=90}, |
| 236 |
level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] |
| 237 |
\node[font=\bfseries] {Computational Complexity} % root |
| 238 |
child { node {Computational Problems} |
| 239 |
child { node {Problem Measures} } child { node {Problem Aspects} } |
| 240 |
child { node {Problem Domains} } child { node {Key Problems} } |
| 241 |
} |
| 242 |
child { node {Computational Models} |
| 243 |
child { node {Turing Machines} } child { node {Random-Access Machines} } |
| 244 |
child { node {Circuits} } child { node {Binary Decision Diagrams} } |
| 245 |
child { node {Oracle Machines} } child { node {Programming in Logic} } |
| 246 |
} |
| 247 |
child { node {Measuring Complexity} |
| 248 |
child { node {Complexity Measures} } child { node {Classifying Complexity} } |
| 249 |
child { node {Comparing Complexity} } child { node {Describing Complexity} } |
| 250 |
} |
| 251 |
child { node {Solving Problems} |
| 252 |
child { node {Exact Algorithms} } child { node {Randomization} } |
| 253 |
child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } |
| 254 |
child { node {Partial Solutions} } child { node {Approximation} } |
| 255 |
}; |
| 256 |
}, |
| 257 |
] |
| 258 |
\tikz [text width=2.7cm, align=flush center, |
| 259 |
grow cyclic, |
| 260 |
level 1/.style={level distance=2.5cm,sibling angle=90}, |
| 261 |
level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] |
| 262 |
\node[font=\bfseries] {Computational Complexity} % root |
| 263 |
child { node {Computational Problems} |
| 264 |
child { node {Problem Measures} } |
| 265 |
child { node {Problem Aspects} } |
| 266 |
... % as before |
| 267 |
\end{codeexample} |
| 268 |
|
| 269 |
Johannes is pleased to learn that he can access and manipulate the nodes of the |
| 270 |
tree like any normal node. In particular, he can name them using the |name=| |
| 271 |
option or the |(|\meta{name}|)| notation and he can use any available shape or |
| 272 |
style for the trees nodes. He can connect trees later on using the normal |
| 273 |
|\draw (some node) -- (another node);| syntax. In essence, the |child| command |
| 274 |
just computes an appropriate position for a node and adds a line from the child |
| 275 |
to the parent node. |
| 276 |
|
| 277 |
|
| 278 |
\subsection{Creating the Lecture Map} |
| 279 |
|
| 280 |
Johannes now has a first possible layout for his lecture map. The next step is |
| 281 |
to make it ``look nicer''. For this, the |mindmap| library is helpful since it |
| 282 |
makes a number of styles available that will make a tree look like a nice |
| 283 |
``mind map'' or ``concept map''. |
| 284 |
|
| 285 |
The first step is to include the |mindmap| library, which Johannes already did. |
| 286 |
Next, he must add one of the following options to a scope that will contain the |
| 287 |
lecture map: |mindmap| or |large mindmap| or |huge mindmap|. These options all |
| 288 |
have the same effect, except that for a |large mindmap| the predefined font |
| 289 |
size and node sizes are somewhat larger than for a standard |mindmap| and for a |
| 290 |
|huge mindmap| they are even larger. So, a |large mindmap| does not necessarily |
| 291 |
need to have a lot of concepts, but it will need a lot of paper. |
| 292 |
|
| 293 |
The second step is to add the |concept| option to every node that will, indeed, |
| 294 |
be a concept of the mindmap. The idea is that some nodes of a tree will be real |
| 295 |
concepts, while other nodes might just be ``simple children''. Typically, this |
| 296 |
is not the case, so you might consider saying |every node/.style=concept|. |
| 297 |
|
| 298 |
The third step is to set up the sibling \emph{angle} (rather than a sibling |
| 299 |
distance) to specify the angle between sibling concepts. |
| 300 |
% |
| 301 |
\begin{codeexample}[ |
| 302 |
preamble={\usetikzlibrary{mindmap}}, |
| 303 |
render instead={ |
| 304 |
\tikz [mindmap, every node/.style=concept, concept color=black!20, |
| 305 |
grow cyclic, |
| 306 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 307 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 308 |
\node [root concept] {Computational Complexity} % root |
| 309 |
child { node {\hbox to 2cm{Computational\hss} Problems} |
| 310 |
child { node {Problem Measures} } |
| 311 |
child { node {Problem Aspects} } |
| 312 |
child { node {Problem Domains} } |
| 313 |
child { node {Key Problems} } |
| 314 |
} |
| 315 |
child { node {\hbox to 2cm{Computational\hss} Models} |
| 316 |
child { node {Turing Machines} } |
| 317 |
child { node {Random-Access Machines} } |
| 318 |
child { node {Circuits} } |
| 319 |
child { node {Binary Decision Diagrams} } |
| 320 |
child { node {Oracle Machines} } |
| 321 |
child { node {\hbox to1.5cm{Programming\hss} in Logic} } |
| 322 |
} |
| 323 |
child { node {Measuring Complexity} |
| 324 |
child { node {Complexity Measures} } |
| 325 |
child { node {Classifying Complexity} } |
| 326 |
child { node {Comparing Complexity} } |
| 327 |
child { node {Describing Complexity} } |
| 328 |
} |
| 329 |
child { node {Solving Problems} |
| 330 |
child { node {Exact Algorithms} } |
| 331 |
child { node {\hbox to 1.5cm{Randomization\hss}} } |
| 332 |
child { node {Fixed-Parameter Algorithms} } |
| 333 |
child { node {Parallel Computation} } |
| 334 |
child { node {Partial Solutions} } |
| 335 |
child { node {\hbox to1.5cm{Approximation\hss}} } |
| 336 |
}; |
| 337 |
}, |
| 338 |
] |
| 339 |
\tikz [mindmap, every node/.style=concept, concept color=black!20, |
| 340 |
grow cyclic, |
| 341 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 342 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 343 |
\node [root concept] {Computational Complexity} % root |
| 344 |
child { node {Computational Problems} |
| 345 |
child { node {Problem Measures} } |
| 346 |
child { node {Problem Aspects} } |
| 347 |
... % as before |
| 348 |
\end{codeexample} |
| 349 |
|
| 350 |
When Johannes typesets the above map, \TeX\ (rightfully) starts complaining |
| 351 |
about several overfull boxes and, indeed, words like ``Randomization'' stretch |
| 352 |
out beyond the circle of the concept. This seems a bit mysterious at first |
| 353 |
sight: Why does \TeX\ not hyphenate the word? The reason is that \TeX\ will |
| 354 |
never hyphenate the first word of a paragraph because it starts looking for |
| 355 |
``hyphenatable'' letters only after a so-called glue. In order to have \TeX\ |
| 356 |
hyphenate these single words, Johannes must use a bit of evil trickery: He |
| 357 |
inserts a |\hskip0pt| before the word. This has no effect except for inserting |
| 358 |
an (invisible) glue before the word and, thereby, allowing \TeX\ to hyphenate |
| 359 |
the first word also. Since Johannes does not want to add |\hskip0pt| inside |
| 360 |
each node, he uses the |execute at begin node| option to make \tikzname\ insert |
| 361 |
this text with every node. |
| 362 |
% |
| 363 |
\begin{codeexample}[ |
| 364 |
preamble={\usetikzlibrary{mindmap}}, |
| 365 |
render instead={ |
| 366 |
\begin{tikzpicture} |
| 367 |
[mindmap, |
| 368 |
every node/.style={concept, execute at begin node=\hskip0pt}, |
| 369 |
concept color=black!20, |
| 370 |
grow cyclic, |
| 371 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 372 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 373 |
\clip (-1,2) rectangle ++ (-4,5); |
| 374 |
\node [root concept] {Computational Complexity} % root |
| 375 |
child { node {Computational Problems} |
| 376 |
child { node {Problem Measures} } |
| 377 |
child { node {Problem Aspects} } |
| 378 |
child { node {Problem Domains} } |
| 379 |
child { node {Key Problems} } |
| 380 |
} |
| 381 |
child { node {Computational Models} |
| 382 |
child { node {Turing Machines} } |
| 383 |
child { node {Random-Access Machines} } |
| 384 |
child { node {Circuits} } |
| 385 |
child { node {Binary Decision Diagrams} } |
| 386 |
child { node {Oracle Machines} } |
| 387 |
child { node {Programming in Logic} } |
| 388 |
} |
| 389 |
child { node {Measuring Complexity} |
| 390 |
child { node {Complexity Measures} } |
| 391 |
child { node {Classifying Complexity} } |
| 392 |
child { node {Comparing Complexity} } |
| 393 |
child { node {Describing Complexity} } |
| 394 |
} |
| 395 |
child { node {Solving Problems} |
| 396 |
child { node {Exact Algorithms} } |
| 397 |
child { node {Randomization} } |
| 398 |
child { node {Fixed-Parameter Algorithms} } |
| 399 |
child { node {Parallel Computation} } |
| 400 |
child { node {Partial Solutions} } |
| 401 |
child { node {Approximation} } |
| 402 |
}; |
| 403 |
\end{tikzpicture} |
| 404 |
}, |
| 405 |
] |
| 406 |
\begin{tikzpicture} |
| 407 |
[mindmap, |
| 408 |
every node/.style={concept, execute at begin node=\hskip0pt}, |
| 409 |
concept color=black!20, |
| 410 |
grow cyclic, |
| 411 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 412 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 413 |
\clip (-1,2) rectangle ++ (-4,5); |
| 414 |
\node [root concept] {Computational Complexity} % root |
| 415 |
child { node {Computational Problems} |
| 416 |
child { node {Problem Measures} } |
| 417 |
child { node {Problem Aspects} } |
| 418 |
... % as before |
| 419 |
\end{tikzpicture} |
| 420 |
\end{codeexample} |
| 421 |
|
| 422 |
In the above example a clipping was used to show only part of the lecture map, |
| 423 |
in order to save space. The same will be done in the following examples, we |
| 424 |
return to the complete lecture map at the end of this tutorial. |
| 425 |
|
| 426 |
Johannes is now eager to colorize the map. The idea is to use different colors |
| 427 |
for different parts of the map. He can then, during his lectures, talk about |
| 428 |
the ``green'' or the ``red'' topics. This will make it easier for his students |
| 429 |
to locate the topic he is talking about on the map. Since ``computational |
| 430 |
problems'' somehow sounds ``problematic'', Johannes chooses red for them, while |
| 431 |
he picks green for the ``solving problems''. The topics ``measuring |
| 432 |
complexity'' and ``computational models'' get more neutral colors; Johannes |
| 433 |
picks orange and blue. |
| 434 |
|
| 435 |
To set the colors, Johannes must use the |concept color| option, rather than |
| 436 |
just, say, |node [fill=red]|. Setting just the fill color to |red| would, |
| 437 |
indeed, make the node red, but it would \emph{just} make the node red and not |
| 438 |
the bar connecting the concept to its parent and also not its children. By |
| 439 |
comparison, the special |concept color| option will not only set the color of |
| 440 |
the node and its children, but it will also (magically) create appropriate |
| 441 |
shadings so that the color of a parent concept smoothly changes to the color of |
| 442 |
a child concept. |
| 443 |
|
| 444 |
For the root concept Johannes decides to do something special: He sets the |
| 445 |
concept color to black, sets the line width to a large value, and sets the fill |
| 446 |
color to white. The effect of this is that the root concept will be encircled |
| 447 |
with a thick black line and the children are connected to the central concept |
| 448 |
via bars. |
| 449 |
% |
| 450 |
\begin{codeexample}[ |
| 451 |
preamble={\usetikzlibrary{mindmap}}, |
| 452 |
render instead={ |
| 453 |
\begin{tikzpicture} |
| 454 |
[mindmap, |
| 455 |
every node/.style={concept, execute at begin node=\hskip0pt}, |
| 456 |
root concept/.append style={ |
| 457 |
concept color=black, |
| 458 |
fill=white, line width=1ex, |
| 459 |
text=black}, |
| 460 |
text=white, |
| 461 |
grow cyclic, |
| 462 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 463 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 464 |
\clip (0,-1) rectangle ++(4,5); |
| 465 |
\node [root concept] {Computational Complexity} % root |
| 466 |
child [concept color=red] { node {Computational Problems} |
| 467 |
child { node {Problem Measures} } |
| 468 |
child { node {Problem Aspects} } |
| 469 |
child { node {Problem Domains} } |
| 470 |
child { node {Key Problems} } |
| 471 |
} |
| 472 |
child [concept color=blue] { node {Computational Models} |
| 473 |
child { node {Turing Machines} } |
| 474 |
child { node {Random-Access Machines} } |
| 475 |
child { node {Circuits} } |
| 476 |
child { node {Binary Decision Diagrams} } |
| 477 |
child { node {Oracle Machines} } |
| 478 |
child { node {Programming in Logic} } |
| 479 |
} |
| 480 |
child [concept color=orange] { node {Measuring Complexity} |
| 481 |
child { node {Complexity Measures} } |
| 482 |
child { node {Classifying Complexity} } |
| 483 |
child { node {Comparing Complexity} } |
| 484 |
child { node {Describing Complexity} } |
| 485 |
} |
| 486 |
child [concept color=green!50!black] { node {Solving Problems} |
| 487 |
child { node {Exact Algorithms} } |
| 488 |
child { node {Randomization} } |
| 489 |
child { node {Fixed-Parameter Algorithms} } |
| 490 |
child { node {Parallel Computation} } |
| 491 |
child { node {Partial Solutions} } |
| 492 |
child { node {Approximation} } |
| 493 |
}; |
| 494 |
\end{tikzpicture} |
| 495 |
}, |
| 496 |
] |
| 497 |
\begin{tikzpicture} |
| 498 |
[mindmap, |
| 499 |
every node/.style={concept, execute at begin node=\hskip0pt}, |
| 500 |
root concept/.append style={ |
| 501 |
concept color=black, fill=white, line width=1ex, text=black}, |
| 502 |
text=white, |
| 503 |
grow cyclic, |
| 504 |
level 1/.append style={level distance=4.5cm,sibling angle=90}, |
| 505 |
level 2/.append style={level distance=3cm,sibling angle=45}] |
| 506 |
\clip (0,-1) rectangle ++(4,5); |
| 507 |
\node [root concept] {Computational Complexity} % root |
| 508 |
child [concept color=red] { node {Computational Problems} |
| 509 |
child { node {Problem Measures} } |
| 510 |
... % as before |
| 511 |
} |
| 512 |
child [concept color=blue] { node {Computational Models} |
| 513 |
child { node {Turing Machines} } |
| 514 |
... % as before |
| 515 |
} |
| 516 |
child [concept color=orange] { node {Measuring Complexity} |
| 517 |
child { node {Complexity Measures} } |
| 518 |
... % as before |
| 519 |
} |
| 520 |
child [concept color=green!50!black] { node {Solving Problems} |
| 521 |
child { node {Exact Algorithms} } |
| 522 |
... % as before |
| 523 |
}; |
| 524 |
\end{tikzpicture} |
| 525 |
\end{codeexample} |
| 526 |
|
| 527 |
Johannes adds three finishing touches: First, he changes the font of the main |
| 528 |
concepts to small caps. Second, he decides that some concepts should be |
| 529 |
``faded'', namely those that are important in principle and belong on the map, |
| 530 |
but which he will not talk about in his lecture. To achieve this, Johannes |
| 531 |
defines four styles, one for each of the four main branches. These styles (a) |
| 532 |
set up the correct concept color for the whole branch and (b) define the |
| 533 |
|faded| style appropriately for this branch. Third, he adds a |
| 534 |
|circular drop shadow|, defined in the |shadows| library, to the concepts, just |
| 535 |
to make things look a bit more fancy. |
| 536 |
% |
| 537 |
\begin{codeexample}[ |
| 538 |
preamble={\usetikzlibrary{mindmap,shadows}}, |
| 539 |
render instead={ |
| 540 |
\begin{tikzpicture}[mindmap] |
| 541 |
\begin{scope}[ |
| 542 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 543 |
root concept/.append style={ |
| 544 |
concept color=black, |
| 545 |
fill=white, line width=1ex, |
| 546 |
text=black, font=\large\scshape}, |
| 547 |
text=white, |
| 548 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 549 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 550 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 551 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 552 |
grow cyclic, |
| 553 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 554 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 555 |
\node [root concept] {Computational Complexity} % root |
| 556 |
child [computational problems] { node {Computational Problems} |
| 557 |
child { node {Problem Measures} } |
| 558 |
child { node {Problem Aspects} } |
| 559 |
child [faded] { node {Problem Domains} } |
| 560 |
child { node {Key Problems} } |
| 561 |
} |
| 562 |
child [computational models] { node {Computational Models} |
| 563 |
child { node {Turing Machines} } |
| 564 |
child [faded] { node {Random-Access Machines} } |
| 565 |
child { node {Circuits} } |
| 566 |
child [faded] { node {Binary Decision Diagrams} } |
| 567 |
child { node {Oracle Machines} } |
| 568 |
child { node {Programming in Logic} } |
| 569 |
} |
| 570 |
child [measuring complexity] { node {Measuring Complexity} |
| 571 |
child { node {Complexity Measures} } |
| 572 |
child { node {Classifying Complexity} } |
| 573 |
child { node {Comparing Complexity} } |
| 574 |
child [faded] { node {Describing Complexity} } |
| 575 |
} |
| 576 |
child [solving problems] { node {Solving Problems} |
| 577 |
child { node {Exact Algorithms} } |
| 578 |
child { node {Randomization} } |
| 579 |
child { node {Fixed-Parameter Algorithms} } |
| 580 |
child { node {Parallel Computation} } |
| 581 |
child { node {Partial Solutions} } |
| 582 |
child { node {Approximation} } |
| 583 |
}; |
| 584 |
\end{scope} |
| 585 |
\end{tikzpicture} |
| 586 |
}, |
| 587 |
] |
| 588 |
\begin{tikzpicture}[mindmap] |
| 589 |
\begin{scope}[ |
| 590 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 591 |
root concept/.append style={ |
| 592 |
concept color=black, fill=white, line width=1ex, text=black, font=\large\scshape}, |
| 593 |
text=white, |
| 594 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 595 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 596 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 597 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 598 |
grow cyclic, |
| 599 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 600 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 601 |
\node [root concept] {Computational Complexity} % root |
| 602 |
child [computational problems] { node {Computational Problems} |
| 603 |
child { node {Problem Measures} } |
| 604 |
child { node {Problem Aspects} } |
| 605 |
child [faded] { node {Problem Domains} } |
| 606 |
child { node {Key Problems} } |
| 607 |
} |
| 608 |
child [computational models] { node {Computational Models} |
| 609 |
child { node {Turing Machines} } |
| 610 |
child [faded] { node {Random-Access Machines} } |
| 611 |
... |
| 612 |
\end{scope} |
| 613 |
\end{tikzpicture} |
| 614 |
\end{codeexample} |
| 615 |
|
| 616 |
|
| 617 |
\subsection{Adding the Lecture Annotations} |
| 618 |
|
| 619 |
Johannes will give about a dozen lectures during the course ``computational |
| 620 |
complexity''. For each lecture he has compiled a (short) list of learning |
| 621 |
targets that state what knowledge and qualifications his students should |
| 622 |
acquire during this particular lecture (note that learning targets are not the |
| 623 |
same as the contents of a lecture). For each lecture he intends to put a little |
| 624 |
rectangle on the map containing these learning targets and the name of the |
| 625 |
lecture, each time somewhere near the topic of the lecture. Such ``little |
| 626 |
rectangles'' are called ``annotations'' by the |mindmap| library. |
| 627 |
|
| 628 |
In order to place the annotations next to the concepts, Johannes must assign |
| 629 |
names to the nodes of the concepts. He could rely on \tikzname's automatic |
| 630 |
naming of the nodes in a tree, where the children of a node named |root| are |
| 631 |
named |root-1|, |root-2|, |root-3|, and so on. However, since Johannes is not |
| 632 |
sure about the final order of the concepts in the tree, it seems better to |
| 633 |
explicitly name all concepts of the tree in the following manner: |
| 634 |
% |
| 635 |
\begin{codeexample}[code only] |
| 636 |
\node [root concept] (Computational Complexity) {Computational Complexity} |
| 637 |
child [computational problems] { node (Computational Problems) {Computational Problems} |
| 638 |
child { node (Problem Measures) {Problem Measures} } |
| 639 |
child { node (Problem Aspects) {Problem Aspects} } |
| 640 |
child [faded] { node (Problem Domains) {Problem Domains} } |
| 641 |
child { node (Key Problems) {Key Problems} } |
| 642 |
} |
| 643 |
... |
| 644 |
\end{codeexample} |
| 645 |
|
| 646 |
The |annotation| style of the |mindmap| library mainly sets up a rectangular |
| 647 |
shape of appropriate size. Johannes configures the style by defining |
| 648 |
|every annotation| appropriately. |
| 649 |
% |
| 650 |
\begin{codeexample}[ |
| 651 |
preamble={\usetikzlibrary{mindmap,shadows}}, |
| 652 |
render instead={ |
| 653 |
\begin{tikzpicture}[mindmap] |
| 654 |
\clip (-5.25,-3) rectangle ++ (4,5); |
| 655 |
\begin{scope}[ |
| 656 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 657 |
root concept/.append style={ |
| 658 |
concept color=black, |
| 659 |
fill=white, line width=1ex, |
| 660 |
text=black, font=\large\scshape}, |
| 661 |
text=white, |
| 662 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 663 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 664 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 665 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 666 |
grow cyclic, |
| 667 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 668 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 669 |
\node [root concept] (Computational Complexity) {Computational Complexity} % root |
| 670 |
child [computational problems] { node (Computational Problems) {Computational Problems} |
| 671 |
child { node (Problem Measures) {Problem Measures} } |
| 672 |
child { node (Problem Aspects) {Problem Aspects} } |
| 673 |
child [faded] { node (Problem Domains) {Problem Domains} } |
| 674 |
child { node (Key Problems) {Key Problems} } |
| 675 |
} |
| 676 |
child [computational models] { node (Computational Models) {Computational Models} |
| 677 |
child { node (Turing Machines) {Turing Machines} } |
| 678 |
child [faded] { node (Random-Access Machines) {Random-Access Machines} } |
| 679 |
child { node (Circuits) {Circuits} } |
| 680 |
child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } |
| 681 |
child { node (Oracle Machines) {Oracle Machines} } |
| 682 |
child { node (Programming in Logic) {Programming in Logic} } |
| 683 |
} |
| 684 |
child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} |
| 685 |
child { node (Complexity Measures) {Complexity Measures} } |
| 686 |
child { node (Classifying Complexity) {Classifying Complexity} } |
| 687 |
child { node (Comparing Complexity) {Comparing Complexity} } |
| 688 |
child [faded] { node (Describing Complexity) {Describing Complexity} } |
| 689 |
} |
| 690 |
child [solving problems] { node (Solving Problems) {Solving Problems} |
| 691 |
child { node (Exact Algorithms) {Exact Algorithms} } |
| 692 |
child { node (Randomization) {Randomization} } |
| 693 |
child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } |
| 694 |
child { node (Parallel Computation) {Parallel Computation} } |
| 695 |
child { node (Partial Solutions) {Partial Solutions} } |
| 696 |
child { node (Approximation) {Approximation} } |
| 697 |
}; |
| 698 |
\end{scope} |
| 699 |
\begin{scope}[every annotation/.style={fill=black!40}] |
| 700 |
\node [annotation, above] at (Computational Problems.north) { |
| 701 |
Lecture 1: Computational Problems |
| 702 |
\begin{itemize} |
| 703 |
\item Knowledge of several key problems |
| 704 |
\item Knowledge of problem encodings |
| 705 |
\item Being able to formalize problems |
| 706 |
\end{itemize} |
| 707 |
}; |
| 708 |
\end{scope} |
| 709 |
\end{tikzpicture} |
| 710 |
}, |
| 711 |
] |
| 712 |
\begin{tikzpicture}[mindmap] |
| 713 |
\clip (-5,-5) rectangle ++ (4,5); |
| 714 |
\begin{scope}[ |
| 715 |
every node/.style={concept, circular drop shadow, ...}] % as before |
| 716 |
\node [root concept] (Computational Complexity) ... % as before |
| 717 |
\end{scope} |
| 718 |
|
| 719 |
\begin{scope}[every annotation/.style={fill=black!40}] |
| 720 |
\node [annotation, above] at (Computational Problems.north) { |
| 721 |
Lecture 1: Computational Problems |
| 722 |
\begin{itemize} |
| 723 |
\item Knowledge of several key problems |
| 724 |
\item Knowledge of problem encodings |
| 725 |
\item Being able to formalize problems |
| 726 |
\end{itemize} |
| 727 |
}; |
| 728 |
\end{scope} |
| 729 |
\end{tikzpicture} |
| 730 |
\end{codeexample} |
| 731 |
|
| 732 |
Well, that does not yet look quite perfect. The spacing or the |{itemize}| is |
| 733 |
not really appropriate and the node is too large. Johannes can configure these |
| 734 |
things ``by hand'', but it seems like a good idea to define a macro that will |
| 735 |
take care of these things for him. The ``right'' way to do this is to define a |
| 736 |
|\lecture| macro that takes a list of key--value pairs as argument and produces |
| 737 |
the desired annotation. However, to keep things simple, Johannes' |\lecture| |
| 738 |
macro simply takes a fixed number of arguments having the following meaning: |
| 739 |
The first argument is the number of the lecture, the second is the name of the |
| 740 |
lecture, the third are positioning options like |above|, the fourth is the |
| 741 |
position where the node is placed, the fifth is the list of items to be shown, |
| 742 |
and the sixth is a date when the lecture will be held (this parameter is not |
| 743 |
yet needed, we will, however, need it later on). |
| 744 |
% |
| 745 |
% TODOsp: codeexamples: redo `\lecture` definition*s* when `preamble` can be emptied |
| 746 |
\begin{codeexample}[code only] |
| 747 |
\def\lecture#1#2#3#4#5#6{ |
| 748 |
\node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { |
| 749 |
Lecture #1: \textcolor{orange}{\textbf{#2}} |
| 750 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 751 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 752 |
\itemindent=0pt\labelsep=2pt} |
| 753 |
#5 |
| 754 |
\endlist |
| 755 |
}; |
| 756 |
} |
| 757 |
\end{codeexample} |
| 758 |
% TODOsp: codeexamples: this definition can most likely be deleted, |
| 759 |
% because it is moved to the `pre` key in the `codeexamples` |
| 760 |
\def\lecture#1#2#3#4#5#6{ |
| 761 |
\node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { |
| 762 |
Lecture #1: \textcolor{orange}{\textbf{#2}} |
| 763 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 764 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 765 |
\itemindent=0pt\labelsep=2pt} |
| 766 |
#5 |
| 767 |
\endlist |
| 768 |
}; |
| 769 |
} |
| 770 |
|
| 771 |
\begin{codeexample}[ |
| 772 |
preamble={\usetikzlibrary{mindmap,shadows}}, |
| 773 |
pre={ % !!! replace all `##x` with `#x` |
| 774 |
\def\lecture##1##2##3##4##5##6{ |
| 775 |
\node [annotation, ##3, scale=0.65, text width=4cm, inner sep=2mm] at (##4) { |
| 776 |
Lecture ##1: \textcolor{orange}{\textbf{##2}} |
| 777 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 778 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 779 |
\itemindent=0pt\labelsep=2pt} |
| 780 |
##5 |
| 781 |
\endlist |
| 782 |
}; |
| 783 |
}}, |
| 784 |
render instead={ |
| 785 |
\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] |
| 786 |
\clip (-5.25,-3) rectangle ++ (4,5); |
| 787 |
\begin{scope}[ |
| 788 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 789 |
root concept/.append style={ |
| 790 |
concept color=black, |
| 791 |
fill=white, line width=1ex, |
| 792 |
text=black, font=\large\scshape}, |
| 793 |
text=white, |
| 794 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 795 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 796 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 797 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 798 |
grow cyclic, |
| 799 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 800 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 801 |
\node [root concept] (Computational Complexity) {Computational Complexity} % root |
| 802 |
child [computational problems] { node (Computational Problems) {Computational Problems} |
| 803 |
child { node (Problem Measures) {Problem Measures} } |
| 804 |
child { node (Problem Aspects) {Problem Aspects} } |
| 805 |
child [faded] { node (problem Domains) {Problem Domains} } |
| 806 |
child { node (Key Problems) {Key Problems} } |
| 807 |
} |
| 808 |
child [computational models] { node (Computational Models) {Computational Models} |
| 809 |
child { node (Turing Machines) {Turing Machines} } |
| 810 |
child [faded] { node (Random-Access Machines) {Random-Access Machines} } |
| 811 |
child { node (Circuits) {Circuits} } |
| 812 |
child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } |
| 813 |
child { node (Oracle Machines) {Oracle Machines} } |
| 814 |
child { node (Programming in Logic) {Programming in Logic} } |
| 815 |
} |
| 816 |
child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} |
| 817 |
child { node (Complexity Measures) {Complexity Measures} } |
| 818 |
child { node (Classifying Complexity) {Classifying Complexity} } |
| 819 |
child { node (Comparing Complexity) {Comparing Complexity} } |
| 820 |
child [faded] { node (Describing Complexity) {Describing Complexity} } |
| 821 |
} |
| 822 |
child [solving problems] { node (Solving Problems) {Solving Problems} |
| 823 |
child { node (Exact Algorithms) {Exact Algorithms} } |
| 824 |
child { node (Randomization) {Randomization} } |
| 825 |
child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } |
| 826 |
child { node (Parallel Computation) {Parallel Computation} } |
| 827 |
child { node (Partial Solutions) {Partial Solutions} } |
| 828 |
child { node (Approximation) {Approximation} } |
| 829 |
}; |
| 830 |
\end{scope} |
| 831 |
\lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{ |
| 832 |
\item Knowledge of several key problems |
| 833 |
\item Knowledge of problem encodings |
| 834 |
\item Being able to formalize problems |
| 835 |
}{2009-04-08} |
| 836 |
\end{tikzpicture} |
| 837 |
}, |
| 838 |
] |
| 839 |
\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] |
| 840 |
\clip (-5,-5) rectangle ++ (4,5); |
| 841 |
\begin{scope}[ |
| 842 |
every node/.style={concept, circular drop shadow, ... % as before |
| 843 |
\node [root concept] (Computational Complexity) ... % as before |
| 844 |
\end{scope} |
| 845 |
|
| 846 |
\lecture{1}{Computational Problems}{above,xshift=-3mm} |
| 847 |
{Computational Problems.north}{ |
| 848 |
\item Knowledge of several key problems |
| 849 |
\item Knowledge of problem encodings |
| 850 |
\item Being able to formalize problems |
| 851 |
}{2009-04-08} |
| 852 |
\end{tikzpicture} |
| 853 |
\end{codeexample} |
| 854 |
|
| 855 |
In the same fashion Johannes can now add the other lecture annotations. |
| 856 |
Obviously, Johannes will have some trouble fitting everything on a single |
| 857 |
A4-sized page, but by adjusting the spacing and some experimentation he can |
| 858 |
quickly arrange all the annotations as needed. |
| 859 |
|
| 860 |
|
| 861 |
\subsection{Adding the Background} |
| 862 |
|
| 863 |
Johannes has already used colors to organize his lecture map into four regions, |
| 864 |
each having a different color. In order to emphasize these regions even more |
| 865 |
strongly, he wishes to add a background coloring to each of these regions. |
| 866 |
|
| 867 |
Adding these background colors turns out to be more tricky than Johannes would |
| 868 |
have thought. At first sight, what he needs is some sort of ``color wheel'' |
| 869 |
that is blue in the lower right direction and then changes smoothly to orange |
| 870 |
in the upper right direction and then to green in the upper left direction and |
| 871 |
so on. Unfortunately, there is no easy way of creating such a color wheel |
| 872 |
shading (although it can be done, in principle, but only at a very high cost, |
| 873 |
see page~\pageref{shading-color-wheel} for an example). |
| 874 |
|
| 875 |
Johannes decides to do something a bit more basic: He creates four large |
| 876 |
rectangles, one for each of the four quadrants around the central concept, each |
| 877 |
colored with a light version of the quadrant. Then, in order to ``smooth'' the |
| 878 |
change between adjacent rectangles, he puts four shadings on top of them. |
| 879 |
|
| 880 |
Since these background rectangles should go ``behind'' everything else, |
| 881 |
Johannes puts all his background stuff on the |background| layer. |
| 882 |
|
| 883 |
In the following code, only the central concept is shown to save some space: |
| 884 |
% |
| 885 |
\begin{codeexample}[preamble={\usetikzlibrary{backgrounds,mindmap,shadows}}] |
| 886 |
\begin{tikzpicture}[ |
| 887 |
mindmap, |
| 888 |
concept color=black, |
| 889 |
root concept/.append style={ |
| 890 |
concept, |
| 891 |
circular drop shadow, |
| 892 |
fill=white, line width=1ex, |
| 893 |
text=black, font=\large\scshape} |
| 894 |
] |
| 895 |
|
| 896 |
\clip (-1.5,-5) rectangle ++(4,10); |
| 897 |
|
| 898 |
\node [root concept] (Computational Complexity) {Computational Complexity}; |
| 899 |
|
| 900 |
\begin{pgfonlayer}{background} |
| 901 |
\clip (-1.5,-5) rectangle ++(4,10); |
| 902 |
|
| 903 |
\colorlet{upperleft}{green!50!black!25} |
| 904 |
\colorlet{upperright}{orange!25} |
| 905 |
\colorlet{lowerleft}{red!25} |
| 906 |
\colorlet{lowerright}{blue!25} |
| 907 |
|
| 908 |
% The large rectangles: |
| 909 |
\fill [upperleft] (Computational Complexity) rectangle ++(-20,20); |
| 910 |
\fill [upperright] (Computational Complexity) rectangle ++(20,20); |
| 911 |
\fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); |
| 912 |
\fill [lowerright] (Computational Complexity) rectangle ++(20,-20); |
| 913 |
|
| 914 |
% The shadings: |
| 915 |
\shade [left color=upperleft,right color=upperright] |
| 916 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,20); |
| 917 |
\shade [left color=lowerleft,right color=lowerright] |
| 918 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); |
| 919 |
\shade [top color=upperleft,bottom color=lowerleft] |
| 920 |
([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); |
| 921 |
\shade [top color=upperright,bottom color=lowerright] |
| 922 |
([yshift=-1cm]Computational Complexity) rectangle ++(20,2); |
| 923 |
\end{pgfonlayer} |
| 924 |
\end{tikzpicture} |
| 925 |
\end{codeexample} |
| 926 |
|
| 927 |
|
| 928 |
\subsection{Adding the Calendar} |
| 929 |
|
| 930 |
Johannes intends to plan his lecture rather carefully. In particular, he |
| 931 |
already knows when each of his lectures will be held during the course. |
| 932 |
Naturally, this does not mean that Johannes will slavishly follow the plan and |
| 933 |
he might need longer for some subjects than he anticipated, but nevertheless he |
| 934 |
has a detailed plan of when which subject will be addressed. |
| 935 |
|
| 936 |
Johannes intends to share this plan with his students by adding a calendar to |
| 937 |
the lecture map. In addition to serving as a reference on which particular day |
| 938 |
a certain topic will be addressed, the calendar is also useful to show the |
| 939 |
overall chronological order of the course. |
| 940 |
|
| 941 |
In order to add a calendar to a \tikzname\ graphic, the |calendar| library is |
| 942 |
most useful. The library provides the |\calendar| command, which takes a large |
| 943 |
number of options and which can be configured in many ways to produce just |
| 944 |
about any kind of calendar imaginable. For Johannes' purposes, a simple |
| 945 |
|day list downward| will be a nice option since it produces a list of days that |
| 946 |
go ``downward''. |
| 947 |
% |
| 948 |
\begin{codeexample}[ |
| 949 |
leave comments, |
| 950 |
preamble={\usetikzlibrary{calendar}}, |
| 951 |
] |
| 952 |
\tiny |
| 953 |
\begin{tikzpicture} |
| 954 |
\calendar [day list downward, |
| 955 |
name=cal, |
| 956 |
dates=2009-04-01 to 2009-04-14] |
| 957 |
if (weekend) |
| 958 |
[black!25]; |
| 959 |
\end{tikzpicture} |
| 960 |
\end{codeexample} |
| 961 |
|
| 962 |
Using the |name| option, we gave a name to the calendar, which will allow us to |
| 963 |
reference the nodes that make up the individual days of the calendar later on. |
| 964 |
For instance, the rectangular node containing the |1| that represents April |
| 965 |
1st, 2009, can be referenced as |(cal-2009-04-01)|. The |dates| option is used |
| 966 |
to specify an interval for which the calendar should be drawn. Johannes will |
| 967 |
need several months in his calendar, but the above example only shows two weeks |
| 968 |
to save some space. |
| 969 |
|
| 970 |
Note the |if (weekend)| construct. The |\calendar| command is followed by |
| 971 |
options and then by |if|-statements. These |if|-statements are checked for each |
| 972 |
day of the calendar and when a date passes this test, the options or the code |
| 973 |
following the |if|-statement is executed. In the above example, we make weekend |
| 974 |
days (Saturdays and Sundays, to be precise) lighter than normal days. (Use your |
| 975 |
favorite calendar to check that, indeed, April 5th, 2009, is a Sunday.) |
| 976 |
|
| 977 |
As mentioned above, Johannes can reference the nodes that are used to typeset |
| 978 |
days. Recall that his |\lecture| macro already got passed a date, which we did |
| 979 |
not use, yet. We can now use it to place the lecture's title next to the date |
| 980 |
when the lecture will be held: |
| 981 |
% |
| 982 |
\begin{codeexample}[code only] |
| 983 |
\def\lecture#1#2#3#4#5#6{ |
| 984 |
% As before: |
| 985 |
\node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { |
| 986 |
Lecture #1: \textcolor{orange}{\textbf{#2}} |
| 987 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 988 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 989 |
\itemindent=0pt\labelsep=2pt} |
| 990 |
#5 |
| 991 |
\endlist |
| 992 |
}; |
| 993 |
% New: |
| 994 |
\node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; |
| 995 |
} |
| 996 |
\end{codeexample} |
| 997 |
\def\lecture#1#2#3#4#5#6{ |
| 998 |
\node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; |
| 999 |
} |
| 1000 |
|
| 1001 |
Johannes can now use this new |\lecture| command as follows (in the example, |
| 1002 |
only the new part of the definition is used): |
| 1003 |
% |
| 1004 |
\begin{codeexample}[ |
| 1005 |
preamble={\usetikzlibrary{calendar}}, |
| 1006 |
pre={ % !!! replace all `##x` with `#x` |
| 1007 |
\def\lecture##1##2##3##4##5##6{ |
| 1008 |
\node [anchor=base west] at (cal-##6.base east) {\textcolor{orange}{\textbf{##2}}}; |
| 1009 |
}}, |
| 1010 |
] |
| 1011 |
\tiny |
| 1012 |
\begin{tikzpicture} |
| 1013 |
\calendar [day list downward, |
| 1014 |
name=cal, |
| 1015 |
dates=2009-04-01 to 2009-04-14] |
| 1016 |
if (weekend) |
| 1017 |
[black!25]; |
| 1018 |
|
| 1019 |
% As before: |
| 1020 |
\lecture{1}{Computational Problems}{above,xshift=-3mm} |
| 1021 |
{Computational Problems.north}{ |
| 1022 |
\item Knowledge of several key problems |
| 1023 |
\item Knowledge of problem encodings |
| 1024 |
\item Being able to formalize problems |
| 1025 |
}{2009-04-08} |
| 1026 |
\end{tikzpicture} |
| 1027 |
\end{codeexample} |
| 1028 |
|
| 1029 |
As a final step, Johannes needs to add a few more options to the calendar |
| 1030 |
command: He uses the |month text| option to configure how the text of a month |
| 1031 |
is rendered (see Section~\ref{section-calender} for details) and then typesets |
| 1032 |
the month text at a special position at the beginning of each month. |
| 1033 |
% |
| 1034 |
\begin{codeexample}[ |
| 1035 |
leave comments, |
| 1036 |
preamble={\usetikzlibrary{calendar}}, |
| 1037 |
pre={ % !!! replace all `##x` with `#x` |
| 1038 |
\def\lecture##1##2##3##4##5##6{ |
| 1039 |
\node [anchor=base west] at (cal-##6.base east) {\textcolor{orange}{\textbf{##2}}}; |
| 1040 |
}}, |
| 1041 |
] |
| 1042 |
\tiny |
| 1043 |
\begin{tikzpicture} |
| 1044 |
\calendar [day list downward, |
| 1045 |
month text=\%mt\ \%y0, |
| 1046 |
month yshift=3.5em, |
| 1047 |
name=cal, |
| 1048 |
dates=2009-04-01 to 2009-05-01] |
| 1049 |
if (weekend) |
| 1050 |
[black!25] |
| 1051 |
if (day of month=1) { |
| 1052 |
\node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; |
| 1053 |
}; |
| 1054 |
|
| 1055 |
\lecture{1}{Computational Problems}{above,xshift=-3mm} |
| 1056 |
{Computational Problems.north}{ |
| 1057 |
\item Knowledge of several key problems |
| 1058 |
\item Knowledge of problem encodings |
| 1059 |
\item Being able to formalize problems |
| 1060 |
}{2009-04-08} |
| 1061 |
|
| 1062 |
\lecture{2}{Computational Models}{above,xshift=-3mm} |
| 1063 |
{Computational Models.north}{ |
| 1064 |
\item Knowledge of Turing machines |
| 1065 |
\item Being able to compare the computational power of different |
| 1066 |
models |
| 1067 |
}{2009-04-15} |
| 1068 |
\end{tikzpicture} |
| 1069 |
\end{codeexample} |
| 1070 |
|
| 1071 |
|
| 1072 |
\subsection{The Complete Code} |
| 1073 |
|
| 1074 |
Putting it all together, Johannes gets the following code: |
| 1075 |
|
| 1076 |
First comes the definition of the |\lecture| command: |
| 1077 |
% |
| 1078 |
\begin{codeexample}[code only] |
| 1079 |
\def\lecture#1#2#3#4#5#6{ |
| 1080 |
% As before: |
| 1081 |
\node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) { |
| 1082 |
Lecture #1: \textcolor{orange}{\textbf{#2}} |
| 1083 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 1084 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 1085 |
\itemindent=0pt\labelsep=2pt} |
| 1086 |
#5 |
| 1087 |
\endlist |
| 1088 |
}; |
| 1089 |
% New: |
| 1090 |
\node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; |
| 1091 |
} |
| 1092 |
\end{codeexample} |
| 1093 |
|
| 1094 |
This is followed by the main mindmap setup\dots |
| 1095 |
% |
| 1096 |
\begin{codeexample}[code only] |
| 1097 |
\noindent |
| 1098 |
\begin{tikzpicture} |
| 1099 |
\begin{scope}[ |
| 1100 |
mindmap, |
| 1101 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 1102 |
root concept/.append style={ |
| 1103 |
concept color=black, |
| 1104 |
fill=white, line width=1ex, |
| 1105 |
text=black, font=\large\scshape}, |
| 1106 |
text=white, |
| 1107 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 1108 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 1109 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 1110 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 1111 |
grow cyclic, |
| 1112 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 1113 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 1114 |
\end{codeexample} |
| 1115 |
% |
| 1116 |
\dots and contents: |
| 1117 |
% |
| 1118 |
\begin{codeexample}[code only] |
| 1119 |
\node [root concept] (Computational Complexity) {Computational Complexity} % root |
| 1120 |
child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems} |
| 1121 |
child { node (Problem Measures) {Problem Measures} } |
| 1122 |
child { node (Problem Aspects) {Problem Aspects} } |
| 1123 |
child [faded] { node (problem Domains) {Problem Domains} } |
| 1124 |
child { node (Key Problems) {Key Problems} } |
| 1125 |
} |
| 1126 |
child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models} |
| 1127 |
child { node (Turing Machines) {Turing Machines} } |
| 1128 |
child [faded] { node (Random-Access Machines) {Random-Access Machines} } |
| 1129 |
child { node (Circuits) {Circuits} } |
| 1130 |
child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } |
| 1131 |
child { node (Oracle Machines) {Oracle Machines} } |
| 1132 |
child { node (Programming in Logic) {Programming in Logic} } |
| 1133 |
} |
| 1134 |
child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity} |
| 1135 |
child { node (Complexity Measures) {Complexity Measures} } |
| 1136 |
child { node (Classifying Complexity) {Classifying Complexity} } |
| 1137 |
child { node (Comparing Complexity) {Comparing Complexity} } |
| 1138 |
child [faded] { node (Describing Complexity) {Describing Complexity} } |
| 1139 |
} |
| 1140 |
child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems} |
| 1141 |
child { node (Exact Algorithms) {Exact Algorithms} } |
| 1142 |
child { node (Randomization) {Randomization} } |
| 1143 |
child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } |
| 1144 |
child { node (Parallel Computation) {Parallel Computation} } |
| 1145 |
child { node (Partial Solutions) {Partial Solutions} } |
| 1146 |
child { node (Approximation) {Approximation} } |
| 1147 |
}; |
| 1148 |
\end{scope} |
| 1149 |
\end{codeexample} |
| 1150 |
% |
| 1151 |
Now comes the calendar code: |
| 1152 |
% |
| 1153 |
\begin{codeexample}[code only] |
| 1154 |
\tiny |
| 1155 |
\calendar [day list downward, |
| 1156 |
month text=\%mt\ \%y0, |
| 1157 |
month yshift=3.5em, |
| 1158 |
name=cal, |
| 1159 |
at={(-.5\textwidth-5mm,.5\textheight-1cm)}, |
| 1160 |
dates=2009-04-01 to 2009-06-last] |
| 1161 |
if (weekend) |
| 1162 |
[black!25] |
| 1163 |
if (day of month=1) { |
| 1164 |
\node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; |
| 1165 |
}; |
| 1166 |
\end{codeexample} |
| 1167 |
% |
| 1168 |
The lecture annotations: |
| 1169 |
% |
| 1170 |
\begin{codeexample}[code only] |
| 1171 |
\lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{ |
| 1172 |
\item Knowledge of several key problems |
| 1173 |
\item Knowledge of problem encodings |
| 1174 |
\item Being able to formalize problems |
| 1175 |
}{2009-04-08} |
| 1176 |
|
| 1177 |
\lecture{2}{Computational Models}{above left} |
| 1178 |
{Computational Models.west}{ |
| 1179 |
\item Knowledge of Turing machines |
| 1180 |
\item Being able to compare the computational power of different |
| 1181 |
models |
| 1182 |
}{2009-04-15} |
| 1183 |
\end{codeexample} |
| 1184 |
% |
| 1185 |
Finally, the background: |
| 1186 |
% |
| 1187 |
\begin{codeexample}[code only] |
| 1188 |
\begin{pgfonlayer}{background} |
| 1189 |
\clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight); |
| 1190 |
|
| 1191 |
\colorlet{upperleft}{green!50!black!25} |
| 1192 |
\colorlet{upperright}{orange!25} |
| 1193 |
\colorlet{lowerleft}{red!25} |
| 1194 |
\colorlet{lowerright}{blue!25} |
| 1195 |
|
| 1196 |
% The large rectangles: |
| 1197 |
\fill [upperleft] (Computational Complexity) rectangle ++(-20,20); |
| 1198 |
\fill [upperright] (Computational Complexity) rectangle ++(20,20); |
| 1199 |
\fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); |
| 1200 |
\fill [lowerright] (Computational Complexity) rectangle ++(20,-20); |
| 1201 |
|
| 1202 |
% The shadings: |
| 1203 |
\shade [left color=upperleft,right color=upperright] |
| 1204 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,20); |
| 1205 |
\shade [left color=lowerleft,right color=lowerright] |
| 1206 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); |
| 1207 |
\shade [top color=upperleft,bottom color=lowerleft] |
| 1208 |
([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); |
| 1209 |
\shade [top color=upperright,bottom color=lowerright] |
| 1210 |
([yshift=-1cm]Computational Complexity) rectangle ++(20,2); |
| 1211 |
\end{pgfonlayer} |
| 1212 |
\end{tikzpicture} |
| 1213 |
\end{codeexample} |
| 1214 |
|
| 1215 |
The next page shows the resulting lecture map in all its glory (it |
| 1216 |
would be somewhat more glorious, if there were more lecture |
| 1217 |
annotations, but you should get the idea). |
| 1218 |
|
| 1219 |
\def\lecture#1#2#3#4#5#6{ |
| 1220 |
% As before: |
| 1221 |
\node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) { |
| 1222 |
Lecture #1: \textcolor{orange}{\textbf{#2}} |
| 1223 |
\list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt |
| 1224 |
\parskip=0pt\labelwidth=8pt\leftmargin=8pt |
| 1225 |
\itemindent=0pt\labelsep=2pt} |
| 1226 |
#5 |
| 1227 |
\endlist |
| 1228 |
}; |
| 1229 |
% New: |
| 1230 |
\node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; |
| 1231 |
} |
| 1232 |
|
| 1233 |
\noindent |
| 1234 |
\begin{tikzpicture} |
| 1235 |
\begin{scope}[ |
| 1236 |
mindmap, |
| 1237 |
every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, |
| 1238 |
root concept/.append style={ |
| 1239 |
concept color=black, |
| 1240 |
fill=white, line width=1ex, |
| 1241 |
text=black, font=\large\scshape}, |
| 1242 |
text=white, |
| 1243 |
computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, |
| 1244 |
computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, |
| 1245 |
measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, |
| 1246 |
solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, |
| 1247 |
grow cyclic, |
| 1248 |
level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, |
| 1249 |
level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] |
| 1250 |
\node [root concept] (Computational Complexity) {Computational Complexity} % root |
| 1251 |
child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems} |
| 1252 |
child { node (Problem Measures) {Problem Measures} } |
| 1253 |
child { node (Problem Aspects) {Problem Aspects} } |
| 1254 |
child [faded] { node (problem Domains) {Problem Domains} } |
| 1255 |
child { node (Key Problems) {Key Problems} } |
| 1256 |
} |
| 1257 |
child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models} |
| 1258 |
child { node (Turing Machines) {Turing Machines} } |
| 1259 |
child [faded] { node (Random-Access Machines) {Random-Access Machines} } |
| 1260 |
child { node (Circuits) {Circuits} } |
| 1261 |
child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } |
| 1262 |
child { node (Oracle Machines) {Oracle Machines} } |
| 1263 |
child { node (Programming in Logic) {Programming in Logic} } |
| 1264 |
} |
| 1265 |
child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity} |
| 1266 |
child { node (Complexity Measures) {Complexity Measures} } |
| 1267 |
child { node (Classifying Complexity) {Classifying Complexity} } |
| 1268 |
child { node (Comparing Complexity) {Comparing Complexity} } |
| 1269 |
child [faded] { node (Describing Complexity) {Describing Complexity} } |
| 1270 |
} |
| 1271 |
child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems} |
| 1272 |
child { node (Exact Algorithms) {Exact Algorithms} } |
| 1273 |
child { node (Randomization) {Randomization} } |
| 1274 |
child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } |
| 1275 |
child { node (Parallel Computation) {Parallel Computation} } |
| 1276 |
child { node (Partial Solutions) {Partial Solutions} } |
| 1277 |
child { node (Approximation) {Approximation} } |
| 1278 |
}; |
| 1279 |
\end{scope} |
| 1280 |
|
| 1281 |
\tiny |
| 1282 |
\calendar [day list downward, |
| 1283 |
month text=\%mt\ \%y0, |
| 1284 |
month yshift=3.5em, |
| 1285 |
name=cal, |
| 1286 |
at={(-.5\textwidth-5mm,.5\textheight-1cm)}, |
| 1287 |
dates=2009-04-01 to 2009-06-last] |
| 1288 |
if (weekend) |
| 1289 |
[black!25] |
| 1290 |
if (day of month=1) { |
| 1291 |
\node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; |
| 1292 |
}; |
| 1293 |
|
| 1294 |
\lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{ |
| 1295 |
\item Knowledge of several key problems |
| 1296 |
\item Knowledge of problem encodings |
| 1297 |
\item Being able to formalize problems |
| 1298 |
}{2009-04-08} |
| 1299 |
|
| 1300 |
\lecture{2}{Computational Models}{above left} |
| 1301 |
{Computational Models.west}{ |
| 1302 |
\item Knowledge of Turing machines |
| 1303 |
\item Being able to compare the computational power of different |
| 1304 |
models |
| 1305 |
}{2009-04-15} |
| 1306 |
|
| 1307 |
\begin{pgfonlayer}{background} |
| 1308 |
\clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight); |
| 1309 |
|
| 1310 |
\colorlet{upperleft}{green!50!black!25} |
| 1311 |
\colorlet{upperright}{orange!25} |
| 1312 |
\colorlet{lowerleft}{red!25} |
| 1313 |
\colorlet{lowerright}{blue!25} |
| 1314 |
|
| 1315 |
% The large rectangles: |
| 1316 |
\fill [upperleft] (Computational Complexity) rectangle ++(-20,20); |
| 1317 |
\fill [upperright] (Computational Complexity) rectangle ++(20,20); |
| 1318 |
\fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); |
| 1319 |
\fill [lowerright] (Computational Complexity) rectangle ++(20,-20); |
| 1320 |
|
| 1321 |
% The shadings: |
| 1322 |
\shade [left color=upperleft,right color=upperright] |
| 1323 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,20); |
| 1324 |
\shade [left color=lowerleft,right color=lowerright] |
| 1325 |
([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); |
| 1326 |
\shade [top color=upperleft,bottom color=lowerleft] |
| 1327 |
([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); |
| 1328 |
\shade [top color=upperright,bottom color=lowerright] |
| 1329 |
([yshift=-1cm]Computational Complexity) rectangle ++(20,2); |
| 1330 |
\end{pgfonlayer} |
| 1331 |
\end{tikzpicture} |