diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks/pst-tree.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks/pst-tree.tex | 397 |
1 files changed, 201 insertions, 196 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks/pst-tree.tex b/Master/texmf-dist/tex/generic/pstricks/pst-tree.tex index 33c1275d9c7..93024663d89 100644 --- a/Master/texmf-dist/tex/generic/pstricks/pst-tree.tex +++ b/Master/texmf-dist/tex/generic/pstricks/pst-tree.tex @@ -1,7 +1,7 @@ %% pst-tree.tex %% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu. %% COPYRIGHT 2000-2003 by Denis Girou. -%% Copyright 2004 Herbert Voss +%% Copyright 2004-2007 Herbert Voss % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -22,8 +22,8 @@ \csname PSTreeLoaded\endcsname \let\PSTreeLoaded\endinput \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi\relax -\def\fileversion{97 patch 6} -\def\filedate{2004/07/24} +\def\fileversion{1.00} +\def\filedate{2007/01/03} \message{ v\fileversion, \filedate} % \edef\TheAtCode{\the\catcode`\@} @@ -182,132 +182,140 @@ \newcount\pstreecnt \let\c@pstreecnt\pstreecnt \newcount\pstree@cnt +% \def\pstree{\def\pst@par{}\pst@object{pstree}} \def\pstree@i{\def\pstree@makebox{\pst@@makebox}\pstree@ii} +% \def\psTree{\def\pst@par{}\pst@object{psTree}} \def\psTree@i{\def\pstree@makebox{\pst@makelongbox}\pstree@ii} -\def\endpsTree{\pst@endlongbox\ignorespaces} +% hv --begin 1.00 2007-01-03 make it LaTeX-compatible +%\def\endpsTree{\pst@endlongbox\ignorespaces} +\def\endpsTree{\pst@endlongbox\csname ignorespacesafterend\endcsname} +% hv --end \def\pstree@ii{% -\ifnum\pstreelevel=\z@ -\let\pstree@savedshortput\pst@shortput -\psset@shortput{tab}% -\else -\pst@@killglue -\fi -\begingroup -\begingroup -\def\pstree@node{% -\xdef\pstree@next{% -\noexpand\@psttrue -\noexpand\def\noexpand\pst@tempa{\number\pst@dima}% -\noexpand\def\noexpand\pst@tempb{\number\pst@dimb}% -\noexpand\def\noexpand\pst@tempc{\number\pst@dimc}% -\noexpand\def\noexpand\pst@tempd{\number\pst@dimd}}% -\box\pstree@box}% -\def\pssubtree@horizontal{\pssubtree@horizontal@o}% -\def\pssubtree@vertical{\pssubtree@vertical@o}% -\global\let\pstree@next\relax -\pst@makebox\pstree@iii} + \ifnum\pstreelevel=\z@ + \let\pstree@savedshortput\pst@shortput + \psset@shortput{tab}% + \else + \pst@@killglue + \fi + \begingroup + \begingroup + \def\pstree@node{% + \xdef\pstree@next{% + \noexpand\@psttrue + \noexpand\def\noexpand\pst@tempa{\number\pst@dima}% + \noexpand\def\noexpand\pst@tempb{\number\pst@dimb}% + \noexpand\def\noexpand\pst@tempc{\number\pst@dimc}% + \noexpand\def\noexpand\pst@tempd{\number\pst@dimd}}% + \box\pstree@box}% + \def\pssubtree@horizontal{\pssubtree@horizontal@o}% + \def\pssubtree@vertical{\pssubtree@vertical@o}% + \global\let\pstree@next\relax + \pst@makebox\pstree@iii} +% \def\pstree@iii{% -\global\setbox\pst@boxg=\box\pst@hbox -\endgroup -\setbox\pstree@rootbox=\box\pst@boxg -\@pstfalse -\pstree@next -\if@pst -\ifdim\wd\pstree@rootbox=\z@\else -\@pstrickserr{Extraneous space in root node}\@ehpa -\wd\pstree@rootbox=\z@ -\fi -\else -\@pstrickserr{Missing or bad root node -(level \the\pstreelevel, node \the\psnodecnt)}\@ehpa -\def\pstree@next{% -\def\pst@tempa{0}% -\def\pst@tempb{0}% -\def\pst@tempc{0}% -\def\pst@tempd{0}}% -\wd\pstree@rootbox=\z@ -\fi -\pstree@savevalues -\begingroup -\pstree@initsuccvalues -\pstree@setlevelpar -\pstree@do} + \global\setbox\pst@boxg=\box\pst@hbox + \endgroup + \setbox\pstree@rootbox=\box\pst@boxg + \@pstfalse + \pstree@next + \if@pst + \ifdim\wd\pstree@rootbox=\z@\else + \@pstrickserr{Extraneous space in root node}\@ehpa + \typeout{===>\the\wd\pst@hbox (rootbox)} + \wd\pstree@rootbox=\z@ + \fi + \else + \@pstrickserr{Missing or bad root node + (level \the\pstreelevel, node \the\psnodecnt)}\@ehpa + \def\pstree@next{% + \def\pst@tempa{0}% + \def\pst@tempb{0}% + \def\pst@tempc{0}% + \def\pst@tempd{0}}% + \wd\pstree@rootbox=\z@ + \fi + \pstree@savevalues + \begingroup + \pstree@initsuccvalues + \pstree@setlevelpar + \pstree@do} +% \def\pstree@setlevelpar{% -\advance\pstreelevel1 -\let\psk@thislevelsep\relax -\let\psk@thistreesep\relax -\let\psk@thistreefit\relax -\let\psk@thistreenodesize\relax -\csname pstreehook\romannumeral\pstreelevel\endcsname -\use@par -\ifx\psk@thistreesep\relax -\let\psk@thistreesep\psk@treesep -\fi -\ifx\psk@thistreenodesize\relax -\let\psk@thistreenodesize\psk@treenodesize -\fi -\ifx\psk@thistreefit\relax -\let\psk@thistreefit\psk@treefit -\fi -\ifx\psk@thislevelsep\relax -\let\psk@thislevelsep\psk@levelsep -\let\psk@thislevelsepmode\psk@levelsepmode -\fi -\ifnum\psk@treemode=\pstree@predmode\else -\global\advance\pstreecnt1 -\edef\pstree@thetree{\the\pstreecnt}% -\let\pstree@predmode\psk@treemode -\fi -\ifx\psk@thislevelsepmode\relax -\pst@dimg=\psk@thislevelsep\relax -\pst@cntg=0\@nameuse{% -pstree@levelsepadjust-\pstree@thetree-\the\pstreelevel}% -\advance\pst@dimg\pst@cntg sp -\edef\psk@thislevelsep{\number\pst@dimg sp}% -\fi -\ifnum\psk@treemode>1 -\def\pst@tposflip{1 sub neg }% -\else -\def\pst@tposflip{}% -\fi -\ifx\pstree@bboxadjust\@empty\else -\xdef\pstree@treebboxadjust{% -\pstree@bboxadjust -\ifpsshowbbox\noexpand\pstree@showbbox\fi}% -\gdef\pstree@bboxadjust{}% -\fi -\let\pst@thispsbox\@skiplevelfalse} + \advance\pstreelevel1 + \let\psk@thislevelsep\relax + \let\psk@thistreesep\relax + \let\psk@thistreefit\relax + \let\psk@thistreenodesize\relax + \csname pstreehook\romannumeral\pstreelevel\endcsname + \use@par + \ifx\psk@thistreesep\relax + \let\psk@thistreesep\psk@treesep + \fi + \ifx\psk@thistreenodesize\relax + \let\psk@thistreenodesize\psk@treenodesize + \fi + \ifx\psk@thistreefit\relax + \let\psk@thistreefit\psk@treefit + \fi + \ifx\psk@thislevelsep\relax + \let\psk@thislevelsep\psk@levelsep + \let\psk@thislevelsepmode\psk@levelsepmode + \fi + \ifnum\psk@treemode=\pstree@predmode\else + \global\advance\pstreecnt1 + \edef\pstree@thetree{\the\pstreecnt}% + \let\pstree@predmode\psk@treemode + \fi + \ifx\psk@thislevelsepmode\relax + \pst@dimg=\psk@thislevelsep\relax + \pst@cntg=0\@nameuse{pstree@levelsepadjust-\pstree@thetree-\the\pstreelevel}% + \advance\pst@dimg\pst@cntg sp + \edef\psk@thislevelsep{\number\pst@dimg sp}% + \fi + \ifnum\psk@treemode>1 + \def\pst@tposflip{1 sub neg }% + \else + \def\pst@tposflip{}% + \fi + \ifx\pstree@bboxadjust\@empty\else + \xdef\pstree@treebboxadjust{% + \pstree@bboxadjust + \ifpsshowbbox\noexpand\pstree@showbbox\fi}% + \gdef\pstree@bboxadjust{}% + \fi + \let\pst@thispsbox\@skiplevelfalse} +% \def\pstree@predmode{-1} \def\pstree@savevalues{% -\edef\pstree@restorevalues{% -\noexpand\gdef\noexpand\pstree@theleftprofile{\pstree@theleftprofile}% -\noexpand\gdef\noexpand\pstree@therightprofile{\pstree@therightprofile}% -\noexpand\gdef\noexpand\pstree@theupprofile{\pstree@theupprofile}% -\noexpand\gdef\noexpand\pstree@thedownprofile{\pstree@thedownprofile}% -\noexpand\gdef\noexpand\pstree@tspace{\pstree@tspace}% -\noexpand\gdef\noexpand\pssucc{\pssucc}% -\global\psnodecnt=\the\psnodecnt\relax -\global\pstree@cnt=\the\pstree@cnt\relax}% -\let\pstree@savebboxadjust\pstree@treebboxadjust} + \edef\pstree@restorevalues{% + \noexpand\gdef\noexpand\pstree@theleftprofile{\pstree@theleftprofile}% + \noexpand\gdef\noexpand\pstree@therightprofile{\pstree@therightprofile}% + \noexpand\gdef\noexpand\pstree@theupprofile{\pstree@theupprofile}% + \noexpand\gdef\noexpand\pstree@thedownprofile{\pstree@thedownprofile}% + \noexpand\gdef\noexpand\pstree@tspace{\pstree@tspace}% + \noexpand\gdef\noexpand\pssucc{\pssucc}% + \global\psnodecnt=\the\psnodecnt\relax + \global\pstree@cnt=\the\pstree@cnt\relax}% + \let\pstree@savebboxadjust\pstree@treebboxadjust} \def\pstree@initsuccvalues{% -\def\pstree@therightprofile{\pstree@stop,}% -\let\pstree@theleftprofile\pstree@therightprofile -\let\pstree@theupprofile\pstree@therightprofile -\let\pstree@thedownprofile\pstree@therightprofile -\psnodecnt=\z@ -\pstree@cnt\z@ -\gdef\pstree@tspace{\z@}% -\let\pspred\pssucc} + \def\pstree@therightprofile{\pstree@stop,}% + \let\pstree@theleftprofile\pstree@therightprofile + \let\pstree@theupprofile\pstree@therightprofile + \let\pstree@thedownprofile\pstree@therightprofile + \psnodecnt=\z@ + \pstree@cnt\z@ + \gdef\pstree@tspace{\z@}% + \let\pspred\pssucc} \def\pssucc{T} \pstree@initsuccvalues \def\pstree@down{% -\pstree@succrow -\pstree@makebox{\pstree@vertical{\lower}}} + \pstree@succrow + \pstree@makebox{\pstree@vertical{\lower}}} \def\pstree@up{% -\pstree@succrow -\pstree@makebox{\pstree@vertical{\raise}}} + \pstree@succrow + \pstree@makebox{\pstree@vertical{\raise}}} \def\pstree@levelsepadjust#1#2{% % DG/SR modification begin - May 14, 1997 - Patch 1 % Problem with levelsep=*... @@ -439,52 +447,49 @@ pstree@levelsepadjust-\pstree@thetree-\the\pstreelevel}% \pstree@succcolumn \pstree@makebox\pstree@horizontal} \def\pstree@horizontal{% -\ifdim\wd\pst@hbox=\z@\else -\@pstrickserr{Extraneous space in tree successors}\@ehpa -\fi -\pst@cntg=\ifpstreeflip\ht\else\dp\fi\pst@hbox -\divide\pst@cntg 2 -\pstree@add\pstree@theupprofile -\pstree@add\pstree@thedownprofile + \ifdim\wd\pst@hbox=\z@\else + \@pstrickserr{Extraneous space in tree successors}\@ehpa + \typeout{===>\the\wd\pst@hbox (hbox)} + \fi + \pst@cntg=\ifpstreeflip\ht\else\dp\fi\pst@hbox + \divide\pst@cntg 2 + \pstree@add\pstree@theupprofile + \pstree@add\pstree@thedownprofile % DG/SR modification begin - Sep. 24, 1997 - Patch 3 %\ifx\psk@thislevelsepmode\relax %\pstree@horizlevelsepadjust %\fi % DG/SR modification end -\pst@dimg\psk@thislevelsep\relax -\global\setbox\pstree@box=\hbox{% -\unhbox\pstree@rootbox -\kern\if@psrighttree\else-\fi\pst@dimg -\ifpstreeflip\lower\else\raise\fi\pst@cntg sp\box\pst@hbox}% + \pst@dimg\psk@thislevelsep\relax + \global\setbox\pstree@box=\hbox{% + \unhbox\pstree@rootbox + \kern\if@psrighttree\else-\fi\pst@dimg + \ifpstreeflip\lower\else\raise\fi\pst@cntg sp\box\pst@hbox}% % DG/SR modification begin - Sep. 24, 1997 - Patch 3 -\ifx\psk@thislevelsepmode\relax -\pstree@horizlevelsepadjust -\fi + \ifx\psk@thislevelsepmode\relax + \pstree@horizlevelsepadjust + \fi % DG/SR modification end -\if@psrighttree -\pst@dimh=\pst@dimg -\pstree@max\pstree@therightprofile\pst@cntg -\global\advance\pst@dimh\pst@cntg sp -\global\pst@dimg=\pst@tempa sp -\else -\pstree@max\pstree@theleftprofile\pst@cntg -\global\advance\pst@dimg\pst@cntg sp -\global\pst@dimh=\pst@tempb sp -\fi -\if@skiplevel -\skiplevel@horizontal -\else -\endgroup -\fi -\pst@dima=\pst@dimg -\pst@dimb=\pst@dimh -\edef\pstree@upprofile{\pst@tempc,\pstree@theupprofile}% -\edef\pstree@downprofile{\pst@tempd,\pstree@thedownprofile}% -\dp\pstree@box=\z@ -\ht\pstree@box=\z@ -\wd\pstree@box=\z@ -\ifpsshowbbox -\pstree@max\pstree@upprofile\pst@cntg + \if@psrighttree + \pst@dimh=\pst@dimg + \pstree@max\pstree@therightprofile\pst@cntg + \global\advance\pst@dimh\pst@cntg sp + \global\pst@dimg=\pst@tempa sp + \else + \pstree@max\pstree@theleftprofile\pst@cntg + \global\advance\pst@dimg\pst@cntg sp + \global\pst@dimh=\pst@tempb sp + \fi + \if@skiplevel\skiplevel@horizontal\else\endgroup\fi + \pst@dima=\pst@dimg + \pst@dimb=\pst@dimh + \edef\pstree@upprofile{\pst@tempc,\pstree@theupprofile}% + \edef\pstree@downprofile{\pst@tempd,\pstree@thedownprofile}% + \dp\pstree@box=\z@ + \ht\pstree@box=\z@ + \wd\pstree@box=\z@ + \ifpsshowbbox + \pstree@max\pstree@upprofile\pst@cntg \pst@dimc=\pst@cntg sp \pstree@max\pstree@downprofile\pst@cntg \pst@dimd=\pst@cntg sp @@ -952,56 +957,56 @@ tx@Dict begin \psline@iii pop end % DG/SR modification begin - Aug. 31, 1999 - Patch 4 %\pst@dimc=\pstree@gettop\pstree@theupprofile sp %\pst@dimd=\pstree@gettop\pstree@thedownprofile sp -\edef\pstree@upprofile{\pst@tempc,\pstree@theupprofile}% -\edef\pstree@downprofile{\pst@tempd,\pstree@thedownprofile}% -\pstree@max\pstree@upprofile\pst@cntg -\pst@dimc=\pst@cntg sp -\pstree@max\pstree@downprofile\pst@cntg -\pst@dimd=\pst@cntg sp + \edef\pstree@upprofile{\pst@tempc,\pstree@theupprofile}% + \edef\pstree@downprofile{\pst@tempd,\pstree@thedownprofile}% + \pstree@max\pstree@upprofile\pst@cntg + \pst@dimc=\pst@cntg sp + \pstree@max\pstree@downprofile\pst@cntg + \pst@dimd=\pst@cntg sp % DG/SR modification end -\pstree@treebboxadjust -\gdef\pstree@treebboxadjust{}% -\xdef\pstree@next{% -\noexpand\def\noexpand\pst@tempc{\number\pst@dimc}% -\noexpand\def\noexpand\pst@tempd{\number\pst@dimd}}% -\endgroup -\pstree@next} + \pstree@treebboxadjust + \gdef\pstree@treebboxadjust{}% + \xdef\pstree@next{% + \noexpand\def\noexpand\pst@tempc{\number\pst@dimc}% + \noexpand\def\noexpand\pst@tempd{\number\pst@dimd}}% + \endgroup + \pstree@next} \def\skiplevel@vertical{% % DG/SR modification begin - Aug. 31, 1999 - Patch 4 %\pst@dima=\pstree@gettop\pstree@theleftprofile sp %\pst@dimb=\pstree@gettop\pstree@therightprofile sp -\edef\pstree@leftprofile{\pst@tempa,\pstree@theleftprofile}% -\edef\pstree@rightprofile{\pst@tempb,\pstree@therightprofile}% -\pstree@max\pstree@leftprofile\pst@cntg -\pst@dima=\pst@cntg sp -\pstree@max\pstree@rightprofile\pst@cntg -\pst@dimb=\pst@cntg sp + \edef\pstree@leftprofile{\pst@tempa,\pstree@theleftprofile}% + \edef\pstree@rightprofile{\pst@tempb,\pstree@therightprofile}% + \pstree@max\pstree@leftprofile\pst@cntg + \pst@dima=\pst@cntg sp + \pstree@max\pstree@rightprofile\pst@cntg + \pst@dimb=\pst@cntg sp % DG/SR modification end -\pstree@treebboxadjust -\gdef\pstree@treebboxadjust{}% -\xdef\pstree@next{% -\noexpand\def\noexpand\pst@tempa{\number\pst@dima}% -\noexpand\def\noexpand\pst@tempb{\number\pst@dimb}}% -\endgroup -\pstree@next} + \pstree@treebboxadjust + \gdef\pstree@treebboxadjust{}% + \xdef\pstree@next{% + \noexpand\def\noexpand\pst@tempa{\number\pst@dima}% + \noexpand\def\noexpand\pst@tempb{\number\pst@dimb}}% + \endgroup + \pstree@next} \def\skiplevels{\def\pst@par{}\pst@object{skiplevels}} \def\skiplevels@i#1{% -\pst@@killglue -\begingroup -\pst@cnta=#1\relax -\edef\skiplevels@num{\the\pst@cnta}% -\def\pstree@makebox{\pst@makelongbox}% -\def\endskiplevels{}% -\loop -\ifnum\pst@cnta>\z@ -\advance\pst@cnta-1 -\expandafter\def\expandafter\endskiplevels\expandafter{% -\endskiplevels\pst@endlongbox} -\skiplevel@ii -\repeat -\expandafter\def\expandafter\endskiplevels\expandafter{% -\endskiplevels\endgroup\ignorespaces} -\ignorespaces} + \pst@@killglue + \begingroup + \pst@cnta=#1\relax + \edef\skiplevels@num{\the\pst@cnta}% + \def\pstree@makebox{\pst@makelongbox}% + \def\endskiplevels{}% + \loop + \ifnum\pst@cnta>\z@ + \advance\pst@cnta-1 + \expandafter\def\expandafter\endskiplevels\expandafter{% + \endskiplevels\pst@endlongbox} + \skiplevel@ii + \repeat + \expandafter\def\expandafter\endskiplevels\expandafter{% + \endskiplevels\endgroup\ignorespaces} + \ignorespaces} \catcode`\@=\TheAtCode\relax |