From df78ede549d02ea12c8c9573da0e4dc2656361f8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 30 Dec 2017 22:43:07 +0000 Subject: pst-node (30dec17) git-svn-id: svn://tug.org/texlive/trunk@46170 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-node/Changes | 2 + .../doc/generic/pst-node/psmatrix-docDE.pdf | Bin 0 -> 229201 bytes .../doc/generic/pst-node/psmatrix-docDE.tex | 13 +- .../doc/generic/pst-node/pst-node-doc.pdf | Bin 604175 -> 673587 bytes .../doc/generic/pst-node/pst-node-doc.tex | 302 ++++++++++++++++++++- 5 files changed, 304 insertions(+), 13 deletions(-) create mode 100644 Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/generic/pst-node/Changes b/Master/texmf-dist/doc/generic/pst-node/Changes index aaa9d601caf..be370061b74 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.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 diff --git a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf new file mode 100644 index 00000000000..cb72a62b43e Binary files /dev/null and b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.pdf differ 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 ae774b5d4fa..8ca96eab4e7 100644 --- a/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex +++ b/Master/texmf-dist/doc/generic/pst-node/psmatrix-docDE.tex @@ -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 @@ vorgestellt werden, die von mir in der \texttt{pstmatrix}-Umgebung gesetzt wurde %\addcontentsline{toc}{section}{Literaturverzeichnis} -\nocite{PSTricks2} -\nocite{pstricks2007} +\nocite{*} \raggedright -\bibliographystyle{gerplain} -\bibliography{psmatrix-docDE} +\printbibliography \egroup \clearpage \addcontentsline{toc}{section}{Index} 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 index 6c01a9da9ec..786101f32e5 100644 Binary files a/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf and b/Master/texmf-dist/doc/generic/pst-node/pst-node-doc.pdf differ 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 33b37d39f6f..d2280a3b396 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,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 @@ when also running the main package \LPack{pstricks} with this option. \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,6 +132,70 @@ But don't restrict yourself to these more obvious uses. For example: %\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} @@ -1256,10 +1322,11 @@ The\XInfoDanger{~} node macros use \Lcs{pstVerb} and \Lcs{pstverbscale}. \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,10 +1354,188 @@ Here is how I used \Lcs{nput} to mark an angle in a previous example: \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 @@ -2325,6 +2570,47 @@ turn a list of coordinates into a node sequence P0 P1 ... \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} @@ -2700,3 +2986,5 @@ node is saved as \nxLenv{Last} \end{document} + +https://tex.stackexchange.com/questions/102558/how-do-we-explain-the-behavior-of-rput-psgetnodecenter-and-savenodecoors/163411#163411 -- cgit v1.2.3