[Programming] Horizontal trees with various exit

Denis Girou Denis.Girou at idris.fr
Wed May 21 23:09:20 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 on complex trees for <Francoise.Coustillas at dept.edfgdf.fr>
who has many complex genealogy trees to draw, with various configurations and
cases, I see that for one kind of them it can be greatly improve.

  It's the case of horizontal trees, where we want to be able to fix the
"exit" point for various connections to sub-nodes. By default, we can't.
To do that, as in the first following solution, we must manage by hand all the
connections. It's very heavy on huge and complex trees.

  But there is an easy and automatic solution, which consist to redefine the
position of the node before to connect it to subnodes. We must in this case
transfer the current node store in \pssucc macro to a new position.
I write the \SameNode macro to define alias of an existing node, and with that
we can define an \ExitNode macro which redefine position of the node before
the link. See my second solution.

  I give you this example as I think it's pedagogical and can be useful.
  I update the genealogy examples for that and for other improvements and
simplifications (see http://www.tug.org/applications/PSTricks/Trees).




% Defaut edge

% Macro to define my node

% Definition of nodes





% Default
% -------

% First solution
% --------------

% Macro to define my node

% Definition of nodes


% Second solution
% ---------------

% Macro to define my node
\UpdateNode% Execute it if defined to change the position of the node
\gdef\UpdateNode{}} % Remove the new definition of node if it was defined

% Default to update later node position: empty

% Definition of an exit node different from the entrance one

% Denis Girou <Denis.Girou at idris.fr> - May 15, 1997
% To give an alias name to a previous defined one
% \SameNode{B}{A} define a node B equivalent to the predefined node A
% Useful for special connections in trees
\pst at getnode{#1}\pst at tempa
\pst at getnode@{#2}\pst at tempb
\pst at Verb{\pst at nodedict \pst at tempa \pst at tempb def end}}
% From \pst at getnode, but to return the name of node without the first /
\def\pst at getnode@#1#2{%
\pst at expandafter\pst@@getnode@{#1},,\@nil#2}
\edef#4{N@\pst at zapspace#1 \@empty\space}%
\pst at cntg=#1\relax
\pst at cnth=#2\relax
\edef#4{N at M-\ifnum\psmatrixcnt=\z@ 1\else\the\psmatrixcnt\fi
-\the\pst at cntg-\the\pst at cnth\space}%

% Definition of nodes



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