我有以下代码。
\documentclass[12pt]{article}
\usepackage{qtree}
\setlength\parindent{0pt}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage[bottom]{footmisc}
\usepackage{times}
\usepackage{lipsum}
\usepackage[margin=2cm,left=2cm,includefoot]{geometry}\linespread{1.5}
\usepackage{apacite}
\usepackage{caption}
%\captionsetup[table]{position=bottom}
\usepackage{array}
\usepackage{tabulary}
\newcolumntype{K}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{multirow}
\usepackage{gb4e}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
\begin{tikzpicture}
\Tree [.CP [.{} \node(c){}; ] [.C' [.TP [.DP_{1} \edge[roof]; \node(A){older sister}; ] [.T' [.VP [.DP\\ \node(a){$t_{1}$}; ] [.V' [.DP \edge[roof]; \node(C){which one food}; ] [.V\\ \node(b){make}; ] ] ] [.T \node(B){}; ] ] ] [.C\\{[+Q]} ] ] ]
\draw[semithick, <-] (A) to [bend right=58] (a);
\draw[loosely dotted, <-] (B) to [bend left=58] (b);
\draw[dotted, <-] (c) to [bend right=58] (C);
\end{tikzpicture}
\end{document}
他们给我一棵树看起来像:
有人能告诉我如何去除左上角节点下方以及 DP 和 T 下方的短垂直线吗?谢谢!
答案1
像这样?
\documentclass[12pt]{article}
\usepackage[margin=2cm,left=2cm,includefoot]{geometry}
\usepackage{tikz-qtree}
\tikzset{every tree node/.style={align=center, anchor=north}}
\usepackage{gb4e}
\linespread{1.5}
\begin{document}
\begin{tikzpicture}
\linespread{0.9}
\Tree [.CP [.\node(c){}; ] % <---
[.C' [.TP [.DP_{1} \edge[roof]; \node(A){older sister}; ]
[.T' [.VP [.\node(a){DP\\$t_{1}$}; ] % <---
[.V' [.DP \edge[roof]; \node(C){which one food}; ]
[.V\\ \node(b){make}; ]
]
]
[.\node(B){T}; ] % <---
]
]
[.C\\{[+Q]} ]
]
]
\draw[semithick, <-] (A) to [bend right=58] (a);
\draw[loosely dotted, <-] (B) to [bend left=58] (b);
\draw[dotted, <-] (c) to [bend right=58] (C);
\end{tikzpicture}
\end{document}
答案2
一个非常简单的森林翻译(没什么特别的!)只是因为。
\documentclass[border=10pt]{standalone}
\usepackage[linguistics]{forest}
\usepackage{gb4e}
% \linespread{1.5}% don't do this - use setspace if required
\begin{document}
\begin{forest}
for tree={
fit=band
},
before typesetting nodes={
where content={}{content=\strut}{}
}
[CP
[, name=c ]
[C'
[TP
[DP_{1}
[older sister, name=A, roof]
]
[T'
[VP
[DP\\$t_{1}$, name=a ]
[V'
[DP
[which one food, name=C, roof]
]
[V
[make, name=b]
]
]
]
[T, name=B ]
]
]
[C\\{[+Q]}]
]
]
\draw[semithick, <-] (A) to [bend right=58] (a);
\draw[loosely dotted, <-] (B) to [bend left=58] (b);
\draw[dotted, <-] (c.center) to [bend right=58] (C);
\end{forest}
\end{document}