5
\documentclass{standalone}
\usepackage{qtree}

\begin{document}
        \Tree [.A 
                    [.B [.D a] a [.E b]]    
                    [.C [.D c] b [.D c]] 
                    [.B [.D b]] 
              ]
\end{document}

Trying to compile this yields "missing {" error.

Ilonpilaaja
  • 1,335

1 Answers1

9

You need to put whitespaces before the inner right brackets

\documentclass{standalone}
\usepackage{qtree}

\begin{document}
        \Tree [.A 
                    [.B [.D a ] a [.E b ]]    
                    [.C [.D c ] b [.D c ]] 
                    [.B [.D b ]]
              ]
\end{document}
percusse
  • 157,807
  • Why would that make a difference? And is it an issue peculiar to qtree, or does the same kind of problem apply more generally? – LarsH Jul 09 '13 at 18:41
  • 1
    @LarsH That's probably how the author decided to parse the input. I guess it looks for the next character and it sees b] if you don't put a whitespace. Regarding the generality, it depends on the convenience, with a guarantee of whitespace you don't need to check if the argument has any closing brace during the input parsing. But TikZ based ones are often much more flexible. – percusse Jul 09 '13 at 19:07