特定のツリースタイルをフォレストのデフォルトにする

特定のツリースタイルをフォレストのデフォルトにする

私たちは、書籍用の LaTeX クラスを作成しています。 特定のツリー スタイルを のデフォルトにしたいと考えていますforest。 以下の例では、すべてのツリーでスタイル (sn エッジ) を定義する必要があります。 この指定を削除して、デフォルトにする方法はありますか?

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

答え1

質問が未解決かどうかはわかりませんが、Stefan さん、たとえばこのコードはすべてのフォレスト環境に適用されます。

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

要するに、スタイル名を省略するだけです :)

お役に立てれば。

関連情報