diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
commit | 8876a8021514f190d676e4e5261f1084a66754d3 (patch) | |
tree | 9a496107a312a1acbbdb06ea0e1657c285109729 /Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex | |
parent | 693eacf895c01285e2992460bb489142ead8ae8a (diff) |
pgf (19dec19)
git-svn-id: svn://tug.org/texlive/trunk@53187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex | 721 |
1 files changed, 391 insertions, 330 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex index e3af1d3b5fe..8a81429b678 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex @@ -164,30 +164,33 @@ expect?). There are two problems: Johannes redraws the tree, but this time with some more appropriate options set, which he found more or less by trial-and-error: % -\begin{codeexample}[render instead={ -\tikz [font=\footnotesize, - grow=right, level 1/.style={sibling distance=6em}, - level 2/.style={sibling distance=1em}, level distance=5cm] - \node {Computational Complexity} % root - child { node {Computational Problems} - child { node {Problem Measures} } child { node {Problem Aspects} } - child { node {Problem Domains} } child { node {Key Problems} } - } - child { node {Computational Models} - child { node {Turing Machines} } child { node {Random-Access Machines} } - child { node {Circuits} } child { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } child { node {Programming in Logic} } - } - child { node {Measuring Complexity} - child { node {Complexity Measures} } child { node {Classifying Complexity} } - child { node {Comparing Complexity} } child { node {Describing Complexity} } - } - child { node {Solving Problems} - child { node {Exact Algorithms} } child { node {Randomization} } - child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } - child { node {Partial Solutions} } child { node {Approximation} } - }; - }] +\begin{codeexample}[ + preamble={\usetikzlibrary{trees}}, + render instead={ + \tikz [font=\footnotesize, + grow=right, level 1/.style={sibling distance=6em}, + level 2/.style={sibling distance=1em}, level distance=5cm] + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + }, +] \tikz [font=\footnotesize, grow=right, level 1/.style={sibling distance=6em}, level 2/.style={sibling distance=1em}, level distance=5cm] @@ -224,31 +227,34 @@ can change growth direction ``in the middle of a tree'' simply by changing this key for a single child or a whole level. By including the |trees| library you also get access to additional growth strategies such as a ``circular'' growth: % -\begin{codeexample}[render instead={ -\tikz [text width=2.7cm, align=flush center, - grow cyclic, - level 1/.style={level distance=2.5cm,sibling angle=90}, - level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] - \node[font=\bfseries] {Computational Complexity} % root - child { node {Computational Problems} - child { node {Problem Measures} } child { node {Problem Aspects} } - child { node {Problem Domains} } child { node {Key Problems} } - } - child { node {Computational Models} - child { node {Turing Machines} } child { node {Random-Access Machines} } - child { node {Circuits} } child { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } child { node {Programming in Logic} } - } - child { node {Measuring Complexity} - child { node {Complexity Measures} } child { node {Classifying Complexity} } - child { node {Comparing Complexity} } child { node {Describing Complexity} } - } - child { node {Solving Problems} - child { node {Exact Algorithms} } child { node {Randomization} } - child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } - child { node {Partial Solutions} } child { node {Approximation} } - }; - }] +\begin{codeexample}[ + preamble={\usetikzlibrary{trees}}, + render instead={ + \tikz [text width=2.7cm, align=flush center, + grow cyclic, + level 1/.style={level distance=2.5cm,sibling angle=90}, + level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] + \node[font=\bfseries] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + }, +] \tikz [text width=2.7cm, align=flush center, grow cyclic, level 1/.style={level distance=2.5cm,sibling angle=90}, @@ -292,40 +298,44 @@ is not the case, so you might consider saying |every node/.style=concept|. The third step is to set up the sibling \emph{angle} (rather than a sibling distance) to specify the angle between sibling concepts. % -\begin{codeexample}[render instead={ -\tikz [mindmap, every node/.style=concept, concept color=black!20, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90}, - level 2/.append style={level distance=3cm,sibling angle=45}] - \node [root concept] {Computational Complexity} % root - child { node {\hbox to 2cm{Computational\hss} Problems} - child { node {Problem Measures} } - child { node {Problem Aspects} } - child { node {Problem Domains} } - child { node {Key Problems} } - } - child { node {\hbox to 2cm{Computational\hss} Models} - child { node {Turing Machines} } - child { node {Random-Access Machines} } - child { node {Circuits} } - child { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } - child { node {\hbox to1.5cm{Programming\hss} in Logic} } - } - child { node {Measuring Complexity} - child { node {Complexity Measures} } - child { node {Classifying Complexity} } - child { node {Comparing Complexity} } - child { node {Describing Complexity} } - } - child { node {Solving Problems} - child { node {Exact Algorithms} } - child { node {\hbox to 1.5cm{Randomization\hss}} } - child { node {Fixed-Parameter Algorithms} } - child { node {Parallel Computation} } - child { node {Partial Solutions} } - child { node {\hbox to1.5cm{Approximation\hss}} } - };}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap}}, + render instead={ + \tikz [mindmap, every node/.style=concept, concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \node [root concept] {Computational Complexity} % root + child { node {\hbox to 2cm{Computational\hss} Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {\hbox to 2cm{Computational\hss} Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {\hbox to1.5cm{Programming\hss} in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {\hbox to 1.5cm{Randomization\hss}} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {\hbox to1.5cm{Approximation\hss}} } + }; + }, +] \tikz [mindmap, every node/.style=concept, concept color=black!20, grow cyclic, level 1/.append style={level distance=4.5cm,sibling angle=90}, @@ -350,46 +360,49 @@ the first word also. Since Johannes does not want to add |\hskip0pt| inside each node, he uses the |execute at begin node| option to make \tikzname\ insert this text with every node. % -\begin{codeexample}[render instead={ -\begin{tikzpicture} - [mindmap, - every node/.style={concept, execute at begin node=\hskip0pt}, - concept color=black!20, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90}, - level 2/.append style={level distance=3cm,sibling angle=45}] - \clip (-1,2) rectangle ++ (-4,5); - \node [root concept] {Computational Complexity} % root - child { node {Computational Problems} - child { node {Problem Measures} } - child { node {Problem Aspects} } - child { node {Problem Domains} } - child { node {Key Problems} } - } - child { node {Computational Models} - child { node {Turing Machines} } - child { node {Random-Access Machines} } - child { node {Circuits} } - child { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } - child { node {Programming in Logic} } - } - child { node {Measuring Complexity} - child { node {Complexity Measures} } - child { node {Classifying Complexity} } - child { node {Comparing Complexity} } - child { node {Describing Complexity} } - } - child { node {Solving Problems} - child { node {Exact Algorithms} } - child { node {Randomization} } - child { node {Fixed-Parameter Algorithms} } - child { node {Parallel Computation} } - child { node {Partial Solutions} } - child { node {Approximation} } - }; -\end{tikzpicture} -}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap}}, + render instead={ + \begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (-1,2) rectangle ++ (-4,5); + \node [root concept] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{tikzpicture} + }, +] \begin{tikzpicture} [mindmap, every node/.style={concept, execute at begin node=\hskip0pt}, @@ -434,49 +447,53 @@ color to white. The effect of this is that the root concept will be encircled with a thick black line and the children are connected to the central concept via bars. % -\begin{codeexample}[render instead={ -\begin{tikzpicture} - [mindmap, - every node/.style={concept, execute at begin node=\hskip0pt}, - root concept/.append style={ - concept color=black, - fill=white, line width=1ex, - text=black}, - text=white, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90}, - level 2/.append style={level distance=3cm,sibling angle=45}] - \clip (0,-1) rectangle ++(4,5); - \node [root concept] {Computational Complexity} % root - child [concept color=red] { node {Computational Problems} - child { node {Problem Measures} } - child { node {Problem Aspects} } - child { node {Problem Domains} } - child { node {Key Problems} } - } - child [concept color=blue] { node {Computational Models} - child { node {Turing Machines} } - child { node {Random-Access Machines} } - child { node {Circuits} } - child { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } - child { node {Programming in Logic} } - } - child [concept color=orange] { node {Measuring Complexity} - child { node {Complexity Measures} } - child { node {Classifying Complexity} } - child { node {Comparing Complexity} } - child { node {Describing Complexity} } - } - child [concept color=green!50!black] { node {Solving Problems} - child { node {Exact Algorithms} } - child { node {Randomization} } - child { node {Fixed-Parameter Algorithms} } - child { node {Parallel Computation} } - child { node {Partial Solutions} } - child { node {Approximation} } - }; - \end{tikzpicture}}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap}}, + render instead={ + \begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black}, + text=white, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (0,-1) rectangle ++(4,5); + \node [root concept] {Computational Complexity} % root + child [concept color=red] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child [concept color=blue] { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [concept color=orange] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child [concept color=green!50!black] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{tikzpicture} + }, +] \begin{tikzpicture} [mindmap, every node/.style={concept, execute at begin node=\hskip0pt}, @@ -517,53 +534,57 @@ set up the correct concept color for the whole branch and (b) define the |circular drop shadow|, defined in the |shadows| library, to the concepts, just to make things look a bit more fancy. % -\begin{codeexample}[render instead={ -\begin{tikzpicture}[mindmap] - \begin{scope}[ - every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, - root concept/.append style={ - concept color=black, - fill=white, line width=1ex, - text=black, font=\large\scshape}, - text=white, - computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, - computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, - measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, - solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, - level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] - \node [root concept] {Computational Complexity} % root - child [computational problems] { node {Computational Problems} - child { node {Problem Measures} } - child { node {Problem Aspects} } - child [faded] { node {Problem Domains} } - child { node {Key Problems} } - } - child [computational models] { node {Computational Models} - child { node {Turing Machines} } - child [faded] { node {Random-Access Machines} } - child { node {Circuits} } - child [faded] { node {Binary Decision Diagrams} } - child { node {Oracle Machines} } - child { node {Programming in Logic} } - } - child [measuring complexity] { node {Measuring Complexity} - child { node {Complexity Measures} } - child { node {Classifying Complexity} } - child { node {Comparing Complexity} } - child [faded] { node {Describing Complexity} } - } - child [solving problems] { node {Solving Problems} - child { node {Exact Algorithms} } - child { node {Randomization} } - child { node {Fixed-Parameter Algorithms} } - child { node {Parallel Computation} } - child { node {Partial Solutions} } - child { node {Approximation} } - }; - \end{scope} -\end{tikzpicture}}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap,shadows}}, + render instead={ + \begin{tikzpicture}[mindmap] + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] {Computational Complexity} % root + child [computational problems] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child [faded] { node {Problem Domains} } + child { node {Key Problems} } + } + child [computational models] { node {Computational Models} + child { node {Turing Machines} } + child [faded] { node {Random-Access Machines} } + child { node {Circuits} } + child [faded] { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [measuring complexity] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child [faded] { node {Describing Complexity} } + } + child [solving problems] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{scope} + \end{tikzpicture} + }, +] \begin{tikzpicture}[mindmap] \begin{scope}[ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, @@ -602,7 +623,7 @@ acquire during this particular lecture (note that learning targets are not the same as the contents of a lecture). For each lecture he intends to put a little rectangle on the map containing these learning targets and the name of the lecture, each time somewhere near the topic of the lecture. Such ``little -rectangles'' are called ``annotations'' by the mindmap library. +rectangles'' are called ``annotations'' by the |mindmap| library. In order to place the annotations next to the concepts, Johannes must assign names to the nodes of the concepts. He could rely on \tikzname's automatic @@ -622,68 +643,72 @@ explicitly name all concepts of the tree in the following manner: ... \end{codeexample} -The |annotation| style of the mind map library mainly sets up a rectangular +The |annotation| style of the |mindmap| library mainly sets up a rectangular shape of appropriate size. Johannes configures the style by defining |every annotation| appropriately. % -\begin{codeexample}[render instead={ -\begin{tikzpicture}[mindmap] - \clip (-5.25,-3) rectangle ++ (4,5); - \begin{scope}[ - every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, - root concept/.append style={ - concept color=black, - fill=white, line width=1ex, - text=black, font=\large\scshape}, - text=white, - computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, - computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, - measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, - solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, - level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] - \node [root concept] (Computational Complexity) {Computational Complexity} % root - child [computational problems] { node (Computational Problems) {Computational Problems} - child { node (Problem Measures) {Problem Measures} } - child { node (Problem Aspects) {Problem Aspects} } - child [faded] { node (problem Domains) {Problem Domains} } - child { node (Key Problems) {Key Problems} } - } - child [computational models] { node (Computational Models) {Computational Models} - child { node (Turing Machines) {Turing Machines} } - child [faded] { node (Random-Access Machines) {Random-Access Machines} } - child { node (Circuits) {Circuits} } - child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } - child { node (Oracle Machines) {Oracle Machines} } - child { node (Programming in Logic) {Programming in Logic} } - } - child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} - child { node (Complexity Measures) {Complexity Measures} } - child { node (Classifying Complexity) {Classifying Complexity} } - child { node (Comparing Complexity) {Comparing Complexity} } - child [faded] { node (Describing Complexity) {Describing Complexity} } - } - child [solving problems] { node (Solving Problems) {Solving Problems} - child { node (Exact Algorithms) {Exact Algorithms} } - child { node (Randomization) {Randomization} } - child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } - child { node (Parallel Computation) {Parallel Computation} } - child { node (Partial Solutions) {Partial Solutions} } - child { node (Approximation) {Approximation} } - }; - \end{scope} - \begin{scope}[every annotation/.style={fill=black!40}] - \node [annotation, above] at (Computational Problems.north) { - Lecture 1: Computational Problems - \begin{itemize} - \item Knowledge of several key problems - \item Knowledge of problem encodings - \item Being able to formalize problems - \end{itemize} - }; - \end{scope} -\end{tikzpicture}}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap,shadows}}, + render instead={ + \begin{tikzpicture}[mindmap] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \begin{scope}[every annotation/.style={fill=black!40}] + \node [annotation, above] at (Computational Problems.north) { + Lecture 1: Computational Problems + \begin{itemize} + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + \end{itemize} + }; + \end{scope} + \end{tikzpicture} + }, +] \begin{tikzpicture}[mindmap] \clip (-5,-5) rectangle ++ (4,5); \begin{scope}[ @@ -717,6 +742,7 @@ position where the node is placed, the fifth is the list of items to be shown, and the sixth is a date when the lecture will be held (this parameter is not yet needed, we will, however, need it later on). % +% TODOsp: codeexamples: redo `\lecture` definition*s* when `preamble` can be emptied \begin{codeexample}[code only] \def\lecture#1#2#3#4#5#6{ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { @@ -729,6 +755,8 @@ yet needed, we will, however, need it later on). }; } \end{codeexample} +% TODOsp: codeexamples: this definition can most likely be deleted, +% because it is moved to the `pre` key in the `codeexamples` \def\lecture#1#2#3#4#5#6{ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { Lecture #1: \textcolor{orange}{\textbf{#2}} @@ -740,59 +768,74 @@ yet needed, we will, however, need it later on). }; } -\begin{codeexample}[render instead={ -\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] - \clip (-5.25,-3) rectangle ++ (4,5); - \begin{scope}[ - every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, - root concept/.append style={ - concept color=black, - fill=white, line width=1ex, - text=black, font=\large\scshape}, - text=white, - computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, - computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, - measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, - solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, - grow cyclic, - level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, - level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] - \node [root concept] (Computational Complexity) {Computational Complexity} % root - child [computational problems] { node (Computational Problems) {Computational Problems} - child { node (Problem Measures) {Problem Measures} } - child { node (Problem Aspects) {Problem Aspects} } - child [faded] { node (problem Domains) {Problem Domains} } - child { node (Key Problems) {Key Problems} } - } - child [computational models] { node (Computational Models) {Computational Models} - child { node (Turing Machines) {Turing Machines} } - child [faded] { node (Random-Access Machines) {Random-Access Machines} } - child { node (Circuits) {Circuits} } - child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } - child { node (Oracle Machines) {Oracle Machines} } - child { node (Programming in Logic) {Programming in Logic} } - } - child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} - child { node (Complexity Measures) {Complexity Measures} } - child { node (Classifying Complexity) {Classifying Complexity} } - child { node (Comparing Complexity) {Comparing Complexity} } - child [faded] { node (Describing Complexity) {Describing Complexity} } - } - child [solving problems] { node (Solving Problems) {Solving Problems} - child { node (Exact Algorithms) {Exact Algorithms} } - child { node (Randomization) {Randomization} } - child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } - child { node (Parallel Computation) {Parallel Computation} } - child { node (Partial Solutions) {Partial Solutions} } - child { node (Approximation) {Approximation} } - }; - \end{scope} - \lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{ - \item Knowledge of several key problems - \item Knowledge of problem encodings - \item Being able to formalize problems - }{2009-04-08} -\end{tikzpicture}}] +\begin{codeexample}[ + preamble={\usetikzlibrary{mindmap,shadows}}, + pre={ % !!! replace all `##x` with `#x` +\def\lecture##1##2##3##4##5##6{ + \node [annotation, ##3, scale=0.65, text width=4cm, inner sep=2mm] at (##4) { + Lecture ##1: \textcolor{orange}{\textbf{##2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + ##5 + \endlist + }; +}}, + render instead={ + \begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + \end{tikzpicture} + }, +] \begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] \clip (-5,-5) rectangle ++ (4,5); \begin{scope}[ @@ -839,7 +882,7 @@ Johannes puts all his background stuff on the |background| layer. In the following code, only the central concept is shown to save some space: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{backgrounds,mindmap,shadows}}] \begin{tikzpicture}[ mindmap, concept color=black, @@ -902,7 +945,10 @@ about any kind of calendar imaginable. For Johannes' purposes, a simple |day list downward| will be a nice option since it produces a list of days that go ``downward''. % -\begin{codeexample}[leave comments] +\begin{codeexample}[ + leave comments, + preamble={\usetikzlibrary{calendar}}, +] \tiny \begin{tikzpicture} \calendar [day list downward, @@ -955,7 +1001,13 @@ when the lecture will be held: Johannes can now use this new |\lecture| command as follows (in the example, only the new part of the definition is used): % -\begin{codeexample}[] +\begin{codeexample}[ + preamble={\usetikzlibrary{calendar}}, + pre={ % !!! replace all `##x` with `#x` +\def\lecture##1##2##3##4##5##6{ + \node [anchor=base west] at (cal-##6.base east) {\textcolor{orange}{\textbf{##2}}}; +}}, +] \tiny \begin{tikzpicture} \calendar [day list downward, @@ -979,7 +1031,14 @@ command: He uses the |month text| option to configure how the text of a month is rendered (see Section~\ref{section-calender} for details) and then typesets the month text at a special position at the beginning of each month. % -\begin{codeexample}[leave comments] +\begin{codeexample}[ + leave comments, + preamble={\usetikzlibrary{calendar}}, + pre={ % !!! replace all `##x` with `#x` +\def\lecture##1##2##3##4##5##6{ + \node [anchor=base west] at (cal-##6.base east) {\textcolor{orange}{\textbf{##2}}}; +}}, +] \tiny \begin{tikzpicture} \calendar [day list downward, @@ -1053,7 +1112,9 @@ This is followed by the main mindmap setup\dots level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] \end{codeexample} +% \dots and contents: +% \begin{codeexample}[code only] \node [root concept] (Computational Complexity) {Computational Complexity} % root child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems} |