Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
tikz-qtree spoils tikz trees

When I draw a tree using TikZ, for example

\documentclass{article} 
\usepackage{tikz}
\begin{document}
  \tikzset{every node/.style={draw,circle}}
  \begin{tikzpicture}
    \node {}
      child { node {} }
      child { node {} };
  \end{tikzpicture}
\end{document}

I get this:

enter image description here

However, if I also load the package tikz-qtree the edges are anchored differently and, arguably, worse:

enter image description here

How can I get around this? I'd like to use qtree but I also want the trees to look nice.

share|improve this question

marked as duplicate by Loop Space, Stefan Kottwitz Nov 28 '12 at 9:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
The package has a section commented with defaults appropriate for linguistic trees -- I smell weirdness by design. –  Raphael Nov 27 '12 at 18:33
add comment

1 Answer 1

up vote 4 down vote accepted

As you notes in the comments, this is by design, since linguistic trees (which is what tikz-qtree was designed for) are usually plain text. You can fix this by changing the default edge to parent path:

\tikzset{
edge from parent/.style=
         {draw, edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}}}
share|improve this answer
    
I will look into that tomorrow at work, so just a quick comment: if it were by design inside tikz-qtree, that would be fine with me. But changing all TikZ trees, that's a bug, isn't it? –  Raphael Nov 27 '12 at 21:37
    
Now that tikz-qtree seems to have a lot of wider appeal, it could be considered a bug. For most linguistics needs the issue won't come up. –  Alan Munn Nov 27 '12 at 22:05
    
Part of the problem is that tikz-qtree is designed so that you don't require a tikzpicture environment to draw a \Tree; if you set the relevant parameters locally within a \Tree you can't override them globally in the way that would be useful for the main user base. (I'm not saying the problem is unsolvable, but that there isn't an obviously simple fix.) –  Alan Munn Nov 27 '12 at 22:38
    
Can't they define "qtree styles" which the \Tree syntax would use under the hood? Then it would not change the behaviour of other trees and would be both globally and locally overridable. That would be similar to the automata library then. –  Raphael Nov 28 '12 at 11:55
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.