[pstricks] node connections between corners of a rectangle

Denis Girou Denis.Girou at idris.fr
Tue Apr 29 12:07:50 CEST 2003


>>>>> "Vincent.Guirardel" == vin gui <vin.gui at laposte.net> writes:

    Vincent.Guirardel> I would like to use pst-node to make a connection between the _corners_
    Vincent.Guirardel> of rectangle nodes. I can make easily a connection between the sides 
    Vincent.Guirardel> using \ncdiag something like

    Vincent.Guirardel> \rput(0,0){\rnode{node1}{\psframebox{$G_1*G_2$}}}
    Vincent.Guirardel> \rput(3,-2){\rnode{node2}{\psframebox{$H$}}}
    Vincent.Guirardel> \ncdiag[angleA=0,angleB=180,arm=0]{node1}{node2}

    Vincent.Guirardel> But do I have to fiddle manually with the angles so that
    Vincent.Guirardel> the connecting lines joins two corners of the nodes ?

  The straightforward solution here is to use the "ref" parameter (see the
documentation), which is accessible with \rnode has a special optional
parameter.

\documentclass[a4paper]{article}

\usepackage{pst-node}

\begin{document}

\rput(0,0){\rnode[br]{node1}{\psframebox{$G_1*G_2$}}}
\rput(3,-2){\rnode[tl]{node2}{\psframebox{$H$}}}
\ncline{node1}{node2}

\rput(6,0){\rnode[tl]{node1}{\psframebox{$G_1*G_2$}}}
\rput(9,-2){\rnode[br]{node2}{\psframebox{$H$}}}
\ncangles[angleA=90,angleB=0]{node1}{node2}

\end{document}


D.G.



More information about the PSTricks mailing list