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.

I need to group portions of a tree with boxes, and additionally label them, e.g. put "W1" on the side of the box, or in the top right corner of the box.

The result I want to achieve is somewhat similar to the one in the following video: http://youtu.be/B78RnoBFYOw?t=10m40s

or to this picture:

desired result

Note that the boxed subtrees must still refer to a node in the parent boxed subree. That is, I don't want a tree of boxes with trees inside, rather I want a single tree with boxes around some portions of it.


Here is the code I use so far to create the tree

        $\forall{x}. P(x) \rightarrow Q(X)$\\
        $P(x) \rightarrow Q(x)$
        child{ node{$\lnot P(a)$} }
        child{ node{$Q(a)$} 
            child{ node{other..} }

By the way, what would be the best way to add multiple lines of math into a tree node? Right now, they are all on the same line.

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 3 at 16:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

How do you create your trees? Can you show us your code? For TikZ-based solution the fit library will help. –  Qrrbrbirlbel May 19 '13 at 15:51
I've tried to use the qtree, embedded into fancybox (ovalbox), but it isn't working for me right now... I think TikZ could definitely come to the rescue –  decden May 19 '13 at 16:00
If you are using qtree anyway, why don't you use the \qframesubtree command it provides? That is, use qtree as the package rather than a tikzpicture environment. –  cfr Jan 17 at 2:49
Without a full minimal working example which shows how the picture is generated, we can't really answer properly here. –  Joseph Wright Aug 3 at 16:55

Browse other questions tagged or ask your own question.