2

I try to use anwser, but when I compile, it output:

! Package pgfkeys Error: I do not know the key '/tikz/folder/.pic' and I am going to ignore it. Perhaps you misspelled it.

Here is my code:

\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}

Here is my package info:

Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)
Package: forest 2013/10/17 v1.04 Drawing (linguistic) trees
How Chen
  • 733
  • What version of PGF/TikZ are you using? I suspect it is rather old. If so, you need to update. (And if you update, you could use cleaner code for Forest, too, but the main thing is that you need .pics.) – cfr Nov 02 '17 at 04:15
  • @cfr how can I check the version? – How Chen Nov 02 '17 at 04:16
  • Look in the log? That's easiest. – cfr Nov 02 '17 at 04:28
  • @cfr I checked error log and i did not find version info – How Chen Nov 02 '17 at 05:23
  • @cfr got it, I find it in *.log file and I put it in my question – How Chen Nov 02 '17 at 05:27
  • 1
    You TeX is very old. Current version of forest is 2017/07/14 v2.1.5 and of tikz 2015/08/07 v3.0.1a. With the current versions (and even with last available updates for TeX Live 2013) your example does work without any problem. So I would say: You should update. – Schweinebacke Nov 02 '17 at 08:15
  • 4
    I'm voting to close this question because the problem can be solved by an update of the outdated TeX installation. – Schweinebacke Nov 02 '17 at 08:22
  • @Schweinebacke I should update whole tex or just package? – How Chen Nov 02 '17 at 09:49
  • I do not know which TeX distribution you are using and I do not know your project. However, if you are using TeX Live or MacTeX you should install a new one. Otherwise you would have to update packages manually which could be a lot of work, if you have also to update depending packages. If you are using MiKTeX 2.9 you should update at least forest, tikz and pgf and see, which other packages need updates because of dependencies. But with such an old TeX installation it could be easier to do a complete update. – Schweinebacke Nov 02 '17 at 11:33
  • @Schweinebacke I use Ubuntu and current Tex was installed by apt – How Chen Nov 02 '17 at 11:39
  • 2
    Even the current LTS version of Ubuntu has a newer TeX Live. You could either ubgrade your Ubuntu or install vanilla TeX Live. – Schweinebacke Nov 02 '17 at 11:48
  • I had the same problem and it turned out that there was a really old version of pgf (2.10 as well) still installed (Ubuntu 18.04 LTS, after several upgrades), presumably as a dependency of some old latex beamer installation (still in the latex-beamer package instead of texlive-latex-recommended). apt-get purge pgf helped, so that the newer version could take over. As a side effect, this also removed the outdated latex-beamer. – quazgar Oct 11 '18 at 14:09
  • I get the same error with tikz version 2015/08/07 v3.0.1a and forest version 2017/07/14 v2.1.5, anyone has an idea? – Reza Feb 01 '19 at 10:09

0 Answers0