Especificando la distancia entre niveles en el bosque

Especificando la distancia entre niveles en el bosque

Me gustaría tener más espacio entre el primer nivel y el segundo nivel en el árbol de abajo. En tikz-qtree puedo usar

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

¿Hay algo equivalente en 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}

Respuesta1

¿Quieres algo como

l sep+=<some length>

¿Qué reducirá la distancia entre niveles en <some length>?

Para restringir este aumento solo a la distancia entre el nodo raíz y el primer nivel, puede usar

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

para revertir el aumento. (Puede haber un método más directo; este es el que más fácilmente se nos ocurrió).

A continuación se compara el incumplimiento con incrementos de 1emy 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}

efecto de aumentar <code>l sep</code> para el nodo raíz

información relacionada