I am trying to implement such a method for spanning a tree over multiple pages in the IEEETran format (double column). I don't want to continue part of the forest on each column on each page (each part of the forest spans over 2 columns on the page). Surrounding \begin{forest} inside \begin{figure*} breaks the forest in the middle of the page and doesn't span multi-page.
MWE:
\documentclass[journal]{IEEEtran}
\usepackage{geometry,blindtext,romannum}
\usepackage[edges]{forest}
\def\hiddenparcommand{\par}
\newcommand\otherhiddenparcommand{\par\noindent}
\newcommand\hiddencommacommand{, }
\forestset{%
declare keylist register={split here ids},
split here ids={},
declare keylist register={split here interjects}, the tree parts
split here interjects={},
declare keylist={split here auto siblings}{},
declare toks register=split here toks,
declare dimen register=tmpdima,
tmpdima'=0pt,
declare dimen register=tmpdimb,
tmpdimb'=0pt,
declare dimen register=tmpdimc,
tmpdimc'=0pt,
to widest/.style={
tikz+={\path (\forestregister{tempdima}, \forestoption{y}) -- (\forestregister{tempdimb}, \forestoption{y});},
},
hide commas/.style={%
split here toks+={\hiddencommacommand},
split here toks+={#1},
},
split dir tree pre/.style={%
label={[text=gray, anchor=north, font=\scriptsize]below:{[cont.]}{}},
},
split dir tree post/.style={%
label={[font=\scriptsize, anchor=south, text=gray]above:{[cont.]}{}},
},
split dir tree auto post/.style={
split dir tree post,
tempkeylistc'={},
tmpdimb/.option=y,
for nodewalk={
while={
> ORw2+d _+d < On=! & {y}{tmpdimb}{##2-##1} {\textheight-#1} {n'}{1}%
}{
next,
tempkeylistc/.option=name
}%
}{},
split here auto siblings/.register=tempkeylistc,
tikz+/.process={
OOw2{edge}{id}
{
\path [##1] (!u.parent anchor |- .north) ++(\forestregister{folder indent},1ex) coordinate (before ##2) |- (.child anchor);
\edef\tempa{\foresteoption{split here auto siblings}}
\foreach \i in \tempa \path [##1] (before ##2) |- ({forest cs:\i.child anchor});
}
},
},
split dir tree/.code={
\forestset{
draw tree stage/.style={
for root'={
tempdima/.min={
>OOw2+d{x}{min x}{####1+####2}%
}{tree},
tempdimb/.max={
>OOw2+d{x}{max x}{####1+####2}%
}{tree},
for tree={
to widest,
},
},
tempcountb'=-1,
do until={
strequal((split_here_ids),"")
}{
tempkeylistb'={},
tempkeylista'={},
split register={split here ids}{,}{tempcounta,tempkeylistb+},
split register={split here interjects}{,}{temptoksa,tempkeylista+},
split here ids'/.register=tempkeylistb,
split here interjects'/.register=tempkeylista,
for nodewalk={
draw tree processing order/.style={
filter={tree}{> ORw+n< OR> & {id}{tempcounta}{########1+1}{id}{tempcountb}}%
}
}{},
for root'={draw tree},
TeX/.process={Rw{temptoksa}{\otherhiddenparcommand ####1\hiddenparcommand}},
tempcountb'/.register=tempcounta,
},
for nodewalk={
draw tree processing order/.style={
filter={tree}{>OR>{id}{tempcountb}}
}
}{},
for root'={draw tree},
},
}%
},
split dir here auto/.style n args=2{
split dir tree pre,
!next node.split dir tree auto post=#2,
split here ids+/.option=id,
split={#1}{,}{split here toks,hide commas},
split here interjects/.register=split here toks,
},
split dir tree auto/.style={
split dir tree,
before drawing tree={
tempdima/.max={y}{tree},
tempdimc/.register=tempdima,
tempdimd/.min={y}{tree},
tempdima-/.register=tempdimd,
tempdimb'=\textheight,
tmpdima'=10ex,
tmpdimc'=\pagetotal,
while={
>RR>{tempdima}{tempdimb}
}{
for nodewalk={
root',
until={
> ROw2+d RRw2+d > {tempdimc}{y}{##1-##2} {tmpdima}{tmpdimc}{\textheight-##2-##1}
}{next node},
previous node,
split dir here auto/.process={R_w2{tmpdima}{continued}{{##2}{##1}}},
next node,
tempdima/.option=y,
tempdimc/.register=tempdima,
tempdima-/.register=tempdimd,
tmpdima'=15ex,
tmpdimc'=0pt
}{},
},
},
},
}
\begin{document}
\begin{forest}
for tree={
folder,
grow'=0,
fit=band,
},
split dir tree auto,
[ Topics
[ \Romannum{1}.\, Introduction]
[ \Romannum{2}.\, Techniques
[ \Romannum{2}-A.\, Principles of Simulation]
[ \Romannum{2}-B.\, Classification of Techniques
[\Romannum{2}-B.1\, Implicit Techniques]
[\Romannum{2}-B.2\, Partitioning]
[\Romannum{2}-B.3\, Simulation]
[\Romannum{2}-B.4\, Algorithms]
]
[\Romannum{2}-C.\, Overview
[\Romannum{2}-C.1\, Advantages of Simulation
[\Romannum{2}-C.1.a\, Computational Burden]
[\Romannum{2}-C.1.b\, Accuracy]
[\Romannum{2}-C.1.c\, System Dynamics]
[\Romannum{2}-C.1.d\, Stability]
]
[\Romannum{2}-C.2\, Challenges
[\Romannum{2}-C.2.a\, Synchronization]
[\Romannum{2}-C.2.b\, Subsystems]
]
]
]
[ \Romannum{3}.\, Methods
[\Romannum{3}-A.\, Classification
[\Romannum{3}-A.1\, Model-one]
[\Romannum{3}-A.2\, Model-two]
]
[\Romannum{3}-B.\, Comparison
[\Romannum{3}-B.1\, Time]
[\Romannum{3}-B.2\, Frequency]
[\Romannum{3}-B.3\, Mixed]
]
[\Romannum{3}-C.\, Evaluation
[\Romannum{3}-C.1\, Efficiency]
[\Romannum{3}-C.2\, Accuracy]
[\Romannum{3}-C.3\, Ease of Use]
]
]
]
\end{forest}
\end{document}



forestenvironments really do not lend themselves to being broken across pages. You should first try to avoid the need to do so. If it can't be avoided, you should think about ways to simplify the problem. And you should develop a Plan B. – cfr Dec 03 '23 at 23:21