diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-25 21:48:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-25 21:48:45 +0000 |
commit | 74287edae1bb94f336a0a6fb26a158de47da4520 (patch) | |
tree | 0ce038a7afb525eb2f01b332371ba4a41876d605 /Master | |
parent | 4deefba1510283635ec9d61417ff06e5013eadc9 (diff) |
pst-node (25apr16)
git-svn-id: svn://tug.org/texlive/trunk@40743 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/Changes | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf | bin | 539507 -> 606885 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex | 68 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-node/pst-node.tex | 65 |
4 files changed, 129 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-node/Changes b/Master/texmf-dist/doc/generic/pst-node/Changes index 95008d810e3..e5694b77b7a 100644 --- a/Master/texmf-dist/doc/generic/pst-node/Changes +++ b/Master/texmf-dist/doc/generic/pst-node/Changes @@ -1,4 +1,5 @@ ----- pst-node.tex +1.36 2016-04-24 - moved node definitions from pstricks-add 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 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 1ba66997bdf..7275e33da60 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 736aee597e1..77d2bd7d141 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 @@ -362,6 +362,74 @@ 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{\nxLcs{psRelNode} and \nxLcs{psDefPSPNodes}} +%-------------------------------------------------------------------------------------- +With these macros it is possible to put a node relative to a given line or given +\Lenv{pspicture}-environment. In the frist case the parameters are +the angle and the length factor: + +\begin{BDef} +\Lcs{psRelNode}\Largs{P0}\Largs{P1}\Largb{length factor}\Largb{end node name}\\ +\Lcs{psDefPSPNodes} +\end{BDef} + +The length factor relates to the distance $\overline{P_0P_1}$ and +the end node name must be a valid nodename and shouldn't contain +any of the special PostScript characters. There are two valid +options: + +\begin{tabularx}{\linewidth}{@{} l|l| X @{} } +name & default & meaning\\\hline +\Lkeyword{angle} & $0$ & angle between the given line $\overline{P_0P_1}$ and the new one + $\overline{P_0P_{endNode}}$\tabularnewline +\Lkeyword{trueAngle} & \false & defines whether the angle refers to the seen line or to +the mathematical one, which respect the scaling factors +\Lkeyword{xunit} and \Lkeyword{yunit}. +\end{tabularx} + +\begin{LTXexample}[width=7cm] +\begin{pspicture}[showgrid](7,6) + \pnode(3,3){A}\pnode(4,2){B} + \psline[nodesep=-3,linewidth=0.5pt](A)(B) + \multido{\iA=0+30}{12}{% + \psRelNode[angle=\iA](A)(B){2}{C}% + \qdisk(C){2pt} + \uput[0](C){\iA}} +\end{pspicture} +\end{LTXexample} + +In the second case the new macro \Lcs{psDefPSPNodes} defines nine nodes that corresponds to +nine particular points (namely bottom left, bottom center, +bottom right, center left, center center, center right, top left, +top center, top right) of the \Lenv{pspicture} box. + +\begin{LTXexample}[width=6cm,wide=false] +\begin{pspicture}[showgrid=true](-1,-1)(4,4) + \psDefPSPNodes + \psdots(PSPbl)(PSPbc)(PSPbr) + (PSPcl)(PSPcc)(PSPcr)(PSPtl)(PSPtc)(PSPtr) + \uput[90](PSPbl){PSPbl} \uput[90](PSPbc){PSPbc} + \uput[90](PSPbr){PSPbr} \uput[90](PSPcl){PSPcl} + \uput[90](PSPcc){PSPcc} \uput[90](PSPcr){PSPcr} + \uput[90](PSPtl){PSPtl} \uput[90](PSPtc){PSPtc} + \uput[90](PSPtr){PSPtr} +\end{pspicture} +\end{LTXexample} + +The name of the nodes are predefined as: + +\begin{lstlisting}[style=syntax] +\psset[pst-PSPNodes]{blName=PSPbl,bcName=PSPbc,brName=PSPbr, + clName=PSPcl,ccName=PSPcc,crName=PSPcr,tlName=PSPtl,tcName=PSPtc,trName=PSPtr} +\end{lstlisting} + +and can be modified in the same way. +%I guess you modified the family to have the pstricks-add one so the +%\xkvview would have to be adapted. + + \section{Node connections}\label{S-nc} All the node connection commands begin with \nxLcs{nc}, and they all have the same 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 1932e483c63..2bcddd7d126 100644 --- a/Master/texmf-dist/tex/generic/pst-node/pst-node.tex +++ b/Master/texmf-dist/tex/generic/pst-node/pst-node.tex @@ -1,12 +1,12 @@ -% $Id: pst-node.tex 65 2014-08-04 18:52:37Z herbert $ +% $Id: pst-node.tex 68 2014-08-07 10:16:26Z 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-2014 by Herbert Voss, hvoss tug.org. +%% COPYRIGHT 2009-2015 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 @@ -18,8 +18,8 @@ \ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi\relax \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi % -\def\fileversion{1.35} -\def\filedate{2014/08/04} +\def\fileversion{1.36} +\def\filedate{2016/04/24} \message{ v\fileversion, \filedate} % \edef\TheAtCode{\the\catcode`\@} @@ -1381,6 +1381,61 @@ tx@NodeDict \pst@tempg known /linelength \pst@number\pst@dimb \pst@number\psunit div def XA linelength angle cos mul add YA linelength angle sin mul add ){#4}% } +\def\psRelNode{\pst@object{psRelNode}} +\def\psRelNode@i(#1)(#2)#3#4{{% A - B - factor - node name + \use@par +% \pst@killglue + \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 + /AlphaStrich \psk@angleA\space def + /unit \pst@number\psyunit \pst@number\psxunit div def % yunit/xunit +% + /dx XB XA sub def + /dy YB YA sub \ifPst@trueAngle\space unit mul \fi\space def + /laenge dy dup mul dx dup mul add sqrt #3 mul def + /Alpha dy dx atan def + /beta Alpha AlphaStrich add def + laenge beta cos mul XA add + laenge beta sin mul \ifPst@trueAngle\space unit div \fi\space YA add ){#4}% +}\ignorespaces} +% +\define@cmdkeys[psset]{pstricks-add}[PSTPSPNk@]{% Christophe Jorssen 2007 + blName,bcName,brName, + clName,ccName,crName, + tlName,tcName,trName}[]{}% +\psset[pstricks-add]{% + blName=PSPbl,bcName=PSPbc,brName=PSPbr, + clName=PSPcl,ccName=PSPcc,crName=PSPcr, + tlName=PSPtl,tcName=PSPtc,trName=PSPtr} +\def\psDefPSPNodes{\def\pst@par{}\pst@object{psDefPSPNodes}} +\def\psDefPSPNodes@i{% + \pst@killglue + \begingroup + \use@par + \expandafter\psDefPSPNodes@ii\pic@coor} +% +\def\psDefPSPNodes@ii(#1)(#2)(#3){% +% \pnode(#1){PSPN@temp}\pnode([nodesep=.75,angle=45]PSPN@temp){\PSTPSPNk@blName} +% \pnode(#3){PSPN@temp}\pnode([nodesep=.75,angle=-135]PSPN@temp){\PSTPSPNk@trName} + \pnode(#1){PSPN@temp}\pnode([angle=45]PSPN@temp){\PSTPSPNk@blName} + \pnode(#3){PSPN@temp}\pnode([angle=-135]PSPN@temp){\PSTPSPNk@trName} + \pnode(\PSTPSPNk@blName|\PSTPSPNk@trName){\PSTPSPNk@tlName} + \pnode(\PSTPSPNk@trName|\PSTPSPNk@blName){\PSTPSPNk@brName} + \ncline[linestyle=none]{\PSTPSPNk@blName}{\PSTPSPNk@tlName} + \ncput[npos=.5]{\pnode{\PSTPSPNk@clName}} + \ncline[linestyle=none]{\PSTPSPNk@blName}{\PSTPSPNk@brName} + \ncput[npos=.5]{\pnode{\PSTPSPNk@bcName}} + \pnode(\PSTPSPNk@brName|\PSTPSPNk@clName){\PSTPSPNk@crName} + \pnode(\PSTPSPNk@bcName|\PSTPSPNk@trName){\PSTPSPNk@tcName} + \pnode(\PSTPSPNk@bcName|\PSTPSPNk@clName){\PSTPSPNk@ccName} + \endgroup + \ignorespaces} +% % \def\psDefBoxNodes#1#2{\rnode[tl]{#1:tl}{\rnode[Bl]{#1:Bl}{\rnode[tr]{#1:tr}{% \rnode[bl]{#1:bl}{\rnode[Br]{#1:Br}{\rnode[br]{#1:br}{#2}}}}}}% |