答案1
我自然会使用 Forest,因为我恰好喜欢它。它非常强大且极其灵活。我会使用linguistics
库默认值加载它
\usepackage[linguistics]{forest}
使用 Ti钾波浪线的 Z 库
\usetikzlibrary{decorations.pathmorphing}
并定义几种样式以方便使用。
\forestset{%
/tikz/squiggly/.style={decorate, decoration={snake, amplitude=.5mm, segment length=2mm}},
钛钾波浪线采用 Z 样式。
wiggly/.style={edge=squiggly},
适合波浪边缘的森林风格。
move me/.style n args=2{%
before drawing tree={%
x+=#1,
y+=#2,
},
},
一种将节点移动到奇怪位置的森林风格,覆盖了由打包机制计算的位置。
}
no edge
可用于阻止边缘,phantom
并可用于创建仅有助于定位的不可见节点。
然后可以用
\begin{forest}
[root
[un, no edge]
[dau, wiggly, no edge, move me={-5pt}{-20pt}]
[tri, wiggly, move me={-10pt}{-40pt}]
[pedwar, wiggly, move me={-15pt}{-60pt}]
[, phantom, calign with current]
[pump
[chwech, roof]
]
]
\end{forest}
替换实际内容
\begin{forest}
[D\textsubscript{[+DEF,+F,-PL]}
[\emph{un} <D\textsubscript{[-DEF,-F,-PL]}>, no edge, move me={200pt}{0pt}]
[\emph{une} <D\textsubscript{[-DEF,+F,-PL]}>, wiggly, no edge, move me={100pt}{-20pt}]
[\emph{le} <D\textsubscript{[+DEF,-PL]}>, wiggly, move me={60pt}{-40pt}]
[\emph{la} <D\textsubscript{[+DEF,+F,-PL]}>, wiggly, move me={15pt}{-60pt}]
[, phantom, calign with current]
[NP
[école, roof]
]
]
\end{forest}
生产
第二张图不是树,但除了一条边之外它是一棵树,所以我只需要tikz
添加额外的线。
[I, tikz+={\draw [squiggly] (.parent anchor) -- (!sL.child anchor); }
为了使最终节点对齐,我会使用tier
,并且由于这里有一个规律,我会wiggly
为所有终端节点添加并使用幻影来防止单个异常在树的底部对齐。
然后
\begin{forest}
where n children=0{
wiggly,
tier=terminus
}{},
[A
[B
[D
[F
[H
[J
[,phantom]
[K]
]
]
[I, tikz+={\draw [squiggly] (.parent anchor) -- (!sL.child anchor); }
[,phantom]
]
]
[G
[L]
]
]
[E
[M]
]
]
[C
[N]
]
]
\end{forest}
将产生第二个非树。
无耻地推销Alan Munn 的内容进入上面的第二个结构,
\begin{forest}
where n children=0{
wiggly,
tier=terminus
}{},
[T
[Asp
[Voice
[$v$
[V
[$\sqrt{\text{EAT}}$
[,phantom]
[fayo]
]
]
[$v$, tikz+={\draw [squiggly] (.parent anchor) -- (!sL.child anchor); }
[,phantom]
]
]
[Voice\\\textminus act
[o]
]
]
[Aspect\\+perf
[ik]
]
]
[{T\\+past,1sg}
[a]
]
]
\end{forest}
生产
完整代码:
\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage[linguistics]{forest}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amsmath,textcomp}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\forestset{%
/tikz/squiggly/.style={decorate, decoration={snake, amplitude=.5mm, segment length=2mm}},
wiggly/.style={edge=squiggly},
move me/.style n args=2{%
before drawing tree={%
x+=#1,
y+=#2,
},
},
}
\begin{forest}
[root
[un, no edge]
[dau, wiggly, no edge, move me={-5pt}{-20pt}]
[tri, wiggly, move me={-10pt}{-40pt}]
[pedwar, wiggly, move me={-15pt}{-60pt}]
[, phantom, calign with current]
[pump
[chwech, roof]
]
]
\end{forest}
\begin{forest}
[D\textsubscript{[+DEF,+F,-PL]}
[\emph{un} <D\textsubscript{[-DEF,-F,-PL]}>, no edge, move me={200pt}{0pt}]
[\emph{une} <D\textsubscript{[-DEF,+F,-PL]}>, wiggly, no edge, move me={100pt}{-20pt}]
[\emph{le} <D\textsubscript{[+DEF,-PL]}>, wiggly, move me={60pt}{-40pt}]
[\emph{la} <D\textsubscript{[+DEF,+F,-PL]}>, wiggly, move me={15pt}{-60pt}]
[, phantom, calign with current]
[NP
[école, roof]
]
]
\end{forest}
\begin{forest}
where n children=0{
wiggly,
tier=terminus
}{},
[A
[B
[D
[F
[H
[J
[,phantom]
[K]
]
]
[I, tikz+={\draw [squiggly] (.parent anchor) -- (!sL.child anchor); }
[,phantom]
]
]
[G
[L]
]
]
[E
[M]
]
]
[C
[N]
]
]
\end{forest}
\begin{forest}
where n children=0{
wiggly,
tier=terminus
}{align=center},
[T
[Asp
[Voice
[$v$
[V
[$\sqrt{\text{EAT}}$
[,phantom]
[fayo]
]
]
[$v$, tikz+={\draw [squiggly] (.parent anchor) -- (!sL.child anchor); }
[,phantom]
]
]
[Voice\\\textminus act
[o]
]
]
[Aspect\\+perf
[ik]
]
]
[{T\\+past,1sg}
[a]
]
]
\end{forest}
\end{document}
答案2
第一棵树几乎算不上是一棵树,所以你可能想用节点矩阵手动绘制它。第二棵树相当简单,但需要一些技巧才能拥有多支配结构五结构因为(正如 cfr 正确指出的那样),多支配“树”严格来说不是树。
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage{amsmath}
\usepackage[linguistics]{forest}
\usetikzlibrary{snakes}
\tikzset{decoration={snake, amplitude=.4mm,segment length=2mm}}
\begin{document}
\begin{forest} where n children=0{tier=word, edge=decorate}{}
[T [Asp [Voice
[v [V\\$\sqrt{\text{\scshape eat}}$,name=V [\phantom{v},no edge]]
[faɣo,no edge, name=Vroot]
[v,name=v [\phantom{v},no edge]]][Voice\\$-$act [θ]]]
[Aspect\\$+$perf [ik]]]
[T\\{$+$past,1sg} [a]]]
\draw[decorate] (v.south) -- (Vroot.north);
\draw[decorate] (V.south) -- (Vroot.north);
\end{forest}
\end{document}