
使用下面的 MWE:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ textcomp }
\begin{document}
\begin{tikzpicture}
\Tree [
.TP [
.T' \node(C){T+verb}; [
.vP \qroof{`ana}.DP [
.v' \node(B){v+{\textlangle}verb{\textrangle}}; [
.VP [
.V' \node(A){V+{\textlangle}verb{\textrangle}}; \qroof{taalib}.DP
]
]
]
]
]
]
\draw [semithick,->] (A) to[out=270,in=180] (B);
\draw [semithick,->] (B) to[out=270,in=180] (C);
\end{tikzpicture}
\end{document}
我得到這樣的輸出:
如果「V+」的箭頭端點和「v+」的箭頭起點位於同一位置,也許用一個小黑點將它們連接起來,那麼樹看起來會好得多,而且我認為更直觀正確。這會更好地表明同一個動詞正在做這兩個動作。有誰知道如何做到這一點?
答案1
您可以新增有點的節點,而不是使用入角和出角,而是使用參數bend
。
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usetikzlibrary{positioning}
\newcommand\TR[1]{\textlangle#1\textrangle}
\usepackage{ textcomp }
\begin{document}
\begin{tikzpicture}
\Tree [
.TP [
.T\1 \node(C){T+verb}; [
.vP \qroof{`ana}.DP [
.v\1 \node(B){v+\TR{verb}}; [
.VP [
.V\1 \node(A){V+\TR{verb}}; \qroof{taalib}.DP
]
]
]
]
]
]
\draw [semithick] (A.south) edge [bend left=70,->,shorten >=.2em] (B.south)
node (D) [draw, fill, circle, minimum size=2pt,below = -.25em of B.south,
inner sep=0pt] {} ;
\draw [semithick] (D) edge [bend left=70,->,shorten <=.5em] (C);
\end{tikzpicture}
\end{document}
我還做了一些其他更改(\1
代替素數的“”,以及標記跡線的命令,這將節省您大量的打字時間。
答案2
您已經有了一個帶有黑點的解決方案,但您也可以使用開始和最終錨點。使用B.240
語法,您可以選擇節點邊界上角度 240 的點。
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ textcomp }
\begin{document}
\begin{tikzpicture}
\Tree [
.TP [
.T' \node(C){T+verb}; [
.vP \qroof{`ana}.DP [
.v' \node(B){v+{\textlangle}verb{\textrangle}}; [
.VP [
.V' \node(A){V+{\textlangle}verb{\textrangle}}; \qroof{taalib}.DP
]
]
]
]
]
]
\draw [semithick,->] (A) to[out=270,in=270] (B.south);
\draw [semithick,->] (B.240) to[out=240,in=180] (C);
\end{tikzpicture}
\end{document}