diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/Changes | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/README | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/index.phtml | 61 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.bib | 60 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf | bin | 0 -> 416702 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex | 942 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pst-node/pst-node.pro | 573 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/pst-node/Makefile | 81 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-node/pst-node.tex | 1745 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-node/pst-node.sty | 10 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 2 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/pst-node.tlpsrc | 0 |
14 files changed, 3505 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-node/Changes b/Master/texmf-dist/doc/generic/pst-node/Changes new file mode 100644 index 00000000000..7013b2d5897 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/Changes @@ -0,0 +1,15 @@ +----- pst-node.tex +1.10 2010-01-22 - first version with pst-xkey and an own + documentation (hv) +1.02 2009-12-09 - fixed bug with \hskip and fnode in psmatrix + which now uses \pshspace#1 for \hskip +1.01 2008-11-26 - bugfix for \fnode +1.00 2007-08-18 - new option pcRef for the first node (hv) + - new option Circle for psmatrix (hv) + - fix bug with pst-node and \\[name=...]. It now uses + \ps@ifnextchar for scanning the next token (defined + in pstricks.tex) + +----- pst-node.sty + 2008-12-12 first version (hv) + diff --git a/Master/texmf-dist/doc/generic/pst-node/README b/Master/texmf-dist/doc/generic/pst-node/README new file mode 100644 index 00000000000..621345ddfeb --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/README @@ -0,0 +1,15 @@ +This version of pst-node uses the xkeyval package, the extended +version of keyval. + +Save the files pst-node.sty|.tex|.pro in a directory, which is part of your +local TeX node. Then do not forget to run texhash to update this node +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-node 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-node/index.phtml b/Master/texmf-dist/doc/generic/pst-node/index.phtml new file mode 100644 index 00000000000..3c72dd01044 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/index.phtml @@ -0,0 +1,61 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head> +<html> +<head> + <title>The PSTricks web page (Herbert Voß)</title> +</head> +<body bgcolor="#ffffff" text="#000000" link="#aa0000" alink="#ff3300" vlink="#330099"> + <hr noshade="noshade"> + <h1>pstricks by Timothy Van Zandt, Denis Girou and Herbert Voß</h1> + <h4>All the files have a <strong>Beta-Status</strong>! For a stable + version look at <a href="http://mirror.ctan.org/graphics/pstricks/contrib/pst-node">here</a></h4> + + <hr noshade="noshade"> + <div class=text> +<? +$cdir = dir("./"); + +$entries=array(); +while ($entry = $cdir->read()) + $entries[] = $entry; + +echo "Files in this directory:"; +echo " <hr noshade=\"noshade\">"; +echo "<table>"; + +asort($entries); +reset($entries); + +//foreach($entries as $entry) { +while (list(, $entry) = each($entries)) { +// if (!is_dir($entry) && ($entry != "index.phtml") && ($entry != ".htaccess")) { + if (($entry != ".") && ($entry != "index.phtml") && ($entry != ".htaccess")) { + echo "<tr>"; + echo "<td><a href=\"$entry\">$entry</a></td>"; + if (is_dir($entry)) + echo "<td><Dir></td>"; + else + echo "<td></td>"; + echo "<td align=\"right\"> ".filesize($entry)." Byte </td>"; + echo "<td align=\"right\"> ".date("D, j F Y, H:i:s",filemtime($entry))." </td>"; + echo "</tr>"; + } +} +echo "</table>"; + +?> +<hr noshade="noshade"> +Page last updated on <?php echo date("d.m.Y", getlastmod() ); ?> +</p> +</div> +<hr> +<? +if (file_exists("README")) { + $fp = fopen("README","r"); + while ($line=fgets($fp,1000)) { + echo "$line<br>"; + } + fclose($fp); +} +?> +</body> +</html> diff --git a/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.bib b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.bib new file mode 100644 index 00000000000..ba07f2211ce --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/pst-node-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-node/pst-node-doc.pdf b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf Binary files differnew file mode 100644 index 00000000000..6c2be6391a7 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex new file mode 100644 index 00000000000..71e00c1f319 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex @@ -0,0 +1,942 @@ +%% $Id: pst-node-doc.tex 263 2010-01-22 11:13:25Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside]{pst-doc} +\listfiles + +\usepackage[utf8]{inputenc} +\usepackage{pst-plot} +\usepackage{pst-node} +\let\pstFV\fileversion +\let\belowcaptionskip\abovecaptionskip +% +\newcommand\xstrut{\vphantom{\tabular{c}Üg\\Üg\endtabular}} +\newcommand\psBox[3][white]{\rput(#2){\rnode{#2}{% + \psframebox[fillcolor=#1]{\xstrut\makebox[3.2cm]{\tabular{c}#3\endtabular}}}}} +\def\bgImage{% +\psscalebox{0.85}{% +\begin{pspicture}(-1,-1)(21,7) +\psset{framearc=0.2,shadow=true,fillstyle=solid,shadowcolor=black!55} +\psBox[blue!30]{7,6}{politische\\Kommunikation} +\psBox[red!30]{3,4}{interpersonale\\Kommunikation} + \psBox[red!30]{13,4}{massenmediale\\Kommunikation} +\psBox[green!30]{1,2}{starke\\Beziehung} + \psBox[green!30]{5,2}{schwache\\Beziehung} + \psBox[green!30]{9,2}{Fernsehen} + \psBox[green!30]{17,2}{Zeitungen} +\psBox[cyan!30]{7,0}{öffentlich-rechtl.\\Fernsehen} + \psBox[cyan!30]{11,0}{privates\\Fernsehen} + \psBox[cyan!30]{15,0}{Boulevard-\\Zeitungen} + \psBox[cyan!30]{19,0}{Abonnement-\\Zeitungen} +\end{pspicture} +\psset{shadow=false,angleA=-90,angleB=90,linewidth=2pt} +\ncangles{7,6}{3,4}\ncangles{7,6}{13,4} +\ncangles{3,4}{1,2}\ncangles{3,4}{5,2} +\ncangles{13,4}{9,2}\ncangles{13,4}{17,2} +\ncangles{9,2}{7,0}\ncangles{9,2}{11,0} +\ncangles{17,2}{15,0}\ncangles{17,2}{19,0}} +} + +\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}} + +\begin{document} +\title{\texttt{pst-node}\\Nodes and node connections% +\\\small v.\pstFV} +\docauthor{Michael Sharpe\\Herbert Vo\ss} +\author{Timothy Van Zandt\\Michael Sharpe\\Herbert Vo\ss} +\date{\today} + +\maketitle + +\begin{abstract} +This version of \LPack{pst-node} uses the extended keyval handling +of pst-xkey and has a lot of the macros which were recently in +the package \LPack{pstricks-add}. This documentation describes in the first part +the basic node commands and connection from the old PSTricks documentation. +The second part describes only the +new and changed stuff. . + +\vfill +\noindent +Thanks to: Denis Girou; Rolf Niepraschk; Sebastian Rahtz; +\end{abstract} + +\clearpage +\tableofcontents + +\clearpage +\part{Basic commands, connections and labels} + +\clearpage +\setcounter{page}{31} +\part{New commands} +%-------------------------------------------------------------------------------------- +\section{Relative nodes with \nxLcs{psGetNodeCenter}} +%-------------------------------------------------------------------------------------- + +\begin{BDef} +\Lcs{psGetNodeCenter}\Largb{node name}\\ +%\Lcs{psGetNodeEdgeA}\Largb{node type}\Largb{node name} +\end{BDef} + +This command makes sense only at +the PostScript level. It defines the two variables \Larg{node.x} +and \Larg{node.y} which can be used to define relative nodes. The +following example defines the node \verb+MyNode+ and a second one +relative to the first one, with 4 units left and 4 units up. +\Larg{node} must be an existing node name. + +\begin{LTXexample}[width=5cm] +\begin{pspicture}[showgrid=true,arrowscale=2](5,5) +\pnode(4.5,0.5){MyNode} +\psdot(MyNode) +\pnode(! \psGetNodeCenter{MyNode} + MyNode.x 4 sub MyNode.y 4 add){MySecondNode} +\psdot(MySecondNode) +\ncline[linecolor=red]{<->}{MyNode}{MySecondNode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm] +\begin{pspicture}[showgrid=true](5,5) +\rput(1.5,0.5){\trinode{CN}{NodeA}} +\rput(3.5,2.5){\trinode{EN}{NodeB}} +\pnode(! \psGetNodeCenter{CN} + CN.x 2 add CN.y 1 add ){MyCNode} +\ncline[linecolor=red]{<->}{MyCNode}{EN} +\ncline[linecolor=blue]{<->}{CN}{EN} +\end{pspicture} +\end{LTXexample} + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{ncdiag} and \nxLcs{pcdiag}} +%-------------------------------------------------------------------------------------- +With the new option \Lkeyword{lineAngle} the lines drawn by the \Lcs{ncdiag} macro +can now have a specified gradient. Without this option one has to define the two +arms (which maybe zero) and PSTricks draws the connection between them. Now there +is only a static \Lkeyword{armA}, the second one \Lkeyword{armB} is calculated when an angle +\Lkeyword{lineAngle} is defined. This angle is the gradient of the intermediate line +between the two arms. The syntax of \Lcs{ncdiag} is + +\begin{BDef} +\Lcs{ncdiag}\OptArgs\Largb{node A}\Largb{node B}\\ +\Lcs{pcdiag}\OptArgs\Largs{node A}\Largs{node B} +\end{BDef} + + +\begin{tabularx}{\linewidth}{l|X} +name & meaning\\\hline +\Lkeyword{lineAngle} & angle of the intermediate line segment. Default is 0, which is the same +than using \Lcs{ncdiag} without the \Lkeyword{lineAngle} option.\tabularnewline +\end{tabularx} + + +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,6) + \circlenode{A}{A}\quad\circlenode{C}{C}% + \quad\circlenode{E}{E} + \rput(0,4){\circlenode{B}{B}} + \rput(1,5){\circlenode{D}{D}} + \rput(2,6){\circlenode{F}{F}} + \psset{arrowscale=2,linearc=0.2,% + linecolor=red,armA=0.5, angleA=90,angleB=-90} + \ncdiag[lineAngle=20]{->}{A}{B} + \ncput*[nrot=:U]{line I} + \ncdiag[lineAngle=20]{->}{C}{D} + \ncput*[nrot=:U]{line II} + \ncdiag[lineAngle=20]{->}{E}{F} + \ncput*[nrot=:U]{line III} +\end{pspicture} +\end{LTXexample} + + +The \Lcs{ncdiag} macro sets the \Lkeyword{armB} dynamically to the calculated value. Any +user setting of \Lkeyword{armB} is overwritten by the macro. The \Lkeyword{armA} could be set to +a zero length: + + +\begin{LTXexample}[width=4.5cm] +\begin{pspicture}(4,3) + \rput(0.5,0.5){\circlenode{A}{A}} + \rput(3.5,3){\circlenode{B}{B}} + {\psset{linecolor=red,arrows=<-,arrowscale=2} + \ncdiag[lineAngle=60,% + armA=0,angleA=0,angleB=180]{A}{B} + \ncdiag[lineAngle=60,% + armA=0,angleA=90,angleB=180]{A}{B}} +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[width=4.5cm] +\begin{pspicture}(4,3) + \rput(1,0.5){\circlenode{A}{A}} + \rput(4,3){\circlenode{B}{B}} + {\psset{linecolor=red,arrows=<-,arrowscale=2} + \ncdiag[lineAngle=60, + armA=0.5,angleA=0,angleB=180]{A}{B} + \ncdiag[lineAngle=60, + armA=0,angleA=70,angleB=180]{A}{B} + \ncdiag[lineAngle=60, + armA=0.5,angleA=180,angleB=180]{A}{B}} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=4.5cm] +\begin{pspicture}(4,5.5) + \cnode*(0,0){2pt}{A} \cnode*(0.25,0){2pt}{C} + \cnode*(0.5,0){2pt}{E}\cnode*(0.75,0){2pt}{G} + \cnode*(2,4){2pt}{B} \cnode*(2.5,4.5){2pt}{D} + \cnode*(3,5){2pt}{F} \cnode*(3.5,5.5){2pt}{H} + {\psset{arrowscale=2,linearc=0.2, + linecolor=red,armA=0.5, angleA=90,angleB=-90} + \pcdiag[lineAngle=20]{->}(A)(B) + \pcdiag[lineAngle=20]{->}(C)(D) + \pcdiag[lineAngle=20]{->}(E)(F) + \pcdiag[lineAngle=20]{->}(G)(H)} +\end{pspicture} +\end{LTXexample} + + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{ncdiagg} and \nxLcs{pcdiagg}} +%-------------------------------------------------------------------------------------- +This is nearly the same as \Lcs{ncdiag} except that +\Lkeyword{armB}=0 and the \Lkeyword{angleB} value is computed by the +macro, so that the line ends at the node with an angle like a +\Lcs{pcdiagg} line. The syntax of \Lcs{ncdiagg}/\Lcs{pcdiagg} +is + +\begin{BDef} +\Lcs{ncdiag}\OptArgs\Largb{node A}\Largb{node B}\\ +\Lcs{pcdiag}\OptArgs\Largs{node A}\Largs{node B} +\end{BDef} + +\begin{LTXexample}[width=5cm] +\begin{pspicture}(4,6) + \psset{linecolor=black} + \circlenode{A}{A}\quad\circlenode{C}{C}\quad% + \circlenode{E}{E} + \rput(0,4){\circlenode{B}{B}} + \rput(1,5){\circlenode{D}{D}} + \rput(2,6){\circlenode{F}{F}} + {\psset{arrowscale=2,linearc=0.2, + linecolor=red,armA=0.5, angleA=90} + \ncdiagg[lineAngle=-160]{->}{A}{B} + \ncput*[nrot=:U]{line I} + \ncdiagg[lineAngle=-160]{->}{C}{D} + \ncput*[nrot=:U]{line II} + \ncdiagg[lineAngle=-160]{->}{E}{F} + \ncput*[nrot=:U]{line III}} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm] +\begin{pspicture}(4,6) + \psset{linecolor=black} + \cnode*(0,0){2pt}{A} \cnode*(0.25,0){2pt}{C} + \cnode*(0.5,0){2pt}{E}\cnode*(0.75,0){2pt}{G} + \cnode*(2,4){2pt}{B} \cnode*(2.5,4.5){2pt}{D} + \cnode*(3,5){2pt}{F} \cnode*(3.5,5.5){2pt}{H} + {\psset{arrowscale=2,linearc=0.2, + linecolor=red,armA=0.5, angleA=90} + \pcdiagg[lineAngle=20]{->}(A)(B) + \pcdiagg[lineAngle=20]{->}(C)(D) + \pcdiagg[lineAngle=20]{->}(E)(F) + \pcdiagg[lineAngle=20]{->}(G)(H)} +\end{pspicture} +\end{LTXexample} + +The only catch for \Lcs{ncdiagg} is that you need the right +value for \Lkeyword{lineAngle}. If the node connection is on the wrong +side of the second node, then choose the corresponding angle, +e.\,g.: if $20$ is wrong then take $-160$, which differs by $180$. + + +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,1.5) + \circlenode{a}{A} + \rput[l](3,1){\rnode{b}{H}} + \ncdiagg[lineAngle=60,angleA=180,armA=.5,nodesepA=3pt,linecolor=blue]{b}{a} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,1.5) + \circlenode{a}{A} + \rput[l](3,1){\rnode{b}{H}} + \ncdiagg[lineAngle=60,armA=.5,nodesepB=3pt,linecolor=blue]{a}{b} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,1.5) + \circlenode{a}{A} + \rput[l](3,1){\rnode{b}{H}} + \ncdiagg[lineAngle=-120,armA=.5,nodesepB=3pt,linecolor=blue]{a}{b} +\end{pspicture} +\end{LTXexample} + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{ncbarr}} +%-------------------------------------------------------------------------------------- +This has the same behaviour as \Lcs{ncbar}, but has 5 segments +and all are horizontal ones. This is the reason why \Lkeyword{angleA} +must be $0$ or alternatively $180$. All other values are set to +$0$ by the macro. The intermediate horizontal line is symmetrical +to the distance of the two nodes. + +\begin{BDef} +\Lcs{ncbarr}\OptArgs\Largb{node A}\Largb{node B}\\ +\end{BDef} + +\begin{LTXexample}[width=3.5cm] +\psset{arrowscale=2}% +\circlenode{X}{X}\\[1cm] +\circlenode{Y}{Y} +\ncbarr[angleA=0,arrows=->,arrowscale=2]{X}{Y} +\end{LTXexample} + +\begin{LTXexample}[width=3.5cm] +\psset{arrowscale=2}% +\ovalnode{X}{Xxxxx}\\[1cm] +\circlenode{Y}{Yyyy} +\ncbarr[angleA=180,arrows=->,arrowscale=2,linecolor=red]{X}{Y} +\end{LTXexample} + +\begin{LTXexample}[width=3.5cm] +\psset{arrowscale=2}% +\ovalnode{X}{Xxxxx}\\[1cm] +\circlenode{Y}{Yyyy} +\ncbarr[angleA=20,arm=1cm,arrows=->,arrowscale=2]{X}{Y} +\end{LTXexample} + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{psLNode} and \nxLcs{psLCNode}} +%-------------------------------------------------------------------------------------- +\Lcs{psLNode} interpolates the Line $\overline{AB}$ by the given value and sets a node at this +point. The syntax is +% +\begin{BDef} +\Lcs{psLNode}\Largs{P1}\Largs{P2}\Largb{value}\Largb{node name}\\ +\Lcs{psLCNode}\Largs{P1}\Largb{value 1}\Largs{P2}\Largb{value 2}\Largb{node name} +\end{BDef} + +\begin{LTXexample}[width=5cm] +\begin{pspicture}(5,5) +\psgrid[subgriddiv=0,griddots=10] +\psset{linecolor=red} +\psline{o-o}(1,1)(5,5) +\psLNode(1,1)(5,5){0.75}{PI} +\qdisk(PI){4pt} +\psset{linecolor=blue} +\psline{o-o}(4,3)(2,5) +\psLNode(4,3)(2,5){-0.5}{PII} +\qdisk(PII){4pt} +\end{pspicture} +\end{LTXexample} + + +\bigskip +The \Lcs{psLCNode} macro builds the linear combination of the two given +vectors and stores the end of +the new vector as a node. All vectors start at $(0,0)$, so a \Lcs{rput} maybe +appropriate. The syntax is + + +\begin{LTXexample}[width=5cm] +\begin{pspicture}[showgrid=true](5,3) +\psset{linecolor=black} +\psline[linestyle=dashed]{->}(3,1.5) +\psline[linestyle=dashed]{->}(0.375,1.5) +\psset{linecolor=red} +\psline{->}(2,1)\psline{->}(0.5,2) +\psLCNode(2,1){1.5}(0.5,2){0.75}{PI} +\psline[linewidth=2pt]{->}(PI) +\psset{linecolor=black} +\psline[linestyle=dashed](3,1.5)(PI) +\psline[linestyle=dashed](0.375,1.5)(PI) +\end{pspicture} +\end{LTXexample} + + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{nlput} and \nxLcs{psLDNode}} +%-------------------------------------------------------------------------------------- +\Lcs{ncput} allows you to set a label relative to the first node +of the last node connection. With \Lcs{nlput} this can be done +absolute to a given node. The syntax is different to the other +node connection macros. It uses internally the macro +\Lcs{psLDNode} which places a node absolute to two given points, +starting from the first one. + +\begin{BDef} +\Lcs{nlput}\OptArgs\Largs{A}\Largs{B}\Largb{distance}\Largb{text}\\ +\Lcs{psLDNode}\OptArgs\Largs{A}\Largs{B}\Largb{distance}\Largb{node name} +\end{BDef} + + +\begin{LTXexample}[width=5cm] +\begin{pspicture}(5,2) +\pnode(0,0){A} +\pnode(5,2){B} +\ncline{A}{B} +\psLDNode(A)(B){1.5cm}{KN}\qdisk(KN){2pt} +\nlput[nrot=:U](A)(B){1cm}{Test} +\nlput[nrot=:D](A)(B){2cm}{Test} +\nlput[nrot=:U](A)(B){3cm}{Test} +\nlput(A)(B){4cm}{Test} +\end{pspicture} +\end{LTXexample} + +\section{Extensions} +\subsection{Quick overview} +All macros in this section are connected in one way or other with the +construction or deployment of +one or more nodes of type \Lcs{pnode}, which is to say in effect, +named points. For the remainder of this section, node always means \Lcs{pnode}. +Nodes are one of +the most powerful features of pstricks---the ``trickiest tricks'' in the words of +its originator. If used without appropriate caution, they can produce PostScript errors +that can be difficult to track down. For example, suppose you have defined a node \texttt{A} +by \verb|\pnode(1,1){A}|, and then, a little later, you want to move the node a bit to the +right, and you write \verb|\pnode([nodesep=.5cm]A){A}|. On processing the file you will +see an error message from ghostscript: \Lps{stackunderflow}\verb| in --exch--|. +The lesson is: you may not assign a node name if a node by that name is involved +explicitly in its definition. To reassign a node name safely, you have to write instead something like +\begin{verbatim} +\pnode([nodesep=.5cm]A){Atemp} +\pnode(Atemp){A} +\end{verbatim} +This problem afflicts a number of other node-forming macros based on a \Lcs{pnode} construction, as most are. + +Nodes are more complicated than they appear. Each node is stored not only with a recipe +for finding its coordinates, but also with the coordinate system in effect when it was +defined. Part of the retrieval process involves modifying the coordinates if necessary +so that they represent the same point on the page even if the coordinate system has +changed. This is important, but has some unexpected consequences. Normally, the simplest +way to translate an object is with \Lcs{rput}. +\begin{verbatim} +\pnode(1,1){P}% define P as (1,1) +\rput(2,3){\psdot{P}}% places dot at original P=(1,1) +\end{verbatim} +is different from +\begin{verbatim} +\rput(2,3){\pnode(1,1){P}\psdot{P}} +% places dot at (1,1)+(2,3) +\end{verbatim} +Effectively, \Lcs{rput} and \Lcs{uput} are not useful for translating previously +defined nodes, but they are useful for defining new nodes relative to fixed positions. + +The new macros in this section +are of several kinds: (i) utility macros, some used +internally by the package and some of general use; (ii) macros that manipulate one or +more nodes to produce other nodes; (iii) constructions intended to be used with nodes and +node sequences. By a node sequence is meant one or more nodes having a common root name +followed by an index---eg, P0 P1 P2 ... P5 is a node sequence with root name P. It is +easy to define such node sequences using the \Lcs{multido} macro, or using one of a +number of macros in this section. + +\subsection{Node expressions} +A number of macros in the package (eg, \Lcs{psxline}) permit the use of node expressions, +by which is meant an expression like +\begin{verbatim} +.25(1,3)+.333(2;90)-1.2([nodesep=.5cm]Q) +\end{verbatim} +which specifies a linear combination of points (the items enclosed in parentheses) +specified in any manner acceptable to \Lcs{SpecialCoor}. +%The items themselves cannot +%themselves be node expressions, as they are not acceptable to \Lcs{SpecialCoor}. + +Node expressions are handled by \Lcs{nodexn}, which calls the macros \Lcs{hasparen} and +\Lcs{parsenodexn} to do the real work. If you write code that needs to be able to handle node expressions, you use + +\begin{BDef} +\Lcs{nodexn}\Largb{expr}\Largb{nodename} +\end{BDef} + +which returns a node \verb|<nodename>| once \verb|<expr>| has been fully parsed. It is safe to +reuse a node name, as in +\begin{verbatim} +\nodexn{(P)+.5(1,2)}{P} +\end{verbatim} + +The following macros amount to special cases of node expressions. +\begin{BDef} +\Lcs{AtoB}\Largr{A}\Largr{B}\Largb{C} +\end{BDef} + defines a node by name C essentially as B-A, as vectors. It is safe to use + \Lcs{AtoB}\verb|(Q)(P){P}| and \Lcs{AtoB}\verb|(Q)(P){Q}|. + +\begin{BDef} +\Lcs{AplusB}\Largr{A}\Largr{B}\Largb{C} +\end{BDef} + defines node by name C essentially as A+B, as vectors. It is safe to use + \Lcs{AplusB}\verb|(Q)(P){P}| and \Lcs{AplusB}\verb|(Q)(P){Q}|. + +\begin{BDef} +\Lcs{midAB}\Largr{A}\Largr{B}\Largb{C} +\end{BDef} + + defines node by name C essentially as $(A+B)/2$, as vectors. It is safe to use \Lcs{midAB}\verb|(Q)(P){P}| + and \Lcs{midAB}\verb|(Q)(P){Q}|. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,2.5) +\psset{arrows=->,arrowscale=1.5} +\pnode(2,1){P}\pnode(.5,1){Q} +\AtoB(Q)(P){QP} +\AplusB(Q)(P){R} +\psline(0,0)(P)\uput[-45](P){P} +\psline(0,0)(Q)\uput[135](Q){Q} +\psline(0,0)(QP)\uput[-70](QP){QP} +\psline(0,0)(R)\uput[160](R){R} +\psline[linestyle=dashed](Q)(P) +\psline[linestyle=dashed](Q)(R) +\psline[linestyle=dashed](P)(R) +\end{pspicture} +\end{LTXexample} + + +\subsection{The main macros} +\begin{BDef} +\Lcs{normalvec}\Largr{coords}\Largb{nodename} +\end{BDef} +For example, +\begin{verbatim} +\normalvec(P){P}\normalvec(2;30){Q} +\end{verbatim} +first redefines the node {\tt P} as a node whose vector interpretation is of the same +length as the original {\tt P}, but rotated 90 degrees. The second instance has the +same effect as \Lcs{pnode}\verb|(2;120){Q}|. +\begin{BDef} +\Lcs{curvepnode}\Largb{tval}\Largb{expression in t}\Largb{nodename} +\end{BDef} + +For example, +\begin{verbatim} +\curvepnode{1}{cos(t) | sin(t)}{P} +\end{verbatim} + sets a node named {\tt P} at \verb|(cos(1), sin(1))| and a node named {\tt Ptang} + which represents a unit vector in the tangent direction to the curve at {\tt P}. + The expression in {\tt t} in this case is algebraic, which is detected automatically by the macro. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,2) +\def\exn{cos(t) | sin(t)} +\psparametricplot[algebraic]{0}{2}{\exn} +\curvepnode{1}{\exn}{P} +\psdot(P)\uput[45](P){P} +\end{pspicture} +\end{LTXexample} +\vspace{2pc} + +\begin{BDef} +\Lcs{psparnode}\Largb{t}\Largb{expression in t}\Largb{<nodename>} +\end{BDef} + is called by the command \Lcs{curvename} if the expression is PostScript, not algebraic. + +\begin{BDef} +\Lcs{algparnode}\Largb{t}\Largb{expression in t}\Largb{nodename} +\end{BDef} + is called by the command \Lcs{curvename} if the expression is algebraic, not PostScript. + +\begin{BDef} +\Lcs{curvepnodes}\Largb{tmin}\Largb{tmax}\Largb{expr. in t}\Largb{nodeRoot} +\end{BDef} + Uses current setting of plotpoints (default 50) to define a node sequence of points along the curve. Eg, +\begin{verbatim} +\curvepnodes[plotpoints=100]{0}{1}{t+t^2 | Ex(-t)}{P} +\end{verbatim} + sets nodes {\tt P0 .. P99} at equally spaced {\tt t} values along the curve, + and assigns the macro \Lcs{Pnodecount} to 99, the highest index. The expression in {\tt t} + may be either algebraic or PostScript, and is handled automatically. The values + \verb|<tmin>, <tmax>| may be expressed using PostScript---eg, \verb|{Pi neg}{PiDiv2}|. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,3) +\def\exn{t+t^2 | 2*Ex(-t)} +\psset{plotpoints=100} +\psparametricplot[algebraic]{0}{1}{\exn} +\curvepnodes{0}{1}{\exn}{P} +\psdot(P50)\uput[75](P50){P50} +\psdot(P99)\uput[75](P99){P99} +\end{pspicture} +\end{LTXexample} + + +\begin{BDef} +\Lcs{fnpnode}\Largb{xval}\Largb{expression in x}\Largb{nodename} +\end{BDef} + + sets a single node on the graph. Eg, + +\begin{verbatim} +\fnpnode{.5}{x x 1 add mul 2 div}{P} +\end{verbatim} + declares the node P at the point x=0.5 on the graph. It has the same effect as + +\begin{verbatim} +\pnode(!/x 0.5 def x x x 1 add mul 2 div}){P} +\end{verbatim} + + If your expression in {\tt t} is algebraic, you must specify the keyword {\tt algebraic}, as in + \Lcs{fnpnode}\verb|[algebraic]{0.5}{x*(x+1)/2}{P}|. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,3) +\def\exn{x x 1 add mul 2 div} +\psplot{0}{2}{\exn} +\fnpnode{0.5}{\exn}{Q} +\psdot(Q)\uput[-45](Q){Q} +\end{pspicture} +\end{LTXexample} +\vspace{2pc} + + + +\begin{BDef} +\Lcs{fnpnodes}\Largb{xmin}\Largb{xmax}\Largb{expression in x}\Largb{nodeRoot} +\end{BDef} +Is similar to \Lcs{curvenodes}, but for the graph of a function. The keyword \Lkeyword{algebraic} +must be specified if your expression is indeed algebraic. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,3) +\def\exn{x x 1 add mul 2 div} +\psplot{0}{2}{\exn} +\fnpnodes[plotpoints=10]{0}{2}{\exn}{A} +\psdot(A4)\uput[-45](A4){A4} +\end{pspicture} +\end{LTXexample} +\vspace{2pc} + + +\begin{BDef} +\Lcs{shownode}\Largr{P} +\end{BDef} +is a debugging tool, which displays in the console window the coordinates of node P. +This will not appear until the final stage of processing the PostScript file. You will +get a PostScript error if the node you specify is undefined. + +\begin{BDef} +\Lcs{getnodelist}\Largb{node root name}\Largb{next command} +\end{BDef} + is useful in writing pstricks macros, where there is a list of parenthesized coordinates + to be read and turned into a node sequence, following which \verb|<next command>| is followed. + +\begin{BDef} +\Lcs{pnodes}\Largb{P}\Largr{1,2}\Largr{2;3}\ldots +\end{BDef} +is effectively \Lcs{getnodelist}\Largb{P}\Largb{}\verb|(1,2)(2;3)...|, just a quick way to +turn a list of coordinates into a node sequence P0 P1 ... + +\begin{BDef} +\Lcs{psnline}\OptArgs\Largb{arrows}\Largr{coors}\Largb{name} +\end{BDef} + for example, expects that there are nodes named P3..P8, and gives the same result as +\begin{verbatim} +\psline[linewidth=1pt]{->}(P3)(P4)(P5)(P6)(P7)(P8) +\end{verbatim} + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(2.5,2) +\pnodes{P}(.1,.1)(1;10)(*2 {x^2/4})(0,1.4) +%defines P0..P3--now join them +\psnline[arrowscale=2]{-D>}(0,3){P} +\end{pspicture} +\end{LTXexample} +\vspace{2pc} + + +\begin{BDef} +\Lcs{psLCNodeVar}\Largr{node A}\Largr{node B}\Largr{factorA,factorB}\Largb{node name} +\end{BDef} + +is similar to \Lcs{psLCNode}, + and provides a means of forming a linear combination of two nodes, thought of as vectors. Where +\begin{verbatim} +\psLCNode(A){a}(B){b}{C} +\end{verbatim} + effectively makes \verb|C=aA+bB|, +\begin{verbatim} +\psLCNodeVar(A)(B)(a,b){C} +\end{verbatim} +does the same, but the third argument \verb|(a,b)| may be specified in any form acceptable +to \Lcs{SpecialCoor}. (With \Lcs{psLCNode}, each coefficient may be specified in PostScript code.) +One other difference is that \Lcs{psLCNodeVar} allows the reuse of a node name in place. For example, +it is possible to write +\begin{verbatim} +\psLCNodeVar(A)(B)(2,3){A}% symbol A reassigned +\end{verbatim} +where the equivalent in \Lcs{psLCNode} will lead to a PostScript error. Since \Lcs{AtoB} and \Lcs{AplusB} +are defined using \Lcs{psLCNodeVar}, they also allow node name reuse: \Lcs{AtoB}\verb|(Q)(P){P}| is legal. + +\begin{BDef} +\Lcs{psRelNodeVar}\Largr{node A}\Largr{node B}\Largr{radius;angle}\Largb{node name} +\end{BDef} +is similar to \Lcs{psRelNode}, and provides a means of scaling and rotating a line segment AB about A. The effect of +\begin{verbatim} +\psRelNodeVar(A)(B)(2;30){C} +\end{verbatim} + is the same as + \begin{verbatim} +\psRelNode[angle=30](A)(B){2}{C} +\end{verbatim} + but the third argument (2;30) may be specified in any form acceptable to \Lcs{SpecialCoor}, + while specifying the angle argument in \Lcs{psRelNode} using PostScript is not possible. + Note that \Lcs{psRelNodeVar}\verb|(0,0)(A)(B){C}| may be interpreted as defining {\tt C} to + be the complex product of {\tt A} and {\tt B}. + + +\begin{LTXexample}[width=5cm] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\pnode(0,.5){P}\pnode(1.5,.75){Q} +\psRelNodeVar(P)(Q)(2;20){R} +\psline(Q)(P)\uput[-45](P){P} +\uput[-70](Q){Q} +\psline(P)(R)\uput[-70](R){R} +\end{pspicture} +\end{LTXexample} + + +\begin{BDef} +\Lcs{psRelLineVar}\Largr{node A}\Largr{node B}\Largr{radius;angle}\Largb{node name} +\end{BDef} + stands to \Lcs{psRelLine} as \Lcs{psRelNodeVar} stands relative to \Lcs{psRelNode}. + +\Lcs{psRelLine}\verb|Var(A)(B)(a;b){C}| defines the node {\tt C}, and, in addition, draws the line segment {\tt AC}. + +\begin{BDef} +\Lcs{rhombus}\Largb{edge length}\Largr{A}\Largb{B}\Largb{C}\Largb{D} +\end{BDef} +computes the two remaining vertices C, D given two opposing vertices A, B +of a rhombus with specified edge length. It does not draw the rhombus, which +could be handled easily by \Lcs{psline}. Internally, \Lcs{rhombus} uses +\Lcs{psRelNodeVar}. + +\begin{BDef} +\Lcs{psrline}\Largr{P}\Largr{Q}\ldots +\end{BDef} + is like \Lcs{psline}, but drawing a line starting at (P), with successive + increments (Q)... It has the same options as\Lcs{psline}. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\pnode(0,.5){P}\pnode(1,1){Q} +\psrline{->}(P)(Q)(2;20) +\uput[-45](P){P} +\end{pspicture} +\end{LTXexample} + +\begin{BDef} +\Lcs{psxline}\Largr{basept}\Largb{nodexpr1}\Largb{nodexpr2} +\end{BDef} +The {\tt x} here stands for expression. The idea is that one builds a +line from \verb|<basept>+<nodexpr1>| to \verb|<basept>+<nodexpr2>|. + +\begin{LTXexample}[width=.35\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,4) +\def\pfn{t | t^2/4} +\psparametricplot[algebraic]{0}{3.5}{\pfn} +\curvepnode{2}{\pfn}{P}% sets P, Ptang +\normalvec(Ptang){Q}\uput[-45](P){P} +\psxline[linecolor=red]{<->}(P){-(Ptang)}{1.5(Ptang)} +\psxline[linecolor=blue]{->}(P){}{.5(Q)}%can use {} for {(0,0)} +\end{pspicture} +\end{LTXexample} +\vspace{2pc} + +\begin{BDef} +\Lcs{polyIntersections}\Largb{Name1}\Largb{Name2}\Largr{A}\Largr{B}\Largb{P}\ldots\\ +\Lcs{polyIntersections}\Largb{Name1}\Largb{Name2}\Largr{A}\Largr{B}\Largb{P}\Largb{n}\\ +\end{BDef} + +is the most complicated macro in the collection. It has two forms. + +\begin{verbatim} +\polyIntersections{<Name1>}{<Name2>}(A)(B)(1,2)(3;30)(6,5)... +\end{verbatim} + +defines the polyline \verb|L=(1,2)(3;30)(6,5)...|, and computes the two points of +intersection closest to {\tt A} in each direction with the directed line starting at +A heading toward B. The first intersection point in the positive direction is named +\verb|<Name1>|, and the first intersection point in the opposite direction (from A) +is named \verb|<Name2>|. If one or other of these intersections is empty, the nodes are +set to remote points on the line {\tt AB}. The effect of the line joining the constructed +nodes depends on the location of {\tt A} and {\tt B} relative to {\tt L}, with two cases worth noting. +\begin{itemize} +\item if {\tt L} is closed and if {\tt A, B} are interior to one of its components, the +resulting line extends across that component of {\tt L}, and contains {\tt AB}. +\item If {\tt L} is simple and closed, one of {\tt A, B} is inside and the other outside, +the resulting line segment will contain {\tt A} but not {\tt B}. +\end{itemize} + +\begin{verbatim} +\polyIntersections{<Name1>}{<Name2>}(A)(B){P}{n} +\end{verbatim} + +has exactly the same effect as + +\begin{verbatim} +\polyIntersections{<Name1>}{<Name2>}(A)(B)(P0)(P1)...(Pn) +\end{verbatim} + +assuming \verb|P0...Pn| to be previously defined nodes. + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\pnodes{P}(0,.5)(3,.5)(2.5,2)(.5,2.5)(0,.5) +\pnode(1,1.1){A}\pnode(2,1.5){B} +\polyIntersections{N1}{N2}(A)(B){P}{4} +\psnline(0,4){P} +\psdots(A)(B)\psline(N1)(N2) +\uput[-60](A){A}\uput[-60](B){B} +\uput[0](N1){N1}\uput[-180](N2){N2} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\pnodes{P}(0,.5)(3,.5)(2.5,2)(.5,2.5)(0,.5) +\pnode(1,1.1){A}\pnode(2,3){B} +\polyIntersections{N1}{N2}(A)(B){P}{4} +\psnline(0,4){P} +\psdots(A)(B)\psline(N1)(N2) +\uput[-60](A){A}\uput[-60](B){B} +\uput[90](N1){N1}\uput[-90](N2){N2} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\def\fn{1.5+sin(t)+.4*sin(2*t)% + | 1+cos(t)+.2*cos(2*t)+.2*sin(4*t)}% +\pnode(1,1.1){A}\pnode(2,1.2){B} +\psset{plotpoints=100} +\psparametricplot[algebraic]{0}{6.283}{\fn} +\curvepnodes{0}{6.283}{\fn}{Z} +\polyIntersections{N1}{N2}(A)(B){Z}{99} +\psdots(A)(B)\psline(N1)(N2) +\uput[-60](A){A}\uput[-60](B){B} +\uput[0](N1){N1}\uput[220](N2){N2} +\end{pspicture} +\end{LTXexample} +\vspace{1pc} + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\def\fn{1.5+sin(t)+.4*sin(2*t)% + | 1+cos(t)+.2*cos(2*t)+.2*sin(4*t)}% +\pnode(.8,.6){A}\pnode(2.5,-.5){B} +\psset{plotpoints=100} +\psparametricplot[algebraic]{0}{6.283}{\fn} +\curvepnodes{0}{6.283}{\fn}{Z} +\polyIntersections{N1}{N2}(A)(B){Z}{99} +\psdots(A)(B)\psline(N1)(N2) +\uput[90](A){A}\uput[-60](B){B} +\uput[70](N1){N1}\uput[180](N2){N2} +\end{pspicture} +\end{LTXexample} +\vspace{1pc} + + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\pnodes{P}(0,.5)(3,.5)(2.5,2)(.5,2.5)(0,.5) +\pnode(1,1.1){A}\pnode(2,1.5){B} +\polyIntersections{N1}{N2}(A)(B){P}{3} +\psnline(0,3){P} +\psdots(A)(B) +\psclip{\psframe[linestyle=none](-.5,-.5)(3.5,2.5)} +\psline(N1)(N2)\endpsclip +\uput[-60](A){A}\uput[-60](B){B} +\uput[0](N1){N1}\uput[-180](N2){N2} +\end{pspicture} +\end{LTXexample} +\vspace{1pc} + +\begin{LTXexample}[width=.375\textwidth] +\begin{pspicture}[showgrid=true](-.5,-.5)(3.5,3) +\def\fn{x+sin(2*x)} +\psplot[algebraic]{0}{3.14}{\fn} +\fnpnodes[algebraic]{0}{3.14}{\fn}{P} +\pnode(.6,.8){A}\pnode(1.5,1.1){B} +\polyIntersections{N1}{N2}(A)(B){P}{49} +\psdots(A)(B) +\uput[-90](A){A}\uput[-90](B){B} +\psline(N1)(N2) +\psset{linestyle=dashed} +\psline(N1)(N1 | 0,0) +\psline(N2)(N2 | 0,0) +\uput[70](N1){N1}\uput[170](N2){N2} +\end{pspicture} +\end{LTXexample} +\vspace{1pc} + +\begin{BDef} +\Lcs{ArrowNotch}\Largb{<NodeName>}\Largb{<nodeindex>}\Largb{<direction>}\Largb{<Notch>} +\end{BDef} +takes as inputs the root name of the node sequence, the index at which the arrow +tip is to be drawn, and the direction (one of \verb+>,<+) of the arrow. It then +constructs the notch as a node with name \verb|<Notch>|. The arrowhead may then be +drawn with a command like \Lcs{psline}\verb|{->}(N)(P3)|, assuming the tip was to be {\tt P3} +and the notch was {\tt N}. Keep in mind that the macro takes its settings for linewidth, +arrowscale, etc from the current values, so it is generally preferable to include them +in a \Lcs{psset} before drawing the curve and calling \Lcs{ArrowNotch}. +(Alternatively, they may be included as optional settings in \Lcs{ArrowNotch}.) +The first example below shows a case where the native arrow direction is not +good. The second shows how to make a version using \Lcs{ArrowNotch}. Notice that the minimum and maximum +parameter values in the second example had to be modified to keep the curve +from protruding near the end arrowheads. + +\Lcs{ArrowNotch} is a computationally expensive macro (quadratic in {\tt plotpoints}) designed to +improve the placement of arrows on curves in those cases (high curvature, large values of +linewidth, arrowscale, etc) where the native arrow direction is not optimal. The macro +depends on the construction of a node sequence, say {\tt P0..Pn}, of samples of the curve +(eg, with \Lcs{curvepnodes}) from which it computes the position of the notch of the arrow +so that, when drawn, the arrow notch will be located on the curve in all cases. It operates +with only two particular arrow shapes---those arrows specified with either +\verb|->| or \verb|-D>|, or their reverses. + + +\begin{LTXexample}[width=.375\textwidth] +\def\fn{1.5+1.5*cos(t) | 1+sin(t)} +\psset{linewidth=2pt,arrowscale=3} +\begin{pspicture}(0,0)(3.5,3) +\psparametricplot[algebraic,arrows=<->]{PiDiv2 neg}{Pi}{\fn} +\end{pspicture} +\end{LTXexample} +\vspace{1pc} + +\begin{LTXexample}[width=.375\textwidth] +\def\fn{1.5+1.5*cos(t) | 1+sin(t)} +\psset{linewidth=2pt,arrowscale=3} +\begin{pspicture}(0,0)(3.5,3) +\curvepnodes{PiDiv2 neg}{Pi}\fn{P}%create P0..P49 +\ArrowNotch{P}{0}{<}{Q} +\ArrowNotch{P}{49}{>}{R} +\ArrowNotch[arrowscale=1.5]{P}{27}{>}{S} +\psparametricplot[algebraic]{-1.47}{2.95}{\fn} +\psline{->}(Q)(P0) +\psline{->}(R)(P49) +\psline[arrowscale=1.5]{->}(S)(P27) +\end{pspicture} +\end{LTXexample} + + +\section{List of all optional arguments for \texttt{pst-node}} + +\xkvview{family=pst-node,columns={key,type,default}} + + +\nocite{*} +\bgroup +\RaggedRight +\bibliographystyle{plain} +\bibliography{pst-node-doc} +\egroup + +\printindex + + +\end{document} diff --git a/Master/texmf-dist/dvips/pst-node/pst-node.pro b/Master/texmf-dist/dvips/pst-node/pst-node.pro new file mode 100644 index 00000000000..4436aac9e87 --- /dev/null +++ b/Master/texmf-dist/dvips/pst-node/pst-node.pro @@ -0,0 +1,573 @@ +% $Id: pst-node.pro 263 2010-01-22 11:13:25Z herbert $ +%% +%% PostScript prologue for pst-node.tex. +%% Version 1.10, 2010/01/22. +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +% +/tx@NodeDict 400 dict def tx@NodeDict begin +tx@Dict begin % from main pstricks dict + /T /translate load def +end +/NewNode { % on stack: { x y } boolean N@name type InitXnode + gsave + /next ED % { x y } boolean N@name type + dict dup % { x y } boolean N@name dict dict + 3 1 roll def % { x y } boolean dict N@name dict def + exch { dup 3 1 roll def } if % { x y } dict boolean + begin % { x y } dict begin + tx@Dict begin + STV CP T exec % set scaling + end + /NodeMtrx CM def % save CM + next % InitXNode + end + grestore +} def +% +/InitPnode { + /Y ED /X ED + /NodePos { NodeSep Cos mul NodeSep Sin mul } def +} def +% +/InitCnode { + /r ED /Y ED /X ED + /NodePos { NodeSep r add dup Cos mul exch Sin mul } def +} def +% +/GetRnodePos { + Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def } ifelse + Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } ifelse + dx Sin mul abs dy + Cos mul abs gt { dy Cos mul Sin div dy } { dx dup Sin mul Cos Div } ifelse +} def +% +/InitRnode { + /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub /u ED + /NodePos { GetRnodePos } def +} def +% +/DiaNodePos { + w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup + Cos mul exch Sin mul +} def +% +/TriNodePos { + Sin s lt + { d NodeSep sub dup Cos mul Sin Div exch } + { w h mul w Sin mul h Cos abs mul add Div + NodeSep add dup Cos mul exch Sin mul + } ifelse +} def +% +/InitTriNode { + sub 2 div exch + 2 div exch + 2 copy T + 2 copy 4 index index /d ED + pop pop pop pop + -90 mul rotate + /NodeMtrx CM def + /X 0 def /Y 0 def + d sub abs neg /d ED + d add /h ED + 2 div h mul h d sub Div /w ED + /s d w Atan sin def + /NodePos { TriNodePos } def +} def +% +/OvalNodePos { + /ww w NodeSep add def + /hh h NodeSep add def + Sin ww mul Cos hh mul Atan dup cos ww mul exch sin hh mul +} def +% +/GetCenter { begin X Y NodeMtrx transform CM itransform end } def +% +/XYPos { + dup sin exch cos Do + /Cos ED /Sin ED /Dist ED + Cos 0 gt + { Dist Dist Sin mul Cos div } + { Cos 0 lt + { Dist neg Dist Sin mul Cos div neg } + { 0 Dist Sin mul } ifelse + } ifelse + Do +} def +% +/GetEdge { + dup 0 eq + { pop begin 1 0 NodeMtrx dtransform + CM idtransform + exch atan sub + dup + sin /Sin ED + cos /Cos ED + /NodeSep ED + NodePos NodeMtrx dtransform CM idtransform end } + { 1 eq {{exch}} {{}} ifelse /Do ED pop XYPos } ifelse +} def +% +/AddOffset { + 1 index 0 eq + { pop pop } + { 2 copy 5 2 roll cos mul add 4 1 roll sin mul sub exch } ifelse +} def +% +/GetEdgeA { + NodeSepA AngleA NodeA NodeSepTypeA GetEdge + OffsetA AngleA AddOffset + yA add /yA1 ED + xA add /xA1 ED +} def +% +/GetEdgeB { + NodeSepB AngleB NodeB NodeSepTypeB GetEdge + OffsetB AngleB AddOffset + yB add /yB1 ED + xB add /xB1 ED +} def +% +/GetArmA { + ArmTypeA 0 eq + { /xA2 ArmA AngleA cos mul xA1 add def + /yA2 ArmA AngleA sin mul yA1 add def } + { ArmTypeA 1 eq {{exch}} {{}} ifelse + /Do ED + ArmA AngleA XYPos OffsetA AngleA AddOffset + yA add /yA2 ED + xA add /xA2 ED } ifelse +} def +% +/GetArmB { + ArmTypeB 0 eq + { /xB2 ArmB AngleB cos mul xB1 add def + /yB2 ArmB AngleB sin mul yB1 add def } + { ArmTypeB 1 eq {{exch}} {{}} ifelse + /Do ED + ArmB AngleB XYPos OffsetB AngleB AddOffset + yB add /yB2 ED + xB add /xB2 ED } ifelse +} def +% +/InitNC { + /b ED /a ED % second and first node + /NodeSepTypeB ED /NodeSepTypeA ED + /NodeSepB ED /NodeSepA ED + /OffsetB ED /OffsetA ED + tx@NodeDict a known tx@NodeDict b known and dup { + /NodeA a load def + /NodeB b load def + NodeA GetCenter /yA ED /xA ED + NodeB GetCenter /yB ED /xB ED } if +} def +% +/LPutLine { + 4 copy + 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED + 1 t sub mul + 3 1 roll 1 t sub mul + 4 1 roll t mul add /Y ED + t mul add /X ED +} def +% +/LPutLines { + mark LPutVar counttomark 2 div 1 sub /n ED +% t floor dup n gt + t floor dup n ge % to allow npos<= hv 2008-08-14 + { pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse + cvi 2 mul { pop } repeat + LPutLine + cleartomark +} def +% +/BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED +/t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 +mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx +sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul +add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add +y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul +mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def +/HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def +} def +/HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def +/HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit +} { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd +} def +/VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def +} def +/VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def +/VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { +exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark +VPosEnd } def +/HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 +roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx +def grestore exec /LPutVar /SaveLPutVar load def } def +/NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def +GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { +LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { +LPutVar VPutLine } def LPutVar } def +% +/NCLine { + NCCoor + tx@Dict begin + ArrowA CP 4 2 roll + ArrowB + lineto pop pop + end +} def +% +/NCLines { + false NArray + n 0 eq + { NCLine } + { 2 copy yA sub exch xA sub Atan /AngleA ED + n 2 mul dup index exch index yB sub exch xB sub + Atan /AngleB ED + GetEdgeA GetEdgeB + /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 yA1 ] cvx def + mark LPutVar + tx@Dict begin false Line end + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def + } ifelse +} def +% +/NCCurve { + GetEdgeA + GetEdgeB + xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 +roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA +GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict +begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] +cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines +} HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def +% +/NCAngles { + GetEdgeA GetEdgeB GetArmA GetArmB + /mtrx AngleA matrix rotate def + xA2 yA2 mtrx transform pop + xB2 yB2 mtrx transform exch pop + mtrx itransform + /y0 ED /x0 ED + mark ArmB 0 ne { xB1 yB1 } if + xB2 yB2 x0 y0 xA2 yA2 + ArmA 0 ne { xA1 yA1 } if + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def } def +% +/NCAngle { + GetEdgeA GetEdgeB GetArmB + /mtrx AngleA matrix rotate def + xB2 yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform + /y0 ED /x0 ED + mark + ArmB 0 ne { xB1 yB1 } if + xB2 yB2 x0 y0 xA1 yA1 + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def +} def +% +/NCBar { + GetEdgeA GetEdgeB GetArmA GetArmB + /mtrx AngleA matrix rotate def + xA2 yA2 mtrx itransform pop + xB2 yB2 mtrx itransform pop + sub dup 0 mtrx transform + 3 -1 roll 0 gt + { /yB2 exch yB2 add def /xB2 exch xB2 add def } + { /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse + mark + ArmB 0 ne { xB1 yB1 } if + xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def +} def +% +/NCDiag { + /lineAngle ED + GetEdgeA GetEdgeB GetArmA GetArmB mark + lineAngle abs 0 gt { + /xTemp xA2 10 add def + /yTemp yA2 lineAngle dup sin exch cos div 10 mul add def + /dY1 yTemp yA2 sub def + /dX1 xTemp xA2 sub def + /dY2 yB2 yB1 sub def + /dX2 xB2 xB1 sub def + dX1 abs 0.01 lt { + /m2 dY2 dX2 div def + /xB2 xA2 def + /yB2 xA2 xB1 sub m2 mul yB1 add def + }{ + dX2 abs 0.01 lt { + /m1 dY1 dX1 div def + /xB2 xB1 def + /yB2 xB1 xA2 sub m1 mul yA2 add def + }{% + /m1 dY1 dX1 div def + /m2 dY2 dX2 div def + /xB2 m1 xA2 mul m2 xB1 mul sub yA2 sub yB1 add m1 m2 sub div def + /yB2 xB2 xA2 sub m1 mul yA2 add def + } ifelse + } ifelse + } if + ArmB 0 ne { xB1 yB1 } if + xB2 yB2 xA2 yA2 + ArmA 0 ne { xA1 yA1 } if + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def +% +% GetEdgeA GetEdgeB GetArmA GetArmB mark +% ArmB 0 ne { xB1 yB1 } if +% xB2 yB2 xA2 yA2 +% ArmA 0 ne { xA1 yA1 } if +% tx@Dict begin false Line end +% /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def +% /LPutPos { LPutLines } def +% /HPutPos { HPutLines } def +% /VPutPos { VPutLines } def +} def +% +/NCDiagg { + /lineAngle ED + GetEdgeA GetArmA + lineAngle abs 0 gt + { lineAngle } + { yB yA2 sub xB xA2 sub Atan 180 add } ifelse + /AngleB ED + GetEdgeB mark + lineAngle abs 0 gt { + /dY2 yA2 yA1 sub def + /dX2 xA2 xA1 sub def + lineAngle abs 90 eq { + /m2 dY2 dX2 div def + /yA2 xB xA2 sub m2 mul yA2 add def + /xA2 xB def + }{ + /m1 lineAngle dup sin exch cos div def % tan alpha + dX2 abs 0.01 lt { + /yA2 xA1 xB sub m1 mul yB add def + /xA2 xA1 def + }{% + /m2 dY2 dX2 div def + /xA2 m1 xB mul m2 xA2 mul sub yA2 add yB sub m1 m2 sub div def + /yA2 xA2 xB sub m1 mul yB add def + } ifelse + } ifelse + } if + xB1 yB1 xA2 yA2 + ArmA 0 ne { xA1 yA1 } if + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def +% +% GetEdgeA GetArmA +% yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED +% GetEdgeB +% mark +% xB1 yB1 xA2 yA2 +% ArmA 0 ne { xA1 yA1 } if +% tx@Dict begin false Line end +% /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def +% /LPutPos { LPutLines } def +% /HPutPos { HPutLines } def +% /VPutPos { VPutLines } def +} def +% +/NCLoop { + GetEdgeA GetEdgeB GetArmA GetArmB + /mtrx AngleA matrix rotate def + xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED + /xB3 xB2 yB2 mtrx transform pop def + xB3 yA3 mtrx itransform /yB3 ED /xB3 ED + xA3 yA3 mtrx itransform /yA3 ED /xA3 ED + mark ArmB 0 ne { xB1 yB1 } if + xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if + tx@Dict begin false Line end + /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] cvx def + /LPutPos { LPutLines } def + /HPutPos { HPutLines } def + /VPutPos { VPutLines } def +} def +% +% DG/SR modification begin - May 9, 1997 - Patch 1 +%/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r +%r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add +%exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 +%mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED +% +/NCCircle { + NodeSepA 0 NodeA 0 GetEdge pop + 2 div dup 2 exp r r mul sub abs sqrt + atan 2 mul /a ED + r AngleA 90 add PtoC yA add exch xA add + exch 2 copy + /LPutVar [ 4 2 roll r AngleA ] cvx def + /LPutPos { + LPutVar t 360 mul add dup 5 1 roll 90 sub PtoC + 3 -1 roll add + /Y ED add /X ED /NAngle ED +% DG/SR modification end + } def + /HPutPos { LPutPos } def + /VPutPos { LPutPos } def + r AngleA 90 sub a add AngleA 270 add a sub + tx@Dict begin + /angleB ED /angleA ED /r ED + /c 57.2957 r Div def + /y ED /x ED +} def +% +/NCBox { + /d ED /h ED + /AngleB yB yA sub xB xA sub Atan def + /AngleA AngleB 180 add def + GetEdgeA GetEdgeB + /dx d AngleB sin mul def + /dy d AngleB cos mul neg def + /hx h AngleB sin mul neg def + /hy h AngleB cos mul def + /LPutVar [ + xA1 hx add yA1 hy add xB1 hx add yB1 hy add + xB1 dx add yB1 dy add xA1 dx add yA1 dy add ] cvx def + /LPutPos { LPutLines } def + /HPutPos { xB yB xA yA LPutLine } def + /VPutPos { HPutPos } def + mark + LPutVar tx@Dict begin false Polygon end +} def +% +/NCArcBox { + /l ED neg /d ED /h ED /a ED + /AngleA yB yA sub xB xA sub Atan def + /AngleB AngleA 180 add def + /tA AngleA a sub 90 add def + /tB tA a 2 mul add def + /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def + /x0 xA r tA cos mul add def + /y0 yA r tA sin mul add def + /c 57.2958 r div def + /AngleA AngleA a sub 180 add def + /AngleB AngleB a add 180 add def + GetEdgeA GetEdgeB + /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul sub def + /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def + l 0 eq { + x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn + }{ + x0 y0 translate + /tA AngleA l c mul add def + /tB AngleB l c mul sub def + 0 0 r h add tA tB arc r h add + AngleB PtoC r d add + AngleB PtoC 2 copy + 6 2 roll l arcto 4 { pop } repeat + r d add tB PtoC l arcto 4 { pop } repeat + 0 0 r d add tB tA arcn r d add + AngleA PtoC r h add + AngleA PtoC 2 copy 6 2 roll + l arcto 4 { pop } repeat + r h add tA PtoC l arcto 4 { pop } repeat + } ifelse + closepath + /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def + /LPutPos { + LPutVar /d ED /h ED + /AngleB ED /AngleA ED + /r ED /y0 ED /x0 ED + t 1 le { + r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC + }{t 2 lt { + /NAngle AngleB 180 add def r 2 t sub + h mul t 1 sub d mul add add AngleB PtoC + }{ + t 3 lt { + r d add AngleB 3 t sub mul AngleA 2 t sub + mul add dup 90 sub /NAngle ED PtoC + }{ + /NAngle AngleA 180 add def + r 4 t sub d mul t 3 sub h mul add add AngleA PtoC + } ifelse + } ifelse + } ifelse + y0 add /Y ED x0 add /X ED + } def + /HPutPos { LPutPos } def + /VPutPos { LPutPos } def +} def +% +/Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB +sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 +ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB +w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos +{ LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } +{ pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } +def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin +/ArrowA { moveto } def /ArrowB { } def false Line closepath end } def +% +/LPutCoor { + NAngle + tx@Dict begin /NAngle ED end + gsave + CM STV + CP Y sub neg exch X sub neg exch moveto + setmatrix CP + grestore +} def +% +/LPut { + tx@NodeDict /LPutPos known + { LPutPos } { CP /Y ED /X ED /NAngle 0 def } ifelse + LPutCoor +} def +% +/HPutAdjust { + Sin Cos mul 0 eq + { 0 } + { d Cos mul Sin div flag not { neg } if + h Cos mul Sin div flag { neg } if + 2 copy gt { pop } { exch pop } ifelse + } ifelse + s add flag { r add neg }{ l add } ifelse + X add /X ED +} def +% +/VPutAdjust { + Sin Cos mul + 0 eq + { 0 } + { l Sin mul Cos div flag { neg } if + r Sin mul Cos div flag not { neg } if + 2 copy gt { pop } { exch pop } ifelse + } ifelse + s add flag { d add } { h add neg } ifelse + Y add /Y ED +} def +% +end +% +% END pst-node.pro diff --git a/Master/texmf-dist/source/generic/pst-node/Makefile b/Master/texmf-dist/source/generic/pst-node/Makefile new file mode 100644 index 00000000000..4aa0c2f58ab --- /dev/null +++ b/Master/texmf-dist/source/generic/pst-node/Makefile @@ -0,0 +1,81 @@ + +# `Makefile' for `pst-node-doc.pdf', hv, 2010/01/22 + +.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps + +PACKAGE = pst-node + +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 $< + echo "\documentclass[a4paper]{article}" > temp.tex + echo "\usepackage{pdfpages}" >> temp.tex + echo "\begin{document}" >> temp.tex + echo "\includepdf[pages=1-4]{pst-node-doc}" >> temp.tex + echo "\includepdf[pages=65-90]{../pstricks/doc/pstricks-doc}" >> temp.tex + echo "\includepdf[pages=5-]{pst-node-doc}" >> temp.tex + echo "\end{document}" >> temp.tex + pdflatex temp + mv temp.pdf pst-node-doc.pdf + +$(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) + rm temp* + +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-node/pst-node.tex b/Master/texmf-dist/tex/generic/pst-node/pst-node.tex new file mode 100644 index 00000000000..71a2ee98e08 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pst-node/pst-node.tex @@ -0,0 +1,1745 @@ +% $Id: pst-node.tex 263 2010-01-22 11:13:25Z herbert $ +%% BEGIN pst-node.tex +%% +%% Nodes with PSTricks. +%% See the betadoc documentation for usage. +%% This uses the header file `pst-node.pro'. +%% +%% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu. +%% COPYRIGHT 2009/10 by Herbert Voss, hvoss tug.org. +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt. +%% +% +\csname PSTnodesLoaded\endcsname +\let\PSTnodesLoaded\endinput +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi\relax +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi +% +\def\fileversion{1.10} +\def\filedate{2010/01/22} +\message{ v\fileversion, \filedate} +% +\edef\TheAtCode{\the\catcode`\@} +\catcode`\@=11 +% +\pstheader{pst-node.pro} +\pst@addfams{pst-node} +% +\SpecialCoor +% +%%%%%%%%%% compytibility stuff +\define@boolkey[psset]{pst-node}[Pst@]{trueAngle}[true]{} +\psset[pst-node]{trueAngle=false} +%%%%%%%%%% compytibility stuff +% +\def\pst@nodedict{tx@NodeDict begin } +\def\pst@zapspace#1 #2{% +#1% +\ifx#2\@empty\else\expandafter\pst@zapspace\fi +#2} +% +\def\pst@getnode#1#2{\pst@expandafter\pst@@getnode{#1},,\@nil#2} +\def\pst@@getnode#1,#2,#3\@nil#4{% + \ifx\@empty#3\@empty + \edef#4{/N@\pst@zapspace#1 \@empty\space}% + \else + \pst@cntg=#1\relax + \pst@cnth=#2\relax + \edef#4{/N@M-\ifnum\psmatrixcnt=\z@ 1\else\the\psmatrixcnt\fi + -\the\pst@cntg-\the\pst@cnth\space}% + \fi} +% +\def\tx@NewNode{NewNode } +\def\pst@newnode#1#2#3#4{% +% DG/SR modification begin - Nov. 9, 2000 - Patch 11 +\pst@killglue +% DG/SR modification end +\leavevmode +\pst@getnode{#1}\pst@thenode +\pst@Verb{% + \pst@nodedict + {#3} + \ifx\psk@name\relax false \else \psk@name true \fi + \pst@thenode + #2 + {#4} + \tx@NewNode + end }% +% +\global\let\psk@name\relax +\pstree@nodehook +\global\let\pstree@nodehook\relax} +\let\pstree@nodehook\relax +\newif\ifnodealign +\define@boolkey[psset]{pst-node}[true]{nodealign}{} +\psset[pst-node]{nodealign=false} + +\def\pst@nodealign{% +\pst@dimg=\ht\pst@hbox +\advance\pst@dimg-\dp\pst@hbox +\divide\pst@dimg2 +\lower\pst@dimg} +% +\def\tx@InitPnode{InitPnode } +\def\pnode{\@ifnextchar({\pnode@}{\pnode@(0,0)}} +\def\pnode@(#1)#2{% + \pst@@getcoor{#1}% + \pst@newnode{#2}{10}{\pst@coor}{\tx@InitPnode}% + \ignorespaces} +% +\def\tx@InitCnode{InitCnode } +\def\cnode{\pst@object{cnode}} +\def\cnode@i{\@ifnextchar({\cnode@ii}{\cnode@ii(0,0)}} +\def\cnode@ii(#1)#2#3{% + \leavevmode + \hbox{% + \use@par + \pst@@getcoor{#1}% + \pssetlength\pst@dimc{#2}% + \pst@dimg=\psk@dimen\pslinewidth + \advance\pst@dimc-\pst@dimg + \advance\pst@dimc.5\pslinewidth + \ifnodealign + \kern\pst@dimc + \vrule width\z@ height \pst@dimc depth \pst@dimc + \fi + \pscircle@do(#1){#2}% + \pst@newnode{#3}{11}{\pst@coor \pst@number\pst@dimc}{\tx@InitCnode}% +%% % DG/SR modification begin - Jul. 30, 1997 - Patch 2 +%% %\ifnodealign \kern\pst@dimc\egroup \fi}% + \ifnodealign\kern\pst@dimc\fi% +%% % DG/SR modification end + }% + \ignorespaces} +% +\def\Cnode{\pst@object{Cnode}} +\def\Cnode@i{\@ifnextchar({\Cnode@ii}{\Cnode@ii(0,0)}} +\def\Cnode@ii(#1)#2{\cnode@ii(#1){\psk@radius}{#2}}% +% +\def\cnodeput{\pst@object{cnodeput}} +\def\cnodeput@i{\@ifnextchar({\cnodeput@iii}{\cnodeput@ii}} +\def\cnodeput@ii#1{% + \addto@par{rot={#1}}% + \@ifnextchar({\cnodeput@iii}{\cnodeput@iii(\z@,\z@)}} +\def\cnodeput@iii(#1)#2{% + \pst@killglue + \@fixedradiusfalse + \def\pst@nodehook{\cnodeput@iv{#2}}% + \pst@makebox{\cput@v{#1}}} +\def\cnodeput@iv#1{% + \pst@newnode{#1}{11}{\pscirclebox@iv \pst@number\pslinewidth add}{\tx@InitCnode}% + \global\let\pst@nodehook\relax} +% +\def\Cnodeput{\pst@object{Cnodeput}} +\def\Cnodeput@i{\@ifnextchar({\Cnodeput@iii}{\Cnodeput@ii}} +\def\Cnodeput@ii#1{% +\addto@par{rot={#1}}% +\@ifnextchar({\Cnodeput@iii}{\Cnodeput@iii(\z@,\z@)}} +\def\Cnodeput@iii(#1)#2{% +\pst@killglue +\@fixedradiustrue +\def\pst@nodehook{\Cnodeput@iv{#2}}% +\pst@makebox{\cput@iv{#1}}} +\def\Cnodeput@iv#1{% +\pst@newnode{#1}{11}{% +\pst@number{\wd\pst@hbox} 2 div \pst@number\pst@dima % x y +\pst@number\pst@dimb \pst@number\pslinewidth \psk@dimen .5 sub mul sub }% r +{\tx@InitCnode}% +\global\let\pst@nodehook\relax} +\def\circlenode{\pst@object{circlenode}} +\def\circlenode@i#1{\pst@makebox{\circlenode@ii{#1}}} +\def\circlenode@ii#1{% + \begingroup + \pst@useboxpar + \setbox\pst@hbox=\hbox{% + \cnodeput@iv{#1}% + \pscirclebox@iii + \box\pst@hbox}% + \ifnodealign \psboxseptrue \fi + \ifpsboxsep \pscirclebox@sep \fi + \leavevmode + \ifnodealign\pst@nodealign\fi + \box\pst@hbox + \endgroup} +\def\Circlenode{\pst@object{Circlenode}} +\def\Circlenode@i#1{\pst@makebox{\Circlenode@ii{#1}}} +\def\Circlenode@ii#1{% +\begingroup +\pst@useboxpar +\pst@dima=\ht\pst@hbox +\advance\pst@dima\dp\pst@hbox +\divide\pst@dima\tw@ +\pssetlength\pst@dimb\psk@radius +\setbox\pst@hbox=\hbox{% +\Cnodeput@iv{#1}% +\pscircle(.5\wd\pst@hbox,\pst@dima){\pst@dimb}% +\box\pst@hbox}% +\ifnodealign \psboxseptrue \fi +\ifpsboxsep \psCirclebox@sep \fi +\leavevmode +\ifnodealign\pst@nodealign\fi +\box\pst@hbox +\endgroup} +\def\tx@GetRnodePos{GetRnodePos } +\def\tx@InitRnode{InitRnode } +\def\rnode{\@ifnextchar[{\rnode@i}{\def\pst@par{}\rnode@ii}} +\def\rnode@i[#1]{\def\pst@par{ref=#1}\rnode@ii} +\def\rnode@ii#1{\pst@makebox{\rnode@iii\rnode@iv{#1}}} +\def\rnode@iii#1#2{% +% DG modification begin - Jan. 1997 +\leavevmode +% DG modification end +\begingroup +% DG/SR modification begin - Apr. 28, 1998 - Patch 6 +\pst@useboxpar +% DG/SR modification end +#1% +\if@star\pst@starbox\fi +\ifnodealign\lower\pst@dimb\fi +\hbox{% +\pst@newnode{#2}{16}{% +\pst@number{\ht\pst@hbox}% +\pst@number{\dp\pst@hbox}% +\pst@number{\wd\pst@hbox}% +\pst@number\pst@dima +\pst@number\pst@dimb}% +{\tx@InitRnode}% +\box\pst@hbox}% +\endgroup} +\def\rnode@iv{% +\pst@dima=\psk@xref\wd\pst@hbox +\ifx\psk@yref\relax +\pst@dimb=\z@ +\else +\pst@dimb=\ht\pst@hbox +\advance\pst@dimb\dp\pst@hbox +\pst@dimb=\psk@yref\pst@dimb +\advance\pst@dimb-\dp\pst@hbox +\fi} +\define@key[psset]{pst-node}{href}{\pst@checknum{#1}\psk@href} +\psset[pst-node]{href=0} +\define@key[psset]{pst-node}{vref}{\def\psk@vref{#1}} +\psset[pst-node]{vref=0.7ex} +\def\Rnode{\pst@object{Rnode}} +\def\Rnode@i#1{\pst@makebox{\rnode@iii\Rnode@ii{#1}}} +\def\Rnode@ii{% +% DG modification begin - Jan. 1997 +% - \begingroup removed as it seems to doesn't work any more +% - \Rnode doesn't process the optional parameter changes +%\begingroup +\use@par +% DG modification end +\pst@dima=\psk@href\wd\pst@hbox +\advance\pst@dima\wd\pst@hbox +\divide\pst@dima 2 +\pssetlength\pst@dimb{\psk@vref}} +\def\tx@DiaNodePos{DiaNodePos } +\def\dianode{\pst@object{dianode}} +\def\dianode@i#1{\pst@makebox{\dianode@ii{#1}}} +\def\dianode@ii#1{% +\begingroup +\pst@useboxpar +\psdiabox@iii +\setbox\pst@hbox=\hbox{% +\pst@newnode{#1}{14}{}{% +/X \pst@number\pst@dima def +/Y \pst@number\pst@dimb def +/w \pst@number\pst@dimc 2 mul def +/h \pst@number\pst@dimd 2 mul def +/NodePos { \tx@DiaNodePos } def}% +\box\pst@hbox}% +\ifnodealign\psboxseptrue\fi +\ifpsboxsep\psdiabox@sep\fi +% DG/SR modification begin - Sep. 2, 1997 - Patch 3 +\leavevmode +% DG/SR modification end +\ifnodealign\lower\pst@dimb\fi +\box\pst@hbox +\endgroup} +\def\tx@TriNodePos{TriNodePos } +\def\tx@InitTriNode{InitTriNode } +% +\def\trinode{\pst@object{trinode}} +\def\trinode@i#1{\pst@makebox{\trinode@ii{#1}}} +\def\trinode@ii#1{% + \begingroup% + \pst@useboxpar% + \pstribox@iii + \setbox\pst@hbox=\hbox{% + \pst@newnode{#1}{14}{}{ + \pst@number\pst@dimc + \pst@number\pst@dimd + \ifodd\psk@trimode + exch + \pst@number\pst@dima + \else + \pst@number\pst@dimb + \fi + \psk@trimode + \pst@number{\wd\pst@hbox} + \pst@number{\ht\pst@hbox} + \pst@number{\dp\pst@hbox} + \tx@InitTriNode + }% + \box\pst@hbox% + }% + \ifnodealign\psboxseptrue\fi + \ifpsboxsep\pstribox@sep\fi +% DG/SR modification begin - Sep. 2, 1997 - Patch 3 + \leavevmode +% DG/SR modification end + \ifnodealign\lower\pst@tempa\fi + \box\pst@hbox% + \endgroup} +% +\def\tx@OvalNodePos{OvalNodePos } +\def\ovalnode{\pst@object{ovalnode}} +\def\ovalnode@i#1{\pst@makebox{\ovalnode@ii{#1}}} +\def\ovalnode@ii#1{% +\begingroup +\pst@useboxpar +\psovalbox@iii +\setbox\pst@hbox=\hbox{% +\pst@newnode{#1}{14}{}{% +/X \pst@number\pst@dima def +/Y \pst@number\pst@dimb def +/w \pst@number\pst@dimc def +/h \pst@number\pst@dimd def +/NodePos { \tx@OvalNodePos } def}% +\unhbox\pst@hbox}% +\ifnodealign\psboxseptrue\fi +\ifpsboxsep\psovalbox@sep\fi +% DG/SR modification begin - Sep. 2, 1997 - Patch 3 +\leavevmode +% DG/SR modification end +\ifnodealign\lower\pst@dimb\fi +\box\pst@hbox +\endgroup} +% +\def\dotnode{\pst@object{dotnode}} +\def\dotnode@i{\@ifnextchar({\dotnode@ii}{\dotnode@ii(\z@,\z@)}} +\def\dotnode@ii(#1)#2{% + \leavevmode% + \hbox{% + \use@par% + \pst@@getcoor{#1}% + \pst@getdotsize% + \pstree@nodehook% + \ifnodealign% + \pst@dima=\pst@dimg% + \kern\pst@dima% + \vrule width\z@ height \pst@dimh depth \pst@dimh% + \fi% + \pst@newnode{#2}{14}{}{ + \pst@coor + /Y exch def /X exch def + /w \pst@number\pst@dimg def + /h \pst@number\pst@dimh def + /NodePos { \tx@OvalNodePos } def}% + \psdot@ii(#1)% + \ifnodealign\kern\pst@dima\fi}% + \ignorespaces} +% +\define@key[psset]{pst-node}{framesize}{\pst@expandafter\psset@@framesize{#1} \@nil} +\def\psset@@framesize#1 #2\@nil{% + \pssetlength\pst@dimg{#1}% + \divide\pst@dimg2 + \edef\psk@framewidth{\pst@number\pst@dimg}% + \ifx\@empty#2\@empty + \let\psk@frameheight\psk@framewidth + \else + \pssetlength\pst@dimg{#2}% + \divide\pst@dimg2 + \edef\psk@frameheight{\pst@number\pst@dimg}% + \fi} +% +\psset[pst-node]{framesize=10pt} +% +\def\fnode{\pst@object{fnode}} +\def\fnode@i{\@ifnextchar({\fnode@ii}{\fnode@ii(\z@,\z@)}} +\def\fnode@ii(#1)#2{% + \leavevmode + \pst@killglue + \hbox{% + \use@par% + \begin@ClosedObj% + \ifnodealign + \kern\psk@framewidth\p@ + \vrule width\z@ height \psk@frameheight\p@ depth \psk@frameheight\p@ + \edef\pst@coor{0 0 }% + \else\pst@@getcoor{#1}\fi + \pst@newnode{#2}{14}{}{ + \pst@coor + /Y exch def /X exch def + /d \psk@dimen .5 sub CLW mul neg def + /r \psk@framewidth d add def + /l r neg def + /u \psk@frameheight d add def + /d u neg def + /NodePos { \tx@GetRnodePos } def}% + \addto@pscode{ + /x2 \psk@framewidth CLW \psk@dimen mul sub def + /y2 \psk@frameheight CLW \psk@dimen mul sub def + \pst@coor 2 copy + y2 sub /y1 ED + x2 sub /x1 exch def + y2 add /y2 exch def + x2 add /x2 exch def + \psk@cornersize + 1 index 0 eq { pop pop \tx@Rect } { \tx@OvalFrame } ifelse}% + \def\pst@linetype{2}% + \showpointsfalse% + \end@ClosedObj% + \ifnodealign\kern\psk@framewidth\p@\fi}% end of \hbox + \ignorespaces} +% +% +% This fixes a bug in pst-node, where the XY-direction is wrong +% the types are changed 1<->2 between X<->Y +% +\define@key[psset]{}{XnodesepA}{\pst@getlength{#1}\psk@nodesepA\def\psk@nodeseptypeA{2 }} +\define@key[psset]{}{XnodesepB}{\pst@getlength{#1}\psk@nodesepB\def\psk@nodeseptypeB{2 }} +\define@key[psset]{}{Xnodesep}{% + \pst@getlength{#1}\psk@nodesepA + \let\psk@nodesepB\psk@nodesepA + \def\psk@nodeseptypeA{2 }% + \def\psk@nodeseptypeB{2 }} +\define@key[psset]{}{YnodesepA}{\pst@getlength{#1}\psk@nodesepA\def\psk@nodeseptypeA{1 }} +\define@key[psset]{}{YnodesepB}{\pst@getlength{#1}\psk@nodesepB\def\psk@nodeseptypeB{1 }} +\define@key[psset]{}{Ynodesep}{% + \pst@getlength{#1}\psk@nodesepA + \let\psk@nodesepB\psk@nodesepA + \def\psk@nodeseptypeA{1 }% + \def\psk@nodeseptypeB{1 }} +%%%% end bugfix %%%%% +\define@key[psset]{pst-node}{nodesepA}[0pt]{\pst@getlength{#1}\psk@nodesepA \def\psk@nodeseptypeA{0 }} +\define@key[psset]{pst-node}{nodesepB}[0pt]{\pst@getlength{#1}\psk@nodesepB \def\psk@nodeseptypeB{0 }} +\define@key[psset]{pst-node}{nodesep}[0pt]{% + \pst@getlength{#1}\psk@nodesepA + \let\psk@nodesepB\psk@nodesepA + \def\psk@nodeseptypeA{0 }% + \def\psk@nodeseptypeB{0 }} +\psset[pst-node]{nodesep=0pt} +%\define@key[psset]{pst-node}{XnodesepA}[]{\pst@getlength{#1}\psk@nodesepA \def\psk@nodeseptypeA{1 }} +%\define@key[psset]{pst-node}{XnodesepB}[]{\pst@getlength{#1}\psk@nodesepB \def\psk@nodeseptypeB{1 }} +%\define@key[psset]{pst-node}{Xnodesep}[]{% +% \pst@getlength{#1}\psk@nodesepA +% \let\psk@nodesepB\psk@nodesepA +% \def\psk@nodeseptypeA{1 }% +% \def\psk@nodeseptypeB{1 }} +%\define@key[psset]{pst-node}{YnodesepA}[]{\pst@getlength{#1}\psk@nodesepA \def\psk@nodeseptypeA{2 }} +%\define@key[psset]{pst-node}{YnodesepB}[]{\pst@getlength{#1}\psk@nodesepB \def\psk@nodeseptypeB{2 }} +%\define@key[psset]{pst-node}{Ynodesep}[]{ +% \pst@getlength{#1}\psk@nodesepA +% \let\psk@nodesepB\psk@nodesepA +% \def\psk@nodeseptypeA{2 }% +% \def\psk@nodeseptypeB{2 }} +\define@key[psset]{pst-node}{armA}[10pt]{\pst@getlength{#1}\psk@armA \def\psk@armtypeA{0 }} +\define@key[psset]{pst-node}{armB}[10pt]{\pst@getlength{#1}\psk@armB \def\psk@armtypeB{0 }} +\define@key[psset]{pst-node}{arm}[10pt]{% + \pst@getlength{#1}\psk@armA + \let\psk@armB\psk@armA + \def\psk@armtypeA{0 }% + \def\psk@armtypeB{0 }} +\psset[pst-node]{arm=10pt} +\define@key[psset]{pst-node}{XarmA}[]{\pst@getlength{#1}\psk@armA \def\psk@armtypeA{1 }} +\define@key[psset]{pst-node}{XarmB}[]{\pst@getlength{#1}\psk@armB \def\psk@armtypeB{1 }} +\define@key[psset]{pst-node}{Xarm}{% + \pst@getlength{#1}\psk@armA + \let\psk@armB\psk@armA + \def\psk@armtypeA{1 }% + \def\psk@armtypeB{1 }} +\define@key[psset]{pst-node}{YarmA}[]{\pst@getlength{#1}\psk@armA \def\psk@armtypeA{2 }} +\define@key[psset]{pst-node}{YarmB}[]{\pst@getlength{#1}\psk@armB \def\psk@armtypeB{2 }} +\define@key[psset]{pst-node}{Yarm}[]{% + \pst@getlength{#1}\psk@armA + \let\psk@armB\psk@armA + \def\psk@armtypeA{2 }% + \def\psk@armtypeB{2 }} +\define@key[psset]{pst-node}{offsetA}[0pt]{\pst@getlength{#1}\psk@offsetA} +\define@key[psset]{pst-node}{offsetB}[0pt]{\pst@getlength{#1}\psk@offsetB} +\define@key[psset]{pst-node}{offset}[0pt]{\pst@getlength{#1}\psk@offsetA\let\psk@offsetB\psk@offsetA} +\psset[pst-node]{offset=0pt} +\define@key[psset]{pst-node}{angleA}[0]{\pst@getangle{#1}\psk@angleA} +\define@key[psset]{pst-node}{angleB}[0]{\pst@getangle{#1}\psk@angleB}% +\define@key[psset]{pst-node}{angle}[0pt]{% + \pst@getangle{#1}\psk@angleA + \let\psk@angleB\psk@angleA} +\psset[pst-node]{angle=0} +\define@key[psset]{pst-node}{arcangleA}[8]{\pst@getangle{#1}\psk@arcangleA} +\define@key[psset]{pst-node}{arcangleB}[8]{\pst@getangle{#1}\psk@arcangleB}% +\define@key[psset]{pst-node}{arcangle}[8]{% + \pst@getangle{#1}\psk@arcangleA + \let\psk@arcangleB\psk@arcangleA} +\psset[pst-node]{arcangle=8} +\define@key[psset]{pst-node}{ncurvA}[0.67]{\pst@checknum{#1}\psk@ncurvA} +\define@key[psset]{pst-node}{ncurvB}[0.67]{\pst@checknum{#1}\psk@ncurvB}% +\define@key[psset]{pst-node}{ncurv}[0.67]{\pst@checknum{#1}\psk@ncurvA\let\psk@ncurvB\psk@ncurvA} +\psset[pst-node]{ncurv=0.67} +% +\def\tx@GetCenter{GetCenter } +\def\tx@XYPos{XYPos } +\def\tx@GetEdge{GetEdge } +\def\tx@AddOffset{AddOffset } +\def\tx@GetEdgeA{GetEdgeA } +\def\tx@GetEdgeB{GetEdgeB } +\def\tx@GetArmA{GetArmA } +\def\tx@GetArmB{GetArmB } +% +\def\check@arrow#1#2{% + \check@@arrow#2-\@nil + \if@pst\addto@par{arrows=#2}\def\next{#1}% + \else\def\next{#1{#2}}\fi + \next} +\def\check@@arrow#1-#2\@nil{% +\ifx\@nil#2\@nil\@pstfalse\else\@psttrue\fi} +% +\def\tx@InitNC{InitNC } +\def\nc@object#1#2#3#4#5{% + \csname begin@#1Obj\endcsname + \showpointsfalse + \pst@getnode{#2}\pst@tempa + \pst@getnode{#3}\pst@tempb + \gdef\npos@default{#4 }% + \addto@pscode{% + /NCLW CLW def + \pst@nodedict + \psk@offsetA + \psk@offsetB neg + \psk@nodesepA + \psk@nodesepB + \psk@nodeseptypeA + \psk@nodeseptypeB + \pst@tempa + \pst@tempb + \tx@InitNC { #5 } if + end }% + \def\use@pscode{% + \pst@Verb{gsave \tx@STV newpath \pst@code\space grestore}% + \gdef\pst@code{}}% + \csname end@#1Obj\endcsname + \pst@shortput} +% +\def\npos@default{.5 } +% +\def\pc@object#1{% + \@ifnextchar({\pc@@object#1}{\pst@getarrows{\pc@@object#1}}} +\def\pc@@object#1(#2)(#3){% + \pnode(#2){@@A}\pnode(#3){@@B}% + #1{@@A}{@@B}} +% +\def\tx@LPutLine{LPutLine } +\def\tx@LPutLines{LPutLines } +\def\tx@BezierMidpoint{BezierMidpoint } +\def\tx@HPosBegin{HPosBegin } +\def\tx@HPosEnd{HPosEnd } +\def\tx@HPutLine{HPutLine } +\def\tx@HPutLines{HPutLines } +\def\tx@VPosBegin{VPosBegin } +\def\tx@VPosEnd{VPosEnd } +\def\tx@VPutLine{VPutLine } +\def\tx@VPutLines{VPutLines } +\def\tx@HPutCurve{HPutCurve } +\def\tx@NCCoor{NCCoor } +\def\tx@NCLine{NCLine } +% +\def\ncline{\pst@object{ncline}} +\def\ncline@i{\check@arrow{\ncline@ii}} +\def\ncline@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{\tx@NCLine}} +% +\def\pcline{\pst@object{pcline}} +\def\pcline@i{\pc@object\ncline@ii} +% +\def\ncLine{\pst@object{ncLine}} +\def\ncLine@i{\check@arrow{\ncLine@ii}} +\def\ncLine@ii#1#2{\nc@object{Open}{#1}{#2}{.5}% +% DG/SR modification begin - Apr. 14, 1999 - Patch 9 +%{\tx@NCLine /LPutPos { xB xA yB yA \tx@LPutLine } def}} +{\tx@NCLine /LPutPos { xB yB xA yA \tx@LPutLine } def}} +% DG/SR modification end +% +\def\tx@NCLines{NCLines } +\def\nclines{\pst@object{nclines}} +\def\nclines@i{\check@arrow\nclines@ii} +\def\nclines@ii#1#2{% +\begingroup +\use@par +\def\pst@aftercoors{\nclines@iii{#1}{#2}}% +\def\pst@coors{}% +\pst@@getcoors} +\def\nclines@iii#1#2{% +\nc@object{Open}{#1}{#2}{.5}{% +tx@Dict begin \psline@iii pop end +mark \pst@coors \tx@NCLines}% +\endgroup +\ignorespaces} +\def\tx@NCCurve{NCCurve } +\def\nccurve{\pst@object{nccurve}} +\def\nccurve@i{\check@arrow{\nccurve@ii}} +\def\nccurve@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% + /AngleA \psk@angleA\space def /AngleB \psk@angleB\space def + \psk@ncurvB\space \psk@ncurvA\space + \tx@NCCurve}} +\def\pccurve{\pst@object{pccurve}} +\def\pccurve@i{\pc@object\nccurve@ii} +% +\def\ncarc{\pst@object{ncarc}} +\def\ncarc@i{\check@arrow{\ncarc@ii}} +\def\ncarc@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% + yB yA sub xB xA sub \tx@Atan dup + \psk@arcangleA\space add /AngleA exch def + \psk@arcangleB\space sub 180 add /AngleB exch def + \psk@ncurvB\space \psk@ncurvA\space + \tx@NCCurve}} +\def\pcarc{\pst@object{pcarc}} +\def\pcarc@i{\pc@object\ncarc@ii} +% +\def\tx@NCAngles{NCAngles } +% +%border or center as reference point (hv) +\define@boolkey[psset]{pst-node}[Pst@]{pcRef}[true]{} +\psset[pst-node]{pcRef=false} +% +\def\ncangles{\pst@object{ncangles}} +\def\ncangles@i{\check@arrow{\ncangles@ii}} +\def\ncangles@ii#1#2{% + \nc@object{Open}{#1}{#2}{1.5}{\ncangles@iii \tx@NCAngles}} +\def\ncangles@iii{ + tx@Dict begin \psline@iii pop end + /AngleA \psk@angleA def + /AngleB \psk@angleB def + /ArmA \psk@armA \ifPst@pcRef + GetEdgeA yA yA1 sub dup mul xA xA1 sub dup mul add sqrt sub \fi def + /ArmB \psk@armB def + /ArmTypeA \psk@armtypeA def + /ArmTypeB \psk@armtypeB def } +% +\def\pcangles{\pst@object{pcangles}} +\def\pcangles@i{\pc@object\ncangles@ii} +\def\tx@NCAngle{NCAngle } +\def\ncangle{\pst@object{ncangle}} +\def\ncangle@i{\check@arrow{\ncangle@ii}} +\def\ncangle@ii#1#2{% +\nc@object{Open}{#1}{#2}{1.5}{\ncangles@iii \tx@NCAngle}} +\def\pcangle{\pst@object{pcangle}} +\def\pcangle@i{\pc@object\ncangle@ii} +\def\tx@NCBar{NCBar } +\def\ncbar{\pst@object{ncbar}} +\def\ncbar@i{\check@arrow{\ncbar@ii}} +\def\ncbar@ii#1#2{\nc@object{Open}{#1}{#2}{1.5}{% +\ncangles@iii /AngleB \psk@angleA def \tx@NCBar}} +\def\pcbar{\pst@object{pcbar}} +\def\pcbar@i{\pc@object\ncbar@ii} +% +\define@key[psset]{pst-node}{lineAngle}[0]{% + \ifdim#1pt=\z@\else\psset{armB=0.5}\fi + \def\psk@lineAngle{#1}}% +\psset[pst-node]{lineAngle=0}% +% +\def\tx@NCDiag{NCDiag } +\def\ncdiag{\pst@object{ncdiag}} +\def\ncdiag@i{\check@arrow{\ncdiag@ii}} +\def\ncdiag@ii#1#2{% + \nc@object{Open}{#1}{#2}{1.5}{\ncangles@iii \psk@lineAngle\space \tx@NCDiag}} +% +\def\pcdiag{\pst@object{pcdiag}} +\def\pcdiag@i{\pc@object\ncdiag@ii} +% +\def\tx@NCDiagg{NCDiagg } +\def\ncdiagg{\pst@object{ncdiagg}} +\def\ncdiagg@i{\check@arrow{\ncdiagg@ii}} +\def\ncdiagg@ii#1#2{% + \nc@object{Open}{#1}{#2}{.5}{\ncangles@iii \psk@lineAngle\space \tx@NCDiagg}} +\def\pcdiagg{\pst@object{pcdiagg}} +% +\def\pcdiagg@i{\pc@object\ncdiagg@ii} +\def\tx@NCLoop{NCLoop } +\define@key[psset]{pst-node}{loopsize}{\pst@getlength{#1}\psk@loopsize} +\psset[pst-node]{loopsize=1cm} +\def\ncloop{\pst@object{ncloop}} +\def\ncloop@i{\check@arrow{\ncloop@ii}} +\def\ncloop@ii#1#2{% +\nc@object{Open}{#1}{#2}{2.5}% +{\ncangles@iii /loopsize \psk@loopsize def \tx@NCLoop}} +\def\pcloop{\pst@object{pcloop}} +\def\pcloop@i{\pc@object\ncloop@ii} +\def\tx@NCCircle{NCCircle } +\def\nccircle{\pst@object{nccircle}} +\def\nccircle@i{\check@arrow{\nccircle@ii}} +\def\nccircle@ii#1#2{% +\pssetlength\pst@dima{#2}% +\nc@object{Open}{#1}{#1}{.5}{% +/AngleA \psk@angleA def +/r \pst@number\pst@dima def +\tx@NCCircle \psarc@v end}} +\def\tx@NCBox{NCBox } +\def\ncbox{\pst@object{ncbox}} +\def\ncbox@i{\check@arrow{\ncbox@ii}} +\def\ncbox@ii#1#2{% +\def\pst@linetype{2}% +\nc@object{Closed}{#1}{#2}{.5}{% +tx@Dict begin \psline@iii pop end +\psk@boxheight \psk@boxdepth +\tx@NCBox}} +\def\pcbox{\pst@object{pcbox}} +\def\pcbox@i{\pc@object\ncbox@ii} +\def\tx@NCArcBox{NCArcBox } +\define@key[psset]{pst-node}{boxheight}[0.4cm]{\pst@getlength{#1}\psk@boxheight} +\define@key[psset]{pst-node}{boxdepth}[0.4cm]{\pst@getlength{#1}\psk@boxdepth} +\define@key[psset]{pst-node}{boxsize}[0.4cm]{% + \pst@getlength{#1}\psk@boxheight% + \let\psk@boxdepth\psk@boxheight} +\psset[pst-node]{boxsize=0.4cm} +% +\def\ncarcbox{\pst@object{ncarcbox}} +\def\ncarcbox@i{\check@arrow{\ncarcbox@ii}} +\def\ncarcbox@ii#1#2{% +\def\pst@linetype{1}% +\nc@object{Closed}{#1}{#2}{.5}{% +\psk@arcangleA \psk@boxheight \psk@boxdepth \pst@number\pslinearc +\tx@NCArcBox}} +\def\pcarcbox{\pst@object{pcarcbox}} +\def\pcarcbox@i{\pc@object\ncarcbox@ii} +\def\tx@Tfan{Tfan } +% Changed according pst-beta.bug December 3, 1993 +% nrot=:<angle> does not work when : is active. +\begingroup +\catcode`\:=13 +\gdef\pst@activerot{\def:{\string:}} +\endgroup +\define@key[psset]{pst-node}{nrot}[0]{% + \begingroup + \pst@activerot + \pst@expandafter{\@ifnextchar:{\psset@@nrot}{\psset@@rot}}{#1}\@nil + \global\let\pst@tempg\psk@rot + \endgroup + \let\psk@nrot\pst@tempg} +\def\psset@@nrot:#1\@nil{% + \psset@@rot#1\@nil + \edef\psk@rot{NAngle \ifx\psk@rot\@empty\else\psk@rot add \fi}} +\psset[pst-node]{nrot=0} +% +\def\tx@LPutCoor{LPutCoor } +\def\tx@LPut{LPut } +\define@key[psset]{pst-node}{npos}[{}]{% + \def\pst@tempa{#1}% + \ifx\pst@tempa\@empty\def\psk@npos{\npos@default}\else\pst@checknum{#1}\psk@npos\fi} +\psset[pst-node]{npos=} +% +\def\ncput{\pst@object{ncput}} +\def\ncput@i{\pst@killglue\pst@makebox{\ncput@ii}} +\def\ncput@ii{% + \begingroup% + \use@par% + \if@star\pst@starbox\fi% + \pst@makesmall\pst@hbox% + \pst@rotate\psk@nrot\pst@hbox% + \ncput@iii% + \endgroup% + \pst@shortput} +\def\ncput@iii{% + \leavevmode% + \hbox{% + \pst@Verb{ + \pst@nodedict + /t \psk@npos def + \tx@LPut + end + \tx@PutBegin}% + \box\pst@hbox% + \pst@Verb{\tx@PutEnd}}} +% +\def\naput{\pst@object{naput}} +\def\naput@i{\pst@killglue\pst@makebox{\naput@ii{NAngle 90 add}}} +\def\naput@ii#1{% +\begingroup +\use@par +\if@star\pst@starbox\fi +\def\psk@refangle{#1 }% +\let\psk@rot\psk@nrot +\uput@vii +{exch pop add a \tx@PtoC h1 add exch w1 add exch }% +{tx@Dict /NCLW known { NCLW add } if }% +\ncput@iii +\endgroup +\pst@shortput} +\def\nbput{\pst@object{nbput}} +\def\nbput@i{\pst@killglue\pst@makebox{\naput@ii{NAngle 90 sub}}} +\define@key[psset]{pst-node}{tpos}[0.5]{% + \pst@checknum{#1}\psk@tpos + \ifdim\psk@tpos \p@<\z@ + \def\psk@tpos{.5}% +% DG/SR modification begin - Sep. 23, 1998 - Patch 7 +%\@pstrickserr{Bad `tpos' value: `#1'. Must be 0<tpos<1}\@epha + \@pstrickserr{Bad `tpos' value: `#1'. Must be 0<tpos<1}\@ehpa +% DG/SR modification end + \else + \ifdim\psk@tpos \p@>\p@ + \def\psk@tpos{.5}% +% DG/SR modification begin - Sep. 23, 1998 - Patch 7 +%\@pstrickserr{Bad `tpos' value: `#1'. Must be 0<tpos<1}\@epha + \@pstrickserr{Bad `tpos' value: `#1'. Must be 0<tpos<1}\@ehpa% +% DG/SR modification end + \fi% + \fi} +\psset[pst-node]{tpos=0.5} +% +\def\nlput{\pst@object{nlput}} +\def\nlput@i(#1)(#2)#3#4{% + \begin@SpecialObj + \psLDNode(#1)(#2){#3}{temp@lnput} + \pcline[linestyle=none](#1)(temp@lnput)% + \ncput[npos=1]{#4}% + \end@SpecialObj} +% +\def\tvput{\pst@object{tvput}} +\def\tvput@i{\pst@makebox{\psput@tput{H}{1}}} +\def\tlput{\pst@object{tlput}} +\def\tlput@i{\pst@makebox{\psput@tput{H}{true}}} +\def\trput{\pst@object{trput}} +\def\trput@i{\pst@makebox{\psput@tput{H}{false}}} +\def\thput{\pst@object{thput}} +\def\thput@i{\pst@makebox{\psput@tput{V}{1}}} +\def\taput{\pst@object{taput}} +\def\taput@i{\pst@makebox{\psput@tput{V}{true}}} +\def\tbput{\pst@object{tbput}} +\def\tbput@i{\pst@makebox{\psput@tput{V}{false}}} +\def\tx@HPutAdjust{HPutAdjust } +\def\tx@VPutAdjust{VPutAdjust } +\def\psput@tput#1#2{% + \begingroup + \use@par + \pst@tputmakesmall + \leavevmode + \hbox{% + \pst@Verb{% + \pst@nodedict + /t \psk@tpos \pst@tposflip def + tx@NodeDict /HPutPos known + { #1PutPos } + { CP /Y exch def /X exch def /NAngle 0 def /NCLW 0 def } + ifelse + /Sin NAngle sin def + /Cos NAngle cos def + /s \pst@number\pslabelsep NCLW add def + /l \pst@number\pst@dima def + /r \pst@number\pst@dimb def + /h \pst@number\pst@dimc def + /d \pst@number\pst@dimd def +% DG/SR modification begin - Sep. 26, 1997 - Patch 4 +%\ifnum1=0#2\else + \ifnum1=0#2 \else +% DG/SR modification end + /flag #2 def + \csname tx@#1PutAdjust\endcsname + \fi + \tx@LPutCoor + end + \tx@PutBegin}% + \box\pst@hbox + \pst@Verb{\tx@PutEnd}}% + \endgroup + \pst@shortput} +% +\def\pst@tposflip{} +\def\pst@tputmakesmall{% +% +\pst@dima=\wd\pst@hbox +\divide\pst@dima 2 +\pst@dimg=\psk@href\pst@dimg +\pst@dimb\pst@dima +\advance\pst@dima\pst@dimg % leftsize +\advance\pst@dimb-\pst@dimg % rightsize +\pst@dimd=\psk@vref\relax +\pst@dimc=\ht\pst@hbox +\advance\pst@dimc-\pst@dimd % height +\advance\pst@dimd\dp\pst@hbox % depth +\setbox\pst@hbox=\hbox to\z@{% +\kern-\pst@dima\vbox to\z@{\vss\box\pst@hbox\vskip-\pst@dimd}\hss}} +\def\MakeShortNab#1#2{% + \def\pst@shortput@nab{% + \def\pst@tempg{\next}% + \ifx#1\next + \let\pst@tempg\naput + \else + \ifx#2\next + \let\pst@tempg\nbput + \else + \ifx\@sptoken\next + \let\pst@tempg\pst@shortput + \fi + \fi + \fi + \pst@tempg}} +\MakeShortNab{^}{_} +\def\MakeShortTablr#1#2#3#4{% + \def\pst@shortput@tablr{% + \def\pst@tempg{\next}% + \ifx#1\next + \let\pst@tempg\taput + \else + \ifx#2\next + \let\pst@tempg\tbput + \else + \ifx#3\next + \let\pst@tempg\tlput + \else + \ifx#4\next + \let\pst@tempg\trput + \else + \ifx\@sptoken\next + \let\pst@tempg\pst@shortput + \fi + \fi + \fi + \fi + \fi + \pst@tempg}} +\MakeShortTablr{^}{_}{<}{>} +\def\MakeShortTab#1#2{% + \def\pst@shortput@tab{% + \def\pst@tempg{\next}% + \ifx#1\next + \def\pst@tempg{% + \@nameuse{% + t\ifodd\psk@treemode\ifpstreeflip b\else a\fi + \else\ifpstreeflip r\else l\fi\fi put}}% + \else + \ifx#2\next + \def\pst@tempg{% + \@nameuse{% + t\ifodd\psk@treemode\ifpstreeflip a\else b\fi + \else\ifpstreeflip l\else r\fi\fi put}}% + \else + \ifx\@sptoken\next + \let\pst@tempg\pst@shortput + \fi + \fi + \fi + \pst@tempg}} +\MakeShortTab{^}{_} +\define@key[psset]{pst-node}{shortput}[none]{% + \def\pst@tempg{#1}% + \ifx\pst@tempg\@none + \let\pst@shortput\ignorespaces + \else + \@ifundefined{pst@shortput@#1}% + {\@pstrickserr{Bad short put: `#1'}\@ehpa}% + {\edef\pst@shortput{\noexpand\afterassignment\expandafter\noexpand + \csname pst@shortput@#1\endcsname\noexpand\let\noexpand\next}}% + \fi} +\psset[pst-node]{shortput=none} +% +\def\lput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\lput@i}{\lput@ii}}} +\def\lput@i[#1]{\addto@par{ref=#1}\lput@ii} +\def\lput@ii{\@ifnextchar({\lput@iv}{\lput@iii}} +\def\lput@iii#1{\addto@par{nrot=#1}\@ifnextchar({\lput@iv}{\ncput@i}} +\def\lput@iv(#1){\addto@par{npos=#1}\ncput@i} +\def\mput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\mput@i}{\ncput@i}}} +\def\mput@i[#1]{\addto@par{ref=#1}\ncput@i} +\def\Lput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Lput@ii}{\Lput@i}}} +\def\Lput@i#1{\addto@par{labelsep=#1}\Lput@ii} +\def\Lput@ii[#1]{\addto@par{ref={#1}}\@ifnextchar({\Lput@iv}{\Lput@iii}} +\def\Lput@iii#1{\addto@par{nrot={#1}}\@ifnextchar({\Lput@iv}{\Lput@v}} +\def\Lput@iv(#1){\addto@par{npos=#1}\Lput@v} +\def\Lput@v{\pst@killglue\pst@makebox{\Lput@vi}} +\def\Lput@vi{% +\begingroup +\use@par +\if@star\pst@starbox\fi +\Rput@vi +\pst@makesmall\pst@hbox +\pst@rotate\psk@nrot\pst@hbox +\ncput@iii +\endgroup +\pst@shortput} +\def\Mput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Mput@ii}{\Mput@i}}} +\def\Mput@i#1{\addto@par{labelsep=#1}\Mput@ii} +\def\Mput@ii[#1]{\addto@par{ref={#1}}\Lput@v} +\def\aput@#1{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\aput@i#1}{\aput@ii#1}}} +\def\aput@i#1[#2]{\addto@par{labelsep=#2}\aput@ii#1} +\def\aput@ii#1{\@ifnextchar({\aput@iv#1}{\aput@iii#1}} +\def\aput@iii#1#2{\addto@par{nrot=#2}\@ifnextchar({\aput@iv#1}{#1}} +\def\aput@iv#1(#2){\addto@par{npos=#2}#1} +\def\aput{\aput@\naput@i} +\def\bput{\aput@\nbput@i} +\def\Aput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Aput@i}{\naput@i}}} +\def\Aput@i[#1]{\addto@par{labelsep=#1}\naput@i} +\def\Bput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Bput@i}{\nbput@i}}} +\def\Bput@i[#1]{\addto@par{labelsep=#1}\nbput@i} +\def\node@coor#1;#2\@nil{% + \pst@getnode{#1}\pst@tempg + \edef\pst@coor{% + \pst@nodedict + tx@NodeDict \pst@tempg known + \pslbrace \pst@tempg load \tx@GetCenter \psrbrace + \pslbrace 0 0 \psrbrace ifelse + end }} +\def\Node@coor[#1]#2;#3\@nil{% +\begingroup +\psset{#1}% +\@ifnextchar\bgroup{\Node@@@coor}{\Node@@coor}#2\@nil +\endgroup +\let\pst@coor\pst@tempg} +\def\Node@@coor#1\@nil{% +\pst@getnode{#1}\pst@tempg +\xdef\pst@tempg{% +\pst@nodedict +tx@NodeDict \pst@tempg known +{ \psk@nodesepA \psk@angleA +\pst@tempg load \psk@nodeseptypeA \tx@GetEdge +\psk@offsetA \psk@angleA \tx@AddOffset +\pst@tempg load \tx@GetCenter +3 -1 roll add 3 1 roll add exch } +{ CP } +ifelse +end }}% +\def\Node@@@coor#1{% +\pst@@getcoor{#1}% +\def\psk@angleA{% +\pst@tempg load \tx@GetCenter \pst@coor +3 -1 roll sub 3 1 roll sub neg \tx@Atan}% +\Node@@coor} +% +\def\nput{\pst@object{nput}} +\def\nput@i#1#2{\pst@killglue\pst@makebox{\nput@ii{#1}{#2}}} +\def\nput@ii#1#2{% + \begingroup + \use@par + \psset[pstricks]{refangle=#1}% + \let\psk@angleA\psk@refangle + \edef\psk@nodesepA{\pst@number\pslabelsep}% + \def\psk@nodeseptypeA{0 }% + \pslabelsep\z@ + \uput@vi + \Node@@coor#2\@nil + \let\pst@coor\pst@tempg + \leavevmode + \psput@special\pst@hbox + \endgroup + \ignorespaces} +% +\newcount\psrow +\newcount\pscol +\newcount\psmatrixcnt +\newskip\psrowsep +\newskip\pscolsep +% +\define@key[psset]{pst-node}{colsep}[1.5cm]{\pssetlength\pscolsep{#1}} +\define@key[psset]{pst-node}{rowsep}[1.5cm]{\pssetlength\psrowsep{#1}} +\psset[pst-node]{colsep=1.5cm} +\psset[pst-node]{rowsep=1.5cm} +\newif\ifpsmatrix +% DG/SR modification begin - Nov. 27, 1998 - Patch 8 +%\let\mscount\@multicnt +\ifx\mscount\@undefined\let\mscount\@multicnt\fi +% DG/SR modification end +\def\psmatrix{\begingroup{\ifnum0=`}\fi % Don't want to expand any &. + \@ifnextchar[{\psmatrix@i}{\ifnum0=`{\fi}{}\psmatrix@ii}} +\def\psmatrix@i[#1]{% + \ifnum0=`{\fi}{}% + \psset{#1}% + \psmatrix@ii} +\def\psmatrix@ii{% + \KillGlue + \edef\psm@beginmath{% + \ifmmode$\m@th\ifinner\textstyle\else\displaystyle\fi\fi}% + \edef\psm@endmath{\ifmmode$\fi}% + \let\\\psm@cr + \advance\psmatrixcnt by \@ne + \def\psm@thenode{M-\the\psmatrixcnt-\the\psrow-\the\pscol}% + \tabskip\z@ + \psrow=\@ne + \pscol\z@ + \psset{shortput=tablr}% + \leavevmode + \vbox\bgroup\halign\bgroup&% + \begingroup + \global\advance\pscol by \@ne + \csname psrowhook\romannumeral\psrow\endcsname + \csname pscolhook\romannumeral\pscol\endcsname + \psm@beginnode##\psm@endnode\endgroup + \cr} +% +\def\endpsmatrix{% + \crcr\egroup\unskip\egroup + \endgroup} +% +% hv 2007-10-16 fix bug with \\[name=...] +%\def\psm@cr{{\ifnum0=`}\fi\@ifnextchar[{\psm@@cr}{\psm@@@cr{}}} +\def\psm@cr{{\ifnum0=`}\fi\ps@ifnextchar[{\psm@@cr}{\psm@@@cr{}}} +% +\def\psm@@cr[#1]{\psm@@@cr{\vskip#1\relax}} +\def\psm@@@cr#1{% + \ifnum0=`{\fi}{}\cr + \noalign{% + \global\advance\psrow 1 + \global\pscol\z@ + \vskip\psrowsep + #1}} +\def\psm@beginnode{% + \@ifnextchar\psm@endnode + {\let\psm@endnode@i\relax\setbox\pst@hbox=\hbox{}}% + {\pst@object{psm@beginnode}}} +\def\psm@beginnode@i{% + \setbox\pst@hbox=\hbox\bgroup + \psm@beginmath + \begingroup + \ignorespaces} +\def\psm@endnode@i{% + \unskip + \endgroup + \psm@endmath + \egroup + \use@par + \@psttrue} +\def\psm@endnode{% + \@pstfalse + \psm@endnode@i + \ifnum\pscol>1\relax \pshskip\pscolsep \fi + \psk@mnodesize + \hfil + \nodealigntrue + \if@pst\csname mnode@\psk@mnode\endcsname + \else\csname mnode@\psk@emnode\endcsname\fi + \psk@mcol + \psk@@mnodesize} +% DG/SR modification begin - Sep. 3, 1999 - Patch 10 - From Michael Sharpe +%\def\psspan#1{\mscount#1\relax\loop\ifnum\mscount>\@ne \sp@n\repeat} +\def\psspan#1{\global\mscount#1\relax\pstloop\ifnum\mscount>\@ne\sp@n\repeat} +\def\pstloop#1\repeat{\gdef\pstiterate{#1\relax\expandafter\pstiterate\fi}% + \pstiterate + \let\pstiterate\relax} +% DG/SR modification end +\define@key[psset]{pst-node}{name}[\relax]{\pst@getnode{#1}\psk@name} +\let\psk@name\relax +\define@key[psset]{pst-node}{mcol}[c]{% + \ifx r#1\relax\let\psk@mcol\relax\else + \ifx l#1\relax\let\psk@mcol\hfill\else + \let\psk@mcol\hfil\fi\fi} +\psset[pst-node]{mcol=c} +% +\define@key[psset]{pst-node}{mnodesize}[-1pt]{% + \pssetlength\pst@dimg{#1}% + \ifdim\pst@dimg<\z@ + \let\psk@mnodesize\relax + \let\psk@@mnodesize\relax + \else + \edef\psk@mnodesize{\noexpand\hbox to\number\pst@dimg sp\noexpand\bgroup}% + \let\psk@@mnodesize\egroup + \fi} +\psset[pst-node]{mnodesize=-1pt} +% +\def\mnode@R{\rnode@iii\Rnode@ii{\psm@thenode}} +\def\mnode@r{\rnode@iii\rnode@iv{\psm@thenode}} +\def\mnode@oval{\ovalnode@ii{\psm@thenode}} +\def\mnode@tri{\trinode@ii{\psm@thenode}} +\def\mnode@dia{\dianode@ii{\psm@thenode}} +\def\mnode@C{{\nodealigntrue\cnode@ii(\z@,\z@){\psk@radius}{\psm@thenode}}} +\def\mnode@f{{\nodealigntrue\fnode@ii(\z@,\z@){\psm@thenode}}} +\def\mnode@circle{\circlenode@ii{\psm@thenode}} +% hv modification begin - Aug. 16, 2007 +\def\mnode@Circle{\Circlenode@ii{\psm@thenode}} +% hv modification end - Aug. 16, 2007 +\def\mnode@p{\pnode(\z@,\z@){\psm@thenode}} +% DG/SR modification begin - Jul. 22, 1997 - Patch 1 +\def\mnode@dot{\dotnode@ii(\z@,\z@){\psm@thenode}} +% DG/SR modification end +\def\mnode@none{\box\pst@hbox} +% +\define@key[psset]{pst-node}{mnode}[R]{% + \@ifundefined{mnode@#1}% + {\@pstrickserr{\string\psmatrix\space node `#1' not defined.}\@ehpa}% + {\edef\psk@mnode{#1}}} +\define@key[psset]{pst-node}{emnode}[none]{% + \@ifundefined{mnode@#1}% + {\@pstrickserr{\string\psmatrix\space node `#1' not defined.}\@ehpa}% + {\edef\psk@emnode{#1}}} +\psset[pst-node]{mnode=R,emnode=none} +% +%%%% FROM pst-coil.tex +\def\nccoil{\pst@object{nccoil}} +\def\nccoil@i{\check@arrow{\nccoil@ii}} +\def\nccoil@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{ + \tx@NCCoor + tx@Dict begin + 4 2 roll + \psk@coilwidth \pscoilheight + \psk@coilarmA \psk@coilarmB + \psk@coilaspect \psk@coilinc + \pst@coildict \tx@Coil end + end}% +} +\def\nczigzag{\pst@object{nczigzag}} +\def\nczigzag@i{\check@arrow{\nczigzag@ii}} +\def\nczigzag@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{ + \tx@NCCoor + tx@Dict begin + 4 2 roll + \pscoilheight + \psk@coilwidth + \psk@coilarmA + \psk@coilarmB + \pst@coildict \tx@ZigZag end + \psline@iii + \tx@Line + end}% +} +% \psGetNodeCenter defines the PS variable #1.x and #1.y, which can then +% be used by the user. #1 must be a valid node name +\def\psGetNodeCenter#1{ tx@NodeDict begin /N@#1 load GetCenter end % x y on stack in system coor + \pst@number\psyunit div /#1.y exch def % /#1.y in user coor + \pst@number\psxunit div /#1.x exch def } % /#1.x in user coor +%\def\psGetNodeEdgeA#1#2{ tx@NodeDict begin /N@#2 load #2 GetEdgeA end % x y on stack in system coor +% \pst@number\psyunit div /#1.y exch def % /#1.y in user coor +% \pst@number\psxunit div /#1.x exch def } % /#1.x in user coor +% +%%%%%%%%%%%%%% the pst-node-tools part %%%%%%%%%%%%%%%%%%%%%%%% +% +\def\ncbarr{\pst@object{ncbarr}} +\def\ncbarr@i#1#2{% + \begingroup + \use@par% + \psLNode(#1)(#2){0.5}{barr@tempNode}% + \pst@dimc=\psk@angleA pt + \pst@dimd=180pt + % be sure, that angleA is 0 or 180. if not, we set it to 0 + \ifdim\pst@dimc=\z@\else\ifdim\pst@dimc=\pst@dimd\else\psset{angleA=0}\fi\fi + \ncbar[arrows=-]{#1}{barr@tempNode} + \ifdim\psk@angleA pt=\z@\relax + \ncbar[angleA=180,angleB=180]{barr@tempNode}{#2} + \else\ncbar[angleA=0,angleB=0]{barr@tempNode}{#2}\fi% + \endgroup% +} +% #1-------#4----------------#2 +% where #1#4= #3 * #1#2 +% +\def\psLNode(#1)(#2)#3#4{% + \pst@getcoor{#1}\pst@tempA% + \pst@getcoor{#2}\pst@tempB% + \pnode(! + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + /dx XB XA sub def + /dy YB YA sub def + XA dx #3\space mul add YA dy #3\space mul add){#4}} +% +% build the linear combination #2*#1+#4*#3=#5 +\def\psLCNode(#1)#2(#3)#4#5{% + \pst@getcoor{#1}\pst@tempA% + \pst@getcoor{#3}\pst@tempB% + \pnode(! + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + XA #2\space mul XB #4\space mul add + YA #2\space mul YB #4\space mul add){#5}} +% +\def\psLDNode(#1)(#2)#3#4{% +% #1: node A #2: node B #3: dimen measured from A #4: node name + \pst@getcoor{#1}\pst@tempA% + \pst@getcoor{#2}\pst@tempB% + \pssetlength\pst@dimb{#3}% + \pnode(!% + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + /dx XB XA sub def + /dy YB YA sub def + /angle dy dx Atan def + /linelength \pst@number\pst@dimb \pst@number\psunit div def + XA linelength angle cos mul add YA linelength angle sin mul add ){#4}% +} +% +%% Author: Michael Sharpe (msharpe at ucsd.edu) +% Macros defined in this file: +% \defaultvalue{<command>}{<value>} assigns <value> to <command> is command is not defined, or is empty. +% \testAlg---used internally to test whether an parametric expression in t is algebraic +% \trim{<command>} trims white space from ends of expansion of <command> +% \hasparen sets \parentrue if its argument contains a ( +% \hasequal sets \equaltrue if its argument starts with = +% \equalwhat returns what follows = +% \parsenodexn parses a node expression recursively. Better to use \nodexn. +% \normalvec(<vec>){<nodename>} returns vector normal to <vec> (same length) in <nodename> +% \curvepnode{<t>}{<expression in t>}{<nodename>} Eg, \curvepnode{1}{sin(t) | cos(t)}{P} sets a pnode named P at (cos(1), sin(1)) +% \psparnode{<t>}{<expression> in t>}{<nodename>} is called by \curvename if expression is PostScript, not algebraic +% \algparnode{<t>}{<expression> in t>}{<nodename>} is called by \curvename if expression is algebraic, not PostScript +% \nodexn is like \parsenodexn, slightly different syntax. \nodexn{<exn>}{<name>} evaluates <exn> as a node expression and calls the result <name>. +% \psxline(P){<nodexn1>}{<nodexn2>} draws line from P+<nodexn1> to P+<nodexn2>. The novelty is that the last two arguments can be node expressions. +% \curvepnodes{<tmin>}{<tmax>}{<expression in t>}{<node root name>} Uses current setting of plotpoints (default 50) to define a sequence of pnodes along the curve. Eg, \curvepnodes[plotpoints=100]{0}{1}{t+t^2 | Ex(-t)}{P} sets pnodes P0..P99 at equally spaced t values along the curve, and defines the macro \Pnodecount to 99, the highest index. The expression in t may be either algebraic or PostScript, and is handled automatically detected. +% \fnpnode{<xval>}{<expression in x>}{<nodename>} sets a single pnode on graph. Eg, \fnpnode{.5}{x 2 mul x 1 add mul}{P} declares the pnode P at the point x=0.5 on the graph. (Same as \pnode(!/x 0.5 def x x 2 mul x 1 add mul}){P}.) If your expression in t is algebraic, you must use the keyword algebraic, as in \fnpnode[algebraic]{0.5}{2*x*(x+1)}{P}. +% \fnpnodes{<xmin}{<xmax>}{<expression in x>}{<node root name>} Is exactly the same as \curvenodes, but for the graph of a function. The keyword algebraic must be specified if your expression is algebraic +% \AtoB(A)(B){C} defines node by name C essentially as B-A +% \AplusB(A)(B){C} defines node by name C essentially as A+B +% \midAB(A)(B){C} defines node by name C essentially as (A+B)/2 +% \psnline[linewidth=1pt,arrows=->](3,5){P}, for example, expects that there are pnodes named P3..P7 (total of 5), and effectively gives the same result as \psline[linewidth=1pt,arrows=->](P3)(P4)(P5)(P6)(P7). Note that arrow must be specified with a keyword, not as an argument. +% \shownode(P) displays in the console window the coordinates of node P. This will not appear until the final stage of processing the PostScript file. It is a debugging tool. +% \getnodelist{<node root name>}{<next command>} is useful in writing pstricks macros, where there is a list of parenthesized coordinates to be read and turned into a node sequence, following which <next command> is followed. +% \pnodes{P}(1,2)(2;3)... is effectively \getnodelist{P}{}(1,2)(2;3)..., just a quick way to turn a list of coordinates into pnodes P0 P1 ... +% \psLCNodeVar is similar to \psLCNode, and provides a means of forming a linear combination of two nodes, thought of as vectors. Where \psLCNode(A){a}(B){b}{C} effectively makes C=aA+bB, \psLCNodeVar(A)(B)(a,b){C} does the same, but the third argument (a,b) may be specified in PostScript code or any form recognized by \SpecialCoor. Unlike \psLCNode, the name C may be one of A, B. +% \psRelNodeVar is similar to \psRelNode, and provides a means of rotating and changing the length of a line segment AB about A. The effect of \psRelNodeVar(A)(B)(2;30){C} is the same as \psRelNode[angle=30](A)(B){2}{C}, but the third argument (2;30) may be specified in PostScript code, which is not possible with \psRelNode. +% \psRelLineVar stands to \psRelLine as \psRelNodeVar stands to \psRelNode. +% \rhombus{<edge length>}(A)(B){C}{D} computes the two remaining vertices C, D given two opposing vertices A, B of a rhombus with given edge length. It does not draw the rhombus--- that can be handled easily by \pspolygon(A)(C)(B)(D). +% \psrline(P)(Q)... is like \psline, drawing a line starting at (P), with successive increments (Q)... It has the same options as \psline. Eg, \psrline[linecolor=red]{->}(1,1)(1,0) +% \polyIntersection is the most complicated macro in the collection. It has two forms +% \polyIntersection{<Nodename1>}{<Nodename2>}(A)(B)(1,2)(3;30)(6,5)... +%works with the line starting at A heading toward B, and computes the first point that lies on the polyline (1,2)(3;30)(6,5)..., calling it <Nodename1>. It also computes the first point in the opposite direction (from A) lying on that polyline, naming it <Nodename2>. If one or other of these intersections is empty, the nodes are set to remote points on the line. The two nodes are then joined by a line. The effect depends on the location of A and B relative to the polyline, with two cases worth noting. +% (a) if the polyline is closed and if A, B are interior to one of its components, you get a line segment from one edge to the other, containing AB. +% (b) If the polylne is simple and closed, and one of A, B is inside and the other outside, the resulting line segment will contain A but not B. +% \polyIntersection{<Nodename1>}{<Nodename2>}(A)(B){P}{n} works exactly the same as \polyIntersection{<Nodename1>}{<Nodename2>}(A)(B)(P0)(P1)...(Pn), assuming P0...Pn are previously defined as pnodes. +% \psStepa is like \psStep (pstricks-add) but for a node sequence rather than equally spaced abscissas. \psStepa[options]{<node root>}{<maxindex>} draws a step function with jumps at the successive nodes in the node sequence. Eg, \psStepa{P}{10} has jumps at P0..P10 +% +\newcount\pst@args%used in several macros +\newcount\num@pts +\newcount\pst@argcnt% for use in parsing node expressions +\def\PST@root{} +\let\pst@next\relax +%my scratch variables +\def\my@tempA{} +\def\my@tempB{} +\def\my@tempC{} +\def\my@tempD{} +\def\my@next{} +\newif\if@paren% +\newif\if@equal% +\newif\if@colon% +\newif\ifshow +\def\plussign{+}\def\minussign{-} +% +% +\def\defaultvalue#1#2{%#1 is a command, #2 is a value, possibly a command + \ifdefined#1\ifx#1\@empty\xdef#1{#2}\fi\else\xdef#1{#2}\fi}% +% +\def\testAlg#1|#2\@nil{% +\ifx\relax#2\relax% + \let\my@next\psparnode\xdef\my@tempD{}% +\else% + \let\my@next\algparnode\xdef\my@tempD{A}% algebraic +\fi}% +% +%Jonathan Fine's trim +\def\trim #1{\expandafter\trim@\expandafter{#1 }#1}% +\def\trim@ #1{\trim@@ @#1 @ #1 @ @@}% +\def\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}% +\def\unbrace#1{#1}% +\unbrace{\def\trim@@@ #1 } #2@#3{\expandafter\def% + \expandafter #3\expandafter {#1}}% +% +\def\hasparen#1(#2\@nil{%check if expression contains a (--call with \hasparen#1(\@nil + \ifx\relax#2\relax \@parenfalse \else \@parentrue\fi}% +% +\def\hasequal#1=#2\@nil{%check if expression contains a =--call with \hasequal#1=\@nil + \ifx\relax#2\relax \@equalfalse \else \@equaltrue\fi + \hascolon#2:\@nil}% +% +\def\hascolon#1:#2\@nil{%check if expression contains a :--call with \hascolon#1:\@nil +\ifx\relax#2\relax \@colonfalse \else \@colontrue\fi}% +% +\def\equalwhat#1=#2:#3\@nil{{#2}{#3}}% +% +\def\parsenodexn#1(#2)#3\@nil{% + \def\coeffA{#1}\edef\nodeA{#2}% + \trim\coeffA% + \ifx\nodeA\@empty\else% + \pnode(#2){@@TMP}% + \ifx\coeffA\@empty\def\coeffA{1}\else% + \ifx\coeffA\plussign\def\coeffA{1}\else\ifx\coeffA\minussign\def\coeffA{-1}\fi\fi\fi% + \edef\cmd{\noexpand\psLCNode(@TMP\the\pst@argcnt){1}(@@TMP){\coeffA}{@TMP}}% + \cmd% + \advance\pst@argcnt by \@ne% + \pnode(@TMP){@TMP\the\pst@argcnt}% + \parsenodexn#3\@nil% + \fi}% +% +\def\normalvec(#1)#2{% +%pnode | new pnode normal to old, same length + \psRelNodeVar(0,0)(#1)(0,1){#2}}% +% +\def\curvepnode#1#2#3{% +% #1=t value, #2=x(t) y(t) in either form,#3=node name, +%must first detect which form of x(t) y(t), looking for | + \edef\my@tempA{#2}% x(t) y(t) expanded + \expandafter\testAlg\my@tempA|\@nil\my@next {#1}{#2}{#3}} +% +\def\psparnode#1#2#3{% +% #1=t value, #2=x(t) y(t) in PS form,#3=node name, + \pnode(!/t #1 def #2){#3}% + \pnode(!/t #1 .001 sub def #2 + /t #1 .001 add def + #2 3 -1 roll sub 3 1 roll sub neg + 2 copy Pyth dup 3 1 roll div 3 1 roll div ){#3tang}}%unit tangent vector at t +% +\def\algparnode#1#2#3{% +% #1=t value, #2=x(t) | y(t) in alg form,#3=node name, +%\pstVerb{tx@Dict begin /t #1 def /Func (#2) AlgParser cvx def end} +%\pnode(!Func){#3}}% + \pstVerb{tx@Dict begin /Func (#2) AlgParser cvx def end } + \pnode(!/t #1 def Func){#3} + \pnode(!/t #1 .001 sub def Func + /t #1 .001 add def + Func 3 -1 roll sub 3 1 roll sub neg + 2 copy Pyth dup 3 1 roll div 3 1 roll div ){#3tang}%unit tangent vector at t +}% +% +\def\nodex#1{% +%#1=node expression --set nodename to @TMP +\expandafter\hasparen#1(\@nil% +\if@paren%it's an expression + \pnode(0,0){@TMP0}% + \pst@argcnt=0% + \expandafter\parsenodexn#1()\@nil% +\else% + \def\my@tempC{#1}% + \ifx\my@tempC\@empty\pnode(0,0){@TMP}\else\pnode(#1){@TMP}\fi% +\fi}%\if@paren +% +\def\nodexn#1#2{% +%#1=node expression | #2=node name +\hasparen#1(\@nil% +\if@paren%it's an expression + \pnode(0,0){@TMP0}% + \pst@argcnt=0% + \parsenodexn#1()\@nil% + \pnode(@TMP){#2}% +\else% + \def\my@tempC{#1}% + \ifx\my@tempC\@empty\pnode(0,0){#2}\else\pnode(#1){#2}\fi% +\fi}%\if@paren +% +\def\psxline{\pst@object{psxline}}% +\def\psxline@i{\@ifnextchar({\psxline@iii}{\psxline@ii}}% +\def\psxline@ii#1{% +\addto@par{arrows=#1}% +\psxline@iii}% +\def\psxline@iii(#1)#2#3{{%#1=basepoint, #2,#3 node expressions +\pst@killglue% +\use@par% +\nodexn{#2}{@TMP@a}% +\AplusB(#1)(@TMP@a){@TMP@A}% +\nodexn{#3}{@TMP@a}% +\AplusB(#1)(@TMP@a){@TMP@B}% +\psline(@TMP@A)(@TMP@B)% +}% +\ignorespaces}% +% +\def\curvepnodes{\pst@object{curvepnodes}} +\def\curvepnodes@i#1#2#3#4{{%optional [plotpoints=xx] +% #1=tmin,#2=tmax,#3=function (of t),#4=node root name, + \pst@killglue + \use@par + \edef\my@tempA{#3}% x(t) y(t) expanded + \expandafter\testAlg\my@tempA|\@nil % +%modify code to work in ps + \pstVerb{% + tx@Dict begin + /t0 #1 def + /t1 #2 def % so we can use constants from tx@Dict + t1 t0 sub end \psk@plotpoints div /dt exch def }% + \pst@cntc=\psk@plotpoints\relax%\psk@plotpoints=plotpoints-1 + \advance\pst@cntc by \@ne\relax %=plotpoints + \ifx\my@tempD\@empty\pstVerb{/Func (#3) cvx def }% + \else\pstVerb{tx@Dict begin /Func (#3 ) AlgParser cvx def end }% + \fi% + \multido{\i=0+1}{\pst@cntc}{% + \pnode(! /t #1 dt \i\space mul add def t Func ){#4\i}}% + \expandafter\xdef \csname #4nodecount\endcsname {\psk@plotpoints}% + \typeout{Created nodes #40 .. #4\psk@plotpoints}% +}\ignorespaces}% +% +\def\fnpnode{\pst@object{fnpnode}} +\def\fnpnode@i#1#2#3{{%optional [algebraic] +%#1=x value | #2=fn of x | #3=node name + \pst@killglue + \use@par + \ifPst@algebraic\pnode(*#1 {#2}){#3}\else\pnode(! /x #1 def x #2){#3}\fi +}\ignorespaces}% +% +\def\fnpnodes{\pst@object{fnpnodes}} +\def\fnpnodes@i#1#2#3#4{{%optional [algebraic] +%#1=xmin | #2=xmax | #3= fn of x | #4=node name +\pst@killglue +\use@par +\pst@dima=#1pt \pst@dimb=#2pt \advance\pst@dimb -\pst@dima% +\pst@cnta=\psk@plotpoints \relax %=plotpoints-1 +\def\PST@root{#4} +\divide\pst@dimb by \pst@cnta%plotpoint-1 intervals +\pst@cntc=\pst@cnta % +\advance\pst@cntc by 1 \relax %=plotpoints +\ifPst@algebraic + \multido{\i=0+1}{\pst@cntc}{\pnode(*\pst@number\pst@dima\space {#3}){#4\i}% + \advance\pst@dima \pst@dimb}% +\else + \multido{\i=0+1}{\pst@cntc}{\pnode(!/x \pst@number\pst@dima\space def x #3){#4\i}% + \advance\pst@dima \pst@dimb}% +\fi% +\expandafter\xdef \csname \PST@root nodecount\endcsname {\the\pst@cnta} +\typeout{Created nodes #40 .. #4\the\pst@cnta}% +}\ignorespaces}% +% +\def\AtoB(#1)(#2)#3{\psLCNodeVar(#1)(#2)(-1,1){#3}} +\def\AplusB(#1)(#2)#3{\psLCNodeVar(#1)(#2)(1,1){#3}} +\def\midAB(#1)(#2)#3{\psLCNodeVar(#1)(#2)(.5,.5){#3}} +% +\def\psnline{\pst@object{psnline}}%line of nodes +\def\psnline@i{\@ifnextchar({\psnline@iii}{\psnline@ii}}% +\def\psnline@ii#1{% +\addto@par{arrows=#1}% +\psnline@iii}% +\def\psnline@iii(#1,#2)#3{{% +\pst@killglue% +\use@par% +\pst@cnta=#2 \relax\advance\pst@cnta by 1 +\edef\@tmp{}% +\multido{\i=#1+1}{\pst@cnta}{\xdef\@tmp{\@tmp(#3\i)}}% +\expandafter\psline\@tmp}% +\ignorespaces}% +% +\def\shownode(#1){%display node user coords in console +\pstVerb{ (Node #1: ) = }% +\pnode(! /nodecoors 2 array def \psGetNodeCenter{#1} + nodecoors 1 #1.y put nodecoors 0 #1.x put nodecoors == #1.x #1.y ){temp@} +} +% Use to construct a sequence of nodes +% Eg, \pnodes{P}(0,1)(2;5)(3,4) defines nodes P0, P1, P2 with respective locations +% and a macro \Pnodecount containing the highest index created +\def\pnodes#1{\getnodelist{#1}{}} +% +\def\getnodelist#1#2{% +\pst@args=0 \relax% +\def\PST@root{#1}% +\def\pst@next{#2}% command to perform after reading list +\getnext@Node}% +% +\def\getnext@Node{\@ifnextchar({\getnext@Node@i}{\advance\pst@args by -1 \expandafter\xdef \csname \PST@root nodecount\endcsname {\the\pst@args} +\typeout{Created nodes \PST@root0 .. \PST@root\the\pst@args}\pst@next}}% +% +\def\getnext@Node@i(#1){% +\pnode(#1){\PST@root\the\pst@args}% +\advance\pst@args by 1\relax% +\getnext@Node}% +% +\def\psLCNodeVar(#1)(#2)(#3)#4{% +\pst@getcoor{#1}\my@tempA% +\pst@getcoor{#2}\my@tempB% +\pnode(#3){tmpLCn@de}% +\pnode(!% + \my@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \my@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def %stack now empty + \psGetNodeCenter{tmpLCn@de}\space + XA tmpLCn@de.x mul XB tmpLCn@de.y mul add + YA tmpLCn@de.x mul YB tmpLCn@de.y mul add){tmpLCn@deA}% +\pnode(tmpLCn@deA){#4}% +}% +% +\def\psRelNodeVar{\pst@object{psRelNodeVar}} +\def\psRelNodeVar@i(#1)(#2)(#3)#4{{% A - B - factor;angle - node name + \use@par + \pst@getcoor{#1}\my@tempA% + \pst@getcoor{#2}\my@tempB% + \pnode(#3){tmpn@de}% +\pnode(! + /unit \pst@number\psyunit \pst@number\psxunit div def % yunit/xunit + \my@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \my@tempB /YB exch \pst@number\psyunit div YA sub + \ifPst@trueAngle\space unit mul \fi\space def + /XB exch \pst@number\psxunit div XA sub def + %complex multiply (XB,YB) and (P.x,P.y), then add (XA,YA) + \psGetNodeCenter{tmpn@de} + XB tmpn@de.x mul YB tmpn@de.y mul sub + YB tmpn@de.x mul XB tmpn@de.y mul add + \ifPst@trueAngle\space unit div \fi\space + YA add exch XA add exch %x, y coords on stack + ){#4}% +}} +% +\def\psRelLineVar{\pst@object{psRelLineVar}} +\def\psRelLineVar@i{\@ifnextchar({\psRelLineVar@iii}{\psRelLineVar@ii}} +\def\psRelLineVar@ii#1{% + \addto@par{arrows=#1}% + \psRelLineVar@iii} +\def\psRelLineVar@iii(#1)(#2)(#3)#4{{% + \pst@killglue + \use@par + \psRelNodeVar(#1)(#2)(#3){#4}% + \psline(#1)(#4)% +}\ignorespaces} +% +\def\rhombus#1(#2)(#3)#4#5{% \rhombus{m}(B)(D){A}{C} +\AtoB(#2)(#3){node@P}% P=BD +% compute angle between BD and BC, in Postscript +\pnode(! %compute angle and scale in PS +/tmp \psGetNodeCenter{node@P} node@P.x node@P.y +Pyth 2 div def %tmp=half-length of BD +/ang tmp #1\space div Acos def %ang=angle from BD to BC & BA +#1\space tmp 2 mul div %scale factor s=m/BD +dup ang cos mul exch ang sin mul ){node@A1}% s cos(ang), s sin(ang) +\pnode(! \psGetNodeCenter{node@A1} node@A1.x node@A1.y neg ){node@A2}%reflect in x axis +\psRelNodeVar(#2)(#3)(node@A1){#4}% +\psRelNodeVar(#2)(#3)(node@A2){#5}% +}% +% +\def\psrline{\pst@object{psrline}}% relative lines +\def\psrline@i{\@ifnextchar({\psrline@iii}{\psrline@ii}}% +\def\psrline@ii#1{% +\addto@par{arrows=#1}% +\psrline@iii}% +\def\psrline@iii{% +\getnodelist{@tmpnode}{\psrline@iv}% +}% +\def\psrline@iv{% + \ifnum\pst@args<0\else%do nothing + \pnode(@tmpnode0){@tmpnodeB0}% + \multido{\iA=1+1,\iB=0+1}{\pst@args}{% + \AplusB(@tmpnodeB\iB)(@tmpnode\iA){@tmpnodeB\iA}}% + \psrline@v% + \fi% +}% +\def\psrline@v{{%finish up + \pst@killglue% + \use@par% + \xdef\tmp{(@tmpnodeB0)}% + \multido{\i=1+1}{\pst@args}% +{\xdef\tmp{\tmp(@tmpnodeB\i)}}% +\expandafter\psline\tmp% +}\ignorespaces}% +% +\def\polyIntersections#1#2(#3)(#4){% +%nodename1 | nodename2 | A | B | % intersections with line from A, B +\def\nodenameA{#1}\def\nodenameB{#2}% +\pnode(#3){P@A}\pnode(#4){P@B}% +\@ifnextchar({\polyIntersections@next}{\polyIntersections@ii}% +}% +\def\polyIntersections@ii#1#2{% +\def\root@node{#1}\num@pts=#2 \relax% +\polyIntersections@iii}% +% +\def\polyIntersections@next{%read as many points as exist +\def\root@node{P@}\getnodelist{P@}{\num@pts=\pst@args \relax\polyIntersections@iii}% +}% +\def\polyIntersections@iii{%nodes are now XXX0....XXXn, n=num@pts +\pst@cnta=\num@pts \relax\advance\pst@cnta by 1 \relax% +\pstVerb{% + /xarray \the\pst@cnta\space array def + /yarray \the\pst@cnta\space array def tx@Dict begin }% +\multido{\i=0+1}{\the\pst@cnta}{\pstVerb{ \psGetNodeCenter{\root@node\i} xarray \i\space \root@node\i.x put yarray \i\space \root@node\i.y put }}% +\pstVerb{ /tposmin 100 def /tnegmax -100 def %/argposmin 0 def /argposmax 0 def +\psGetNodeCenter{P@B} \psGetNodeCenter{P@A} +/dx P@B.x P@A.x sub def +/dy P@B.y P@A.y sub def +/lenAB dx dy Pyth def +/oldx xarray 0 get def /oldy yarray 0 get def +1 1 \the\num@pts\space {/k exch def /newx xarray k get def /newy yarray k get def +/ddx newx oldx sub def /ddy newy oldy sub def +/det ddy dx mul ddx dy mul sub def +det abs lenAB ddx ddy Pyth mul .001 mul gt +{/ac oldx P@A.x sub def /bd oldy P@A.y sub def + /tt ac ddy mul bd ddx mul sub det div def %solve for t value at intersection + /ss ac dy mul bd dx mul sub det div def % solve for s value at intersection +ss 0 ge + {ss 1 le + {tt 0 lt {tt tnegmax gt {/tnegmax tt def} if } {tt tposmin lt {/tposmin tt def} if } ifelse } + if } % ss 1 le +if }%ss 0 ge + if %det> + /oldx newx def /oldy newy def} for end }% +\pnode(! \psGetNodeCenter{P@A} \psGetNodeCenter{P@B} P@B.x P@A.x sub tposmin mul P@A.x add P@B.y P@A.y sub tposmin mul P@A.y add ){\nodenameA}% +\pnode(! \psGetNodeCenter{P@A} \psGetNodeCenter{P@B} P@B.x P@A.x sub tnegmax mul P@A.x add P@B.y P@A.y sub tnegmax mul P@A.y add){\nodenameB}% +}% +% +\def\actualscale#1 #2 scale{% extract x-scale from, eg, {2. 2. scale} +#1} +% +\def\psGetCenter#1{ tx@NodeDict begin /N@#1 load GetCenter end }% x y on stack in system coor +% +\def\ArrowNotch{\pst@object{ArrowNotch}} +\def\ArrowNotch@i#1#2#3#4{{% +%noderootname | index | arrowdirection | notchnodename % +\pst@killglue% +\use@par% +\def\inc{-1}% +\ifx#3<\def\inc{1}\fi% -1 means notch to left of arrowhead +%get length of pointed arrow under these conditions (types ->, -D> and their reverses) +\pstVerb{ + 1 \psk@arrowinset\space sub \psk@arrowlength\space \psk@arrowsize\space + \pst@number\pslinewidth \space mul add mul mul + \expandafter\actualscale\psk@arrowscale \space mul + /hh exch def /hh1 hh .05 sub def }% PS variable hh contains dist from tip to notch of arrow, in pts +\def\root@node{#1}\num@pts=\csname\root@node nodecount\endcsname % +\pst@cntb=\num@pts \advance\pst@cntb by \@ne%actual node count +\pst@cnta=\num@pts \advance\pst@cnta by \thr@@%size of PS array +\pst@cntc=#2 \relax% index of center of circle +\ifnum\pst@cntc>\num@pts \pnode(0,0){#4}\else +%compute a (screen based) unit vector in directions P1P0 and Pn-1Pn +\pstVerb{% +/PythSq { dup mul exch dup mul add } def +/PtSub { % xA yA xB yB + 3 -1 roll % xA xB yB yA + sub neg % xA xB yA-yB + 3 1 roll % yB-yA xA xB + sub % yB-yA xA-xB + exch % xB-xA yA-yB +} def + /xarray \the\pst@cnta\space array def + /yarray \the\pst@cnta\space array def + tx@Dict begin }% end pstVerb +\multido{\i=0+1,\ib=1+1}{\the\pst@cntb}{\pnode(! \psGetCenter{\root@node\i}\space % center on stack in system coords, not user coords +yarray \ib\space 3 -1 roll put xarray \ib\space 3 -1 roll put 0 0 ){@tmp}}% end multido +%\pstVerb{ \psGetCenter{\root@node6} == == } +\pnode(! xarray 1 get dup yarray 1 get dup 3 1 roll % x1 y1 x1 y1 +xarray 2 get yarray 2 get PtSub % x1 y1 x1-x2 y1-y2 +2 copy Pyth hh div 2 div dup % x1 y1 x1-x2 y1-y2 d d ,d->d/2*hh +3 1 roll % x1 y1 x1-x2 d y1-y2 d +div 3 1 roll div %x1 y1 (y1-y2)/d (x1-x2)/d +3 1 roll %x1 (x1-x2)/d y1 (y1-y2)/d +add 3 1 roll add % y1-(y2-y1)/d x1-(x2-x1)/d + xarray 0 3 -1 roll put yarray 0 3 -1 roll put %stack empty + xarray length 2 sub /topnum exch def + xarray topnum get dup yarray topnum get dup 3 1 roll %xn yn xn yn +topnum 1 sub /topnum exch def xarray topnum get yarray topnum get % xn yn xn yn x(n-1) y(n-1) +3 -1 roll sub neg 3 1 roll sub exch % xn yn (xn-x(n-1)) (yn-y(n-1)) +2 copy Pyth hh div 2 div dup % xn yn (xn-x(n-1)) (yn-y(n-1)) d d (d->d/(2*h)) +3 1 roll div 3 1 roll div %xn yn (xn-x(n-1))/d (yn-y(n-1))/d +3 -1 roll add 3 1 roll % y(n+1) x(n+1) +topnum 2 add /topnum exch def xarray topnum 3 -1 roll put yarray topnum 3 -1 roll put % empty +% next step--find first index outside circle of radius hh + /oldcindex \the\pst@cntc\space 1 add def %position in array + xarray oldcindex get /xc exch def yarray oldcindex get /yc exch def + %hh .05 sub /hh exch def % that's close enough for a crossing +/inc \inc\space def %+1 for left facing arrow, else -1 +/cindex oldcindex def +{cindex inc add /cindex exch def xarray cindex get xc sub yarray cindex get yc sub Pyth dup hh1 gt +{ exit } if } loop % exit from loop with cindex the first index of an external point--dist on stack + hh1 .1 add lt { xarray cindex get yarray cindex get } %else within segment +{ xarray cindex inc sub get dup yarray cindex inc sub get dup 4 -1 roll exch +xarray cindex get yarray cindex get PtSub /dy1 exch def /dx1 exch def dx1 dy1 PythSq /Aterm exch def +% dx1=x(n-1)-x(n), dy1=y(n-1)-y(n) [if inc=1]: dx1=x(n+1)-x(n), dy1=y(n+1)-y(n) [if inc=-1] +% x(n-inc) y(n-inc), Aterm=dx1^2+dy1^2 + 2 copy xc yc PtSub % x(n-inc) y(n-inc) (x(n-inc)-xc) (y(n-inc)-yc) + 2 copy 2 copy 3 -1 roll mul 3 1 roll mul add hh dup mul sub % x(n-inc) y(n-inc) (y(n-inc)-yc) (x(n-inc)-xc) (x(n-inc)-xc)^2+(y(n-inc)-yc)^2-hh^2 + Aterm div /Cterm exch def % x(n-inc) y(n-inc) (y(n-inc)-yc) (x(n-inc)-xc) , Cterm=((x(n-inc)-xc)^2+(y(n-inc)-yc)^2-hh^2)/(Aterm) (<0) + dx1 dy1 % x(n-inc) y(n-inc) (y(n-inc)-yc) (x(n-inc)-xc) dx1 dy1 + 4 1 roll mul 3 1 roll mul add Aterm div /Bterm exch def % x(n-inc) y(n-inc) , Bterm=( (x(n-inc)-xc)*dx1+(y(n-inc)-yc)*dy1)/Aterm + Bterm abs neg dup dup mul Cterm sub sqrt add dup /tval exch def +% x(n-inc) y(n-inc) tvalue + dup dx1 dy1 4 1 roll mul 3 1 roll mul % x(n-inc) y(n-inc) t*dx1 t*dy1 + PtSub } ifelse % x y screen coords of arrow notch now on stack---convert to user x y + \pst@number\psyunit div exch \pst@number\psxunit div exch %use coords now on stack +){#4}\fi% +\pstVerb { end } %tx@Dict +}\ignorespaces}% +% +% +\catcode`\@=\TheAtCode\relax +\endinput +%% +%% END pst-node.tex diff --git a/Master/texmf-dist/tex/latex/pst-node/pst-node.sty b/Master/texmf-dist/tex/latex/pst-node/pst-node.sty new file mode 100644 index 00000000000..b6ccb5aa42b --- /dev/null +++ b/Master/texmf-dist/tex/latex/pst-node/pst-node.sty @@ -0,0 +1,10 @@ +\RequirePackage{pstricks} +\ProvidesPackage{pst-node}[2010/01/22 package wrapper for pst-node.tex] +\input{pst-node.tex} +\ProvidesFile{pst-node.tex} + [\filedate\space \fileversion\space `pst-node' (tvz)] +\IfFileExists{pst-node.pro}{% + \ProvidesFile{pst-node.pro} + [2010/01/22 v. 1.10, PostScript prologue file (hv)] + \@addtofilelist{pst-node.pro}}{}% +\endinput diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index eb2759bc496..c04b3c487a4 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -216,7 +216,7 @@ my @WorkingTLP = qw( pst-eps pst-eucl pst-exa pst-fill pst-fr3d pst-fractal pst-fun pst-func pst-gantt pst-geo pst-grad pst-infixplot pst-jtree pst-knot pst-labo - pst-lens pst-light3d pst-math pst-mirror + pst-lens pst-light3d pst-math pst-mirror pst-node pst-ob3d pst-optexp pst-optic pst-osci pst-pad pst-platon pst-poly pst-pdf pst-pdgr pst-qtree pst-sigsys pst-solides3d pst-soroban pst-spectra diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 238f44d218a..d3c5abc84b7 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -512,6 +512,7 @@ $Master = "$mydir/../.."; 'pst-light3d', "&MAKEpst", 'pst-math', "&MAKEpst", 'pst-mirror', "&MAKEpst", + 'pst-node', "&MAKEpst", 'pst-optexp', "&MAKEpst", 'pst-ob3d', "&MAKEpst", 'pst-optic', "&MAKEpst", diff --git a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc index 9d7d6e8d26a..2dd248fd510 100644 --- a/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-pstricks.tlpsrc @@ -43,6 +43,7 @@ depend pst-lens depend pst-light3d depend pst-math depend pst-mirror +depend pst-node depend pst-ob3d depend pst-optexp depend pst-optic diff --git a/Master/tlpkg/tlpsrc/pst-node.tlpsrc b/Master/tlpkg/tlpsrc/pst-node.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/pst-node.tlpsrc |