How to style all edges in a tikz-qtree as arrows?

I'd like the edges in my tikz-qtree to be painted as arrows (pointing to the child node).

How can this be done? I found a lot of questions here about how to add addtional edges, lines or arcs, but none about how to draw the edges in a tikz-qtree as arrows instead of plain lines.

You can use the edge from parent style. A compete example:

\documentclass{article}
\usepackage{tikz-qtree}

\tikzset{edge from parent/.append style={->}}

\begin{document}

\begin{tikzpicture}
\Tree
[.A
[.B ]
[.C ]
]
\end{tikzpicture}

\end{document}


The result:

Changing to latex arrow tips and adding red color:

\documentclass{article}
\usepackage{tikz-qtree}

\tikzset{edge from parent/.append style={->,>=latex,red}}

\begin{document}

\begin{tikzpicture}
\Tree
[.A
[.B ]
[.C ]
]
\end{tikzpicture}

\end{document}


• Wow, so simple and yet I managed to look around for an hour without finding it. Thanks for the speedy reply!
– mort
Jun 18, 2015 at 17:24
• Can this be extended to work for specified nodes only? Jan 1, 2017 at 11:26