[pstricks] drawing ncbox* in background

Christian Stork pstricks-list at cstork.org
Sun Sep 28 02:40:43 CEST 2003


On Sat, Sep 27, 2003 at 08:24:14AM +0200, Herbert Voss wrote:
> Christian Stork schrieb:
> >
> >I'd like to highlight a path within a pstree.  Ideally I would like to
> >use something like
> >
> >...
> >%draw tree with nodes named n1, n2, n3,..
> >...
> >\ncbox*[linecolor=red]{n1}{n2}
> >\ncbox*[linecolor=red]{n2}{n3}
> >...
> >
> >Problem is that ncbox* fills the area on top the tree.
> >
> >Is there a way to change the backgroundcolor with ncbox?  
> 
> for example:
> 
> \ncbox[linecolor=blue,fillcolor=red,fillstyle=solid]{n1}{n2}
 
No, sorry, I guess I wasn't clear enough:  I still want to see the tree.
So if you do

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

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

\end{document}

you won't see node a or b...

> >(More generally, is there a way to draw in layers with pstricks?)
> 
> give a full working example, to see what you really want

Ok, here's what I envision:

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

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

\end{document}

This would solve the problem that I can only specify the ncbox after
specifying the pstree, even though I want to draw it before (ie below)
the tree.

Is there any such facility as these fictitious pslayer commands?

-Chris



More information about the PSTricks mailing list