我使用下面的代码来生成该图形:
\documentclass{article}
\usepackage{forest}
\forestset{
sn edges/.style={for tree={parent anchor=south, child anchor=north,base=top},
where n children=0{tier=word}{}
}}
% auxiliary nodes without node label
\forestset{
empty nodes/.style={
delay={where content={}{shape=coordinate,for parent={for children={anchor=north}}}{}}}
}
\begin{document}
\begin{forest}
sn edges, empty nodes
[{}
[{} [{} [Mummy]]
[{} [must]]
[{} [leave]]]
[{} [now]]]
\end{forest}
\end{document}
这对于 1.0(例如 texlive 2013)运行良好,forest
但我无法让它在 2.0 上运行forest
。
这是我尝试过的:
\documentclass{article}
\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}
\forestset{
sn edges/.style={for tree={parent anchor=south, child anchor=north,base=top},
where n children=0{tier=word}{}
}}
\begin{document}
\begin{forest}
sn edges
[{}, nice empty nodes
[{} [{} [Mummy]]
[{} [must]]
[{} [leave]]]
[{} [now]]]
\end{forest}
\end{document}
答案1
定义empty nodes
为
\forestset{
empty nodes/.style={
for tree={calign=fixed edge angles},
delay={where content={}{shape=coordinate,for siblings={anchor=north}}{}}
}
}
看这个答案了解详情。