What I have done:
I have looked in to the
pgf
manual.I have searched on this site for
mindmap
and did not find a solution.
I have a mindmap
with many nodes at level 2 and eight nodes at level 1. I figured it would be nice to have the level 2 nodes be along the sides of a (large) rectangle, while the level 1 nodes would still be arranged along a circle with center at the root node; this would guarantee that the paths from level 1 nodes to level 2 nodes to not cross. How can I achieve such a design ?
So far I have achieved this:
This is a mindmap with a minimal amount of manual intervention (changed starting angle for the parents V
and VIII
). I had to drop the children from parents II
and IV
for obvious reasons. If I could arrange the level 2 nodes along a rectangle, nothing would have to be left aside.
Here is a source for the image above. Ultimately this has to be on a4paper
, alongside some text. The stuff is actually produced automatically from the actual headings of the document, but I have extracted here for convenience.
\documentclass[11pt,a4paper]{article}
\usepackage[margin=.2cm]{geometry}
\usepackage{xspace}
\usepackage[dvipsnames]{xcolor}
\usepackage{hyperref}
\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace}
\DeclareRobustCommand\csa [1] {{\ttfamily\hyphenchar\font45 \char`\\ #1}}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\begin{document}
\noindent
\resizebox{.9\paperwidth}{!}
{\begin{tikzpicture}[grow cyclic,
text width=2cm,
align=flush center,
every node/.style=concept,
concept color=orange!60,
level 1/.style={level distance=6cm,sibling angle=45},
level 2/.style={level distance=8cm,sibling angle=25}
]
\node {\textbf {The \etoc documentation}} child [concept color = teal!60]{node {I. Overview} child [concept color = teal!30]{node {3 Do I need to be a geek to use {\color {joli}\ttfamily \bfseries etoc}\xspace ?}} child [concept color = teal!30]{node {4 Line styles and toc display style}} child [concept color = teal!30]{node {5 A first example}} child [concept color = teal!30]{node {6 A second example}} child [concept color = teal!30]{node {7 Linked list of the main package commands}}} child [concept color = yellow!80]{node {II. Arbitrarily many TOCs, and local ones too}} child [concept color = green!50]{node {III. Surprising uses of {\color {joli}\ttfamily \bfseries etoc}\xspace } child [concept color = green!30]{node {15 The TOC of TOCs}} child [concept color = green!30]{node {16 Arbitrary ``Lists Of...'', \csa {etoctoccontentsline}}} child [concept color = green!30]{node {17 A TOC with a fancy layout}} child [concept color = green!30]{node {18 Another compatibility mode}} child [concept color = green!30]{node {19 The TOC as a tree}} child [concept color = green!30]{node {20 The TOC as a molecule}} child [concept color = green!30]{node {21 The TOC as a TikZ Mindmap}} child [concept color = green!30]{node {22 The TOC as a table}}} child [concept color = teal!60]{node {IV. Commands for the toc line styles}} child [concept color = yellow!80]{node {V. Commands for the toc display style} [counterclockwise from =-40] child [concept color = yellow!40]{node {27 Specifying the toc display style}} child [concept color = yellow!40]{node {28 Starred variants of the \csa {tableofcontents} etc... commands}} child [concept color = yellow!40]{node {29 Table of contents for this part}}} child [concept color = green!50]{node {VI. Using and customizing {\color {joli}\ttfamily \bfseries etoc}\xspace } child [concept color = green!30]{node {30 Summary of the main style commands}} child [concept color = green!30]{node {31 The package default line styles: \csa {etocdefaultlines}}} child [concept color = green!30]{node {32 Customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }} child [concept color = green!30]{node {33 One more example of colored TOC layout}}} child [concept color = teal!60]{node {VII. Tips} child [concept color = teal!30]{node {34 ... and tricks}}} child [concept color = yellow!80]{node {VIII. The code}[counterclockwise from =-50] child [concept color = yellow!40]{node {35 Timestamp}} child [concept color = yellow!40]{node {36 Change history}} child [concept color = yellow!40]{node {37 Implementation}}} ;
\end{tikzpicture}}
\end{document}
Here is the data for parents and children in a more legible display with linebreaks and spaces, for the gentle people who copy/paste for testing :
\node {\textbf {The \etoc documentation}}
child [concept color = teal!60]
{node {I. Overview}
child [concept color = teal!30]{node {3 Do I need to be a geek to use {\color {joli}\ttfamily \bfseries etoc}\xspace ?}}
child [concept color = teal!30]{node {4 Line styles and toc display style}}
child [concept color = teal!30]{node {5 A first example}}
child [concept color = teal!30]{node {6 A second example}}
child [concept color = teal!30]{node {7 Linked list of the main package commands}}
}
child [concept color = yellow!80]{node {II. Arbitrarily many TOCs, and local ones too}}
child [concept color = green!50]
{node {III. Surprising uses of {\color {joli}\ttfamily \bfseries etoc}\xspace }
child [concept color = green!30]{node {15 The TOC of TOCs}}
child [concept color = green!30]{node {16 Arbitrary ``Lists Of...'', \csa {etoctoccontentsline}}}
child [concept color = green!30]{node {17 A TOC with a fancy layout}}
child [concept color = green!30]{node {18 Another compatibility mode}}
child [concept color = green!30]{node {19 The TOC as a tree}}
child [concept color = green!30]{node {20 The TOC as a molecule}}
child [concept color = green!30]{node {21 The TOC as a TikZ Mindmap}}
child [concept color = green!30]{node {22 The TOC as a table}}
}
child [concept color = teal!60]
{node {IV. Commands for the toc line styles}}
child [concept color = yellow!80]
{node {V. Commands for the toc display style} [counterclockwise from =-40]
child [concept color = yellow!40]{node {27 Specifying the toc display style}}
child [concept color = yellow!40]{node {28 Starred variants of the \csa {tableofcontents} etc... commands}}
child [concept color = yellow!40]{node {29 Table of contents for this part}}
}
child [concept color = green!50]
{node {VI. Using and customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }
child [concept color = green!30]{node {30 Summary of the main style commands}}
child [concept color = green!30]{node {31 The package default line styles: \csa {etocdefaultlines}}}
child [concept color = green!30]{node {32 Customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }}
child [concept color = green!30]{node {33 One more example of colored TOC layout}}
}
child [concept color = teal!60]
{node {VII. Tips}
child [concept color = teal!30]{node {34 ... and tricks}}
}
child [concept color = yellow!80]
{node {VIII. The code}[counterclockwise from =-50]
child [concept color = yellow!40]{node {35 Timestamp}}
child [concept color = yellow!40]{node {36 Change history}}
child [concept color = yellow!40]{node {37 Implementation}}
} ;
Thanks to this answer below I got some starting code to play width. I have not tried the rectangular thing, I know what needs to be done, but it is too complicated for me at this time, not only because it is quite mathematical, but also because it would need knowing doing calculations with TikZ in a better way than I currently know (which is nil). But I learned from the answer how to position the grand children on a circle. Thus I could add the missing sections and here is what I get at this time:
This will make a perfect title page.
\documentclass[tikz,border=9]{standalone}
\usetikzlibrary{mindmap}
\usepackage{xspace}
\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace}
\DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}}
\newcount\tikznumberofcurrentgrandchild
\def\tikzmycustomgrowth {%
\pgftransformreset
\ifnum\tikztreelevel=1
\pgftransformrotate {(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}%
\fi
\ifnum\tikztreelevel=2
\pgftransformrotate {(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentgrandchild-4)}%
\global\advance\tikznumberofcurrentgrandchild by 1
\fi
\pgftransformxshift {\the\tikzleveldistance}%
}
\tikzset{
branch color/.style={
concept color=#1!white,
every child/.append style={concept color=#1!white!30!white},
}
}
\begin{document}
\begin{tikzpicture}[mindmap,
growth function=\tikzmycustomgrowth,
nodes={concept},
concept color=orange!60,
root concept/.append style={font=\huge, minimum size=5.5cm},
level 1/.append style={level distance=6.5cm, sibling angle=360/8},
level 1 concept/.append style={font=\Large,minimum size=4cm},
level 2/.append style={level distance=12.5cm, sibling angle=360/35},
% distance par rapport au CENTRE ! (avec le code tel qu'en ce moment)
]
\tikznumberofcurrentgrandchild=0
\node [root concept]{The \etoc package}
child [branch color=teal!60]{node {I Overview}
child {node {3 Do I need to be a geek to use {\color {joli}\ttfamily \bfseries etoc}\xspace ?}}
child {node {4 Line styles and toc display style}}
child {node {5 A first example}}
child {node {6 A second example}}
child {node {7 Linked list of the main package commands}}}
child [branch color=yellow!80]{node {II Arbitrarily many TOCs, and local ones too}
child {node {8 Labeling and reusing elsewhere}}
child {node {9 A powerful functionality of {\color {joli}\ttfamily \bfseries etoc}\xspace : the re-assignment of levels with \csa {etocsetlevel}}}
child {node {10 The \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}toc\discretionary {-}{}{}depth} and \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}next\discretionary {-}{}{}toc\discretionary {-}{}{}depth} commands}}
child {node {11 The command \csa {etoc\discretionary {-}{}{}set\discretionary {-}{}{}toc\discretionary {-}{}{}dep\discretionary {-}{}{}th.toc}}}
child {node {12 The commands \csa {etoc\discretionary {-}{}{}depth\discretionary {-}{}{}tag.toc} and \csa {etocsettagdepth}}}
child {node {13 Adding commands to the \texttt {.toc} file}}
child {node {14 Two Examples}}}
child [branch color=green!50]{node {III Surprising uses of {\color {joli}\ttfamily \bfseries etoc}\xspace }
child {node {15 The TOC of TOCs}}
child {node {16 Arbitrary ``Lists Of...'', \csa {etoctoccontentsline}}}
child {node {17 A TOC with a fancy layout}}
child {node {18 Another compatibility mode}}
child {node {19 The TOC as a tree}}
child {node {20 The TOC as a molecule}}
child {node {21 The TOC as a TikZ Mindmap}}
child {node {22 The TOC as a table}}}
child [branch color=teal!60]{node {IV Commands for the toc line styles}
child {node {23 The \csa {etocsetstyle} command}}
child {node {24 The \csa {etocsetlevel} command}}
child {node {25 Scope of commands added to the \texttt {.toc} file}}
child {node {26 Am I also red?}}}
child [branch color=yellow!80]{node {V Commands for the toc display style}
child {node {27 Specifying the toc display style}}
child {node {28 Starred variants of the \csa {tableofcontents} etc... commands}}
child {node {29 Table of contents for this part}}}
child [branch color=green!50]{node {VI Using and customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }
child {node {30 Summary of the main style commands}}
child {node {31 The package default line styles: \csa {etocdefaultlines}}}
child {node {32 Customizing {\color {joli}\ttfamily \bfseries etoc}\xspace }}
child {node {33 One more example of colored TOC layout}}}
child [branch color=teal!60]{node {VII Tips}
child {node {34 ... and tricks}}}
child [branch color=yellow!80]{node {VIII The code}
child {node {35 Timestamp}}
child {node {36 Change history}}
child {node {37 Implementation}}} ;
\end{tikzpicture}
\end{document}