같은 레벨의 요소를 연결하는 선으로 목록을 생성할 수 있나요?

같은 레벨의 요소를 연결하는 선으로 목록을 생성할 수 있나요?

LaTex에서 다음을 복제하려고 합니다.

선을 연결하는 중첩 목록

이를 수행할 수 있는 패키지나 간단한 방법이 있습니까? 주변을 검색했지만 정확히 이와 같이 만들어진 항목을 찾을 수 없습니다(아마 잘못된 키워드로 인해).

미리 감사드립니다.

답변1

dirtree이러한 종류의 다이어그램을 위해 특별히 설계된 패키지입니다. 그러나 나는 아마도 Forest의 edge라이브러리(오해의 소지가 있는 이름) folder스타일을 사용할 것입니다.

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
  for tree={
    folder,
    grow'=0,
    align=left,
    % Sašo: http://chat.stackexchange.com/transcript/message/35178162#35178162
    child anchor=mid west,
  },
  [Things it is time to speak of \dots
    [Shoes
      [An invention designed to mitigate the\\disadvantages suffered by the wealthy as a\\result of inflicting roads on the poor.]
    ]
    [Ships
      [Occasionally to be found in bottles.]
    ]
    [Sealing was
      [Not to be confused with ceiling wax.]
    ]
    [Cabbages
      [{Plant of historical importance for its role\\in the production of a soup, ostensibly\\given from charity, but actually inflicted\\as punishment for misfortune.}]
    ]
    [Kings
      [Hereditary obsolescence.]
    ]
    [Why the sea is boiling hot
      [\emph{Non sequitur}.]
    ]
    [Whether pigs have wings
      [Falsehood.
        [\emph{A posteriori.}]
        [Contingent.]
      ]
    ]
  ]
\end{forest}
\end{document}

캐롤은 그의 무덤에서 변할 것이다, 의심의 여지가 없다

답변2

이것은 작동합니다: (사소한 적응)

\documentclass{minimal}
\usepackage{tikz}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>
\begin{comment}
:Title: Filesystem tree
:Tags: Trees; Styles
:Author: Frantisek Burian
:Slug: filesystem-tree
\end{comment}
\usetikzlibrary{trees}
\begin{document}
%\tikzstyle{every node}=[draw=black,thick,anchor=west]
%\tikzstyle{selected}=[draw=red,fill=red!30]
%\tikzstyle{optional}=[dashed,fill=gray!50]
\begin{tikzpicture}[%
  grow via three points={one child at (1.0,-0.7) and
  two children at (1.0,-0.7) and (1.0,-1.4)},
  edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}]
  \node {texmf}
    child { node {doc}}     
    child { node {fonts}}
    child { node {source}}
    child { node {tex}
      child { node {generic}}
      child { node {latex}}
      child { node {plain}}
    }
    child [missing] {}              
    child [missing] {}              
    child [missing] {}              
    child { node {texdoc}};
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보