pst-node
Denis Girou
Denis.Girou at idris.fr
Wed Sep 2 23:05:52 CEST 1998
-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------
>>>>> "Bernd.Brandt" == Bernd Brandt <bernd at balaena.bio.vu.nl> writes:
Bernd.Brandt> Does anyone know of an easy way in pst-node to use nodes of
Bernd.Brandt> constant size/radius?
Bernd.Brandt> As to have circles of the same radius around text I used
Bernd.Brandt> \cnode and then \rnode to place the text:
Bernd.Brandt> \begin{pspicture}(2,2)(4,8)
Bernd.Brandt> \rput[c](2,8){\cnode{.4}{A}}
Bernd.Brandt> \rput[c](2,6){\cnode{.4}{B}}
Bernd.Brandt> \rput(2,8){\rnode{a}{$x_0$}}
Bernd.Brandt> \rput(2,6){\rnode{b}{$x_{1_1}$}}
Bernd.Brandt> \ncline[nodesep=5pt]{->}{A}{B}
Bernd.Brandt> \end{pspicture}
Use \makebox.
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\begin{document}
\begin{pspicture}(2,2)(4,8)
\rput[c](2,8){\cnode{.4}{A}}
\rput[c](2,6){\cnode{.4}{B}}
\rput(2,8){\rnode{a}{$x_0$}}
\rput(2,6){\rnode{b}{$x_{1_1}$}}
\ncline[nodesep=5pt]{->}{A}{B}
\end{pspicture}
\newcommand{\MyNode}[2]{\circlenode{#1}{\makebox[1cm]{#2}}}
\begin{pspicture}(2,2)(4,8)
\rput(2,8){\MyNode{A}{$x_0$}}
\rput(2,6){\MyNode{B}{$x_{1_1}$}}
\ncline[nodesep=5pt]{->}{A}{B}
\end{pspicture}
\newlength{\MyLength}
\settowidth{\MyLength}{$x_{1_1}$}
\renewcommand{\MyNode}[2]{\circlenode{#1}{\makebox[\MyLength]{#2}}}
\begin{pspicture}(2,2)(4,8)
\rput(2,8){\MyNode{A}{$x_0$}}
\rput(2,6){\MyNode{B}{$x_{1_1}$}}
\ncline[nodesep=5pt]{->}{A}{B}
\end{pspicture}
\end{document}
P.S. It is the same thing for tree nodes. For an example of it, look at:
http://www.tug.org/ListsArchives/pstricks/msg00193.html
Bernd.Brandt> Is there one command that is able to place text surrounded
Bernd.Brandt> by a triangle, diamond, box, or circle of the same size?
Bernd.Brandt> I was unable to find one in LGC.
I am not sure here to really understand what you mean by "same size".
Can you be more precise? Thanks.
D.G.
-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------
More information about the PSTricks
mailing list