[pstricks] Dotted lines in framebox

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Jul 6 19:02:36 CEST 2008


Arne Hallam schrieb:
> 
> I would like the right hand side of a framebox to have dotted lines
> while the top, bottom, and left had side have a solid line as in
> \fnode[framesize=5 2,linecolor=blue].
> 
> If I put two such boxes next to each other, is there a way to only
> show the righthand side of one box or the left handside of the other
> thanks..
> 
> For example,
> 
> \fnode[framesize=5 2,linecolor=blue](0,4){Holy}
> \rput(0,4){\large \rnode{A}{ Holy (Sacred)}}
> \fnode[framesize=5 2,linecolor=red](5,4){Unholy}
> \rput(5,4){\large \rnode{B} Unholy (Common)}
> 
>   I would like a dotted line between the two boxes.

\documentclass{article}
\usepackage{pst-node}
\SpecialCoor
\makeatletter
\def\Fnode{\pst at object{Fnode}}
\def\Fnode at i{\@ifnextchar({\Fnode at ii}{\Fnode at ii(\z@,\z@)}}
\def\Fnode at ii(#1,#2)#3#4#5{%
   \leavevmode\pst at killglue\begingroup
   \use at par
   \ifx#4R
     \psline[linestyle=dotted]% Right
       (!#1 \psk at framewidth\space \pst at number\psxunit div  add
         #2 \psk at frameheight \pst at number\psyunit div sub)%
       (!#1 \psk at framewidth\space \pst at number\psxunit div  add
         #2 \psk at frameheight \pst at number\psyunit div add)
   \else%
     \psline[linestyle=dotted]% Right
       (!#1 \psk at framewidth\space \pst at number\psxunit div  sub
         #2 \psk at frameheight \pst at number\psyunit div sub)%
       (!#1 \psk at framewidth\space \pst at number\psxunit div  sub
         #2 \psk at frameheight \pst at number\psyunit div add)
   \fi%
   \hbox{%
     \begin at ClosedObj
     \ifnodealign
       \kern\psk at framewidth\p@
       \vrule width\z@ height \psk at frameheight\p@ depth \psk at frameheight\p@
       \edef\pst at coor{0 0 }%
     \else\pst@@getcoor{#1,#2}\fi
     \pst at newnode{#3}{14}{}{
       \pst at coor
       /Y ED /X ED
       /d \psk at dimen .5 sub CLW mul neg def
       /r \psk at framewidth d add def
       /l r neg def
       /u \psk at frameheight d add def
       /d u neg def
       /NodePos { \tx at GetRnodePos } def }%
     \addto at pscode{
       /x2 \psk at framewidth CLW \psk at dimen mul sub def
       /y2 \psk at frameheight CLW \psk at dimen mul sub def
       \pst at coor 2 copy
       y2 sub /y1 ED
       x2 sub /x1 ED
       y2 add /y2 ED
       x2 add /x2 ED
       \psk at cornersize
       1 index 0 eq { pop pop
       \ifx#4R x2 y1 x1 y1 x1 y2 x2 y2 moveto lineto lineto lineto
       \else   x1 y2 x2 y2 x2 y1 x1 y1 moveto lineto lineto lineto \fi
	   stroke } { \tx at OvalFrame } ifelse }%
     \def\pst at linetype{2}%
     \showpointsfalse
     \end at ClosedObj
     \ifnodealign\kern\psk at framewidth\p@\fi}%
   \rput(#1,#2){#5}%
   \endgroup%
   \ignorespaces}

\makeatother
\begin{document}
\SpecialCoor

\begin{pspicture}(10,10)
\Fnode[framesize=5 2,linecolor=blue](0,4){Holy}{R}{\large Holy (Sacred)}
\Fnode[framesize=5 2,linecolor=red](5,4){Unholy}{L}{\large Unholy (Common)}
\ncbar[angle=90]{->}{Holy}{Unholy}
\end{pspicture}

\end{document}


Herbert



More information about the PSTricks mailing list