Especificando a distância entre os níveis na floresta

Especificando a distância entre os níveis na floresta

Gostaria de ter mais espaço entre o primeiro nível e o segundo nível na árvore abaixo. No tikz-qtree eu posso usar

\tikzset{level 1+/.style={level distance=3\baselineskip}} \tikzset{level 2+/.style={level distance=2\baselineskip}}

Existe algo equivalente em forest?

\documentclass{minimal}

\usepackage{forest}

\forestset{
sn edges/.style={for tree={parent anchor=south, child anchor=north,align=center,base=bottom,where n children=0{tier=word}{}}}, 
background tree/.style={for tree={text opacity=0.2,draw opacity=0.2,edge={draw opacity=0.2}}}
}


\begin{document}

\begin{forest}
sn edges
[S
  [NP [er\\he] ]
  [NP
    [Det [das\\the] ]
    [N [Buch\\book] ] 
  ]
  [NP
    [Det [der\\the] ]
    [N [Frau\\woman] ] 
  ]
  [V [gibt\\gives] ]
]
\end{forest}

\end{document}

Responder1

Você quer algo como

l sep+=<some length>

o que reduzirá a distância entre as camadas em <some length>?

Para restringir esse aumento apenas à distância entre o nó raiz e a primeira camada, você pode usar

for children={
  l sep-=<some length>,
}

para reverter o aumento. (Pode haver um método mais direto - este é exatamente o que veio mais facilmente à mão.)

O seguinte compara o padrão com aumentos de 1eme 2emrespectivamente:

\documentclass{standalone}

\usepackage{forest}

\forestset{
sn edges/.style={for tree={parent anchor=south, child anchor=north,align=center,base=bottom,where n children=0{tier=word}{}}},
background tree/.style={for tree={text opacity=0.2,draw opacity=0.2,edge={draw opacity=0.2}}}
}


\begin{document}

\begin{forest}
sn edges
[S
  [NP [er\\he] ]
  [NP
    [Det [das\\the] ]
    [N [Buch\\book] ]
  ]
  [NP
    [Det [der\\the] ]
    [N [Frau\\woman] ]
  ]
  [V [gibt\\gives] ]
]
\end{forest}
\begin{forest}
sn edges,
l sep+=1em,
for children={
  l sep-=1em,
}
[S
  [NP [er\\he] ]
  [NP
    [Det [das\\the] ]
    [N [Buch\\book] ]
  ]
  [NP
    [Det [der\\the] ]
    [N [Frau\\woman] ]
  ]
  [V [gibt\\gives] ]
]
\end{forest}
\begin{forest}
sn edges,
l sep+=2em,
for children={
  l sep-=2em,
}
[S
  [NP [er\\he] ]
  [NP
    [Det [das\\the] ]
    [N [Buch\\book] ]
  ]
  [NP
    [Det [der\\the] ]
    [N [Frau\\woman] ]
  ]
  [V [gibt\\gives] ]
]
\end{forest}

\end{document}

efeito do aumento de <code>l sep</code> para o nó raiz

informação relacionada