0

I found a latex code (file tree with page break, the owner/creator of this code (pagebreak+filetree) is Sašo Živanović).

I want to use this code for a documentation. I want to have several different file trees but with this code only one file tree with page breaks is working. Does anybody knows how it works with several different trees? Thank you in advance.

German Forum: https://texwelt.de/wissen/fragen/24325/wie-kann-man-2-oder-mehrere-file-trees-mit-pagebreak-abbilden

Have a nice day.

\documentclass[11pt,a4paper,titlepage,bibliography=totoc,numbers=noenddot,abstract=on,multi,dvipsnames,svgnames,x11names]{scrreprt}%Dokumentklasse wie in unserer Vorlage

\usepackage{storebox}%Pagebrak
\usepackage[edges]{forest}%FileTree
\usepackage{adjustbox}%Pagebrak
%\usepackage{lmodern}%Schrift


%Zeilenumbruch in der tikz Umgebung!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% addaswyd o gôd Sašo Živanović: http://tex.stackexchange.com/a/296771/
\def\hiddenparcommand{\par}
\newcommand\otherhiddenparcommand{\par\noindent}
\newcommand\hiddencommacommand{, }
\forestset{%
    declare keylist register={split here ids},% the list of nodes to split the tree at
    split here ids={},
    declare keylist register={split here interjects},% the list of comments to put in between the tree parts
    split here interjects={},
    declare keylist={split here auto siblings}{},% a list to hold the siblings which need edge restoration
    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={% this gets applied to the first node after a break
        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
        }%
    }{},
    % save the list
    split here auto siblings/.register=tempkeylistc,
    tikz+/.process={% this tries to redraw the edges to the following siblings
        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,
            % Sašo Živanović: http://chat.stackexchange.com/transcript/message/28484520#28484520
            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,
    %     !next node.split resume 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,
            draw, %zeichnet Kästchen
            before computing xy={l=100pt},%definiert die länge der horizontalen Linie
            grow'=0,
            fit=band,
        },
        split dir tree auto,
        [ \textcolor{green}{\textbf{LASTFall}}
        [ {\fontsize{8}{9} \selectfont fdsdssdfsd},edge label={node[pos=0.75,above,font=\scriptsize]{$\textbf{(2.807E+05x) 005}$}} %Mathematik Modus plus Fett 
        [ \scriptsize{str Rinfi aq000 tq0 fs v002 l000 AW0 check},edge label={node[pos=0.75,above,font=\ttfamily]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett 
        [ \tiny{str Rinfi aq000 tq0 fs v002 l000 AW0 check},edge label={node[pos=0.75,above,font=\scriptsize]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett 
        [ \normalsize{str Rinfi aq000 tq0 fs v002 l000 AW0 check},edge label={node[pos=0.75,above,font=\scriptsize]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett 
        [  \large{str Rinfi aq000 tq0 fs v002 l000 AW0 check},edge label={node[pos=0.75,above,font=\Large]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett 
        [  \small{str Rinfi aq000 tq0 fs v002 l000 AW0 check},edge label={node[pos=0.75,above,font=\large]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett 
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 check,edge label={node[pos=0.75,above,font=\footnotesize]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus 
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 check,edge label={node[pos=0.75,above,font=\small]{$\textbf{(2.807E+05x) 005}$}}] %Mathematik Modus plus Fett     
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        ]
        ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}}
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        [ str Rinfi aq000 tq0 fs v002 l000 AW0 kjijlopopheck,edge label={node[pos=0.75,above,font=\scriptsize]{(2.807E+05x) 005}} ]
        ]
        ]
        ]
        ]
    \end{forest}
\end{document}

Update: With this version (code) it does not work. Any idea why?

\documentclass[11pt,a4paper,titlepage,bibliography=totoc,numbers=noenddot,abstract=on,multi,dvipsnames,svgnames,x11names]{scrreprt}%Dokumentklasse wie in unserer Vorlage

\usepackage{storebox}%Pagebrak
\usepackage[edges]{forest}%FileTree
\usepackage{adjustbox}%Pagebrak
%\usepackage{lmodern}%Schrift
%Zeilenumbruch in der tikz Umgebung!
% addaswyd o gôd Sašo Živanović: http://tex.stackexchange.com/a/296771/
\def\hiddenparcommand{\par}
\newcommand\otherhiddenparcommand{\par\noindent}
\newcommand\hiddencommacommand{, }
\forestset{%
    declare keylist register={split here ids},% the list of nodes to split the tree at
    split here ids={},
    declare keylist register={split here interjects},% the list of comments to put in between the tree parts
    split here interjects={},
    %declare keylist={split here auto siblings}{},% a list to hold the siblings which need edge restoration
    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={% this gets applied to the first node after a break
        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
        }%
    }{},
    % save the list
    %split here auto siblings/.register=tempkeylistc,
    tikz+={\path(!u.parent anchor |- .north) ++(\forestregister{folder indent},1ex) coordinate (before split) |- (.child anchor);},
    split register={tempkeylistc}{,}{edge in tikz},
},
edge in tikz/.style={
    tikz+/.process=OOw2{#1.edge}{#1.edge label}{%
        \path [##1] (before split) |- (#1.child anchor)##2;
    },
},
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,
            % Sašo Živanović: http://chat.stackexchange.com/transcript/message/28484520#28484520
            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,
    %     !next node.split resume 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
        }{},
    },
},
},
}
%Zeilenumbruch in der tikz Umgebung! Ende

