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.
\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.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

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}
share|improve this answer
    
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 9 '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 9 '13 at 19:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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