summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/forest/forest-lib-edges.sty
blob: 3182ad46de46823f3c13bf50b92e176643b8be0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%%
%% This is file `forest-lib-edges.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% forest-libs.dtx  (with options: `edges')
%% 
%% `forest-libs' is a collection of libraries for package `forest'.
%%
%% Copyright (c) 2012-2017 Saso Zivanovic
%%                    (Sa\v{s}o \v{Z}ivanovi\'{c})
%% saso.zivanovic@guest.arnes.si
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%
%%   http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% This file is a part of package `forest'. For the list of files
%% constituting the package see main source file of the package,
%% `forest.dtx', or the derived `forest.sty'.
%%
\RequirePackage{forest}
\ProvidesForestLibrary{edges}[2016/12/05 v0.1.1]
\forestset{
  declare dimen={fork sep}{0.5em},
  forked edge'/.style={
    edge={rotate/.option=!parent.grow},
    edge path'={(!u.parent anchor) -- ++(\forestoption{fork sep},0) |- (.child anchor)},
  },
  forked edge/.style={
    on invalid={fake}{!parent.parent anchor=children},
    child anchor=parent,
    forked edge',
  },
  forked edges/.style={for nodewalk={#1}{forked edge}},
  forked edges/.default=tree,
}
\forestset{
  declare dimen register=folder indent,
  folder indent=.45em,
  folder/.style={
    parent anchor=-children last,
    anchor=parent first,
    calign=child,
    calign primary child=1,
    for children={
      child anchor=parent,
      anchor=parent first,
      edge={rotate/.option=!parent.grow},
      edge path'/.expanded={
        ([xshift=\forestregister{folder indent}]!u.parent anchor) |- (.child anchor)
      },
    },
    after packing node={
      if n children=0{}{
        tempdiml=l_sep()-l("!1"),
        tempdims={-abs(max_s("","")-min_s("",""))-s_sep()},
        for children={
          l+=tempdiml,
          s+=tempdims()*(reversed()-0.5)*2,
        },
      },
    },
  }
}
\endinput
%%
%% End of file `forest-lib-edges.sty'.