%
\ExplSyntaxOn
\box_new:N \l_helmutW_box
\cs_new_protected:Npx \helmutW_replace_verb_newline:Nn #1 #2
{
    \tl_replace_all:Nnn #1 { \char_generate:nn { 13 } { 12 } } { #2 }
}
\cs_new_protected:Npx \helmutW_replace_verb_newline_newline:Nn #1 #2
{
    \tl_replace_all:Nnn #1
    { \char_generate:nn { 13 } { 12 } \char_generate:nn { 13 } { 12 } } { #2 }
}
\cs_new_protected:Npn \helmutW_process_verb_newline:nnn #1 #2 #3
{
    \tl_set:Nn \ProcessedArgument { #3 }
    \helmutW_replace_verb_newline_newline:Nn \ProcessedArgument { #2 }
    \helmutW_replace_verb_newline:Nn \ProcessedArgument { #1 }
}
\NewDocumentCommand \AutoSplittedTree
{
    s
    O{ for~tree = { folder, grow'=0, fit=band,draw } }
    >{ \helmutW_process_verb_newline:nnn { ~ } { ~ \par } } +v
}
{
    \par
    \IfBooleanTF { #1 }
    { \iftrue }
    {
        \vbox_set:Nn \l_helmutW_box { \helmutW_tree:n { #2, #3 } }
        \dim_compare:nNnTF { \box_ht:N \l_helmutW_box } >
        { \dim_min:nn { \pagegoal-\pagetotal } { \textheight } }
        {
            \iftrue
        }
        {
            \box_use:N \l_helmutW_box
            \iffalse
        }
    }
    \helmutW_tree:n { #2, split~dir~tree~auto, #3 }
    \fi
}
\cs_new_protected:Npn \helmutW_tree:n #1
{
    \scantokens
    {
        \begin{forest}
            #1
        \end{forest}%
    }
}
\ExplSyntaxOff

\begin{document}    
\AutoSplittedTree
{
    [ XYZ
    [ XYZ
    [  \textcolor{green}{\textbf{gfgfg}},edge label={node[pos=0.75,above,font=\scriptsize]{A}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [ XYZ,edge label={node[pos=0.75,above,font=\scriptsize]{AAA}}]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head1}} ]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},rounded corners,edge label={node[pos=0.75,above,font=\scriptsize]{ist das}}
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{lang}}
    [ XYZ,before computing xy={l=50pt},edge label={node[pos=0.75,above,font=\scriptsize]{wow}}
    [ XYZ,before computing xy={l=100pt},fill=yellow,edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}
    ]
    ]
    ]
    ]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]\\
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]\\
    [  \textcolor{red}{LASTFall},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head11}} ]
    [ gfgh,before computing xy={l=50pt}, edge label={node[midway,left,font=\scriptsize]{head1111111111}},minimum size=6cm ]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head1111111111}},minimum size=3cm ]
    [ gfgh,edge label={node[fill=red!20,midway,left,font=\scriptsize]{head1111111111}},minimum size=1cm ]
    [ 7,before computing xy={l=50pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    ]
    ]
    ]
}
\mbox{}
\AutoSplittedTree
{
    [ XYZ
    [ XYZ
    [  \textcolor{green}{\textbf{gfgfg}},edge label={node[pos=0.75,above,font=\scriptsize]{A}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [ XYZ,edge label={node[pos=0.75,above,font=\scriptsize]{AAA}}]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head1}} ]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},rounded corners,edge label={node[pos=0.75,above,font=\scriptsize]{ist das}}
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{lang}}
    [ XYZ,before computing xy={l=50pt},edge label={node[pos=0.75,above,font=\scriptsize]{wow}}
    [ XYZ,before computing xy={l=100pt},fill=yellow,edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}
    ]
    ]
    ]
    ]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [ XYZ,before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]\\
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]\\
    [  \textcolor{red}{LASTFall},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [  \textcolor{red}{LASTFall},before computing xy={l=100pt},edge label={node[pos=0.75,above,font=\scriptsize]{\textcolor{green}{\textbf{gfgfg}}}}]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head11}} ]
    [ gfgh,before computing xy={l=50pt}, edge label={node[midway,left,font=\scriptsize]{head1111111111}},minimum size=6cm ]
    [ gfgh,edge label={node[midway,left,font=\scriptsize]{head1111111111}},minimum size=3cm ]
    [ gfgh,edge label={node[fill=red!20,midway,left,font=\scriptsize]{head1111111111}},minimum size=1cm ]
    [ 7,before computing xy={l=50pt},edge label={node[pos=0.75,above,font=\scriptsize]{Too longggggggg}}]
    ]
    ]
    ]
}

