I am certainly lacking of knowledge on graph theory, computing, optimization or probably just geometry ! But just asking the brains here if a solution to the problem in title exists (without external programs?). And if not, what would be the next step(s) to automate harmonious mindmaps ?

Sequence of answers so far

Based on multiple questions on mindmaps shape automation (growcyclic circle-shape-for-level-4-or-5, circle-shape-for-level-3, nodes-alongside-a-rectangle ), Schrodinger's cat gave multiple variations on the topic and produced multiple, complex growing functions. With 2 compilations, they are automatically calculating the number of nodes at each level and adapt automatically the sibling angles based on 360/number of nodes on that level.

What works

As mentioned in a previous post, when the Mindmaps are well balanced (with a relatively equal number of nodes and children), the growing function works well and reaches the fantastic objective of focusing on content, and not so much on the organization of the nodes (wasn't it one of the original target of TeX ?).

What worked less...

The problem comes from unbalanced mindmaps with for instance level 2 without level 3 or 4. The nodes look twisted and feel like watchmaking mechanisms where you'd like to shift level 2 by clockwise X% and level 3 counterclockwise by Y% (as below) to make things nicer.

enter image description here

Conclusion so far (by Schrodinger's cat)

"Progress is more if someone provides a concrete idea (a specific algorithm, say) which one can build on. There are many possible modifications of the above one can explore. One particular promising one may be to marry the mindmap story to graph drawing algorithms."

I ran the following code (based on shape-for-level-4-or-5 to have an idea of the shape in limit cases and I get a strange behaviour with distance between nodes (and ever weirder without [clockwise from=0], I hardcoded the sibling angles, I cannot adapt the level distance)

enter image description here

\tikzset{garlic growth/.style={growth function=\tikz@grow@garlic,
/tikz/mmap/name=#1,mmap/#1/.is family,
mmap/initialize counts,
execute at end scope={%
mmap/.cd,initialize counts/.code={\tikzcountchildi=0%
\immediate\write\@mainaux{\string\expandafter\xdef\noexpand\csname pgfk@/tikz/mmap/\pgfkeysvalueof{/tikz/mmap/name}/#1\string\endcsname{#2}}}%
\ifcsname pgfk@/tikz/mmap/\pgfkeysvalueof{/tikz/mmap/name}/#1\endcsname
\edef#2{\csname pgfk@/tikz/mmap/\pgfkeysvalueof{/tikz/mmap/name}/#1\endcsname}%

  \pgfmathsetmacro{\pgfutil@tempa}{\pgfkeysvalueof{/tikz/mmap/overall rotation}}%
   \global\advance\tikzcountchildi by1\relax%
        *(\pgfkeysvalueof{/tikz/mmap/child weight}*(\mypi)*360/\mynii+%
            (1-\pgfkeysvalueof{/tikz/mmap/child weight})*(\tikzcountchildi-1)*360/\myni)}%
   \global\advance\tikzcountchildii by1\relax%
   \global\advance\tikzcountchildiii by1\relax%
   \ifdim\bettera pt=0pt\relax
   \global\advance\tikzcountchildiv by1\relax%
    \global\advance\tikzcountchildv by1\relax%
   \global\advance\tikzcountchildvi by1\relax%
  \pgftransformshift{\pgfpoint{\pgfkeysvalueof{/tikz/mmap/overall xshift}}%
        {\pgfkeysvalueof{/tikz/mmap/overall yshift}}}%
    overall rotation/.initial=00,
    overall xshift/.initial=0pt,
    overall yshift/.initial=0pt,
    child weight/.initial=0,
    Xshift/.style={xshift=#1,mmap/overall xshift=#1},
    Yshift/.style={yshift=#1,mmap/overall yshift=#1},
    branch color/.style={
        concept color=#1!80,ball color=#1!50,
        every child/.append style={concept color=#1!50},

            mindmap,garlic growth=A,
            mmap/child weight=0,
            mmap/overall rotation=00,
            root concept/.append style={ball color=blue!50, line width=1.5ex,text=red!80!black,font=\Large\bfseries\scshape,minimum size=2.5cm,text width=2.5cm,},            
            nodes={concept,align=center, text width=2cm,inner sep=1mm,minimum size=1.0cm,execute at begin node=\hskip0pt},
            concept color=blue!50!black,
            level 1/.style={nodes=concept,
                every child/.append style={concept color=blue!90},
                level distance=4cm,
            level 2/.style={%opacity=0,
%           nodes=concept,
            every child/.append style={concept color=blue!70},
            level distance=8cm,
 %           minimum size=1.0cm
            level 3/.style={%opacity=0,
%           nodes=concept,
                every child/.append style={concept color=blue!50},
                level distance=12cm,
 %               minimum size=1.0cm,
            level 4/.style={%opacity=0,
%           nodes=concept,
                every child/.append style={concept color=blue!30},
                level distance=14cm,
 %               minimum size=1.0cm,text width=1.0cm
            level 5/.style={%opacity=0,
%                every child/.append style={concept color=white},
                level distance=16cm,
%                minimum size=1.0cm,text width=1.0cm
 \node [root concept]{}
 child  foreach \A in {1,2,3,4}{  
   node[] {\A} 
     child foreach \B in {1,2,3}{ 
       node[] { \A-\B}
         child foreach \C in {1,2,3}{
          node { \A-\B-\C} 
             child[clockwise from=0,sibling angle=10] foreach \D in {1,2}{
              node {\A-\B-\C-\D}           
             child[clockwise from=0,sibling angle=10]  foreach \E in {1,2}{
                  node {\footnotesize \A-\B-\C-\D-\E}            

  • 1
    I guess you may want to make a concrete proposal for how the nodes are to be arranged.
    – user194703
    Apr 21, 2020 at 23:27
  • I am trying not to say anything stupid here :) Would it make sense to you if I'd say... The mindmap could be cut as a pie and each color would be a slice?
    – JeT
    Apr 21, 2020 at 23:36
  • 2
    I did not want to imply you are saying something negative. ;-) What I mean is that there are two things. One is a prescription and one is to code this. There are many different prescriptions one could try to implement. So there are basically two questions one may ask: (i) propose a new prescription and ask for a LaTeX realization or (ii) specify the way the mindmap should look like (symmetries, relative location of node and their children, etc.) and ask for a prescription and code that realize those. Otherwise it is hard to give a concrete answer.
    – user194703
    Apr 21, 2020 at 23:41
  • Perfectly clear! I'm gonna work on a graphical example to post and edit to include the two questions that should be addressed. Merci the Cat :)
    – JeT
    Apr 21, 2020 at 23:44
  • Your question made something very clear in my mind, I'd like to diminish/minimize the "torsions" between the levels. Trying to word that in a question and graph.
    – JeT
    Apr 22, 2020 at 0:03


You must log in to answer this question.

Browse other questions tagged .