texlive[46170] Master/texmf-dist: pst-node (30dec17)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 30 23:43:07 CET 2017


Revision: 46170
          http://tug.org/svn/texlive?view=revision&revision=46170
Author:   karl
Date:     2017-12-30 23:43:07 +0100 (Sat, 30 Dec 2017)
Log Message:
-----------
pst-node (30dec17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-node/Changes
    trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex
    trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex
    trunk/Master/texmf-dist/tex/generic/pst-node/pst-node.tex
    trunk/Master/texmf-dist/tex/latex/pst-node/pst-node.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf

Modified: trunk/Master/texmf-dist/doc/generic/pst-node/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-node/Changes	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/doc/generic/pst-node/Changes	2017-12-30 22:43:07 UTC (rev 46170)
@@ -1,4 +1,6 @@
 ----- pst-node.tex
+1.41  2017-12-30 - added \psnpolygon
+1.40a 2017-12-14 - modified documentation
 1.40  2017-12-09 - added #1Last for \saveDataAsNodes
 1.39  2017-01-20 - fix for \Circlenode with +/+\dp\hbox
 1.38  2016-05-27 - revert fix for \Cnodeput. Problem was in pstricks.tex

Added: trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf	2017-12-30 22:43:07 UTC (rev 46170)

Property changes on: trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex	2017-12-30 22:43:07 UTC (rev 46170)
@@ -1,6 +1,6 @@
-%% $Id: psmatrix-docDE.tex 42 2014-07-25 06:49:51Z herbert $
+%% $Id: psmatrix-docDE.tex 696 2017-12-30 19:01:07Z herbert $
 \listfiles
-\documentclass[11pt,ngerman,a4paper,BCOR10mm,DIV12,bibliography=totoc,parskip,smallheadings
+\documentclass[11pt,ngerman,a4paper,BCOR10mm,DIV12,bibliography=totoc,parskip,smallheadings,
     headexclude,footexclude,oneside]{pst-doc}
 \usepackage[utf8]{inputenc}
 \usepackage{babel}
@@ -17,6 +17,9 @@
 \usepackage{tabularx}
 \usepackage{longtable}
 
+\addbibresource{\jobname.bib}
+
+
 \lstset{explpreset={pos=l,rframe=},frame=,backgroundcolor=\color{white},literate={ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
   {Ä}{{\"A}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
   {ß}{\ss}1} 
@@ -1137,12 +1140,10 @@
 
 %\addcontentsline{toc}{section}{Literaturverzeichnis}
 
-\nocite{PSTricks2}
-\nocite{pstricks2007}
+\nocite{*}
 \raggedright
-\bibliographystyle{gerplain}
 
-\bibliography{psmatrix-docDE}
+\printbibliography
 \egroup
 \clearpage
 \addcontentsline{toc}{section}{Index}

Modified: trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.tex	2017-12-30 22:43:07 UTC (rev 46170)
@@ -1,5 +1,5 @@
-%% $Id: pst-node-doc.tex 684 2017-12-09 19:05:01Z herbert $
-\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,smallheadings,
+%% $Id: pst-node-doc.tex 696 2017-12-30 19:01:07Z herbert $
+\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
     headinclude=false,footinclude=false,oneside]{pst-doc}
 \listfiles
 
@@ -46,7 +46,9 @@
 \addbibresource{\jobname.bib}
 
 
-\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}}
+\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
+        %mathescape,basicstyle=\small\ttfamily
+}
 
 \begin{document}
 \title{\texttt{pst-node}\\Nodes and node connections%
@@ -71,7 +73,7 @@
 
 \vfill
 \noindent
-Thanks to:  Marco Daniel; Denis Girou; Rolf Niepraschk; Sebastian Rahtz;
+Thanks to:  Marco Daniel; Denis Girou; Rolf Niepraschk; Sebastian Rahtz; Andi Setiawan;
 \end{abstract}
 
 \clearpage
@@ -130,8 +132,72 @@
 
 %\psset{showNode}
 
+\section[Comparing nodes and coordinates]%
+  {Comparing nodes and coordinates\footnote{Christoph Bersch on \url{http://tex.stackexchange.com}}}
 
+The crucial point is understanding the difference between a node (A), which is created by \Lcs{pnode},
+ and a pair of coordinates $(x,y)$:
 
+\begin{itemize}
+\item
+    A coordinate pair, e.g. (1,1) specifies a relative point. 
+    Its position depends on the current environment, whether its surrounded by \Lcs{psdot}\Largr{1,1} 
+    text, or shifted with \Lcs{rput}(2,2)\texttt{\{\Lcs{psdot}(1,1)\}} etc.
+\item
+    A node (A) refers to an absolute, fixed point on the page. This is independent of the environment.
+\end{itemize}
+
+The following example resumes this.
+
+\begin{LTXexample}[width=3cm]
+\begin{pspicture}[showgrid](2,2)
+\rput(1,1){\pnode(1,1){A}}
+\psdot(A)
+\pnode(1,1){B}
+\rput(1,1){\psdot[linecolor=red](B)}
+\end{pspicture}
+\end{LTXexample}
+
+The black dot is placed at (2,2), because \Lcs{rput} shifts the coordinate pair (1,1), 
+which is used to define node A. The red dots remains at (1,1) because \Lcs{rput} 
+has no effect on (B) after its definition:
+
+That's the essence of all node-stuff.
+
+Using \texttt{(!\Lcs{psGetNodeCenter}\{A\} A.x A.y)} is equivalent to (A).
+
+The parameter \Lkeyword{saveNodeCoors} saves the relative coordinates 
+at the time of the node definition. I.e. adding dots at \texttt{(!N-A.x N-A.y)} 
+and \texttt{(!N-B.x N-B.y)} in the above example places two dots at 
+(1,1), which are the coordinate pairs used to define both nodes A and B:
+
+
+\begin{LTXexample}[width=3cm]
+\begin{pspicture}[showgrid, saveNodeCoors](2,2)
+\rput(1,1){\pnode(1,1){A}}
+\psdot(A)
+\pnode(1,1){B}
+\rput(1,1){\psdot[linecolor=red](B)}
+    %
+\psdot[dotstyle=+, dotscale=2](!N-A.x N-A.y)
+\psdot[dotstyle=x, dotscale=2](!N-B.x N-B.y)
+\end{pspicture}
+\end{LTXexample}
+
+Resuming this:
+
+\begin{itemize}
+\item
+Coordinate pairs like (1, 1) or node expressions with \texttt{! N-A.x N-A.y} are relative and 
+    are subject to scaling and translation like with \Lcs{rput}, \Lcs{scale}, \Lcs{translate} and such.
+\item
+    Nodes (A) and node expressions with \Lcs{psGetNodeCenter} are fixed, »immutable« points.
+\end{itemize}
+
+
+
+
+
 \section{Nodes}\label{S-nodes}
 
 Nodes have a name. a boundary and a center.
@@ -1256,10 +1322,11 @@
 
 \section{Attaching labels to nodes}
 
-The command
+The commands
 
 \begin{BDef}
-\LcsStar{nput}\OptArgs\Largb{refangle}\Largb{name}\Larg{stuff}
+\LcsStar{nput}\OptArgs\Largb{refangle}\Largb{name}\Largb{stuff}\\
+\LcsStar{uput}\OptArg*{\Largb{distance}}\Largs{angle}\OptArg*{\Largb{rotation}}\Largr{name}\Largb{stuff}
 \end{BDef}
 
 
@@ -1287,11 +1354,189 @@
 \end{pspicture}
 \end{LTXexample}
 
-\section{Mathematical diagrams and graphs}\label{S-psmatrix}
+\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+For the put macros there are several possibilities:
 
+\begin{LTXexample}[width=7cm]
+\begin{pspicture}[showgrid](-0.25,-0.25)(6,5)
+\pnodes(0,3){A}(3,1){B}
+\psline[showpoints](A)(B)
+\uput[-90](A){A}\uput[-90](B){B}
+\psline[linestyle=dashed](A)(3,4)
+\psline[linestyle=dashed](A)(3,5)
+\psline[linestyle=dashed](A)(3,3)
+\psline[linestyle=dashed](6,2)
+\psline[linestyle=dashed](B)(6,1)
+\psarc{->}(0,3){2.5}{0}{(3,1)}
+\psarc{->}(3,1){2.5}{0}{(3,1)}
+\uput*{1cm}[(B)](A){foo} \uput*{1cm}[(B)](>A){bar}
+\end{pspicture}
+\end{LTXexample}
 
 
+
+
+\newcommand\object[1][solid]{\psline[linecolor=red,linewidth=1pt,linestyle=#1]{->}(0,1.5)}
+\def\Theta{150}
+\def\Radius{1.6}
+\psset{linestyle=dashed,dash=4pt 1pt,linecolor=cyan}
+
+\subsection{Normal behavior without rotation}
+If there are a point $B$ of type node and a point $A$ of any type then
+\begin{lstlisting}
+\uput{r}[(B)]{0}(A){\object}
+\end{lstlisting}
+will produce the same effect as
+\begin{lstlisting}
+\pnode([nodesep=r]{B}A){C}
+\rput{0}(C){\object}
+\end{lstlisting}
+
+\begin{LTXexample}[width=5.5cm]
+\begin{pspicture}[showgrid](-1,-1)(4,6)
+\pnodes(2,1){A}(0,0){O}(1,5){B}
+\pnode([nodesep=\Radius]{B}A){C}
+\pcline(O)(A) \pcline(O)(B)  \pcline(A)(B)
+\pcline(A)([nodesep=-\Radius]A)\nbput{$r$}
+\uput[-135](O){$O$} \uput[-110](A){$A$} 
+\uput[90](B){$B$} \uput[150](C){$C$}
+\pscircle(A){\Radius}
+% -------------------------------
+\uput{\Radius}[(B)]{0}(A){\object}
+%\rput{0}([nodesep=\Radius]{B}A){\object}
+\end{pspicture}
+\end{LTXexample}
+
+	
+\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%	
+
+\subsection{Normal behavior with rotation}
+If there are a point $B$ of type node and a point $A$ of any type then 
+\begin{lstlisting}
+\uput{r}[(B)]{rotangle}(A){\object}
+\end{lstlisting}
+will produce the same effect as 
+\begin{lstlisting}
+\pnode([nodesep=r,angle=-rotangle]{B}A){R}
+\rput{rotangle}(R){\object}
+\end{lstlisting}
+
+\begin{LTXexample}[width=5.5cm]
+\begin{pspicture}[showgrid](-1,-2)(4,6)
+\pnodes(2,1){A}(0,0){O}\pnode(1,5){B}
+\pnode([nodesep=\Radius]{B}A){C}
+\pnode([nodesep=\Radius,angle=-150]{B}A){R}
+% -------------------------------
+\pcline(O)(A) \pcline(O)(B) \pcline(A)(B)
+\pcline(A)([nodesep=-\Radius]A)
+\nbput{$r$}   \pcline(A)(R)
+\uput[-135](O){$O$}  \uput[-110](A){$A$}  
+\uput[90](B){$B$}    \uput[150](C){$C$}   
+\uput[-45](R){$R$}
+%
+\pscircle(A){\Radius}
+\psarcn[origin={A}]{->}(A){.6}{(B)}{(R)}
+\uput{5pt}[30](A){$\theta$}
+\psarc[origin={R}]{->}(R){.7}{([offset=1]R)}%
+      {([offset=1,angle=\Theta]R)}    
+\uput*{8pt}[160](R){$\theta$}
+% -------------------------------
+\rput(R){\object[dashed]}  
+\uput{\Radius}[(B)]{150}(A){\object}
+%\rput{\Theta}([nodesep=\Radius,
+%         angle=-\Theta]{B}A){\object}
+\end{pspicture}
+\end{LTXexample}
+
+\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%	
+
+\subsection{Special behavior without rotation}
+If there are a point $B$ of type node and a point $A$ of any type then
+\begin{lstlisting}
+\uput{r}[(B)]{0}(>A){\object}
+\end{lstlisting}
+will produce the same effect as
+\begin{lstlisting}
+\nodexn{(A)+(B)}{D}
+\pnode([nodesep=r]{D}A){C'}
+\rput{0}(C'){\object}
+\end{lstlisting}
+
+\begin{LTXexample}[width=5.5cm]
+\begin{pspicture}[showgrid](-1,-1)(4,7)
+\pnodes(2,1){A}(0,0){O}(1,5){B}
+\pnode([nodesep=\Radius]{B}A){C}  
+\nodexn{(A)+(B)}{D}
+\pnode([nodesep=\Radius]{D}A){C'}
+% -------------------------------
+\pcline[ArrowInside=->>](O)(A) 
+\pcline[ArrowInside=->](O)(B)
+\pcline(A)(B)                  
+\pcline(A)([nodesep=-\Radius]A)\nbput{$r$}
+\pcline[ArrowInside=->](A)(D)  
+\pcline[ArrowInside=->>](B)(D)
+\uput[-135](O){$O$}  \uput[-110](A){$A$}  
+\uput[90](B){$B$}    \uput[150](C){$C$}   
+\uput[30](C'){$C'$}  \uput[45](D){$D$}
+%
+\pscircle(A){\Radius}
+% -------------------------------
+\uput{\Radius}[(B)]{0}(>A){\object}
+%\rput{0}(C'){\object}
+\end{pspicture}
+\end{LTXexample}
+	
+
+\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%	
+
+\subsection{Special behavior with rotation}
+If there are a point $B$ of type node and a point $A$ of any type then
+\begin{lstlisting}
+\uput{r}[(B)]{rotangle}(>A){\object}
+\end{lstlisting}
+will produce the same effect as
+\begin{lstlisting}
+\nodexn{(A)+(B)}{D}
+\pnode([nodesep=r]{D}A){C'}
+\rput{rotangle}(C'){\object}
+\end{lstlisting}
+
+\begin{LTXexample}[width=5.5cm]
+\begin{pspicture}[showgrid](-1,-1)(4,7)
+\pnodes(2,1){A}(0,0){O}(1,5){B}
+\pnode([nodesep=\Radius]{B}A){C}   
+\nodexn{(A)+(B)}{D}
+\pnode([nodesep=\Radius]{D}A){C'}
+% -------------------------------
+\pcline[ArrowInside=->>](O)(A) 
+\pcline[ArrowInside=->](O)(B)
+\pcline(A)(B)                  
+\pcline(A)([nodesep=-\Radius]A)
+\nbput{$r$}
+\pcline[ArrowInside=->](A)(D)  
+\pcline[ArrowInside=->>](B)(D)
+\uput[-135](O){$O$}  \uput[-110](A){$A$}  
+\uput[90](B){$B$}    \uput[150](C){$C$}   
+\uput[30](C'){$C'$}  \uput[45](D){$D$}
+%
+\pscircle(A){\Radius}
+\psarc[origin={C'}]{->}(C'){.55}{([offset=1]C')}%
+        {([offset=1,angle=150]C')}
+\uput*{5pt}[170](C'){$\theta$}
+% -------------------------------
+\rput{0}(C'){\object[dashed]}
+\uput{\Radius}[(B)]{150}(>A){\object}
+%\rput{150}(C'){\object}
+\end{pspicture}
+\end{LTXexample}
+
+
+\psset{linestyle=solid,dash=4pt 1pt,linecolor=black}
+
+
+\section{Mathematical diagrams and graphs}\label{S-psmatrix}
+
 For some applications, such as mathematical diagrams and graphs, it is useful
 to arrange nodes on a grid. You can do this with alignment environments, such
 as \TeX's  \Lcs{halign} primitive, \LaTeX's \Lenv{tabular} environment, and \AmS-\TeX's
@@ -2325,7 +2570,48 @@
 \end{LTXexample}
 \vspace{2pc}
 
+
 \begin{BDef}
+\Lcs{psnpolygon}\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}
+\pspolygon[linewidth=1pt]{->}(P3)(P4)(P5)(P6)(P7)(P8)
+\end{verbatim}
+
+Conversion between any angle unit and degree unit
+
+\begin{LTXexample}[pos=t,vsep=1cm]
+\begin{pspicture}[showgrid=b](-2,-2)(2,2)
+\def\N{9 }%
+\degrees[\N]
+\curvepnodes[plotpoints=\numexpr\N+1]{0}{\N AnytoDeg}{t dup cos exch sin}{P}
+\psnpolygon(0,\numexpr\Pnodecount-1){P}
+\foreach \i in {0,1,...,\numexpr\Pnodecount-1}{%
+  \uput{6pt}[\i]{!\i\space 90 DegtoAny sub}(P\i){\psline{->}(0,12pt)}}
+\end{pspicture}
+\end{LTXexample}
+	
+	
+	
+Conversion between any angle unit and radian unit
+
+\begin{LTXexample}[pos=t,vsep=1cm]
+\begin{pspicture}[showgrid=b](-2,-2)(2,2)
+\def\N{9 }% 
+\degrees[\N]
+\curvepnodes[plotpoints=\numexpr\N+1]{0}{\N AnytoRad}{cos(t)|sin(t)}{P}
+\psnpolygon(0,\numexpr\Pnodecount-1){P}
+\foreach \i in {0,1,...,\numexpr\Pnodecount-1}{%
+  \uput{6pt}[\i]{!\i\space Pi 2 div RadtoAny sub}(P\i){\psline{->}(0,12pt)}}
+\end{pspicture}
+\end{LTXexample}
+
+
+
+
+
+\begin{BDef}
 \Lcs{psncurve}\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
@@ -2700,3 +2986,5 @@
 
 
 \end{document}
+
+https://tex.stackexchange.com/questions/102558/how-do-we-explain-the-behavior-of-rput-psgetnodecenter-and-savenodecoors/163411#163411

Modified: trunk/Master/texmf-dist/tex/generic/pst-node/pst-node.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-node/pst-node.tex	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/tex/generic/pst-node/pst-node.tex	2017-12-30 22:43:07 UTC (rev 46170)
@@ -1,4 +1,4 @@
-% $Id: pst-node.tex 683 2017-12-09 18:52:02Z herbert $
+% $Id: pst-node.tex 696 2017-12-30 19:01:07Z herbert $
 %%
 %% BEGIN pst-node.tex
 %%
@@ -18,8 +18,8 @@
 \ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi\relax
 \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
 %
-\def\fileversion{1.40}
-\def\filedate{2017/12/09}
+\def\fileversion{1.41}
+\def\filedate{2017/12/30}
 \message{ v\fileversion, \filedate}
 %
 \edef\TheAtCode{\the\catcode`\@}
@@ -1699,6 +1699,17 @@
 \expandafter\psline\@tmp}%
 \ignorespaces}%
 %
+\def\psnpolygon{\pst at object{psnpolygon}}%polygon of nodes
+\def\psnpolygon at i{\pst at getarrows{\psnpolygon at ii}}
+\def\psnpolygon at ii(#1,#2)#3{{%
+\pst at killglue%
+\use at par%
+\pst at cnta=#2 \relax\advance\pst at cnta by 1
+\edef\@tmp{}%
+\multido{\i=#1+1}{\pst at cnta}{\xdef\@tmp{\@tmp(#3\i)}}%
+\expandafter\pspolygon\@tmp}%
+\ignorespaces}%
+%
 \def\psncurve{\pst at object{psncurve}}%line of nodes
 \def\psncurve at i{\pst at getarrows{\psncurve at ii}}
 \def\psncurve at ii(#1,#2)#3{{%

Modified: trunk/Master/texmf-dist/tex/latex/pst-node/pst-node.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pst-node/pst-node.sty	2017-12-30 22:19:20 UTC (rev 46169)
+++ trunk/Master/texmf-dist/tex/latex/pst-node/pst-node.sty	2017-12-30 22:43:07 UTC (rev 46170)
@@ -1,4 +1,4 @@
-% $Id: pst-node.sty 40 2014-07-25 06:46:27Z herbert $
+% $Id: pst-node.sty 688 2017-12-14 13:08:41Z herbert $
 %%
 %% This is file `pst-node.sty'.
 %%



More information about the tex-live-commits mailing list