[pstricks] node connections between corners of a rectangle

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Tue Apr 29 11:43:06 CEST 2003


vin gui sagte:
>
> I would like to use pst-node to make a connection between the _corners_
> of rectangle nodes. I can make easily a connection between the sides
> using \ncdiag something like
>
> \rput(0,0){\rnode{node1}{\psframebox{$G_1*G_2$}}}
> \rput(3,-2){\rnode{node2}{\psframebox{$H$}}}
> \ncdiag[angleA=0,angleB=180,arm=0]{node1}{node2}
>
> But do I have to fiddle manually with the angles so that
> the connecting lines joins two corners of the nodes ?
> Or could anyone help me finding a clever way ?

it is possible to calculate the angle depending to the width and
height of the box, but it seems to be easier to insert this
angles by hand:

\documentclass[12pt]{article}
\usepackage{pst-node}
\begin{document}
\begin{pspicture}(8,4)
  \rput(0,0){\rnode{node1}{\psframebox{$G_1*G_2$}}}
  \rput(3,-2){\rnode{node2}{\psframebox{$H$}}}
\end{pspicture}
\ncdiag[angleA=-20,angleB=137,arm=0]{node1}{node2}
\end{document}

Herbert






More information about the PSTricks mailing list