LaTeX中如何绘制TreeView类型的树状图?

发布于 2022-08-31 20:48:22 字数 876 浏览 12 评论 0

类似下面这样。

sample
├── curses
├── drb
├── logger
├── openssl
├── optparse
├── pty
├── rdoc
│   └── markup
├── ripper
├── rss
├── testunit
├── trick2013
│   ├── kinaba
│   ├── mame
│   ├── shinh
│   └── yhara
└── webrick
a
└── b
    └── c
        └── d
            └── e
                └── f
                    └── g
                        └── h
                            └── i
                                └── j
                                    └── k
                                        └── l
                                            └── m
this
├── short
│       A short description.
├── long
│       A very very very very very very very very very
│       very very very very very very very very very
│       very very very very very very long description.
└── no description

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蘑菇王子 2022-09-07 20:48:22

可以用tikz,参考如下的代码,不过最后一个没有搞定

\documentclass{minimal}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
\usetikzlibrary{trees}
\begin{document}
\tikzstyle{every node}=[anchor=west]
\begin{tikzpicture}[%
  grow via three points={one child at (0.5,-0.7) and
  two children at (0.5,-0.7) and (0.5,-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}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文