# [pstricks] using braces from pstricks-add

Herbert Voss Herbert.Voss at fu-berlin.de
Mon Nov 12 11:45:35 CET 2007

Alexander Bergolth schrieb:

> How did you calculate the negative extra space (-25pt) to obtain "empty
> lines"? rowsep is 0.8cm but if I chose [-0.8cm] for the empty line, the
> resulting space between the lines is still about 0.2cm more than without
> the empty line. Is there any other spacing like a minimum row heigth
> that I have to subtract?

no, it needs some experience or trial and error.
It maybe easier to choose a rowsep of 20pt and then adding
the extra space.

> Concerning the second problem:
> I'd like to include the width of psbrace in the width of the whole
> diagram, so that centering will work correctly. Is there a way to obtain
> this?

put it into a table and choose a p column for the brace text

Herbert

\documentclass{article}
\usepackage{varwidth}

\begin{document}

\noindent
\rule{\linewidth}{1pt}

\begin{center}
\begin{tabular}{p{2cm} c}
\begin{psmatrix}[rowsep=0.8,colsep=0.4]
[name=X1] & \\[-25pt]
& \dianode{S}{Condition1?}\\[0pt]
& \rnode{SA}{\psframebox{do something}}\\[-25pt]
[name=X2] & \\[0pt]
& \dianode{R}{Condition2?}\\[-10pt]
[name=Y2] &
\end{psmatrix}%
\psset{arrows=->,nodesep=0pt}
\ncline{S}{SA}\nbput{Yes}
\ncline{SA}{R}
\psbrace[ref=r,rot=180,nodesepA=-8pt](X1)(X2){Stage 1}
\psbrace[ref=r,rot=180,nodesepA=-8pt](X2)(Y2){\parbox{2cm}{Stage 2
very
looooooong text}}
\end{tabular}
\end{center}

\end{document}