[Problem] Horizontal trees using levelsep=*dim parameter are bad positioned

Denis Girou Denis.Girou at idris.fr
Fri Oct 17 23:33:19 CEST 1997


-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------

  Trees using the very powerful levelsep=*dim feature (see for instance the
genealogy trees on http://www.tug.org/applications/PSTricks/Trees) were bad
positioned when there were horizontal. The root were top aligned, which is
obviously wrong.

  From CHANGES file:

  * 97/09/24 pst-tree.tex (0.93-97 patch 3): The levelsep=*dim parameter
give wrong result for treemode=R, because all leaves were positioned on the top
(reported by Denis Girou <Denis.Girou at idris.fr>)

  My test case is:

% To compile twice!!!!

\documentclass{article}

\usepackage{pst-tree}

\newcommand{\A}{\TR[href=1]{AAAA}}
\newcommand{\B}{\TR{BBBB}}
\newcommand{\C}{\TR{CCCC}}
\newcommand{\D}{\TR{DDDD}}

\pagestyle{empty}

\begin{document}

\pstree[treemode=R,levelsep=*1cm,href=-1]{\A}{\B \C \D}

\makeatletter
\def\pstree at horizontal{%
\ifdim\wd\pst at hbox=\z@\else
\@pstrickserr{Extraneous space in tree successors}\@ehpa
\fi
\pst at cntg=\ifpstreeflip\ht\else\dp\fi\pst at hbox
\divide\pst at cntg 2
\pstree at add\pstree at theupprofile
\pstree at add\pstree at thedownprofile
% DG/SR modification begin - Sep. 24, 1997
%\ifx\psk at thislevelsepmode\relax
%\pstree at horizlevelsepadjust
%\fi
% DG/SR modification end
\pst at dimg\psk at thislevelsep\relax
\global\setbox\pstree at box=\hbox{%
\unhbox\pstree at rootbox
\kern\if at psrighttree\else-\fi\pst at dimg
\ifpstreeflip\lower\else\raise\fi\pst at cntg sp\box\pst at hbox}%
% DG/SR modification begin - Sep. 24, 1997
\ifx\psk at thislevelsepmode\relax
\pstree at horizlevelsepadjust
\fi
% DG/SR modification end
\if at psrighttree
\pst at dimh=\pst at dimg
\pstree at max\pstree at therightprofile\pst at cntg
\global\advance\pst at dimh\pst at cntg sp
\global\pst at dimg=\pst at tempa sp
\else
\pstree at max\pstree at theleftprofile\pst at cntg
\global\advance\pst at dimg\pst at cntg sp
\global\pst at dimh=\pst at tempb sp
\fi
\if at skiplevel
\skiplevel at horizontal
\else
\endgroup
\fi
\pst at dima=\pst at dimg
\pst at dimb=\pst at dimh
\edef\pstree at upprofile{\pst at tempc,\pstree at theupprofile}%
\edef\pstree at downprofile{\pst at tempd,\pstree at thedownprofile}%
\dp\pstree at box=\z@
\ht\pstree at box=\z@
\wd\pstree at box=\z@
\ifpsshowbbox
\pstree at max\pstree at upprofile\pst at cntg
\pst at dimc=\pst at cntg sp
\pstree at max\pstree at downprofile\pst at cntg
\pst at dimd=\pst at cntg sp
\pstree at showbbox
\fi
\pstree at restorevalues
\pssubtree at horizontal
\endgroup
\ifnum\pstreelevel>\z@\expandafter\ignorespaces\fi}

\vspace*{3cm}
\pstree[treemode=R,levelsep=*1cm,href=-1]{\A}{\B \C \D}

\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