This question already has an answer here:

I'm trying to draw parse trees for mathematical expressions such as (x + (y - z)).

When I google for parse trees in LaTeX, all I get are packages that produce an output similar to the style of this package:

The wrong parse tree!

However, the notation used at my university doesn't resemble that at all. Our parse trees look like this:

My desired parse tree

Or like this (using a slightly different notation that doesn't show the intermediate nodes):

My desired parse tree 2

I'm stuck for what to do. Are there any packages that will produce this kind of output that I haven't come across?

marked as duplicate by Alan Munn, Qrrbrbirlbel, Red, Benedikt Bauer, m0nhawk Oct 29 '13 at 13:22

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.