Graphics, Figures & TablesAngled arrows with tikz-qtree?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
JasonM
Posts: 3
Joined: Fri Jun 13, 2014 4:48 pm

Angled arrows with tikz-qtree?

Post by JasonM »

Would anyone know how to get \abarnodeconnect (or something equivalent) to work with tikz-qtree? The classic example I'm looking to imitate is:

Code: Select all

\documentclass{minimal}
\usepackage{tree-dvips}
\usepackage{qtree}
\begin{document}

\Tree [.S [.NP \node{subj}{subj$_i$} ]
[.VP [.V verb ] [.NP \node{t}{t$_i$} ]]]
\abarnodeconnect[-6pt]{t}{subj}

\end{document}
Of course, this won't work with XeLatex, and I'm looking for a way to get the 'angled arrows' in the tree diagram using tikz-qtree.
Last edited by Stefan Kottwitz on Fri Jun 20, 2014 7:50 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Angled arrows with tikz-qtree?

Post by esdd »

Set the tree inside a tikzpicture. Then you can use the normal tikz syntax to draw the arrow:

Code: Select all

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tikz-qtree}
\begin{document}
\begin{tikzpicture}
\Tree [.S [.NP [.\node(subj){subj$_i$}; ] ]
          [.VP [.V verb ] [.NP [.\node(t){t$_i$}; ] ] ] ]
\draw[-latex](t.south)--+(0,-6pt)-|(subj);
\end{tikzpicture}
\end{document}
Note the additional code changes inside the \Tree command.
qtree.png
qtree.png (8.73 KiB) Viewed 4323 times
Best regards
Elke
Post Reply