
我指定了一個where
聲明,以便在基礎層級對齊樹中的所有單字。我的書中可能包含一棵不符合此預設值的樹。如何擺脫預設設置,以便說明符和附加符不會被推到基線?
\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
[XP
[Specifier]
[X'
[Adjunct]
[X'
[Complement] [X] ] ] ]
\end{forest}
\end{document}
答案1
您可以在本地將其設為tier
空:
\documentclass{article}
\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,
where n children=0{tier=}{}
[X
[Specifier]
[X'
[Adjunct]
[X'
[Complement] [X] ] ] ]
\end{forest}
\end{document}