3

How can I prolong the big bracket to not only cover yyyy but also the uuuu node?

\tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]
\begin{figure}
\centering
\begin{tikzpicture}[grow=right, sloped]
\node[draw] {ppp\textsuperscript{p}}        
            child {
                node[draw, circle, label=right:
                    {$xxxx$}]
{}
                edge from parent
                node[above] {xx}
                node[below]  {$xxxx$}
            }
            child {
                node[draw, circle, label=right:
                    {$uuuu$}] 
{}
                edge from parent
                node[above] {uu}
                node[below]  {$uuuu$}
             }
            child {
                node[draw, circle,label=right:
                    {$yyyy \Bigg\} $}] 
{}
                edge from parent
                node[above] {yy}
                node[below]  {$yyyy$}
    };
\end{tikzpicture}
\end{figure}

2 Answers 2

2

I \smashed and \raiseboxed a zero-width \rule that had an enclosing right brace that followed it.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]
\begin{figure}
\centering
\begin{tikzpicture}[grow=right, sloped]
\node[draw] {ppp\textsuperscript{p}}        
            child {
                node[draw, circle, label=right:
                    {$xxxx$}]
{}
                edge from parent
                node[above] {xx}
                node[below]  {$xxxx$}
            }
            child {
                node[draw, circle, label=right:
                    {$uuuu$}] 
{}
                edge from parent
                node[above] {uu}
                node[below]  {$uuuu$}
             }
            child {
                node[draw, circle,label=right:
                    {$yyyy 
            \smash{\raisebox{-52pt}{$\left.\rule{0pt}{60pt}\right\}$}} $}] 
{}
                edge from parent
                node[above] {yy}
                node[below]  {$yyyy$}
    };
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

3

You can add labels to the relevant nodes

            child {
                node[draw, circle, label=right:
                    {$uuuu$}] (U)
{}

and similarly for (Y) and then you can draw a brace as a decoration:

\draw [decoration={brace,amplitude=8pt},decorate] ($(Y)+(3.5em,1ex)$) -- ($(U)+(3.5em,-1ex)$);

The offsets here are needed because of the labels and to get the extra height. I have specified these in terms of ex and em as these are units that depend on the font size.

Sample output

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}

\begin{document}

\tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]
\begin{figure}
\centering
\begin{tikzpicture}[grow=right, sloped]
\node[draw] {ppp\textsuperscript{p}}        
            child {
                node[draw, circle, label=right:
                    {$xxxx$}]
{}
                edge from parent
                node[above] {xx}
                node[below]  {$xxxx$}
            }
            child {
                node[draw, circle, label=right:
                    {$uuuu$}] (U)
{}
                edge from parent
                node[above] {uu}
                node[below]  {$uuuu$}
             }
            child {
                node[draw, circle,label=right:
                    {$yyyy$}] (Y)
{}
                edge from parent
                node[above] {yy}
                node[below]  {$yyyy$}
    };
\draw [decoration={brace,amplitude=8pt},decorate] ($(Y)+(3.5em,1ex)$) -- ($(U)+(3.5em,-1ex)$);
\end{tikzpicture}
\end{figure}

\end{document}
1
  • Thanks Andrew and @steven everything resolved!! your suggestions work perfect!!!
    – carlo
    Commented Sep 9, 2014 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .