diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-06 22:50:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-06 22:50:05 +0000 |
commit | c29bf84e74c53725373f5ae4f092b4864dbfa1d6 (patch) | |
tree | 064b855c8f8fb7f4fc00fa142cece6bd417ed197 /Master | |
parent | 93f40c786b161d015b7093c33c7d93f68e6a0973 (diff) |
pst-node (5aug14)
git-svn-id: svn://tug.org/texlive/trunk@34856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/Changes | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf | bin | 207607 -> 207044 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf | bin | 548157 -> 539507 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex | 64 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pst-node/pst-node.pro | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-node/pst-node.tex | 83 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-node/pst-node.sty | 2 |
8 files changed, 125 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-node/Changes b/Master/texmf-dist/doc/generic/pst-node/Changes index 162bd3d1c20..95008d810e3 100644 --- a/Master/texmf-dist/doc/generic/pst-node/Changes +++ b/Master/texmf-dist/doc/generic/pst-node/Changes @@ -1,4 +1,6 @@ ----- pst-node.tex +1.35 2014-08-04 - added \saveDataAsNodes{Filename}{NodePrefix} +1.34 2014-06-17 - fix bug for showNodes 1.33 2014-03-25 - added optional argument NodeCoorPrefix for savedCoors By default it is empty: names are N-<Name>.x|y if it is set: names are <NodeCoorPrefix><Name>x|y diff --git a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf Binary files differindex bef4b6ce1f2..ae944e4e07d 100644 --- a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf +++ b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf diff --git a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex index 8317ba5f809..ae774b5d4fa 100644 --- a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex +++ b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex @@ -1,4 +1,4 @@ -%% $Id: pstmatrix-doc.tex ch. roemer $ +%% $Id: psmatrix-docDE.tex 42 2014-07-25 06:49:51Z herbert $ \listfiles \documentclass[11pt,ngerman,a4paper,BCOR10mm,DIV12,bibliography=totoc,parskip,smallheadings headexclude,footexclude,oneside]{pst-doc} 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 differindex 415eecb9716..1ba66997bdf 100644 --- a/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf +++ 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 index 5bdff2d922b..736aee597e1 100644 --- a/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex @@ -1,4 +1,4 @@ -%% $Id: pst-node-doc.tex 876 2014-01-28 15:03:13Z herbert $ +%% $Id: pst-node-doc.tex 66 2014-08-04 19:10:10Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings headexclude,footexclude,oneside]{pst-doc} \listfiles @@ -125,6 +125,8 @@ But don't restrict yourself to these more obvious uses. For example: \ncarc[nodesep=8pt]{->}{A}{file} \end{lstlisting} +%\psset{showNode} + \section{Nodes}\label{S-nodes} @@ -142,6 +144,8 @@ contain only letters and numbers, and must begin with a letter. Bad node names can cause PostScript errors. + + Here are the nodes: \begin{BDef} @@ -229,10 +233,6 @@ one can also define the nodes in a short way: If an optional argument for the offset is used, then it is passes to all nodes. - - - - The command \Lcs{psnode} is a combination of using \Lcs{rput} and \Lcs{rnode}. \begin{BDef} @@ -362,7 +362,6 @@ There are two differences between \Lcs{fnode} and \Lcs{psframe}: \LKeyword{framesize=dim1 `dim2'} parameter. If you omit <dim2>, you get a square frame. \end{itemize} - \section{Node connections}\label{S-nc} All the node connection commands begin with \nxLcs{nc}, and they all have the same @@ -830,6 +829,9 @@ previous example: Note also the use of \Lcs{Rnode}. + + + One more parameter trick: By using the \Lkeyword{border} parameter, you can create the impression that one node connection passes over another. @@ -1083,6 +1085,8 @@ non-standard category codes. Just invoke the command after you have made your The \Lkeyset{shortput=tablr} and \Lkeyset{shortput=tab} options are described on pages~\pageref{tablr} and \pageref{tab}, respectively. + + \section{Node connection labels: II} Now the second group of node connections: @@ -1337,6 +1341,8 @@ $ \psmatrix[colsep=1cm] \ncline[linestyle=dotted]{2,1}{2,2} $ \end{LTXexample} + + If you want your entry to begin with a \verb|[| that is not meant to indicate parameter changes, the precede it by \verb|{}|. @@ -1740,7 +1746,6 @@ than using \Lcs{ncdiag} without the \Lkeyword{lineAngle} option.\tabularnewline \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: @@ -1951,6 +1956,7 @@ appropriate. The syntax is \end{LTXexample} + %-------------------------------------------------------------------------------------- \section{\nxLcs{nlput} and \nxLcs{psLDNode}} %-------------------------------------------------------------------------------------- @@ -1981,7 +1987,8 @@ starting from the first one. \end{LTXexample} \section{Extensions} -\subsection{Quick overview} + +\subsection{Node definitions} 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, @@ -2324,6 +2331,7 @@ is similar to \Lcs{psRelNode}, and provides a means of scaling and rotating a l \end{LTXexample} + \begin{BDef} \Lcs{psRelLineVar}\Largr{node A}\Largr{node B}\Largr{radius;angle}\Largb{node name} \end{BDef} @@ -2345,6 +2353,7 @@ could be handled easily by \Lcs{psline}. Internally, \Lcs{rhombus} uses 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} @@ -2411,6 +2420,7 @@ has exactly the same effect as 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) @@ -2451,6 +2461,8 @@ assuming \verb|P0...Pn| to be previously defined nodes. \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)% @@ -2557,6 +2569,42 @@ with only two particular arrow shapes---those arrows specified with either \end{LTXexample} +\section{Reading external data and save it as nodes} + +\begin{BDef} +\Lcs{saveDataAsNodes}\Largb{<data>}\Largb{<Nodeprefix>} +\end{BDef} + +The macro \Lcs{saveDataAsNodes} allows to read $x|y$ values from an external data file +and save the coordinates in nodes named \texttt{<Nodeprefix>i>} where $i$ is the nodecounter, +starting at 0. + + +\begin{filecontents*}{node.data} +12 12 +12 13 +13 15 +15 15 +15 13 +13 12 +12 10 +10 8 +8 8 +8 10 +\end{filecontents*} +\begin{LTXexample}[pos=t] +\begin{pspicture}(6.5,6.5)(16.5,16.5) + \psaxes[axesstyle=frame,ticksize=0 9cm,tickcolor=black!20,Ox=7,Oy=7](7,7)(16,16) + \saveDataAsNodes{node.data}{N} + \psset{radius=2.5mm,arrows=->,arrowscale=1.5,nodesep=2.7mm,linewidth=1.3pt} + \Cnodeput[linecolor=red]{0}(N0){foo}{0} + \multido{\iA=1+1,\iB=0+1}{\numexpr\the\psLoopIndex-1}{% + \Cnodeput{0}(N\iA){foo}{\iA}\ncline{N\iB}{N\iA}} + \ncline[linecolor=blue,linestyle=dashed]{N8}{N3} +\end{pspicture} +\end{LTXexample} + + \clearpage \section{List of all optional arguments for \texttt{pst-node}} diff --git a/Master/texmf-dist/dvips/pst-node/pst-node.pro b/Master/texmf-dist/dvips/pst-node/pst-node.pro index 96b74f133fa..39243dc0b01 100644 --- a/Master/texmf-dist/dvips/pst-node/pst-node.pro +++ b/Master/texmf-dist/dvips/pst-node/pst-node.pro @@ -1,4 +1,4 @@ -% $Id: pst-node.pro 876 2014-01-28 15:03:13Z herbert $ +% $Id: pst-node.pro 40 2014-07-25 06:46:27Z herbert $ %% %% PostScript prologue for pst-node.tex. %% Version 1.15, 2014/01/27. diff --git a/Master/texmf-dist/tex/generic/pst-node/pst-node.tex b/Master/texmf-dist/tex/generic/pst-node/pst-node.tex index 407b9049664..1932e483c63 100644 --- a/Master/texmf-dist/tex/generic/pst-node/pst-node.tex +++ b/Master/texmf-dist/tex/generic/pst-node/pst-node.tex @@ -1,4 +1,4 @@ -% $Id: pst-node.tex 898 2014-03-25 20:52:31Z herbert $ +% $Id: pst-node.tex 65 2014-08-04 18:52:37Z herbert $ %% BEGIN pst-node.tex %% %% Nodes with PSTricks. @@ -18,8 +18,8 @@ \ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi\relax \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi % -\def\fileversion{1.33} -\def\filedate{2014/03/25} +\def\fileversion{1.35} +\def\filedate{2014/08/04} \message{ v\fileversion, \filedate} % \edef\TheAtCode{\the\catcode`\@} @@ -57,17 +57,21 @@ % bug fix for xelatex, dvipdfmx uses the wrong scaling \def\tx@NewNode{/NodeScale {\ifx\pstnodescale\@undefined \else\pstnodescale \fi} def NewNode } % -\define@boolkey[psset]{pst-node}[Pst@]{showNode}[true]{}% write coors into the logfile +\def\psopenNodeFile{% + \pst@Verb{ %globaldict begin +% tx@NodeDict begin + (\jobname.nodes) (w) file /NodeFile exch def +% end + }} + % +\def\pscloseNodeFile{\pstVerb{ tx@NodeDict begin NodeFile closefile end }} +% +\define@boolkey[psset]{pst-node}[Pst@]{showNode}[true]{\ifPst@showNode\psopenNodeFile\fi}% write coors into the logfile \define@boolkey[psset]{pst-node}[Pst@]{markNode}[true]{}% makr the node with its name \define@boolkey[psset]{pst-node}[Pst@]{saveNodeCoors}[true]{} \define@key[psset]{pst-node}{NodeCoorPrefix}[]{\def\psk@NodeCoorPrefix{#1}}% if empty it is N-<Name>.x|y \psset[pst-node]{saveNodeCoors=false,showNode=false,markNode=false,NodeCoorPrefix=}% <NodeCoorPrefix<Name>x|y> % -\def\psopenNodeFile{\pstVerb{ tx@NodeDict begin %/NodeFile { - (\jobname.nodes)(w) file %} def - end }} -\def\pscloseNodeFile{\pstVerb{ tx@NodeDict begin currentfile closefile end }} -% \def\pst@newnode#1#2#3#4{% \pst@killglue \leavevmode @@ -89,19 +93,46 @@ \pst@thenode #2 {#4} - \ifPst@showNode + \ifPst@showNode + exch dup /NodeType ED + exch + NodeType 10 eq { % pnode type 5 copy - cvlit aload pop + cvlit aload pop 20 string cvs (; ) 6 2 roll % InitPnode 20 string cvs (; ) 7 2 roll % type 20 string cvs (; ) 8 2 roll %/N@Name 20 string cvs (; ) 9 2 roll % true/false - cvlit aload pop exch - 20 string cvs (; ) 11 2 roll - 20 string cvs (, ) 12 2 roll % x,y - 12 array astore concatstringarray - currentfile exch writestring -% NodeFile exch writestring + cvlit dup length 2 eq + { aload pop exch + 20 string cvs (; ) 11 2 roll + 20 string cvs (, ) 12 2 roll % x,y + (\string\n) % add newline + 13 array astore concatstringarray + } + { 255 string cvs (; ) 10 2 roll + (\string\n) % add newline + 11 array astore concatstringarray + } ifelse + NodeFile exch writestring + } if + NodeType 14 eq { % dotnode + 5 copy + /@@temp ED +% gsave + @@temp % to get X Y + 4 -1 roll cvlit pop + ( OvalNodePos ) (; ) 5 2 roll + 20 string cvs (; ) 6 2 roll % type + 20 string cvs (; ) 7 2 roll %/N@Name + 20 string cvs (; ) 8 2 roll % true/false + Y 20 string cvs (; ) 10 2 roll + X 20 string cvs (, ) 12 2 roll + (\string\n) % add newline + 13 array astore concatstringarray +% grestore + tx@NodeDict begin NodeFile exch writestring end + } if \fi \tx@NewNode end @@ -127,8 +158,7 @@ \def\pnode@ii[#1](#2)#3{% \pst@getcoor{#1}\pst@tempA% \pst@getcoor{#2}\pst@tempB% - \pst@newnode{#3}{10}{% - \pst@tempA \pst@tempB 3 -1 roll add 3 1 roll add exch }{\tx@InitPnode}% + \pst@newnode{#3}{10}{\pst@tempA \pst@tempB 3 -1 roll add 3 1 roll add exch }{\tx@InitPnode}% \ifPst@showNode\psdot(#3)\uput[\ifx\psk@rot\@empty0\else\psk@rot\fi]{0}(#3){#3}\fi \ignorespaces} % @@ -1373,6 +1403,7 @@ tx@NodeDict \pst@tempg known \psGetNodeCenter{#1:bl} #1:br.x #1:bl.x add 2 div #1:br.y #1:bl.y add 2 div ){#1:bC}}% % +% %% 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. @@ -1887,6 +1918,20 @@ xarray cindex get yarray cindex get PtSub /dy1 exch def /dx1 exch def dx1 dy1 Py \pstVerb { end } %tx@Dict }\ignorespaces}% % +\def\saveDataAsNodes#1#2{% Filename NodePrefix + \psLoopIndex=0\relax + \typeout{Open file #1}% + \openin7=#1 + \loop + \read7 to \@Data + \ifeof7\else + \ifx\@Data\@empty\else\pnode(!\@Data){#2\the\psLoopIndex}% + \typeout{#2\the\psLoopIndex -> \@Data}% + \advance\psLoopIndex by 1 + \fi + \repeat + \closein7 +} % \catcode`\@=\TheAtCode\relax \endinput diff --git a/Master/texmf-dist/tex/latex/pst-node/pst-node.sty b/Master/texmf-dist/tex/latex/pst-node/pst-node.sty index 39a5b320b63..f88f2b648dc 100644 --- a/Master/texmf-dist/tex/latex/pst-node/pst-node.sty +++ b/Master/texmf-dist/tex/latex/pst-node/pst-node.sty @@ -1,4 +1,4 @@ -% $Id: pst-node.sty 703 2012-09-15 18:54:16Z herbert $ +% $Id: pst-node.sty 40 2014-07-25 06:46:27Z herbert $ %% %% This is file `pst-node.sty'. %% |