[Problem] levelsep=*dim in pst-tree.tex

Denis Girou Denis.Girou at idris.fr
Wed May 14 21:47:46 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.
-----------------------------------------------------------------------------

  Working again this evening on complex trees (genealogy trees) done by
Francoise Coustillas, which have huge constraints and requirements (see some
examples of them on http://www.tug.org/applications/PSTricks/Trees),
I found that a strange comportment I have was in fact the result of a subtle
bug related to the levelsep=*dim parameter (see origdoc/betadoc2.ps page 37).

  With nodes defined as boxes of varying number of lines, alignments must be
made following the hugest one. But this work only if this one is the rightest
one. Here is a test case (to compile twice, as levelsep=*dim is a two passes
procedure):

% This file must be compile twice

\documentclass{article}

\usepackage{pst-tree}

% Uncomment following lines solve the problem (compile file twice too)

%\makeatletter
%\def\pstree at levelsepadjust#1#2{%
%% DG/SR modification begin - May 14, 1997 (problem with levelsep=*...)
%%\pst at cntg=0\@nameuse{pstree at levelsepadjust-#1}%
%\pst at cntg=0\@nameuse{pstree at levelsepadjust-#1}
%% DG/SR modification end
%\ifnum#2>\pst at cntg
%\expandafter\xdef\csname pstree at levelsepadjust-#1\endcsname
%{#2}%
%\fi}
%\makeatother

\newcommand{\MyNode}[3][]{%
\TR[#1]{\tabcolsep=0mm\begin{tabular}[t]{#2}#3\end{tabular}}}

\newcommand{\PA}{\MyNode{c}{AA\\AAAA\\AA}}
\newcommand{\PB}{\MyNode{c}{BBBB\\BBBB\\BBBB\\BBBB\\BBBB}}
\newcommand{\PC}{\MyNode{c}{CC}}

\renewcommand{\psedge}{\ncangle[angleA=-90,angleB=90,nodesep=0]}

\begin{document}

\pagestyle{empty}

\LARGE

\psset{showbbox=true}

\pstree[treesep=3cm,levelsep=*\baselineskip]
       {\PA}
       {\pstree{\PB}{\PC}
        \pstree{\PC}{\PA}
        \pstree{\PA}{\PC}}

\end{document}

  Using levelsep=*... allow real simplification of programming, as we have not
to adjust each time by hand the \thislevelsep value.

  So, the correction I found is (I must say that I don't clearly understand
the explanation), in generic/pst-tree.tex :

\def\fileversion{0.93-97 patch 1}
\def\filedate{1997/05/14}

......................................................................

\def\pstree at levelsepadjust#1#2{%
% DG/SR modification begin - May 14, 1997 (problem with levelsep=*...)
%\pst at cntg=0\@nameuse{pstree at levelsepadjust-#1}%
\pst at cntg=0\@nameuse{pstree at levelsepadjust-#1}
% DG/SR modification end

D.G.

-----------------------------------------------------------------------------
To [un]subscribe to this list, send mail to pstricks-request at mail.tug.org
Leave the subject line blank and in the body put the line
[un]subscribe <email-address>
For help, put the word "help" in the message body.
To obtain current archive, put the words "get current" in the message body.
-----------------------------------------------------------------------------



More information about the PSTricks mailing list