Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. documentclass[border=10pt,multi,tikz]{standalone}
  2. usepackage[edges]{forest}
  3. definecolor{folderbg}{RGB}{124,166,198}
  4. definecolor{folderborder}{RGB}{110,144,169}
  5. newlengthSize
  6. setlengthSize{4pt}
  7. tikzset{%
  8. folder/.pic={%
  9. filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg] (-1.05*Size,0.2Size+5pt) rectangle ++(.75*Size,-0.2Size-5pt);
  10. filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg] (-1.15*Size,-Size) rectangle (1.15*Size,Size);
  11. },
  12. file/.pic={%
  13. filldraw [draw=folderborder, top color=folderbg!5, bottom color=folderbg!10] (-Size,.4*Size+5pt) coordinate (a) |- (Size,-1.2*Size) coordinate (b) -- ++(0,1.6*Size) coordinate (c) -- ++(-5pt,5pt) coordinate (d) -- cycle (d) |- (c) ;
  14. },
  15. }
  16. forestset{%
  17. declare autowrapped toks={pic me}{},
  18. pic dir tree/.style={%
  19. for tree={%
  20. folder,
  21. font=ttfamily,
  22. grow'=0,
  23. },
  24. before typesetting nodes={%
  25. for tree={%
  26. edge label+/.option={pic me},
  27. },
  28. },
  29. },
  30. pic me set/.code n args=2{%
  31. forestset{%
  32. #1/.style={%
  33. inner xsep=2Size,
  34. pic me={pic {#2}},
  35. }
  36. }
  37. },
  38. pic me set={directory}{folder},
  39. pic me set={file}{file},
  40. }
  41. begin{document}
  42.  
  43. begin{forest}
  44. pic dir tree,
  45. where level=0{}{% folder icons by default; override using file for file icons
  46. directory,
  47. },
  48. [system
  49. [config
  50. ]
  51. [lib
  52. [Access
  53. ]
  54. [Plugin
  55. ]
  56. [file.txt, file
  57. ]
  58. ]
  59. [templates
  60. ]
  61. [tests
  62. ]
  63. ]
  64. end{forest}
  65. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement