I like the mindmap library to make mindmaps in tikz. The issue is that the node positioning is manual (and I am extremely lazy), hence the general question:
'is it possible to build a mindmap with automatic node positioning?'
I did my research and I found out that tikz comes along with automatic graph-building algorithms. In particular, it seems that the spring algorithms are the most suitable for building mindmaps, however, I am having two problems:
- The setting
sibling pre septo set the minimum distance between the edges of nodes on the same level does not seem to work with the spring algorithms. The result is that some nodes overlap:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{mindmap,trees, graphs, graphdrawing}
\usegdlibrary{force}
\usepackage{chemformula}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
spring layout,
node distance= 6cm,
sibling pre sep = 1cm, %% some sibling nodes overlap anyway
font = \small,
every node/.style = {circle, draw, align =center, text width = 1.5cm},
]
\node{Portland cement paste}
child { node {Solids in the cement paste}
child{node {C-S-H}}
child{node{\ch{Ca(OH)2}}}
child{node {$ \mathrm{C_6A\bar{S}3H{32}} $ and $ \mathrm{C_6A\bar{S}H_{18}} $}}
child{node{Unhydrated p. cement grains}}
}
child { node {Voids in the cement paste}
child{ node {Interlayer space in C-S-H}}
child{ node {Capillary voids}}
child{ node{Air voids}}
}
child { node {Water in the cement paste}
child{ node {Capillary water}}
child{ node {Physically absorbed water}}
child{ node {Interlayer water}}
child{ node {Chemically combined water}}
};
\end{tikzpicture}
\end{figure}
\end{document}
- The mindmap styles do not seem to work (the lines between the nodes are black instead of grey and they do not have the right shape):

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{mindmap,trees, graphs, graphdrawing}
\usegdlibrary{force}
\usepackage{chemformula}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
mindmap,
spring layout,
node distance= 6cm,
sibling pre sep = 1cm, %% some sibling nodes overlap anyway
font = \small,
every node/.style = {concept, execute at begin node=\hskip0pt},
concept color=gray!20,
]
\node{Portland cement paste}
child { node {Solids in the cement paste}
child{node {C-S-H}}
child{node{\ch{Ca(OH)2}}}
child{node {$ \mathrm{C_6A\bar{S}3H{32}} $ and $ \mathrm{C_6A\bar{S}H_{18}} $}}
child{node{Unhydrated p. cement grains}}
}
child { node {Voids in the cement paste}
child{ node {Interlayer space in C-S-H}}
child{ node {Capillary voids}}
child{ node{Air voids}}
}
child { node {Water in the cement paste}
child{ node {Capillary water}}
child{ node {Physically absorbed water}}
child{ node {Interlayer water}}
child{ node {Chemically combined water}}
};
\end{tikzpicture}
\end{figure}
\end{document}
Concluding, If you know the solution to these two issues (node overlapping and mindmap style not working) or you know a better way to draw mindmaps (with automatic node positioning) altogether please let me know. Thank you!


