The qtree package seems to facilitate the drawing of simple trees only. Is there a way to incorporate:

  1. Multiple roots &
  2. Nodes with multiple parents

in a tree in LaTeX?

  • 1
    Such objects aren't really trees. :) The tikz-qtree package provides more capabilities to combine trees because it is based on TikZ and has the full power of that package behind it. But out of the box, no tree drawing package can do what you want. Qrrbrbirlbel's answer to this question: How to reflect duplicating a tree horizontally? might provide the beginnings of a more general way to do some of this. See also Graph-like structures with Qtree.
    – Alan Munn
    Commented May 13, 2013 at 20:29
  • @AlanMunn: Thank you. The information was quite helpful. You might want to shift your reply from the comment section to the answer section, so that I can acknowledge it as the accepted answer. :)
    – Chatterjee
    Commented May 13, 2013 at 20:46
  • Thanks. I'll wait a bit, since the answer is essentially negative. There are some very clever TikZ people here who might have some ideas on solutions, but if nothing shows up in a day I'll convert my comment to an answer.
    – Alan Munn
    Commented May 13, 2013 at 20:49

1 Answer 1


Multi-dominance "trees" are not really trees, but graphs, and the standard tree drawing packages are really not designed to handle them. Depending on the complexity of the tree, it's possible to draw these trees, however, but it requires some manual intervention. I would use one of the TikZ based tree drawing packages for this rather than qtree. The two best such packages are tikz-qtree and very powerful forest package. The general method for achieving multi-dominance is the same: you draw an empty edge and node, and then manually draw the extra branch to the relevant node that has multiple parents.

Using tikz-qtree


% Some multi-dominance structures using qtree and forest
% We fake the multi-dominance with an empty edge and node and then
% a regular tikz \draw between the node and its extra parent
\begin{tikzpicture}[sibling distance=.25cm]
\Tree [.Y
        [.Z ]
        [.\node (X) {X}; 
           [.A [.B ] [.\node (C) {C}; ] ]
           [.\node (A2) {A};
             \edge[draw=none]; {} \edge; {B} ]]]] 
\draw (A2.south) -- (C.north);


Using forest

\forestset{qtree edges/.style={for tree=
    {parent anchor=south, child anchor=north}}}

qtree edges
[Z ]
[X,name=X [A  [B ] [C, name=C ]]
   [A, name=A2  [, no edge ] [B ]]]]
\draw (A2.south) -- (C.north);

output of code

Graphs with tkz-graph

For more complicated graphs, it's likely better to use a package designed specifically for graphs. Alain Matthes' tkz-graph package does just that. Here's a more complex example using that package. The documentation is in French, but there are plenty of examples to work from, and all the command syntax is English-based. Note also that tikz-qtree and tkz-graph cannot be used together because of command name clashes, but there is a patch to be found here:

How to use tkz-graph and tikz-qtree without conflict?.

% a more complicated graph using tkz-graph
% depending on the actual graph this could be partially automated
% with tikz \for loops



enter image description here

  • I think you are drawing some edges repeatedly in the tkz-graph example. \Edges(Z,Y,X,Q,R) \Edges(A,X,B) \Edges(C,A,D,B,E) would just do. Commented May 15, 2013 at 0:17
  • @Qrrbrbirlbel Thanks for the correction. I'm not sure I quite get how the edge syntax works.
    – Alan Munn
    Commented May 15, 2013 at 0:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .