[Tex/LaTex] Making a certain tree style the default for forest

forest

We are putting together latex classes for books. We want to make a certain tree style the default for forest. With the example below one has to define the style (sn edges) in every tree. Is there a way to get rid of this specification and make it the default?

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

Best Answer

Not sure if the question is unsolved Stefan, but this code for instance is applied to all forest environments:

\forestset{.style={for tree={l=1em, l sep=1em, s sep=1em}}}

In essence, just drop the style name :)

Hope this helps.

Related Question