1

How to draw a curved line in the qtree and add a description like the following picture?

\Tree [.n,v,aP [.n,v,a ] [.$\sqrt{P}$ [.$\sqrt{\alpha}$ ] [.$\sqrt{\beta}$ ] ] ] 

https://minio.scielo.br/documentstore/2175-8026/dT6twcHBBKBCXgYCz5T9nZH/d187117b34a83367a42f7c6059d36e14c85bd856.png

Thanks!

user296028
  • 11
  • 1
  • 5
    Welcome to TeX.se. Instead of posting a code fragment, it's better to put your fragment into a compilable document that people can play with. qtree is a very old package and I wouldn't recommend using it. What you want to do is much easier using tikz-qtree or forest. Especially if you are just starting out drawing trees, I would definitely recommend learning to use them. – Alan Munn Apr 30 '23 at 07:55
  • Thank you for your suggestion! May I know if I should use gb4e or other packages for linguistic glossing? It seems that gb4e generates many bugs but I'm not sure if there is any good alternative. – user296028 Apr 30 '23 at 08:43
  • Personally I use gb4e and I'm not aware of any real bugs, although it has some quirks. Most can probably be solved by adding \noautomath after you load the package. If your glossing needs are very complex, then expex is a good alternative, but it's very non-latex in its syntax since the author is a plain TeX user. – Alan Munn Apr 30 '23 at 18:26

1 Answers1

4

Using forest or tikz-qtree is definitely the way to go for trees. I would recommend forest since it allows you to name nodes very simply which then allows all sorts of annotations of the sort you need to be made quite simply. tikz-qtree can do the same sort of thing, but you need to encode the nodes specifically in the tree, which makes the code much more clunky.

Here's both solutions, using the answer here:

And here's another couple of solutions, also using forest:

\documentclass{article}
\usepackage{tikz-qtree}
\usepackage[linguistics]{forest}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}
\Tree [.n,v,aP [.n,v,a ] [.$\sqrt{P}$ [.\node (A){$\sqrt{\alpha}$};] [.$\sqrt{\beta}$ ] ] ] 
\draw 
  ([xshift=-14pt]A) arc[start angle=180,end angle=60,radius=2cm] node[below] {Spellout domain};
\end{tikzpicture}

\begin{forest}
[{n,v,aP} [{n,v,a} ] [$\sqrt{P}$ [$\sqrt{\alpha}$,name=A] [$\sqrt{\beta}$ ] ] ]
\draw 
  ([xshift=-14pt]A) arc[start angle=180,end angle=60,radius=2cm] node[below] {Spellout domain};
\end{forest}
\end{document}

output of code

Alan Munn
  • 218,180