[pstricks] drawing ncbox* in background

Christian Stork pstricks-list at cstork.org
Sun Sep 28 22:08:17 CEST 2003


On Sun, Sep 28, 2003 at 08:12:55AM +0200, Herbert Voss wrote:
...
> Define first the nodes with the same command.
> 
> Herbert
> 
> 
> \documentclass[12pt]{article}
> \usepackage{pstcol,pst-tree}
> \pagestyle{empty}
> \begin{document}
> 
> \rput(0,0){%
> 	\pstree[linestyle=none]%
> 		{\Tp[name=a]}{\Tr[name=b]{ }\Tr[name=c]{ }}%
> }
> \ncbox*[linearc=.2,linecolor=red,nodesep=0.5]{a}{b}
> \rput(0,0){\pstree{\Tp}{\Tr{B}\Tr{C}}}
> 
> \end{document}

Ok, so you're telling me that I need to hack it. :-)

Well, rput doesn't do it for me since it doesn't return the bounding box
(at least I don't know how to make do so).

So here's my second attempt:


\documentclass{article}
\usepackage{pstcol,pst-tree}
\pagestyle{empty}
\begin{document}

\newcommand{\fgbg}[2]{% foreground/background hack
  \makebox[0pt][l]{%
    #1% draw foreground
  }%
  #2% draw background
  #1% redraw foreground
}

\fgbg{%
  \pstree{\Tr[name=a]{A}}{\Tr[name=b]{B}\Tr[name=c]{C}}%
}{%
  \ncbox[fillcolor=red,fillstyle=solid,linearc=.2,linecolor=red]{a}{b}%
}

\end{document}


So far, it works great.  Thanks!

-Chris



More information about the PSTricks mailing list