是否可以创建一个用线连接同一级别的元素的列表?

是否可以创建一个用线连接同一级别的元素的列表?

我正在尝试在 LaTex 中复制以下内容:

用线连接起来的嵌套列表

有没有可以做到这一点的软件包,或者有简单的方法可以做到这一点?我搜索了一番,但找不到任何可以做到这一点的东西(可能是由于关键字错误)。

提前致谢。

答案1

dirtree是专门为此类图表设计的包。不过,我可能会使用 Forestedge库的(名称误导性)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}

在此处输入图片描述

相关内容