From cba57c4c29c5b31127818aade4a3e9ccb5abecf7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 26 Jan 2009 00:38:51 +0000 Subject: split out pst-tree 1.10 (25jan09) git-svn-id: svn://tug.org/texlive/trunk@11976 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-tree/Changes | 8 + Master/texmf-dist/doc/generic/pst-tree/README | 15 + .../doc/generic/pst-tree/pst-tree-doc.bib | 60 ++ .../doc/generic/pst-tree/pst-tree-doc.pdf | Bin 0 -> 213967 bytes .../doc/generic/pst-tree/pst-tree-doc.tex | 865 ++++++++++++++++ Master/texmf-dist/source/generic/pst-tree/Makefile | 71 ++ .../texmf-dist/tex/generic/pst-tree/pst-tree.tex | 1048 ++++++++++++++++++++ Master/texmf-dist/tex/latex/pst-tree/pst-tree.sty | 6 + Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/libexec/ctan2tds | 1 + Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc | 1 + Master/tlpkg/tlpsrc/pst-tree.tlpsrc | 2 + 12 files changed, 2078 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/generic/pst-tree/Changes create mode 100644 Master/texmf-dist/doc/generic/pst-tree/README create mode 100644 Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.bib create mode 100644 Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.pdf create mode 100644 Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.tex create mode 100644 Master/texmf-dist/source/generic/pst-tree/Makefile create mode 100644 Master/texmf-dist/tex/generic/pst-tree/pst-tree.tex create mode 100644 Master/texmf-dist/tex/latex/pst-tree/pst-tree.sty create mode 100644 Master/tlpkg/tlpsrc/pst-tree.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/generic/pst-tree/Changes b/Master/texmf-dist/doc/generic/pst-tree/Changes new file mode 100644 index 00000000000..03b6cefc9bf --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-tree/Changes @@ -0,0 +1,8 @@ +----- pst-tree.tex +1.10 2008-12-12 - first version with pst-xkey and own documentation (hv) +1.01 2007-01-03 - fix bug with \endpsTree (hv) + + +----- pst-tree.sty + 2008-12-12 first version (hv) + diff --git a/Master/texmf-dist/doc/generic/pst-tree/README b/Master/texmf-dist/doc/generic/pst-tree/README new file mode 100644 index 00000000000..5b198d982f1 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-tree/README @@ -0,0 +1,15 @@ +This version of pst-tree uses the xkeyval package, the extended +version of keyval. + +Save the files pst-tree.sty|.tex| in a directory, which is part of your +local TeX tree. Then do not forget to run texhash to update this tree +if these packages are new to your TeX distribution. +For more information see the documentation of your LaTeX distribution +on installing packages into your LaTeX distribution or the +TeX Frequently Asked Questions: +(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). + +pst-tree needs pstricks, which should be part of your +local TeX installation, otherwise get it from a CTAN server, f.ex. +http://www.dante.de/CTAN/graphics/pstricks/ + diff --git a/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.bib b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.bib new file mode 100644 index 00000000000..ba07f2211ce --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.bib @@ -0,0 +1,60 @@ +%% -*-bibtex-*- +@STRING{tugboat = {TUGboat} } +@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } + +@Book{companion, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Dennis Roegel and Herbert Vo\ss}, + title = {The {\LaTeX} {G}raphics {C}ompanion}, + publisher = {{Addison-Wesley Publishing Company}}, + edition = {second}, + year = {2007}, + address = {Boston, Mass.} +} + +@Article{girou:01:, + author = {Denis Girou}, + title = {Pr\'esentation de {PST}ricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {{Timothy Van} Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum + praktischen {E}insatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, +} + +@Manual{multido, + Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition}, + Author = {{Timothy Van} Zandt}, + Organization = {}, + Address = {\url{CTAN:/macros/generic/multido.tex}}, + Note = {}, + year = 1997 +} + +@Book{PSTricks2, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {fifth}, + publisher = {DANTE -- Lehmanns}, + year = {2008}, + address = {Heidelberg/Hamburg} +} + diff --git a/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.pdf b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.pdf new file mode 100644 index 00000000000..92b16025002 Binary files /dev/null and b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.tex b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.tex new file mode 100644 index 00000000000..ae703f71026 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-tree/pst-tree-doc.tex @@ -0,0 +1,865 @@ +%% $Id: pst-func-doc.tex 64 2008-12-08 22:14:27Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside]{pst-doc} +\usepackage[utf8]{inputenc} +\usepackage{pst-tree} +\let\pstTreeFV\fileversion +\lstset{pos=t,language=PSTricks, + morekeywords={psGammaDist,psChiIIDist,psTDist,psFDist,psBetaDist,psPlotImpl},basicstyle=\footnotesize\ttfamily} +% +\begin{document} + +\title{\texttt{pst-tree}} +\subtitle{Nodes and Trees; v.\pstTreeFV} +\author{Timothy Van Zandt\\Herbert Vo\ss} +\docauthor{Herbert Vo\ss} +\date{\today} +\maketitle + +\tableofcontents + +\clearpage% + +\begin{abstract} +The node and node connections are perfect tools for making trees, but +positioning the nodes using \Lcs{rput} would be rather tedious.\footnote{% +Unless you have a computer program that generates the coordinates.} +The file \nxLPack{pst-tree.tex}/\nxLPack{pstree.sty} contains a high-level interface for +making trees. + +It should be noted that the correct result is not guaranteed with every \Lprog{dvips} driver. +This package was written for Rokicki's\index{Rokicki} +\Lprog{dvips} programme, which is practically part of every \TeX{} +distribution. + +%\vfill +%Thanks to: Lars Kotthoff, Geoff Mercer +\end{abstract} + +\clearpage + +% --------------------- + +\section{Overview} + + +The tree commands are +\begin{BDef} +\Lcs{pstree}\Largb{}\Largb{} +\end{BDef} + +\begin{BDef} +\begin{tabular}{@{}l@{\kern30pt}l} +\TeX\ version & \LaTeX\ version\\ +\Lcs{psTree}\Largb{} & \LBEG{psTree}\Largb{root}\\ +\qquad & \qquad \\ +\Lcs{endpsTree} & \LEND{psTree} +\end{tabular} +\end{BDef} + + +These do the same thing, but just have different syntax. \Lcs{psTree} is the ``long'' version. +These macros make a box that encloses all the nodes, and whose baseline passes +through the center of the root. +Most of the nodes has a variant for use within a tree and are called tree nodes (see Section~\ref{treenodes}). + +Trees and tree nodes are called \emph{\Index{tree objects}}. The \Larg{root} of a tree +should be a single tree object, and the \Larg{successors} should be one or more +tree objects. Here is an example with only nodes: +\begin{LTXexample}[pos=l] + \pstree[radius=3pt]{\Toval{root}}{\TC* \TC* \TC* \TC*} +\end{LTXexample} +There is no difference between a terminal node and a root node, other than +their position in the \Lcs{pstree}\Largb{} command. + +Here is an example where a tree is included in the list of successors, and +hence becomes \Index{subtree}: +\begin{LTXexample}[pos=l] + \pstree[radius=3pt]{\Tp}{% + \TC* + \pstree{\TC}{\TC* \TC*} + \TC*} +\end{LTXexample} + + +\section{Tree Nodes}\label{treenodes} + +In each case, the name of the tree node is +formed by omitting "`node"' from the end of the name and adding "T" at the +beginning. For example, \Lcs{psovalnode} becomes \Lcs{Toval}. Here is the list of such +tree nodes: +\begin{BDef} +\LcsStar{Tp}\OptArgs\\ +\LcsStar{Tc}\OptArgs\Largb{dim}\\ +\LcsStar{TC}\OptArgs\\ +\LcsStar{Tf}\OptArgs\\ +\LcsStar{Tdot}\OptArgs\\ +\LcsStar{Tr}\OptArgs\Largb{stuff}\\ +\LcsStar{TR}\OptArgs\Largb{stuff}\\ +\LcsStar{Tcircle}\OptArgs\Largb{stuff}\\ +\LcsStar{TCircle}\OptArgs\Largb{stuff}\\ +\LcsStar{Toval}\OptArgs\Largb{stuff}\\ +\LcsStar{Tdia}\OptArgs\Largb{stuff}\\ +\LcsStar{Ttri}\OptArgs\Largb{stuff} +\end{BDef} + +The syntax of a tree node is the same as of its corresponding ``normal'' node, +except that: +\begin{itemize} + \item There is always an optional argument for setting graphics parameters, + even if the original node did not have one; + \item There is no argument for specifying the name of the node; + \item There is never a coordinate argument for positioning the node; and + \item To set the reference point with \Lcs{Tr}, set the \Lkeyword{ref} parameter. +\end{itemize} + +Figure~\ref{allnodes} gives a reminder of what the nodes look like. + +\begin{figure}[!htb] +\begin{LTXexample} + \small + \psset{armB=1cm, levelsep=3cm, treesep=-3mm, angleB=-90, angleA=90, nodesepA=3pt} + \def\s#1{#1~{\tt\string#1}}\def\b#1{#1{\tt\string#1}}\def\psedge#1#2{\ncangle{#2}{#1}} + \psTree[treenodesize=1cm]{\Toval{Tree nodes}} + \s\Tp\Tc{.5}~{\tt\string\Tc} \s\TC + \psTree[levelsep=4cm,armB=2cm]{\Tp[edge=\ncline]} + \b\Tcircle \s\Tdot + \TCircle[radius=1.2]{\tt\string\TCircle} + \Tn \b\Toval \b\Ttri \b\Tdia + \endpsTree + \s\Tf \b\Tr \b\TR + \endpsTree +\end{LTXexample} +\caption{The tree nodes.}\label{allnodes} +\end{figure} + +The difference between \Lcs{Tr} and \Lcs{TR} (variants of \Lcs{rnode} and \Lcs{Rnode}, +respectively) is important with trees. Usually, you want to use \Lcs{TR} with +vertical trees because the baselines of the text in the nodes line up +horizontally. For example: +\begin{LTXexample}[pos=l] + $ + \pstree[nodesepB=3pt]{\Tcircle{X}}{% + \TR{\tilde{\tilde{X}}} + \TR{x} + \TR{y}} + $ +\end{LTXexample} +Compare with this example, which uses \Lcs{Tr}: +\begin{LTXexample}[pos=l] + $ + \pstree[nodesepB=3pt]{\Tcircle{X}}{% + \Tr{\tilde{\tilde{X}}} + \Tr{x} + \Tr{y}} + $ +\end{LTXexample} + +There is also a null tree node: +\begin{BDef} +\Lcs{Tn} +\end{BDef} +It is meant to be just a place holder. Look at the tree in Figure +page~\pageref{allnodes}. The bottom row has a node missing in the middle. +\Lcs{Tn}\Largb{} was used for this missing node. + +There is also a special tree node that doesn't have a ``normal'' version and +that can't be used as the root node of a whole tree: +\begin{BDef} +\LcsStar{Tfan}\OptArgs +\end{BDef} +This draws a triangle whose base is \Lkeyword{fansize} %=\makeatletter\psk@fansize\makeatother +and whose opposite corner is the predecessor node, adjusted by the value of +\Lkeyword{nodesepA} and \Lkeyword{offsetA}. +For example: +\begin{LTXexample}[pos=l] + \pstree[dotstyle=oplus,dotsize=8pt,nodesep=2pt]{\Tcircle{11}}{% + \Tdot + \pstree{\Tfan}{\Tdot} + \pstree{\Tdot}{\Tfan[linestyle=dashed]}} +\end{LTXexample} + + + + +\section{Tree orientation} + +Trees can grow down, up, right or left, depending on the \Lkeyword{treemode=} +\Lkeyval{D}, \Lkeyval{U}, \Lkeyval{R}, or \Lkeyval{L} parameter. + +Here is what the previous example looks like when it grows to the right: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree[dotstyle=oplus,dotsize=8pt, + nodesep=2pt,treemode=R] + {\Tcircle{11}}{% + \Tdot + \pstree{\Tfan}{\Tdot} + \pstree{\Tdot}{\Tfan[linestyle=dashed]}} +\end{LTXexample} + + +You can change the \Lkeyword{treemode} in the middle of the tree. +For example, here is a tree that grows up, and that has a subtree which grows +to the left: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \footnotesize + \pstree[treemode=U,dotstyle=otimes,dotsize=8pt,nodesep=2pt] + {\Tdot}{% + \pstree[treemode=L]{\Tdot}{\Tcircle{1} \Tcircle{2}} + \pstree{\Tdot}{\Tcircle{3} \Tcircle{4}}} +\end{LTXexample} + +Since you can change a tree's orientation, it can make sense to include a tree +() as a root node (of ). This makes a single logical tree, whose +root is the root of , and that has successors going off in different +directions, depending on whether they appear as a successor to or to +. + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree{\pstree[treemode=L]{\Tcircle{root}}{\Tr{B}}}{% + \Tr{A1} + \Tr{A2}} +\end{LTXexample} + +%%DG: to do + +On a semi-related theme, note that any node that creates an LR-box can contain +a tree. However, nested trees of this kind are not related in any way to the +rest of the tree. Here is an example: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \psTree{\Tcircle{% + \pstree[treesep=0.4,levelsep=0.6, + nodesepB=-6pt]{\Tdot}{% + \TR{a} \TR{b}}}} + \TC + \TC + \endpsTree +\end{LTXexample} + +When the tree grows up or down, the successors are lined up from left to right +in the order they appear in \Lcs{pstree}. When the tree grows to the left or +right, the successors are lined up from top to bottom. As an afterthought, you +might want to flip the order of the nodes. The keyword \Lkeyword{treeflip}=\true/\false +let's you do this. For example: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\footnotesize +\pstree[treemode=U,dotstyle=otimes,dotsize=8pt, + nodesep=2pt,treeflip=true]{\Tdot}{% + \pstree[treemode=R]{\Tdot}{\Tcircle{1} \Tcircle{2}} + \pstree{\Tdot}{\Tcircle{3} \Tcircle{4}}} +\end{LTXexample} +Note that I still have to go back and change the \Lkeyword{treemode} of the subtree +that used to grow to the left. + + +\section{The distance between successors} + +The distance between successors is set by the key \Lkeyword{treesep}. +The rest of this section describes ways to fine-tune the spacing between +successors. +You can change the method for calculating the distance between subtrees by +setting the \Lkeyword{treefit}=\Lkeyval{tight}/\Lkeyval{loose} +parameter. Here are the two methods: +\begin{description} + \item[\Lkeyval{tight}] When \Lkeyset{treefit=tight}, which is the default, \Lkeyword{treesep} is + the minimum distance between each of the levels of the subtrees. + \item[\Lkeyval{loose}] When \Lkeyset{treefit=loose}, \Lkeyword{treesep} is the distance between the + subtrees' bounding boxes. Except when you have large intermediate nodes, the + effect is that the horizontal distance (or vertical distance, for horizontal + trees) between all the terminal nodes is the same (even when they are on + different levels).\footnote{% + When all the terminal nodes are on the same level, and the intermediate + nodes are not wider than the base of their corresponding \Index{subtree}s, then + there is no difference between the two methods.} +\end{description} + +Compare: +\begin{center} +\tabcolsep=1cm +\begin{tabular}{cc} + \psset{radius=2pt} + \pstree{\TC*}{% + \TC + \pstree{\TC*}{% + \pstree{\Tc{3pt}}{\TC \TC} + \TC*}} + & + \psset{radius=2pt} + \pstree[treefit=loose]{\TC*}{% + \TC + \pstree{\TC*}{% + \pstree{\Tc{3pt}}{\TC \TC} + \TC*}} +\end{tabular} +\end{center} + +With \Lkeyset{treefit=loose}, trees take up more space, but sometimes the structure +of the tree is emphasized. + + +%Another (orthogonal) way to highlight the structure of the tree is by setting +%\begin{Ex} +% \Par{xtreesep=dim} +%\end{Ex} +%to a positive value. The effect is that adjacent nodes with different parents +%are farther apart than adjacent nodes with the same parent.\footnote{% +%When \p{treefit=tight}, the minimum distance between levels other than the top +%of the subtrees is increased by \p{xtreesep}. When \p{treefit=loose}, the +%minimum distance between subtrees is increased by \p{xtreesep}}. + +%This would have no effect in the previous two examples, but compare the +%spacing between the two subtrees in +%\begin{LTXexample} +% \psTree[radius=2pt,levelsep=1.5,xtreesep=.25cm] \TC* \\ +% \pstree{\TC*}{\TC* \TC*} +% \pstree{\TC*}{\TC* \TC*} +% \endpsTree +%\end{LTXexample} +%with the spacing in +%\begin{LTXexample} +% \psTree[radius=2pt,levelsep=1.5] \TC* \\ +% \pstree{\TC*}{\TC* \TC*} +% \pstree{\TC*}{\TC* \TC*} +% \endpsTree +%\end{LTXexample} + +Sometimes you want the spacing between the centers of the nodes to be regular +even though the nodes have different sizes. If you set \Lkeyword{treenodesize} +to a non-negative value, then PSTricks sets the width (or height+depth for +vertical trees) to \Lkeyword{treenodesize}, \emph{for the purpose of calculating the +distance between successors}. + + +For example, ternary trees look nice when they are symmetric, as in the +following example: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree[nodesepB=-8pt,treenodesize=.85]{\Tc{3pt}}{% + \TR{$x=y$} + \TR{$x_1=y_1$} + \TR{$x_{11}=y_{11}$}}%$ +\end{LTXexample} + +Compare with this example, where the spacing varies with the size of the +nodes: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree[nodesepB=-8pt]{\Tc{3pt}}{% + \TR{$x=y$} + \TR{$x_1=y_1$} + \TR{$x_{11}=y_{11}$}}%$ +\end{LTXexample} + +Finally, if all else fails, you can adjust the distance between two successors +by inserting \Lcs{tspace}\Largb{length} between them: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree{\Tc{3pt}}{% + \Tdia{foo} + \tspace{-0.5} + \Toval{and} + \Ttri{bar}} +\end{LTXexample} + +\section{Spacing between the root and successors} + +The distance between the center lines of the tree levels is \Lkeyword{levelsep}. +If you want the spacing between levels to vary with the size of the levels, +use the * convention. Then \Lkeyword{levelsep} is the distance between the bottom of +one level and the top of the next level (or between the sides of the two +levels, for horizontal trees). + +Note: PSTricks has to write some information to your \Lext{aux} file if using +\LaTeX, or to \Lcs{jobname}.pst otherwise, in order to calculate the spacing. +You have to run your input file a few times before PSTricks gets the spacing +right. + + + +%%DG: to do +%You are most likely to want to set \p{varlevelsep} to "true" in horizontal +trees. Compare the following example: + +\begin{LTXexample} + \def\psedge#1#2{\ncdiagg[nodesep=3pt,angleA=180,armA=0]{#2}{#1}} + \pstree[treemode=R,levelsep=*1cm]{\Tr{George Alexander Kopf VII}}{% + \pstree{\Tr{Barry Santos}}{\Tr{James Kyle} \Tr{Ann Ada}} + \pstree{\Tr{Terri Maloney}}{\Tr{Uwe Kopf} \Tr{Vera Kan}}} +\end{LTXexample} + +with this one, were the spacing between levels is fixed: + +\begin{LTXexample} + \def\psedge#1#2{\ncdiagg[nodesep=3pt,angleA=180,armA=0]{#2}{#1}} + \pstree[treemode=R,levelsep=3cm]{\Tr{George Alexander Kopf VII}}{% + \pstree{\Tr{Barry Santos}}{\Tr{James Kyle} \Tr{Ann Ada}} + \pstree{\Tr{Terri Maloney}}{\Tr{Uwe Kopf} \Tr{Vera Kan}}} +\end{LTXexample} + +%The center of the root node of a tree is positioned above the midpoint between +%the centers of the two outer successors. If you want the root to be positioned +%drectly above one of the successors, put the command +% \Mac \treecenter +%right \emph{after} that successor. For example: +%\begin{LTXexample} +% \def\myfan#1{\Tfan[fillstyle=solid,fillcolor=#1]\treecenter}% +% \pstree{\Tcircle{$x_2$}}{% +% \pstree{\Tcircle{$x_1$}}{% +% \pstree{\Tcircle{$x_0$}}{\myfan{black}} +% \myfan{gray}} +% \myfan{white}} +%\end{LTXexample} + +%Here is another interesting example: +%\begin{example} +% \def\psedge{\ncangle[angleA=0,angleB=90]} +% \pstree[treesep=10pt]{\Tcircle[name=after]{$x_0$}}{% +% \Tfan[fillstyle=solid,fillcolor=black] +% \treecenter +% \pstree{\Tcircle{$x_1$}}{\Tfan[fillstyle=solid,fillcolor=darkgray]} +% \pstree{\Tcircle{$x_2$}}{\Tfan[fillstyle=solid,fillcolor=gray]} +% \pstree{\Tcircle{$x_3$}}{\Tfan[fillstyle=solid,fillcolor=lightgray]} +% \pstree{\Tcircle{$x_4$}}{\Tfan[fillstyle=solid,fillcolor=white]}} +%\end{example} + + +\section{Edges} + +Right after you use a tree node command, \Lcs{pssucc} is equal to the name of the +node, and \Lcs{pspred} is equal to the name of the node's predecessor. Therefore, +you can draw a line between the node and its predecessor by inserting, for +example, + +\begin{lstlisting}[style=syntax] +\ncline{\pspred}{\pssucc} +\end{lstlisting} + +To save you the trouble of doing this for every node, each tree node executes +\begin{lstlisting}[style=syntax] + \psedge{\pspred}{\pssucc} +\end{lstlisting} +The default definition of \Lcs{psedge} is \Lcs{ncline}, but you can redefine it as +you please with \Lcs{def} or \LaTeX's \Lcs{renewcommand}. + +For example, here I use \Lcs{ncdiag}, with \Lkeyword{armA}=0, to get all the node +connections to emanate from the same point in the predecessor. \LaTeX{} users can instead type: +\begin{lstlisting}[style=syntax] +\renewcommand{\psedge}{\ncdiag[armA=0,angleB=180,armB=1cm]} +\end{lstlisting} + + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \def\psedge{\ncdiag[armA=0,angleB=180,armB=1cm]} + \pstree[treemode=R,levelsep=3.5cm,framesep=2pt]{\Tc{6pt}}{% + \small \Tcircle{K} \Tcircle{L} \Tcircle{M} \Tcircle{N}} +\end{LTXexample} + +Here is an example with \Lcs{ncdiagg}. Note the use of a negative \Lkeyword{armA} value +so that the corners of the edges are vertically aligned, even though the nodes +have different sizes: + +\begin{LTXexample} +$ +\def\psedge#1#2{\ncdiagg[angleA=180,armA=1cm,nodesep=4pt]{#2}{#1}} +% Or: \renewcommand{\psedge}[2]{ ... } +\pstree[treemode=R, levelsep=5cm]{\Tc{3pt}}{% + \Tr{z_1\leq y} \Tr{z_1, xbbl=15pt, + xbbr=15pt, levelsep=2.5cm]{\Tdia{root}}{% + $ + \TR[edge={\ncbar[angle=180]}]{x} + \TR{y} + \TR[edge=\ncbar]{z} + $} +\end{LTXexample} + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \psset{armB=1cm, levelsep=3cm, treesep=1cm, + angleB=-90, angleA=90, arrows=<-, nodesepA=3pt} + \def\psedge#1#2{\ncangle{#2}{#1}} + \pstree[radius=2pt]{\Ttri{root}}{\TC* \TC* \TC* \TC*} +\end{LTXexample} + + + +\section{Edge and node labels} + +Right after a node, an edge has typically been drawn, and you can attach +labels using \Lcs{ncput}, \Lcs{tlput}, etc. +With \Lcs{tlput}, \Lcs{trput}, \Lcs{taput}, and \Lcs{tbput}, you can align the labels +vertically or horizontally, just like the nodes. This can look nice, at least +if the slopes of the node connections are not too different. + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \pstree[radius=2pt]{\Tp}{% + \psset{tpos=.6} + \TC* \tlput{k} + \pstree{\Tc{3pt} \tlput[labelsep=3pt]{r}}{% + \TC* \tlput{j} + \TC* \trput{i}} + \TC* \trput{m}} +\end{LTXexample} + +Within trees, the \Lkeyword{tpos} parameter measures this distance from the +predecessor to the successor, whatever the orientation of the true. +(Outside of trees it measures the distance from the top to bottom or left to +right nodes.) + +PSTricks also sets \Lkeyset{shortput=tab} within trees. This is a special +\Lkeyword{shortput} option that should not be used outside of trees. It implements +the following abbreviations, which depend of the orientation of the true: + +\begin{center} +\begin{tabular}{ccc} + & \multicolumn{2}{c}{Short for:}\\ + \emph{Char.} & \emph{Vert.} & \emph{Horiz.}\\[2pt] + \textasciicircum & \Lcs{tlput} & \Lcs{taput} \\ + \textunderscore & \Lcs{trput} & \Lcs{tbput} +\end{tabular} +\end{center} +(The scheme is reversed if \Lkeyset{treeflip=true}.) + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \psset{tpos=.6} + \pstree[treemode=R, thistreesep=1cm, + thislevelsep=3cm,radius=2pt]{\Tc{3pt}}{% + \pstree[treemode=U, xbbr=20pt]{\Tc{3pt}^{above}}{% + \TC*^{left} + \TC*_{right}} + \TC*^{above} + \TC*_{below}} +\end{LTXexample} + +You can change the character abbreviations with + + +\begin{BDef} +\Lcs{MakeShortTab}\Largb{}\Largb{} +\end{BDef} + +The \verb+\n*put+ commands can also give good results: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] + \psset{npos=.6,nrot=:U} + \pstree[treemode=R, thistreesep=1cm, + thislevelsep=3cm]{\Tc{3pt}}{% + \Tc{3pt}\naput{above} + \Tc*{2pt}\naput{above} + \Tc*{2pt}\nbput{below}} +\end{LTXexample} + +You can put labels on the nodes using \Lcs{nput}. However, \Lcs{pstree} won't take +these labels into account when calculating the bounding boxes. + +There is a special node label option for trees that does keep track of the +bounding boxes: +\begin{BDef} +\Lnotation{\texttildelow}\OptArg*{*}\OptArgs\Largb{stuff} +\end{BDef} +Call this a ``tree node label''. + +Put a tree node label right after the node to which it applies, before any +node connection labels (but node connection labels, including the short forms, +can follow a tree node label). The label is positioned directly below the node +in vertical trees, and similarly in other trees. For example: + + +\begin{LTXexample} + \pstree[radius=2pt]{\Tc{3pt}\nput{45}{\pssucc}{root}}{% + \TC*~{$h$} \TC*~{$i$} \TC*~{$j$} \TC*~{$k$}} +\end{LTXexample} + +Note that there is no ``long form'' for this tree node label. However, you can +change the single character used to delimit the label with +\begin{BDef} +\Lcs{MakeShortTnput}\Largb{} +\end{BDef} +If you find it confusing to use a single character, you can also use a command +sequence. E.g., + +\begin{lstlisting}[style=syntax] +\MakeShortTnput{\tnput} +\end{lstlisting} + +You can have multiple labels, but each successive label is positioned relative +to the bounding box that includes the previous labels. Thus, the order in +which the labels are placed makes a difference, and not all combinations will +produce satisfactory results. + +You will probably find that the tree node label works well for terminal nodes, +without your intervention. However, you can control the tree node labels be +setting several parameters. + +To position the label on any side of the node ("l"eft, "r"ight, "a"bove or +"b"elow), set: \Lkeyword{tnpos}=\Lkeyval{l}/\Lkeyval{r}/\Lkeyval{a}/\Lkeyval{b} + +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\psframebox{% + \pstree{\Tc{3pt}~[tnpos=a,tndepth=0pt,radius=4pt]{root}}{% + \TC*~[tnpos=l]{$h$} + \TC*~[tnpos=r]{$i$}}} +\end{LTXexample} + +When you leave the argument empty, which is the default, PSTricks chooses the +label position is automatically. + +To change the distance between the node and the label, set \Lkeyword{tnsep} to a dimension +When you leave the argument empty, which is the default, PSTricks uses the +value of \Lkeyword{labelsep}. When the value is negative, the distance is measured +from the center of the node. + +When labels are positioned below a node, the label is given a minimum height +of \Lkeyword{tnheight}. +Thus, if you add labels to several nodes that are horizontally aligned, and if +either these nodes have the same depth or \Lkeyword{tnsep} is negative, and if the +height of each of the labels is no more than \Lkeyword{tnheight}, then the labels +will also be aligned by their baselines. The default is \nxLcs{ht}\Lcs{strutbox}, which +in most \TeX{} formats is the height of a typical line of text in the current +font. Note that the value of \Lkeyword{tnheight} is not evaluated until it is used. + +The positioning is similar for labels that go below a node. The label is given +a minimum \emph{depth} of \Lkeyword{tndepth}. +For labels positioned above or below, the horizontal reference point of the +label, i.e., the point in the label directly above or below the center of the +node, is set by the \Lkeyword{href} parameter. + +When labels are positioned on the left or right, the right or left edge of the +label is positioned distance \Lkeyword{tnsep} from the node. The vertical point that +is aligned with the center of the node is set by \Lkeyword{tnyref}. +When you leave this empty, \Lkeyword{vref} is used instead. Recall that \Lkeyword{vref} +gives the vertical \emph{distance} from the baseline. Otherwise, the +\Lkeyword{tnyref} parameter works like the \Lkeyword{yref} parameter, giving the fraction of +the distance from the bottom to the top of the label. + +\section{Details} + +PSTricks does a pretty good job of positioning the nodes and creating a box +whose size is close to the true bounding box of the tree. However, PSTricks +does not take into account the node connections or labels when calculating the +bounding boxes, except the tree node labels. + +If, for this or other reasons, you want to fine tune the bounding box of the +nodes, you can set the following parameters to a dimension: + +\begin{tabular}{@{}l l @{}} +\emph{name} & \emph{default}\\\hline +\Lkeyword{bbl} & 0pt\\ +\Lkeyword{bbr}& 0pt\\ +\Lkeyword{bbh}& 0pt\\ +\Lkeyword{bbd}& 0pt\\ +\Lkeyword{xbbl}& 0pt\\ +\Lkeyword{xbbr}& 0pt\\ +\Lkeyword{xbbh}& 0pt\\ +\Lkeyword{xbbd}& 0pt +\end{tabular} + +The "`x"' versions increase the bounding box by , and the others set the +bounding box to the dimension. There is one parameter for each direction from the +center of the node, \textbf{l}eft, \textbf{r}ight, \textbf{h}eight, and +\textbf{d}epth. + +These parameters affect trees and nodes, and subtrees that switch directions, +but not subtrees that go in the same direction as their parent tree (such +subtrees have a profile rather than a bounding box, and should be adjusted by +changing the bounding boxes of the constituent nodes). + +Save any fiddling with the bounding box until you are otherwise finished with +the tree. + +You can see the bounding boxes by setting the \Lkeyword{showbbox}=\true/\false +parameter to \true. To see the bounding boxes of all the nodes in a tree, you +have to set this parameter before the tree. + +In the following example, the labels stick out of the bounding box: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\psset{tpos=.6,showbbox=true} +\pstree[treemode=U]{\Tc{5pt}}{% + \TR{foo}^{left} + \TR{bar}_{right}} +\end{LTXexample} + +Here is how we fix it: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\psset{tpos=.6,showbbox=true} +\pstree[treemode=U,xbbl=8pt,xbbr=14pt]{\Tc{5pt}}{% + \TR{foo}^{left} + \TR{bar}_{right}} +\end{LTXexample} + +Now we can frame the tree: + +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\psframebox[fillstyle=solid,fillcolor=lightgray,framesep=14pt, + linearc=14pt,cornersize=absolute,linewidth=1.5pt]{% + \psset{tpos=.6,border=1pt,nodesepB=3pt} + \pstree[treemode=U,xbbl=8pt,xbbr=14pt]{% + \Tc[fillcolor=white,fillstyle=solid]{5pt}}{% + \TR*{foo}^{left} + \TR*{bar}_{right}}} +\end{LTXexample} + +We would have gotten the same result by changing the bounding box of the two +terminal nodes. + +To skip levels, use + +\begin{BDef} +\LcsStar{skiplevel}\OptArgs\Largb{nodes or subtrees}\\[4pt] +\LcsStar{skiplevels}\OptArgs\Largb{int} \\ +\qquad \\ +\Lcs{endskiplevels} +\end{BDef} + + +These are kind of like subtrees, but with no root node. + +\begin{LTXexample} + \pstree[treemode=R,levelsep=1.8,radius=2pt]{\Tc{3pt}}{% + \skiplevel{\Tfan} + \pstree{\Tc{3pt}}{% + \TC* + \skiplevels{2} + \pstree{\Tc{3pt}}{\TC* \TC*} + \TC* + \endskiplevels + \pstree{\Tc{3pt}}{\TC* \TC*}}} +\end{LTXexample} + +The profile at the missing levels is the same as at the first non-missing +level. You can adjust this with the bounding box parameters. You get greatest +control if you use nested \Lcs{skiplevel} commands instead of \Lcs{skiplevels}. + +\begin{LTXexample} +\large\psset{radius=6pt, dotsize=4pt} +\pstree[thislevelsep=0,edge=none,levelsep=2.5cm]{\Tn}{% + \pstree{\TR{Player 1}}{\pstree{\TR{Player 2}}{\TR{Player 3}}} + \psset{edge=\ncline} + \pstree{\pstree[treemode=R]{\TC}{\Tdot ~{(0,0,0)} ^{N}}}{% + \pstree{\TC[name=A] ^{L}}{% + \Tdot ~{(-10,10.-10)} ^{l} + \pstree{\TC[name=C] _{r}}{% + \Tdot ~{(3,8,-4)} ^{c} + \Tdot ~{(-8,3,4)} _{d}}} + \pstree{\TC[name=B] _{R}}{% + \Tdot ~{(10,-10.0)} ^{l} + \pstree{\TC[name=D]_{r}}{% + \Tdot ~{(4,8,-3)} ^{c} + \Tdot ~{(0,-5,0)} _{d}}}}} +\ncbox[linearc=.3,boxsize=.3,linestyle=dashed,nodesep=.4]{A}{B} +\ncarcbox[linearc=.3,boxsize=.3,linestyle=dashed,arcangle=25,nodesep=.4]{D}{C} +\end{LTXexample} + +\section{The scope of parameter changes} + +\Lkeyword{edge} is the only parameter which, when set in a tree node's parameter +argument, affects the drawing of the node connection (e.g., if you want to +change the \Lkeyword{nodesep}, your edge has to include the parameter change, or you +have to set it before the node). + +As noted at the beginning of this section, parameter changes made with +\Lcs{pstree} affect all subtrees. However, there are variants of some of these +parameters for making local changes, i.e, changes that affects only the +current level: \Lkeyword{thistreesep}, \Lkeyword{thistreenodesize}, +\Lkeyword{thistreefit}=\Lkeyval{tight}/\Lkeyval{loose}, and \Lkeyword{thislevelsep}. + +For example: +\begin{LTXexample}[pos=l,width=0.4\linewidth] +\pstree[thislevelsep=.5cm,thistreesep=2cm, + radius=2pt]{\Tc*{3pt}}{% + \pstree{\TC*}{\TC* \TC*} + \pstree{\TC*}{\TC* \TC*}} +\end{LTXexample} + +There are some things you may want set uniformly across a level in the tree, +such as the \Lkeyword{levelsep}. At level , the command \nxLcs{pstreehook} +(e.\,g., \Lcs{pstreehookii}) is executed, if it is defined (the root node of the +whole tree is level 0, the successor tree objects and the node connections +from the root node to these successors is level 1, etc.). In the following +example, the \Lkeyword{levelsep} is changed for level 2, without having to set the +\Lkeyword{thislevelsep} parameter for each of the three subtrees that make of +level 2: + +\begin{LTXexample} +\[ +\def\pstreehookiii{\psset{thislevelsep=3cm}} +\pstree[treemode=R,levelsep=1cm,radius=2pt]{\Tc{4pt}}{% + \pstree{\TC*}{% + \pstree{\TC*}{\Tr{X_1} \Tr{X_2}} + \pstree{\TC*}{\Tr{Y_1} \Tr{Y_2}}} + \pstree{\TC*}{% + \pstree{\TC*}{\Tr{K_1} \Tr{K_2}} + \pstree{\TC*}{\Tr{J_1} \Tr{J_2}}}} +\] +\end{LTXexample} + +\clearpage +\section{List of all optional arguments for \nxLPack{pst-tree}} + +The default value ist set when an optional argument is called without any value, +e.\,g. \Lcs{pstree}\Largs{levelsep} is the same as \Lcs{pstree}\Largs{levelsep=2cm}. +All boolean arguments are preset to \false. + +\xkvview{family=pst-tree,columns={key,type,default}} + + + +\nocite{*} +\bgroup +\raggedright +\bibliographystyle{plain} +\bibliography{\jobname} +\egroup + +\printindex + + +\end{document} diff --git a/Master/texmf-dist/source/generic/pst-tree/Makefile b/Master/texmf-dist/source/generic/pst-tree/Makefile new file mode 100644 index 00000000000..30303cb761c --- /dev/null +++ b/Master/texmf-dist/source/generic/pst-tree/Makefile @@ -0,0 +1,71 @@ + +# `Makefile' for `pst-tree.pdf', hv, 2008/12/11 + +.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps + +PACKAGE = pst-tree + +MAIN = $(PACKAGE)-doc + +LATEX = latex + +ARCHNAME = $(MAIN)-$(shell date +%y%m%d) + +ARCHFILES = $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro $(MAIN).tex README Changes Makefile + +TDS = ~/PSTricks/PSTricks-TDS + +all : doc clean tds +# clean +doc: $(MAIN).pdf + +$(MAIN).pdf : $(MAIN).ps + GS_OPTIONS=-dAutoRotatePages=/None ps2pdf $< + +$(MAIN).ps : $(MAIN).dvi + dvips $< + +$(MAIN).dvi : $(MAIN).tex + $(LATEX) $< + $(LATEX) $< + if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi + if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi + makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \ + $(basename $<).glo + makeindex -s pst-doc.ist -t $(basename $<).ilg -o $(basename $<).ind \ + $(basename $<).idx + bibtex $(basename $<) + $(LATEX) $< + $(LATEX) $< + +clean : + $(RM) $(addprefix $(MAIN), .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out ) + $(RM) $(addprefix $(MAIN), .dvi .ps .blg .bbl) + +veryclean : clean + $(RM) $(addprefix $(MAIN), .pdf .bbl .blg) + +arch : + zip $(ARCHNAME).zip $(ARCHFILES) + +tds: + cp -u Changes $(TDS)/doc/generic/$(PACKAGE)/ + cp -u README $(TDS)/doc/generic/$(PACKAGE)/ + cp -u $(MAIN).pdf $(TDS)/doc/generic/$(PACKAGE)/ +# + cp -u Changes $(TDS)/tex/latex/$(PACKAGE)/ + cp -u $(PACKAGE).sty $(TDS)/tex/latex/$(PACKAGE)/ +# + cp -u Changes $(TDS)/tex/generic/$(PACKAGE)/ + cp -u $(PACKAGE).tex $(TDS)/tex/generic/$(PACKAGE)/ +# +# cp -u Changes $(TDS)/dvips/$(PACKAGE)/ +# cp -u $(PACKAGE).pro $(TDS)/dvips/$(PACKAGE)/ +# + cp -u Changes $(TDS)/source/$(PACKAGE)/ + cp -u $(MAIN).tex $(TDS)/source/$(PACKAGE)/ + cp -u $(MAIN).bib $(TDS)/source/$(PACKAGE)/ + cp -u Makefile $(TDS)/source/$(PACKAGE)/ + + +# EOF diff --git a/Master/texmf-dist/tex/generic/pst-tree/pst-tree.tex b/Master/texmf-dist/tex/generic/pst-tree/pst-tree.tex new file mode 100644 index 00000000000..140d18cbc6d --- /dev/null +++ b/Master/texmf-dist/tex/generic/pst-tree/pst-tree.tex @@ -0,0 +1,1048 @@ +%% pst-tree.tex +%% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu. +%% COPYRIGHT 2000-2003 by Denis Girou. +%% Copyright 2004-2009 Herbert Voss +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This Current Maintainer of this work is Herbert Voss +% +% This work consists of the file pstricks.tex, PostScript macros +% for Generic TeX. +% See the PSTricks User's Guide for description. +% +\csname PSTreeLoaded\endcsname +\let\PSTreeLoaded\endinput +\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi\relax +\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi +% +\def\fileversion{1.10} +\def\filedate{2008/12/12} +\message{ v\fileversion, \filedate} +% +\edef\TheAtCode{\the\catcode`\@} +\catcode`\@=11 +% +\pst@addfams{pst-tree} +\NormalCoor +\newbox\pstree@rootbox +\newbox\pstree@box +\def\pstree@succrow{% +\ifpstreeflip + \def\pssubtree@vertical{\pssubtree@vertical@vflip}% +\else + \def\pssubtree@vertical{\pssubtree@vertical@v}% +\fi +\def\pstree@node{\pstree@node@v}% +\def\pssubtree@horizontal{\pssubtree@horizontal@v}}% +\def\pssubtree@vertical@v{% + \vrule height \pst@dimc depth \pst@dimd width \z@ + \ifnum\psnodecnt=\z@ + \global\let\pstree@theleftprofile\pstree@leftprofile + \global\let\pstree@therightprofile\pstree@rightprofile + \else + \psk@thistreefit\pstree@therightprofile\pstree@leftprofile + \kern\the\pst@cnth sp + \pstree@zip\pstree@therightprofile + \pstree@rightprofile\pstree@therightprofile + \global\advance\pstree@cnt\pst@cnth + \pst@cnth=\pstree@cnt + \pstree@zip\pstree@leftprofile + \pstree@theleftprofile\pstree@theleftprofile + \fi + \box\pstree@box + \global\advance\psnodecnt 1\relax% +}% +\def\pssubtree@vertical@vflip{% + \vrule height \pst@dimc depth \pst@dimd width \z@ + \ifnum\psnodecnt=\z@ + \global\let\pstree@theleftprofile\pstree@leftprofile + \global\let\pstree@therightprofile\pstree@rightprofile + \else + \psk@thistreefit\pstree@theleftprofile\pstree@rightprofile + \kern-\pst@cnth sp + \pstree@zip\pstree@theleftprofile + \pstree@leftprofile\pstree@theleftprofile + \global\advance\pstree@cnt\pst@cnth + \pst@cnth=\pstree@cnt + \pstree@zip\pstree@rightprofile + \pstree@therightprofile\pstree@therightprofile + \fi + \box\pstree@box + \global\advance\psnodecnt 1\relax% +}% +\def\pstree@node@v{% + \edef\pstree@leftprofile{\psk@thistreenodesize\pst@dima,\pstree@stop,}% + \edef\pstree@rightprofile{\psk@thistreenodesize\pst@dimb,\pstree@stop,}% + \pssubtree@vertical}% +% +\def\pssubtree@horizontal@v{% + \pstree@max\pstree@upprofile\pst@cntg + \pst@dimc=\pst@cntg sp + \pstree@max\pstree@downprofile\pst@cntg + \pst@dimd=\pst@cntg sp + \pstree@treebboxadjust + \edef\pstree@leftprofile{\number\pst@dima,\pstree@stop,}% + \edef\pstree@rightprofile{\number\pst@dimb,\pstree@stop,}% + \pssubtree@vertical}% +% +\def\pstree@tightfit#1#2{% + \pst@cnth=\z@ + \edef\treenext{\noexpand\pstree@@tightfit#1\noexpand\@nil#2\noexpand\@nil}% + \treenext + \advance\pst@cnth\psk@thistreesep\relax + \advance\pst@cnth\pstree@tspace\relax + \gdef\pstree@tspace{\z@}} +% +\def\pstree@@tightfit#1,#2\@nil#3,#4\@nil{% + \ifnum#1=\pstree@stop + \let\treenext\relax + \else + \ifnum#3=\pstree@stop + \let\treenext\relax + \else + \pst@cntg=#1 + \advance\pst@cntg#3 + \ifnum\pst@cntg>\pst@cnth \pst@cnth=\pst@cntg\fi + \def\treenext{\pstree@@tightfit#2\@nil#4\@nil}% + \fi + \fi + \treenext} +% +\def\pstree@loosefit#1#2{% + \pstree@max{#1}\pst@cnth + \pstree@max{#2}\pst@cntg + \advance\pst@cnth\pst@cntg + \advance\pst@cnth\psk@thistreesep\relax + \advance\pst@cnth\pstree@tspace\relax + \gdef\pstree@tspace{\z@}} +% +\def\tspace#1{% + \pst@@killglue + \pssetlength\pst@dimg{#1}% + \xdef\pstree@tspace{\number\pst@dimg}% + \ignorespaces} +% +\define@key[psset]{pst-tree}{treefit}[tight]{% + \@ifundefined{pstree@#1fit}% + {\@pstrickserr{Bad `treefit' parameter value: `#1'}\@ehpa}% + {\expandafter\let\expandafter\psk@treefit\csname pstree@#1fit\endcsname}} +\psset[pst-tree]{treefit=tight} +% +\define@key[psset]{pst-tree}{thistreefit}[tight]{% + \@ifundefined{pstree@#1fit}% + {\@pstrickserr{Bad `treefit' parameter value: `#1'}\@ehpa}% + {\expandafter\let\expandafter\psk@thistreefit\csname pstree@#1fit\endcsname}} +\psset[pst-tree]{thistreefit=tight} +% +\def\pstree@zip#1#2#3{% + \def\pst@tempg{}% + \edef\treenext{\noexpand\pstree@@zip#1\noexpand\@nil#2\noexpand\@nil}% + \treenext + \global\let#3\pst@tempg} +% +\def\pstree@@zip#1,#2\@nil#3,#4\@nil{% + \ifnum#1=\pstree@stop + \edef\pst@tempg{\pst@tempg#3,#4}% + \let\treenext\relax + \else + \ifnum#3=\pstree@stop + \pst@cntg=#1 + \advance\pst@cntg-\pst@cnth + \edef\pst@tempg{\pst@tempg\the\pst@cntg,}% + \def\treenext{\pstree@@zip#2\@nil\pstree@stop,\@nil}% + \else + \edef\pst@tempg{\pst@tempg#3,}% + \def\treenext{\pstree@@zip#2\@nil#4\@nil}% + \fi + \fi + \treenext} +% +\def\pstree@max#1#2{% + \pst@cntg=\z@ + \expandafter\pstree@@max#1% + #2=\pst@cntg}% +% +\def\pstree@@max#1,{% + \ifnum#1=\pstree@stop \else + \ifnum#1>\pst@cntg \pst@cntg=#1\fi + \expandafter\pstree@@max + \fi} +% +\def\pstree@add#1{% + \def\pst@tempg{}% + \expandafter\pstree@@add#1% + \xdef#1{\pst@tempg\pstree@stop,}} +% +\def\pstree@@add#1,{% + \ifnum#1=\pstree@stop \else + \pst@cnth=#1 + \advance\pst@cnth\pst@cntg + \xdef\pst@tempg{\pst@tempg\the\pst@cnth,}% + \expandafter\pstree@@add + \fi} +% +\newcount\psnodecnt +\let\c@psnodecnt\psnodecnt +\newcount\pstreelevel +\let\c@pstreelevel\pstreelevel +\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} +% 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} +% +\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 + \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} +% +\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} +% +\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\pssucc{T} +\pstree@initsuccvalues +\def\pstree@down{% + \pstree@succrow + \pstree@makebox{\pstree@vertical{\lower}}} +\def\pstree@up{% + \pstree@succrow + \pstree@makebox{\pstree@vertical{\raise}}} +\def\pstree@levelsepadjust#1#2{% +% DG/SR modification begin - May 14, 1997 - Patch 1 +% Problem with levelsep=*... +%\pst@cntg=0\@nameuse{pstree@levelsepadjust-#1}% +\pst@cntg=0\@nameuse{pstree@levelsepadjust-#1} +% DG/SR modification end +\ifnum#2>\pst@cntg +\expandafter\xdef\csname pstree@levelsepadjust-#1\endcsname +{#2}% +\fi} +% DG/SR modification begin - October 28, 1999 - Patch 5 - For plain TeX +\ifx\@undefined\@auxout\newwrite\@auxout\fi +% DG/SR modification end +\def\pstree@initlevelsepadjust{% +\@ifundefined{@latexerr}{% +\immediate\openin1 \jobname.pst +\ifeof1 \else +\input \jobname.pst +\fi +\immediate\closein1 +\csname newwrite\endcsname\pstree@auxout +\immediate\openout\pstree@auxout \jobname.pst }% +{\let\pstree@auxout\@auxout}% +\global\let\pstree@initlevelsepadjust\relax} +\newcount\pstree@stop +\pstree@stop=-987654321 +\def\pstree@vertical#1{% +\pst@cntg=\ifpstreeflip-\fi\wd\pst@hbox +\divide\pst@cntg 2 +\pstree@add\pstree@theleftprofile +\pstree@add\pstree@therightprofile +\pst@dimg=\psk@thislevelsep\relax +\ifx\psk@thislevelsepmode\relax +\pstree@vertlevelsepadjust{#1}% +\fi +\global\setbox\pstree@box=\hbox{% +\vrule height \pst@tempc sp depth \pst@tempd sp width \z@ +\unhbox\pstree@rootbox +#1\pst@dimg\hbox to\z@{\hss\unhbox\pst@hbox\hss}}% +\if@skiplevel +\skiplevel@vertical +\else +\endgroup +\fi +\edef\pstree@leftprofile{\pst@tempa,\pstree@theleftprofile}% +\edef\pstree@rightprofile{\pst@tempb,\pstree@therightprofile}% +\pst@dimc=\ht\pstree@box +\pst@dimd=\dp\pstree@box +\ifpsshowbbox +\pstree@max\pstree@leftprofile\pst@cntg +\pst@dima=\pst@cntg sp +\pstree@max\pstree@rightprofile\pst@cntg +\pst@dimb=\pst@cntg sp +\pstree@showbbox +\fi +\dp\pstree@box=\z@ +\ht\pstree@box=\z@ +\pstree@restorevalues +\pssubtree@vertical +\global\let\pstree@treebboxadjust\pstree@savebboxadjust +\endgroup +\ifnum\pstreelevel>\z@\expandafter\ignorespaces\fi} +\def\pstree@vertlevelsepadjust#1{% +\ifx\if@filesw\iffalse\else +\ifx#1\lower +\pst@dimh=\pst@tempd sp +\advance\pst@dimh\ht\pst@hbox +\else +\pst@dimh=\pst@tempc sp +\advance\pst@dimh\dp\pst@hbox +\fi +\immediate\write\@auxout{% +\string\pstree@levelsepadjust +{\pstree@thetree-\the\pstreelevel}{\number\pst@dimh}}% +\fi} +\def\pstree@succcolumn{% +\def\pssubtree@vertical{\pssubtree@vertical@h}% +\def\pssubtree@horizontal{\pssubtree@horizontal@h}% +\def\pstree@node{\pstree@node@h}}% +\def\pssubtree@horizontal@h{% +\xdef\pstree@theleftprofile{\number\pst@dima,\pstree@theleftprofile}% +\xdef\pstree@therightprofile{\number\pst@dimb,\pstree@therightprofile}% +\ifnum\psnodecnt=\z@ +\global\let\pstree@theupprofile\pstree@upprofile +\global\let\pstree@thedownprofile\pstree@downprofile +\box\pstree@box +\else +\ifpstreeflip +\pssubtree@horizontal@@hflip +\else +\pssubtree@horizontal@@h +\fi +\fi +\global\advance\psnodecnt 1\relax} +\def\pssubtree@horizontal@@h{% +\psk@thistreefit\pstree@thedownprofile\pstree@upprofile +\global\advance\pstree@cnt\pst@cnth +\lower\the\pstree@cnt sp\box\pstree@box +\pstree@zip\pstree@thedownprofile\pstree@downprofile\pstree@thedownprofile +\pst@cnth=\pstree@cnt +\pstree@zip\pstree@upprofile\pstree@theupprofile\pstree@theupprofile} +\def\pssubtree@horizontal@@hflip{% +\psk@thistreefit\pstree@theupprofile\pstree@downprofile +\global\advance\pstree@cnt\pst@cnth +\raise\the\pstree@cnt sp\box\pstree@box +\pstree@zip\pstree@theupprofile\pstree@upprofile\pstree@theupprofile +\pst@cnth=\pstree@cnt +\pstree@zip\pstree@downprofile\pstree@thedownprofile\pstree@thedownprofile} +\def\pstree@node@h{% +\edef\pstree@upprofile{\psk@thistreenodesize\pst@dimc,\pstree@stop,}% +\edef\pstree@downprofile{\psk@thistreenodesize\pst@dimd,\pstree@stop,}% +\pssubtree@horizontal@h}% +\def\pssubtree@vertical@h{% +\pstree@max\pstree@leftprofile\pst@cntg +\pst@dima=\pst@cntg sp +\pstree@max\pstree@rightprofile\pst@cntg +\pst@dimb=\pst@cntg sp +\pstree@treebboxadjust +\edef\pstree@upprofile{\number\pst@dimc,\pstree@stop,}% +\edef\pstree@downprofile{\number\pst@dimd,\pstree@stop,}% +\pssubtree@horizontal@h}% +\newif\if@psrighttree +\def\pstree@right{% +\@psrighttreetrue +\pstree@succcolumn +\pstree@makebox\pstree@horizontal} +\def\pstree@left{% +\@psrighttreefalse +\pstree@succcolumn +\pstree@makebox\pstree@horizontal} +\def\pstree@horizontal{% + \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}% +% DG/SR modification begin - Sep. 24, 1997 - Patch 3 + \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 +\pst@dimc=\pst@cntg sp +\pstree@max\pstree@downprofile\pst@cntg +\pst@dimd=\pst@cntg sp +\pstree@showbbox +\fi +\pstree@restorevalues +\pssubtree@horizontal +\endgroup +\ifnum\pstreelevel>\z@\expandafter\ignorespaces\fi} +% DG/SR modification begin - Sep. 24, 1997 - Patch 2 +%\def\pstree@horizlevelsepadjust#1{% +\def\pstree@horizlevelsepadjust{% +% DG/SR modification end +\ifx\if@filesw\iffalse\else +\if@psrighttree +\pst@dimh=\pst@tempb sp +\pstree@max\pstree@theleftprofile\pst@cntg +\advance\pst@dimh\pst@cntg sp +\else +\pst@dimh=\pst@tempa sp +\pstree@max\pstree@therightprofile\pst@cntg +\advance\pst@dimh\pst@cntg sp +\fi +\immediate\write\@auxout{% +\string\pstree@levelsepadjust +{\pstree@thetree-\the\pstreelevel}{\number\pst@dimh}}% +\fi} +% +\define@key[psset]{pst-tree}{treemode}[0]{% + \pst@cntg=\ifx#1U\@empty2\else\ifx#1R\@empty1\else\ifx#1L\@empty3\else0\fi\fi\fi + \relax + \edef\psk@treemode{\the\pst@cntg}% + \ifcase\pst@cntg + \let\pstree@do\pstree@down\or + \let\pstree@do\pstree@right\or + \let\pstree@do\pstree@up\or + \let\pstree@do\pstree@left + \fi} +\psset[pst-tree]{treemode=0} +% +\let\pstree@do\pstree@down +\define@key[psset]{pst-tree}{treesep}[0.75cm]{% + \pssetlength\pst@dimg{#1}% + \edef\psk@treesep{\number\pst@dimg}}% +\psset[pst-tree]{treesep=.75cm} +% +\define@key[psset]{pst-tree}{thistreesep}{% + \pssetlength\pst@dimg{#1}% + \edef\psk@thistreesep{\number\pst@dimg}}% +%\psset[pst-tree]{thistreesep=.75cm} +% +\define@key[psset]{pst-tree}{treenodesize}[-1pt]{% + \pssetlength\pst@dimg{#1}% + \ifdim\pst@dimg<\z@ + \let\psk@treenodesize\number + \else + \edef\psk@treenodesize{\number\pst@dimg\noexpand\@gobble}% +\fi} +\psset[pst-tree]{treenodesize=-1pt} +% +\define@key[psset]{pst-tree}{thistreenodesize}[-1pt]{% + \pssetlength\pst@dimg{#1}% + \ifdim\pst@dimg<\z@ + \let\psk@thistreenodesize\number + \else + \edef\psk@thistreenodesize{\number\pst@dimg\noexpand\@gobble}% + \fi} +\psset[pst-tree]{thistreenodesize=-1pt} +% +\define@key[psset]{pst-tree}{levelsep}[2cm]{% + \pst@expandafter{\pst@ifstar\psset@@levelsep}{#1}\@nil} +\def\psset@@levelsep#1\@nil{% + \pst@@getlength{#1}\psk@levelsep + \if@star + \pstree@initlevelsepadjust + \let\psk@levelsepmode\relax + \else + \def\psk@levelsepmode{}% + \fi} +\psset[pst-tree]{levelsep=2cm} +\define@key[psset]{pst-tree}{thislevelsep}{% + \pst@expandafter{\pst@ifstar\psset@@thislevelsep}{#1}\@nil} +\def\psset@@thislevelsep#1\@nil{% + \pst@@getlength{#1}\psk@thislevelsep + \if@star + \pstree@initlevelsepadjust + \let\psk@thislevelsepmode\relax + \else + \def\psk@thislevelsepmode{}% +\fi} +% +\define@boolkey[psset]{pst-tree}[ps]{treeflip}[true]{} +\psset[pst-tree]{treeflip=false} +% +\def\pstree@node@o{% +\leavevmode +\hbox{% +\vrule height \pst@dimc depth \pst@dimd width \z@ +\kern\pst@dima +\box\pstree@box +\kern\pst@dimb}} +\def\pssubtree@vertical@o{% +\pstree@max\pstree@leftprofile\pst@cntg +\pst@dima=\pst@cntg sp +\pstree@max\pstree@rightprofile\pst@cntg +\pst@dimb=\pst@cntg sp +\pstree@treebboxadjust +\pstree@node} +\def\pssubtree@horizontal@o{% +\pstree@max\pstree@upprofile\pst@cntg +\pst@dimc=\pst@cntg sp +\pstree@max\pstree@downprofile\pst@cntg +\pst@dimd=\pst@cntg sp +\pstree@treebboxadjust +\pstree@node} +\def\pstree@outer{% +\def\pstree@node{\pstree@node@o}% +\def\pssubtree@vertical{\pssubtree@vertical@o}% +\def\pssubtree@horizontal{\pssubtree@horizontal@o}% +\pstreelevel=\z@ +\def\pstree@predmode{-1}% +\def\pst@tposflip{}% +\let\pst@thisbox\relax +\let\pst@shortput\pstree@savedshortput} +\let\pstree@savedshortput\ignorespaces +\pstree@outer +% +\define@boolkey[psset]{pst-tree}[ps]{showbbox}[true]{} +\psset[pst-tree]{showbbox=false} +% +\def\pstree@showbbox{% +\setbox\pstree@box=\hbox{% +\psframe[linewidth=0,linecolor=black,linestyle=solid,fillstyle=none]% +(-\pst@dima,-\pst@dimd)(\pst@dimb,\pst@dimc)% +\box\pstree@box}}% +% +\define@key[psset]{pst-tree}{edge}[\ncline]{% + \def\psedge{#1}% + \ifx\psedge\@none\def\psedge##1##2{}\fi} +\psset[pst-tree]{edge=\ncline} +% +\def\pspred{T} +\def\pstree@makenodebox{% +\pst@@killglue +\let\pst@thispsbox\pstree@outer +\pst@makebox} +\def\begin@treenode{% +\pst@@killglue +\begingroup +\use@par +\global\let\pstree@edge\psedge +\xdef\pssucc{\pspred-\the\psnodecnt}} +\def\MakeShortTnput#1{% +\def\end@treenode{\@ifnextchar#1{\tnput@}{\end@@treenode}}} +\MakeShortTnput{~} +\def\end@@treenode{% +\pstree@bboxadjust +\gdef\pstree@bboxadjust{}% +\ifpsshowbbox\pstree@showbbox\fi +\pstree@node +\endgroup +\ifnum\pstreelevel>\z@ +\pstree@edge{\pspred}{\pssucc}% +\expandafter\pst@shortput +\else +\expandafter\ignorespaces +\fi} +\def\pstree@bboxadjust{} +\def\pstree@setbboxadjust#1#2{% +\pssetlength\pst@dimg{#1}% +\xdef\pstree@bboxadjust{% +\pstree@bboxadjust +#2\number\pst@dimg sp\relax}} +% +\define@key[psset]{pst-tree}{bbl}{\pstree@setbboxadjust{#1}{\pst@dima=}} +\define@key[psset]{pst-tree}{bbr}{\pstree@setbboxadjust{#1}{\pst@dimb=}} +\define@key[psset]{pst-tree}{bbh}{\pstree@setbboxadjust{#1}{\pst@dimc=}} +\define@key[psset]{pst-tree}{bbd}{\pstree@setbboxadjust{#1}{\pst@dimd=}} +\define@key[psset]{pst-tree}{xbbl}{\pstree@setbboxadjust{#1}{\advance\pst@dima}} +\define@key[psset]{pst-tree}{xbbr}{\pstree@setbboxadjust{#1}{\advance\pst@dimb}} +\define@key[psset]{pst-tree}{xbbh}{\pstree@setbboxadjust{#1}{\advance\pst@dimc}} +\define@key[psset]{pst-tree}{xbbd}{\pstree@setbboxadjust{#1}{\advance\pst@dimd}} +% +\let\pstree@treebboxadjust\relax +\def\Tn{\def\pst@par{}\pst@object{Tn}} +\def\Tn@i{% +\pst@@killglue +\global\let\pssucc\pspred +\begingroup +\pst@dima=\z@ +\pst@dimb=\z@ +\pst@dimc=\z@ +\pst@dimd=\z@ +\setbox\pstree@box=\hbox{}%% +\pstree@node +\endgroup +\ignorespaces} +\def\Tp{\def\pst@par{}\pst@object{Tp}} +\def\Tp@i{% +\begin@treenode +\pst@dima=\z@ +\pst@dimb=\z@ +\pst@dimc=\z@ +\pst@dimd=\z@ +\setbox\pstree@box=\hbox{% +\pst@newnode{\pssucc}{10}{0 0 }{\tx@InitPnode}}% +\end@treenode} +\def\Tc{\def\pst@par{}\pst@object{Tc}} +\def\Tc@i#1{% +\begin@treenode +\pssetlength\pst@dima{#1}% +\pst@dimb=\pst@dima +\pst@dimc=\pst@dima +\pst@dimd=\pst@dima +\nodealignfalse +\setbox\pstree@box=\hbox{\cnode@ii(\z@,\z@){#1}{\pssucc}}% +\end@treenode} +\def\TC{\def\pst@par{}\pst@object{TC}} +\def\TC@i{\Tc@i{\psk@radius}} +\def\Toval{\def\pst@par{}\pst@object{Toval}} +\def\Toval@i{\pstree@makenodebox{\Toval@ii\ovalnode@ii}} +\def\Toval@ii#1{% + \begin@treenode + \nodealigntrue + \setbox\pstree@box=\hbox{#1\pssucc}% + \pst@dima=\wd\pstree@box + \divide\pst@dima 2 + \pst@dimb=\pst@dima + \pst@dimc=\ht\pstree@box + \pst@dimd=\dp\pstree@box + \setbox\pstree@box=\hbox to\z@{\hss\unhbox\pstree@box\hss}% + \dp\pstree@box=\z@ + \ht\pstree@box=\z@ + \end@treenode% +} +% +\def\Tcircle{\def\pst@par{}\pst@object{Tcircle}} +\def\Tcircle@i{\pstree@makenodebox{\Toval@ii\circlenode@ii}} +% DG/SR modification begin - Mar. 7, 2003 - Patch 6 +\def\TCircle{\pst@object{TCircle}} +\def\TCircle@i{\pst@@killglue\pst@makebox{\Toval@ii\Circlenode@ii}} +% DG/SR modification end +% +\def\Tf{\def\pst@par{}\pst@object{Tf}} +\def\Tf@i{\Toval@ii{\fnode@ii()}} +\def\Tdia{\def\pst@par{}\pst@object{Tdia}} +\def\Tdia@i{\pstree@makenodebox{\Toval@ii\dianode@ii}} +\def\Ttri{\def\pst@par{}\pst@object{Ttri}} +\def\Ttri@i{\pstree@makenodebox{\Ttri@ii}} +\def\Ttri@ii{% + \begin@treenode + \nodealigntrue + \setbox\pstree@box=\hbox{\trinode@ii\pssucc}% + \pst@dima=\pst@dimg % Set by \pst@triboxsep + \pst@dimb=\wd\pstree@box + \advance\pst@dimb-\pst@dima + \pst@dimc=\ht\pstree@box + \pst@dimd=\dp\pstree@box + \setbox\pstree@box=\hbox to\z@{\hss\unhbox\pstree@box\hss}% + \dp\pstree@box=\z@ + \ht\pstree@box=\z@ + \end@treenode% +} +\def\Tr{\def\pst@par{}\pst@object{Tr}} +% SR modification begin - Oct. 27, 1996 +%\def\Tr@i{\pstree@makenodebox{\Tr@ii{\begingroup\rnode@ii}}} +\def\Tr@i{\pstree@makenodebox{\Tr@ii{\rnode@iii\rnode@iv}}} +% SR modification end +\def\Tr@ii#1{% + \begin@treenode + \def\pstree@nodehook{% + \xdef\pstree@next{\pst@dima=\number\pst@dima sp\relax}}% + \nodealigntrue + \setbox\pstree@box\hbox{#1\pssucc}% + \pstree@next + \pst@dimb=\wd\pstree@box + \advance\pst@dimb-\pst@dima + \pst@dimc=\ht\pstree@box + \pst@dimd=\dp\pstree@box + \setbox\pstree@box\hbox to\z@{\kern-\pst@dima\unhbox\pstree@box\hss}% + \ht\pstree@box=\z@ + \dp\pstree@box=\z@ + \end@treenode} +% +\def\TR{\def\pst@par{}\pst@object{TR}} +% DG modification begin - Oct. 25, 1996 +%\def\TR@i{\pstree@makenodebox{\Tr@ii{\Rnode@ii}}} +\def\TR@i{\pstree@makenodebox{\Tr@ii{\rnode@iii\Rnode@ii}}} +% DG modification end +\def\Tdot{\def\pst@par{}\pst@object{Tdot}} +\def\Tdot@i{% +\begin@treenode +\def\pstree@nodehook{\xdef\pstree@next{% +\pst@dima=\number\pst@dima sp\relax +\pst@dimc=\number\pst@dimb sp\relax}}% +\nodealignfalse +\setbox\pstree@box=\hbox{\dotnode@ii(\z@,\z@)\pssucc}% +\pstree@next +\pst@dimb=\pst@dima +\pst@dimd=\pst@dimc +\end@treenode} +% +\define@key[psset]{pst-tree}{fansize}[1cm]{\pst@@getlength{#1}\psk@fansize} +\psset[pst-tree]{fansize=1cm} +% +\def\Tfan{\def\pst@par{}\pst@object{Tfan}} +\def\Tfan@i{% +\addto@par{edge=none}% +\begin@treenode +\solid@star +\pst@dimb=\psk@fansize +\pst@dimd=\pslinewidth +\advance\pst@dimb-\pst@dimd +\divide\pst@dimb 2 +\divide\pst@dimd 2 +\ifodd\psk@treemode\relax +\pst@dima=\pst@dimd +\pst@dimc=\pst@dimb +\else +\pst@dima=\pst@dimb +\pst@dimc=\pst@dimd +\fi +\setbox\pstree@box=\hbox{% +\pst@newnode{\pssucc}{16}{}{% +/Y 0 def +/X 0 def +/l \pst@number\pst@dima def +/r l def +/u \pst@number\pst@dimc def +/d u def +/NodePos { \tx@GetRnodePos } def}% +\def\pst@linetype{1}% +\nc@object{Closed}{\pspred}{\pssucc}{.5}{% +tx@Dict begin \psline@iii pop end +/w \pst@number\pst@dimb CLW 2 div sub def +/m \ifodd\psk@treemode false \else true \fi def +\tx@Tfan}}% +\pst@dimb=\pst@dima +\pst@dimd=\pst@dimc +\end@treenode} +\define@key[psset]{pst-tree}{tnsep}[{}]{% + \def\pst@tempg{#1}% + \ifx\pst@tempg\@empty + \def\psk@tnsep{\number\pslabelsep sp}% + \else + \pst@@getlength{#1}\psk@tnsep +\fi} +\psset[pst-tree]{tnsep={}} +% +\define@key[psset]{pst-tree}{tnyref}[{}]{\def\psk@tnyref{#1}}% +\psset[pst-tree]{tnyref={}} +% +\define@key[psset]{pst-tree}{tnheight}[\ht\strutbox]{\edef\psk@tnheight{#1}} +\psset[pst-tree]{tnheight=\ht\strutbox} +% +\define@key[psset]{pst-tree}{tndepth}[\dp\strutbox]{\edef\psk@tndepth{#1}} +\psset[pst-tree]{tndepth=\dp\strutbox} +% +\define@key[psset]{pst-tree}{tnpos}[{}]{% + \def\pst@tempg{#1}% + \ifx\pst@tempg\@empty + \def\psk@tnpos{% + \ifcase\psk@treemode b\or r\or a\or l\fi}% + \else + \@ifundefined{pstree@tnput@#1}% + {\@pstrickserr{Bad tnpos: `#1'}\@ehpa}% + {\edef\psk@tnpos{#1}}% + \fi} +\psset[pst-tree]{tnpos={}} +% +\def\tnput@#1{\def\pst@par{}\pst@object{tnput}} +\def\tnput@i{\pstree@makenodebox{\tnput@ii}} +\def\tnput@ii{% +\begingroup +\use@par +\xdef\treenext{% +\if@star\noexpand\pst@starbox\fi +\noexpand\def\noexpand\psk@thistndepth{\psk@tndepth}% +\noexpand\def\noexpand\psk@thistnheight{\psk@tnheight}% +\noexpand\def\noexpand\psk@thistnyref{\psk@tnyref}% +\noexpand\def\noexpand\psk@thistnsep{\psk@tnsep}% +\expandafter\noexpand\csname pstree@tnput@\psk@tnpos\endcsname}% +\endgroup +\treenext +\end@treenode} +\@namedef{pstree@tnput@b}{% +\pstree@tnput@@v\pst@dimd\ht\dp\lower\psk@thistnheight} +\@namedef{pstree@tnput@a}{% +\pstree@tnput@@v\pst@dimc\dp\ht\raise\psk@thistndepth} +\def\pstree@tnput@@v#1#2#3#4#5{% +\pst@dimh=\wd\pst@hbox +\pst@dimg=\psk@href\pst@dimh +\advance\pst@dimg\pst@dimh +\divide\pst@dimg 2 +\advance\pst@dimh-\pst@dimg +\ifdim\pst@dimg>\pst@dima +\pst@dima=\pst@dimg +\fi +\ifdim\pst@dimh>\pst@dimb +\pst@dimb=\pst@dimh +\fi +\pst@dimh=\psk@thistnsep\relax +\ifdim\pst@dimh<\z@ +\pst@dimh=-\pst@dimh +\else +\advance\pst@dimh#1% +\fi +\pssetlength\dimen@{#5}% +\ifdim\dimen@>#2\pst@hbox +\advance\pst@dimh\dimen@\relax +\else +\advance\pst@dimh#2\pst@hbox +\fi +\setbox\pstree@box=\hbox{% +\box\pstree@box +#4\pst@dimh\hbox to\z@{\kern-\pst@dimg\unhbox\pst@hbox\hss}}% +#1=#3\pstree@box +\dp\pstree@box=\z@ +\ht\pstree@box=\z@} +\@namedef{pstree@tnput@l}{% +\pstree@tnput@@h\pst@dima{% +\hss +\lower\pst@dimg\box\pst@hbox +\kern\pst@dimh +\box\pstree@box}} +\@namedef{pstree@tnput@r}{% +\pstree@tnput@@h\pst@dimb{% +\box\pstree@box +\kern\pst@dimh +\lower\pst@dimg\box\pst@hbox +\hss}}% +\def\pstree@tnput@@h#1#2{% +\ifx\psk@thistnyref\@empty +\pssetlength\pst@dimg\psk@vref +\else +\pst@dimg=\ht\pst@hbox +\advance\pst@dimg\dp\pst@hbox +\pst@dimg=\psk@thistnyref\pst@dimg +\advance\pst@dimg-\dp\pst@hbox +\fi +\pst@dimh=\psk@thistnsep\relax +\ifdim\pst@dimh<\z@ +\pst@dimh=-\pst@dimh +\else +\advance\pst@dimh#1% +\fi +#1=\pst@dimh +\advance#1\wd\pst@hbox +\setbox\pstree@box=\hbox to\z@{#2}% +\ifdim\ht\pstree@box>\pst@dimc +\pst@dimc=\ht\pstree@box +\fi +\ifdim\dp\pstree@box>\pst@dimd +\pst@dimd=\dp\pstree@box +\fi +\dp\pstree@box=\z@ +\ht\pstree@box=\z@} +\newif\if@skiplevel +\def\skiplevel{\def\pst@par{}\pst@object{skiplevel}} +\def\skiplevel@i{\def\pstree@makebox{\pst@@makebox}\skiplevel@ii} +\def\skiplevel@ii{% +\pst@@killglue +\begingroup +\let\pssucc\pspred +\def\pst@tempa{0}% +\def\pst@tempb{0}% +\def\pst@tempc{0}% +\def\pst@tempd{0}% +\setbox\pstree@rootbox=\hbox{}% +\pstree@savevalues +\begingroup +\pstree@initsuccvalues +\pstree@setlevelpar +\@skipleveltrue +\pstree@do} +% DG/SR modification begin - Aug. 31, 1999 - Patch 4 +%\def\pstree@gettop#1{\expandafter\pstree@@gettop#1\@nil} +%\def\pstree@@gettop#1,#2\@nil{#1} +% DG/SR modification end +\def\skiplevel@horizontal{% +% 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 +% 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} +\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 +% 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} +\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} + +\catcode`\@=\TheAtCode\relax + +\endinput +%% +%% END: pst-tree.tex diff --git a/Master/texmf-dist/tex/latex/pst-tree/pst-tree.sty b/Master/texmf-dist/tex/latex/pst-tree/pst-tree.sty new file mode 100644 index 00000000000..6da25a30052 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pst-tree/pst-tree.sty @@ -0,0 +1,6 @@ +\RequirePackage{pstricks} +\ProvidesPackage{pst-tree}[2009/01/25 package wrapper for pst-tree.tex] +\input{pst-tree.tex} +\ProvidesFile{pst-tree.tex} + [\filedate\space \fileversion\space `pst-tree' (tvz,hv)] +\endinput diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index fa0b9619a45..0f221a373f3 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -186,7 +186,7 @@ my @WorkingTLP = qw( pst-lens pst-light3d pst-math pst-ob3d pst-optexp pst-optic pst-osci pst-pad pst-pdf pst-pdgr pst-qtree pst-sigsys pst-solides3d pst-soroban pst-spectra - pst-slpe pst-stru pst-text pst-uml pst-vue3d + pst-slpe pst-stru pst-text pst-tree pst-uml pst-vue3d pst2pdf pstool pstricks pstricks-add psu-thesis ptptex pxfonts qcm qobitree qstest qtree quotmark diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index dca66e3535c..170c50eedea 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -421,6 +421,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw 'pst-spectra', "&MAKEpst", 'pst-stru', "&MAKEpst", 'pst-text', "&MAKEpst", + 'pst-tree', "&MAKEpst", 'pst-uml', "&MAKEpst", 'pst-vue3d', "&MAKEpst", 'pstricks', "&MAKEpstricks", diff --git a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc index 3ff3739b927..6c6bad75fc6 100644 --- a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc @@ -51,6 +51,7 @@ depend pst-stru depend pst-solides3d depend pst-soroban depend pst-text +depend pst-tree depend pst-uml depend pst-vue3d depend pst2pdf diff --git a/Master/tlpkg/tlpsrc/pst-tree.tlpsrc b/Master/tlpkg/tlpsrc/pst-tree.tlpsrc new file mode 100644 index 00000000000..b6fc45cd144 --- /dev/null +++ b/Master/tlpkg/tlpsrc/pst-tree.tlpsrc @@ -0,0 +1,2 @@ +name pst-tree +category Package -- cgit v1.2.3