我尝试使用答案,但是当我编译时,它输出:
! Package pgfkeys Error: I do not know the key '/tikz/folder/.pic' and I am going to ignore it. Perhaps you misspelled it.
这是我的代码:
\documentclass[xcolor=x11names,compress]{beamer}
\usepackage{forest}
\definecolor{folderbg}{RGB}{124,166,198}
\definecolor{folderborder}{RGB}{110,144,169}
\def\Size{4pt}
\tikzset{
folder/.pic={
\filldraw[draw=folderborder,top color=folderbg!50,bottom color=folderbg]
(-1.05*\Size,0.2\Size+5pt) rectangle ++(.75*\Size,-0.2\Size-5pt);
\filldraw[draw=folderborder,top color=folderbg!50,bottom color=folderbg]
(-1.15*\Size,-\Size) rectangle (1.15*\Size,\Size);
}
}
\begin{document}
\begin{frame}{forest test}
\begin{forest}
for tree={
font=\ttfamily,
grow'=0,
child anchor=west,
parent anchor=south,
anchor=west,
calign=first,
inner xsep=7pt,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south west) +(7.5pt,0) |- (.child anchor) pic {folder} \forestoption{edge label};
},
before typesetting nodes={
if n=1
{insert before={[,phantom]}}
{}
},
fit=band,
before computing xy={l=15pt},
}
[system
[config
]
[lib
[Access
]
[Plugin
]
]
[templates
]
[tests
]
]
\end{forest}
\end{frame}
\end{document}
这是我的包裹信息:
Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)
Package: forest 2013/10/17 v1.04 Drawing (linguistic) trees