\end{document}
  • @Sašo Živanović Can you help me? – Ph MO Mar 4 '19 at 8:55
  • Welcome! Have you tried tex.stackexchange.com/a/356922/121799 ? – user121799 Mar 4 '19 at 12:38
  • Yes, but in my case i need a special solution. My tree looks a little bit different. I have 2 captions at each horizontal line. And i want two or more trees in my documents. My question was i want more than one tree. And each tree is a new tree. :) thank you at this point for support. – Ph MO Mar 4 '19 at 12:59
  • The problem arises when the second tree immediately follows the first one. Adding even an \mbox{} between them helps. – Sašo Živanović Mar 8 '19 at 9:46
  • @SašoŽivanović thank you. Can look at my update code. With this code i get some error messages. Do you know why? – Ph MO Mar 8 '19 at 12:33
1

The error is caused by too little vertical space left on the page before the (first part of the) autosplit tree. The splitting algorithm tries to split the tree at the root node, but instead of noticing that, it tries to go to the previous node (to format it, i.e. add the continued label), which is where the error occurs.

While the proper solution would be to address the issue in the tree-splitting code, I believe the following adhoc solution might suffice: use the needspace package to make sure that there's enough vertical space left on the page before starting the tree.

In OP's example, adding \Needspace{2\baselineskip} before the second tree does the trick, but in general, the amount of space needed may vary.

I actually suggest adding \Needspace{2\baselineskip} to the very beginning of the definition of \AutoSplittedTree.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.