I already asked in the question Describing leaves of a tree with an underbrace using pstree/pstricks how to use a underbrace. Now I'd like to use \Tfan
instead of \Tf
, but the trick with the angle doesn't seem to work there (I also don't really understand why it's working with \Tf
). I have to attach the psbrace
not at the center of the nodes, but with a bit of offset - the psbrace
should be a bit longer.
Herbert Voß provides a solution in this maillist post, unfortunately I don't understand the methods used there and I can't manage to adopt them to my problem. He suggests basically suggests two methods.
One is to replace \rnode{A}{$a$}
by \rnode[bc]{A}{$a$\vphantom{gt}}
. But I couldn't manage to get this working also for horizontal space as desired.
The second method is to connect the psbrace
not to (A)
but to (!\psGetNodeCenter{A} A.x A.y .2 sub)
. How is this called? How is the syntax of !whatever
working? How could I adopt this?
\documentclass[english]{article}
\usepackage{pst-plot}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-tree}
\usepackage{pstricks-add}
\usepackage{babel}
\begin{document}
\begin{pspicture}(1,-5)
\pstree[levelsep=50pt,treesep=12pt]{\Tcircle{ }} {
\skiplevel {
\Tf[name=firstleaf]{}
\Tf{}
{\psset{linestyle=none} \Tr{$\cdots$} }
\Tf[name=lastleaf]{}
}
\tspace{1.5cm}
\pstree{\Tr{ }}{\Tfan[name=firstantree]}
{\psset{linestyle=none} \Tr{$\cdots$} }
\pstree{\Tr{ }}{\Tfan[name=lastantree]}
}
\psbrace*[ref=tC,rot=90,nodesep=5pt]([angle=-165]firstleaf)([angle=-15]lastleaf){leaves}
\psbrace*[rot=90,ref=tC,nodesep=5pt,nodesepA=-5pt](firstantree)(lastantree){subrees}
\end{pspicture}
\end{document}