Hallo Kollegen,

Ich habe da so einen Dateibaum mit Seitenumbruch im Forum aufgeschnappt. Ich würde diesen Dateibaum gerne für meine Zwecke verwenden. Dieser Code wurde ursprünglich (teilweise) von Sašo Živanović erstellt: http://tex.stackexchange.com/a/296771/

Der Code funktioniert soweit. Was jedoch nicht funktioniert, ist wenn ich zwei verschiedene Bäume nach einander haben möchte. Ergänzende Info: Der Code ist nicht kürzbar. Die kryptische Programmierung am Anfang geht auf den Seitenumbruch zurück. Ich bitte um Verständnis.

Zusammenfassung: Ich würde gerne wissen wie man zwei verschieden Dateibäume in diesem Code abbilden kann.

Öffne in Overleaf
\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}

gefragt 04 Mär '19, 09:37

UserAnonym's gravatar image

UserAnonym
11124
Akzeptiert-Rate: 0%

bearbeitet 05 Mär '19, 00:16

Henri's gravatar image

Henri
15.7k133943

Hätte jemand eine Idee wie man dieses Problem lösen könnte? Ich finde einfach keine Lösung @Henri @Murmeltier @Skillmon

(05 Mär '19, 09:52) UserAnonym

Ich frage mich natürlich, warum Du eine Folgefrage zu einem Code, den Du auf TSX entdeckt hast, nicht auf TSX stellst. Andererseits ist die Frage hier durchaus nicht falsch. Dort, wo der ursprüngliche Autor zu finden ist, ist aber vielleicht die Chance auf eine erweiterte Antwort auch nicht ganz schlecht …

(05 Mär '19, 16:40) saputello

Bei TeX.SX ist die Frage auch: https://tex.stackexchange.com/q/477653/35864 eine Antwort hat sich aber noch nicht gefunden.

(05 Mär '19, 18:08) moewe

Danke für eure Kommentare :) kann man bei Tex. SX mit dem Verfasser des original Codes Kontakt aufnehmen? Gibt es da eine Möglichkeit? Danke. @saputello @moewe

(08 Mär '19, 08:04) UserAnonym

Einfach unter der entsprechenden Antwort einen Kommentar hinterlassen, dass Du darauf aufbauend eine Frage hast, und per Link angeben, wo diese Frage zu finden ist. Wobei bisher Deine Fragen IMHO nicht sehr klar formuliert sind. Dein Beispiel hier funktioniert beispielsweise und enthält auch nur einen Baum. Das Beispiel sollte aber das Problem veranschaulichen. Also gehört ein zweiter Baum hinein und die Fehlermeldung, die es dabei gibt, gehört zitiert. Und wenn der Baum anders aussehen soll, sollte auch das möglichst klar beschrieben oder illustriert sein.

(08 Mär '19, 11:13) saputello
1

The problem arises when the second tree immediately follows the first one. Adding even an mbox{} between them helps. – Sašo Živanović 33 mins ago Das Problem ist gelsöt. Soll ich jetzt selber die Frage beantworten?

(08 Mär '19, 11:49) UserAnonym
1

Ja. Am besten mit Beispiel und Link zur Originalaussage.

(08 Mär '19, 13:13) saputello

Kommt da noch etwas? Sonst würde ich die Frage als per Kommentar beantwortet schließen.

(25 Mär '19, 10:58) saputello
Ergebnis 5 von 8 show 3 more comments
Deine Antwort auf die Frage: (Bemerkungen bitte oben als Kommentar)
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×728
×3
×3

gestellte Frage: 04 Mär '19, 09:37

Frage wurde gesehen: 55,981 Mal

zuletzt geändert: 25 Mär '19, 10:58