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}
\forestset{.style={sn edges}}– Andrew Swann May 13 '14 at 12:53forest:-) However, to make the issue clearer, the next version will implement keydefault preamble. Usage just as above:\forestset{default preamble/.style={sn edges}}}– Sašo Živanović Dec 11 '14 at 14:24sn edgesstyle will be pre-loaded byforestso that the code for the style doesn't have be copied into the preamble? I like the flexibility and simple syntax offorest, and it's great for compact trees, but I hesitate to recommend it to my linguistics students because it doesn't work "out of the box" the waytikz-qtreedoes. If I could tell them to just use\usepackage[linguistics]{forest}where thelinguisticsoption would loadsn edgesandnice empty nodesfor every tree, that would be great. – Jason Zentz Jul 22 '15 at 19:42\usepackage[linguistics]{forest}idea, I like it! – Sašo Živanović Jul 22 '15 at 22:36\useforestlibrary{linguistics}? Then people could create libraries as they can for TikZ which grouped related styles etc. together. Otherwise, as soon as you have alinguisticsoption, somebody (like me) will be asking for alogicoption and then somebody else will be using a completely different kind of proof tree and will wantotherlogic... and how can you say no todecisiontheoryandprobabilitywhen you've said yes tolinguistics,logicandotherlogic? – cfr Oct 23 '15 at 23:32\usepackage{forest}\useforestlibrary{linguistics}loads the base package plus linguistics-related stuff, and\usepackage[linguistics]{forest}additionally makes linguistic style the default. And I will be extremely glad to includelogicand co! – Sašo Živanović Oct 24 '15 at 01:58\pgfkeys{/forest/.is family}and then used\pgfkeys{/forest, ...}at the end offor Xpropagators. All perfectly legal at first sight, but when/forestis redefined, which is precisely what.style/{...}does, then the redefinition is called not just once, but a million times! – Sašo Živanović Nov 05 '15 at 05:46