I have a problem with the following code:
\begin{tikzpicture} [level distance=4mm]
\path [
every node/.style={ball color=red,inner sep=1.5pt},
level 2/.style={sibling distance=22mm},
level 5/.style={sibling distance=3mm}
]
node{} child foreach \perI in {1,...,6} {
node{} child { node{} child { node{} child {
node{} child foreach \perII in {1,...,5} {
node{} child { node{} child { node{} child { node{} child {
node{} child { node{} child { node{} child { node{} child {
node{} child { node{} child { node{} child { node{} child {
node{} child { node{} child { node{} child { node{} child {
node{} child { node{} child { node{} child { node{} child {
node{}
}}}}}}}}}}}}}}}}}}}}
}}}}
}
;
\end{tikzpicture}
When I compile it with pdflatex (using MiKTeX), I get the following error message:
! TeX capacity exceeded, sorry [grouping levels=255].
I guess I hit a bound on the level of recursion .. Is there some way around this?
Note that I actually need an even longer tree (48 levels in total) - do not ask why, long story..
My only idea is to generate the long path under the second foreach command in advance and then re-use it in each node, i.e. 30 times - but I do not know how to do this.
(I tried \path[save to=\tmpPath], but it seems to save it with absolute co-ordinates, so I did not manage to get the 30 copies I need.)

lualatex(instead ofpdflatex), because it can dynamically increase the memory limits. – Jake Mar 29 '12 at 9:13lualatex, and have their TeX-editors set up forpdflatex.. – Michal Kaut Mar 29 '12 at 10:57standaloneclass, compile it and include the PDF. – egreg Mar 29 '12 at 11:52