# Offset for node - psbrace around nodes

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{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}
-

use

\psbrace*[rot=90,ref=tC,nodesep=5pt,nodesepA=-5pt]%
([Xnodesep=-1.5em]firstantree)([Xnodesep=1.5em]lastantree){subrees}
-
This method I didn't present ;-) –  Marco Daniel Feb 7 '12 at 20:21
Wow, great! Thanks! This was excactly the option I was searching for. –  lumbric Feb 8 '12 at 10:53

The following answer perhaps should be a comment, but it's too big.

Why don't you ask this question at the mailing list? pstricks accepts different kinds of coordinate input. Normally you use (x,y), but you can use other input methods like (! x y )

A small collection is shown below:

• (x,y) -- normal Cartesian input
• (r;a) -- r=radius; a=angle -- polar coordinates
• (! x y) -- postscript notation. Here the coordinates will be computed at the postscript level
• (* x {f(x)}) -- use a function to compute the y coordinate related to the x coordinate
• (Nodename) -- use a defined node
• ( x1,y1 | x2,y2 ) use the x coordinate of the first group and the y coordinate of the second one. More complicated calculations are possible.

There are a lot of other possibilities shown in the documentation. However I don't want to show everything here.

The command \psGetNodeCenter accepts one mandatory argument, a node. The command takes the node and allows to handle the x and y coordinates separately. This command works only inside PostScript, so you must use the coordinate form (! x y). The syntax itself follows the Reverse Polish notation. An example: addition of two numbers for the x coordinate and a single number for y