[pstricks] Dotted lines in framebox

Arne Hallam ahallam at iastate.edu
Mon Jul 7 00:41:38 CEST 2008


This works great.

How does one write this many lines of appropriate code in such a short time?



Herbert Voss wrote:
> 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
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks

-- 
with all thy getting get understanding---Proverbs 4:7.

The gentle art of being gentle---of kindness and forgiveness, 
sensitivity and thoughtfulness and generosity and humility and good 
old-fashioned love---have gone out of fashion.  Ironically, everyone is 
demanding their rights, and this demand is so shrill that it destroys 
one of the most basic rights, if we can put it like that: the right, or 
at least the longing and hope, to have a peaceful, stable, secure, and 
caring place to live, to be, to learn, and to flourish---N.T. Wright.

In the wildness of speculation it has been suggested (of course more in 
jest than in earnest),that Europe ought to grow its corn in America, and 
devote itself solely to manufactures and commerce, as the best sort of 
division of the labour of the globe---Thomas Malthus, An Essay on the 
Principle of Population Book III, Chapter XII.

Arne Hallam
Department of Economics
266 Heady Hall
Iowa State University
Ames, IA 50011
ahallam at iastate.edu

Contact Information:
ahallam at iastate.edu
Work:	515-294-5861
FAX: 	515-294-0221
Home:	515-292-8739



More information about the PSTricks mailing list