[pst-tree] Connecting triangle nodes by apex
Denis Girou
Denis.Girou at idris.fr
Thu Oct 29 21:54:09 CET 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.
-----------------------------------------------------------------------------
Somebody not on the list ask me today how to connect triangle nodes by apex
(top of triangles), because the default is to use the center of the triangles
and the effect seems rather strange (look at my first example) and is not the
common way shown in books.
Requirement is easily understandable, but default behavior is also logical
as it is the way it work for other tree nodes.
Nevertheless, it is easy to change this behavior to the expected one, but
the solution is probably not obvious for majority of people. It require to
not use \Ttri but \Tr with the "ref" parameter, together with the \pstribox
macro. This parameter was introduced in Beta stuff (so in PSTricks 97) but is
not very clearly documented (page 19 of the so-called Beta documentation).
In fact, this is related to \rput, but the documentation for it was not
updated. There is also a description and some usage examples in LGC.
\documentclass{article}
\usepackage{pst-tree}
\setlength{\parindent}{0cm}
\pagestyle{empty}
\begin{document}
\pstree{\Tcircle{A}}
{\Ttri{A}
\Ttri[fillstyle=solid,fillcolor=yellow]{AAA}
\Ttri{AAA AAA AAA}}
\newcommand{\MyTtri}[2][]{\Tr[ref=t]{\pstribox[#1]{#2}}}
\vspace{1cm}
\pstree[levelsep=1cm]{\Tcircle{A}}
{\MyTtri{A}
\MyTtri[fillstyle=solid,fillcolor=yellow]{AAA}
\MyTtri{AAA AAA AAA}}
\vspace{1cm}
\pstree{\Tcircle{A}}
{\Tr[ref=br]{\pstribox{A}}
\Tr[ref=t]{\pstribox[fillstyle=solid,fillcolor=yellow]{AAA}}
\Tr[ref=bl]{\pstribox{AAA AAA AAA}}}
\end{document}
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