I'm attempting to recreate the 'TOC as a TikZ mind map' as featured on p.47 of Jean-Francois Burnol's "The etoc package" but I cannot resolve the error that occurs on line 115:
(\centeredline{\resizebox{.85\paperwidth}{!}%)
of the following MWE:
\documentclass[12pt,oneside, tikz, ignorerest=false]{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\pagestyle{empty}
\usepackage{etoc}
\def\input@path{{/usr/local/texlive/2022/texmf-dist/tex/latex/centeredline/}}
\usepackage{centeredline}
\newcounter{visibletoc}
\renewcommand{\etocaftertitlehook}
{\stepcounter{visibletoc}\etoctoccontentsline{visibletoc}{\thevisibletoc}}
\etocsetlevel{visibletoc}{6}
\begin{document}
\subsection{Surprising uses of etoc}
\begingroup
% \newtoks\treetok % done in preamble
% \newtoks\parttok
\newcommand\partnode {} % just to check we don’t overwrite something
\newcommand\childnode {}
\newcommand\tmprotate {} % just to check we don’t overwrite something
\newcommand\tmpoption {} % just to check we don’t overwrite something
\newcommand*\tmpstuff {} % just to check we don’t overwrite something
\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
#1\expandafter\expandafter\expandafter{\expandafter\the\expandafter #1#2}}
\newcommand*{\appendchildtree}[3]{%
% this is to construct "t1 child [#3]{t2}" from #1=t1 and #2=t2
% t1 and t2 are two toks variable (not macros)
% #3 = for example teal!60
\edef\tmpstuff {\the#1 child [#3]{\the#2}}%
#1\expandafter {\tmpstuff }%
}
\newcounter{partco}
% 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3
\def\pseudomodthree #1{\numexpr #1 + 3 - 3*((#1+1)/3)\relax}
\etocsetstyle{part}
{\etocskipfirstprefix}
% This updates the global tree with the data from the previous
% part and all its children sections. Moved here because for some parts the
% sections are not displayed due to depth tags.
{\ifnum\value{partco}=3
\appendchildtree\treetok\parttok {branch color= green!50,level distance=10cm}%
\else
\ifcase\pseudomodthree{\value{partco}}%
\or \appendchildtree\treetok\parttok {branch color= teal!60}% first
\or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
\else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
\fi\fi
}
{\stepcounter{partco}%
% customize manually some TikZ set-up (should be done inside the TikZ thing I guess)
\def\tmpoption {}%
\def\tmprotate {}% first
%\ifnum\value{partco}=5 \def\tmprotate {[counterclockwise from =-40]}\fi
%\ifnum\value{partco}=8 \def\tmprotate {[counterclockwise from =-50]}\fi
% define the part node
\edef\partnode{node \tmpoption
{\unexpanded\expandafter{\etocthelinkednumber}.
\unexpanded\expandafter{\etocthelinkedname}}\tmprotate }%
% this is a starting point which will be filled it by the section children
\parttok\expandafter{\partnode}}
{\ifcase\pseudomodthree{\value{partco}}%
\or \appendchildtree\treetok\parttok {branch color= teal!60}% first
\or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
\else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
\fi
}
\etocsetstyle{section}
{}
{}
{% define the section node
\edef\childnode{child {node {\unexpanded\expandafter{\etocthelinkednumber}
\unexpanded\expandafter{\etocthelinkedname}}}}%
% append it to the current \parttok
\appendtotok\parttok\childnode
}
{}
\etocsettocstyle
{\setcounter{partco}{0}%
\treetok{\node [root concept]{\textbf{The \etoc documentation}}}}
{\global\appendtotok\treetok{ ;}}
% The \global above is mandatory because etoc always typesets TOC inside a group
\etocsetnexttocdepth{section}
% use of depth tags to cut out some sections.
\etocsettagdepth {preamble} {none}
\etocsettagdepth {overview} {part}
\etocsettagdepth {arbitrarily} {part}
\etocsettagdepth {examples} {section}
\etocsettagdepth {surprising} {part}
\etocsettagdepth {linestyles} {part}
\etocsettagdepth {globalcmds} {part}
\etocsettagdepth {custom} {section}
\etocsettagdepth {tips} {part}
\etocsettagdepth {etocandworld}{part}
\etocsettagdepth {code} {section}
\tikzset{
branch color/.style={
concept color=#1!white,
every child/.append style={concept color=#1!white!30!white, font=\normalsize},
}
}%
\begin{figure}[thp!]
\tableofcontents\label{toc:mindmap}%
\centeredline{\resizebox{.85\paperwidth}{!}%
{\begin{tikzpicture}[mindmap,
grow cyclic,
text width=2cm,
align=flush center,
nodes={concept},
concept color=orange!60,
root concept/.append style={text width=4cm, font=\Large},
level 1/.append style={level distance=5cm,sibling angle=40, text width=3cm},
level 2/.append style={level distance=7cm,sibling angle=30, text width=3cm},
level 1 concept/.append style={font=\normalsize},
]
\the\treetok
\end{tikzpicture}}}
\end{figure}
\endgroup
The MWE is a combination of code taken from pgs. 46-49 of "The etoc package", along with setup code for the Preamble from user4686's 2015 answer to an issue in the SE post Visual table of contents (tikz mindmap) - Problem in output.
I also added the following code in an attempt to deal with an issue that occurrs when loading the 'centeredline' package, e.g. '\usepackage{centeredline}':
\def\input@path{{/usr/local/texlive/2022/texmf-dist/tex/latex/centeredline/}}
to eliminate a warning that occurred when compiled.
Any thoughts on what I am missing would be greatly appreciated.

'TOC as a TikZ mind map'for my project. It will, however, take me a bit of time to do so once I've completed my switch frompdflatextolualatexas I've been trying to do for the last few weeks. I should have done that sooner, but compelled now to do so as I've hit the main_memory = 12435455 memory limit. Thank you so much again. Apologies in advance if I don't respond successfully a bit more down the road! Thanks again!! – RosesBouquet Feb 10 '24 at 22:06etoc's manual :). – cfr Feb 11 '24 at 01:37pdflatextolualatextransition (completely new for me), implementingetocis at the top of my ToDo list. It's good to know that you are around for questions if I have them. Thank you Ssssooo much! – RosesBouquet Feb 13 '24 at 00:40