[Problem] Bug with \skiplevel in `pst-tree'

Denis Girou Denis.Girou at idris.fr
Wed Sep 1 18:39:31 CEST 1999


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

  Working on questions submitted by Françoise Coustillas
<Francoise.Coustillas at edf.fr>, who do a hard work on using PSTricks trees
in genealogy, I found a problem in the \skiplevel macro and the relative
"skiplevels" environment of `pst-tree'. It arrive only when the argument of
\skiplevel is a tree of a configuration as the ones she use (that I simplify
in my test case).

  The problem is that the resulting tree itself is correct, but it bounding
box is wrongly computed, which create severe positioning problems when we want
to integrate such complex trees in a document. It is easy to check when we ask
to draw the bounding boxes, using the "showbox" parameter.

  I found several ways to suppress this problem, but most of them
unfortunately create other ones in other circumstances. I finish to found one
that seems to break nothing else...


  * 99/08/31 pst-tree.tex (97 patch 4): The \skiplevel macro and the relative
"skiplevels" environment doesn't compute correctly the bounding boxes when
their arguments are some trees with special configuration.
(reported by Denis Girou <Denis.Girou at idris.fr>)


  My test case is:

\documentclass{article}

\usepackage{pst-tree}

\newcommand{\AAAA}{\TR{\begin{tabular}[t]{l}AAAA\\A\\A\\A\\A\\A\\A\end{tabular}}}

\newcommand{\PbTree}{%
\vspace{2cm}
\pstree{\TC*}{\pstree{\Tn}{\pstree{\AAAA}{\TC*}}}
\hfill
\pstree{\TC*}{\skiplevel{\pstree{\AAAA}{\TC*}}}
\hfill
\pstree{\TC*}{\begin{skiplevels}{1}\pstree{\AAAA}{\TC*}\end{skiplevels}}}

\setlength{\textwidth}{19cm}
\setlength{\oddsidemargin}{-2cm}

\begin{document}

\psset{treemode=R,levelsep=1.5,showbbox=true}
\PbTree

\makeatletter

\def\skiplevel at horizontal{%
% DG/SR modification begin - Aug. 31, 1999 - Patch 4
%\pst at dimc=\pstree at gettop\pstree at theupprofile sp
%\pst at dimd=\pstree at gettop\pstree at thedownprofile sp
\edef\pstree at upprofile{\pst at tempc,\pstree at theupprofile}%
\edef\pstree at downprofile{\pst at tempd,\pstree at thedownprofile}%
\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
% DG/SR modification end
\pstree at treebboxadjust
\gdef\pstree at treebboxadjust{}%
\xdef\pstree at next{%
\noexpand\def\noexpand\pst at tempc{\number\pst at dimc}%
\noexpand\def\noexpand\pst at tempd{\number\pst at dimd}}%
\endgroup
\pstree at next}

\makeatother

\PbTree

\clearpage
\psset{treemode=D}
\PbTree

\makeatletter

\def\skiplevel at vertical{%
% DG/SR modification begin - Aug. 31, 1999 - Patch 4
%\pst at dima=\pstree at gettop\pstree at theleftprofile sp
%\pst at dimb=\pstree at gettop\pstree at therightprofile sp
\edef\pstree at leftprofile{\pst at tempa,\pstree at theleftprofile}%
\edef\pstree at rightprofile{\pst at tempb,\pstree at therightprofile}%
\pstree at max\pstree at leftprofile\pst at cntg
\pst at dima=\pst at cntg sp
\pstree at max\pstree at rightprofile\pst at cntg
\pst at dimb=\pst at cntg sp
% DG/SR modification end
\pstree at treebboxadjust
\gdef\pstree at treebboxadjust{}%
\xdef\pstree at next{%
\noexpand\def\noexpand\pst at tempa{\number\pst at dima}%
\noexpand\def\noexpand\pst at tempb{\number\pst at dimb}}%
\endgroup
\pstree at next}

\makeatother

\PbTree

\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