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/texmf-dist/tex | |
parent | 93f40c786b161d015b7093c33c7d93f68e6a0973 (diff) |
pst-node (5aug14)
git-svn-id: svn://tug.org/texlive/trunk@34856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-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 |
2 files changed, 65 insertions, 20 deletions
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'. %% |