zauguin / luapstricks

8 stars 0 forks source link

Report `pst-node` ... OK #18

Closed pablgonz closed 3 years ago

pablgonz commented 3 years ago

Just as a report, with the examples that I have adapted and others taken from the documentation... Everything is going perfect!!!

% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY ] }
% arara: clean: { extensions : [ aux, log, dvi, ps ] }
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\addtolength{\hoffset}{-1.5cm}
% short
\newcommand{\BSS}[1]{\textbf{\textbackslash{#1}}}
\newcommand{\AC}[1]{\{#1\}}
\newcommand{\BS}[1]{$\backslash$#1}
\begin{document}
% Adadted from visualpstricks
\psset{llx=-.5cm,lly=-.5cm,urx=.2cm,ury=.2cm,xAxisLabel={}, yAxisLabel={}}
\psset{fillcolor=yellow,linecolor=blue}
\section{Nodes}

\subsection{Types of nodes}
\subsubsection{With coordinates}

\begin{tabular}{|c|c|c|}
\hline
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \dotnode(.5,0.5){A}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \fnode(.5,0.5){B}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \fnode[framesize=.5 5pt](.5,0.5){B}
\end{psgraph*} \\
\hline
\BSS{dotnode}(.5,0.5)\AC{A} & \BSS{fnode}(.5,0.5)\AC{B} & \BSS{fnode}[\textcolor{red}{framesize}=.5 5pt](.5,0.5)\AC{B} \\
\hline
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \dotnode*(.5,0.5){A}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \fnode*(.5,0.5){B}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \fnode*[framesize=.5 5pt](.5,0.5){B}
\end{psgraph*} \\
\hline
\BSS{dotnode}*(.5,0.5)\AC{A} & \BSS{fnode}*(.5,0.5)\AC{B} & \BSS{fnode}*[\textcolor{red}{framesize}=.5 5pt](.5,0.5)\AC{B} \\
\hline
\end{tabular}

\begin{tabular}{|c|c|c|}
\hline
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \pnode(.5,0.5){A}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \cnode(.5,0.5){.2cm}{A}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \Cnode[radius=.2cm](.5,0.5){A}
\end{psgraph*} \\
\hline
\BSS{pnode}(.5,0.5)\AC{A} & \BSS{cnode}(.5,0.5)\AC{.2cm}\AC{A} & \BSS{Cnode}[radius=.2cm](.5,0.5)\AC{A} \\
\hline
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \cnode*(.5,0.5){.2cm}{A}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \Cnode*[radius=.2cm](.5,0.5){A}
\end{psgraph*}
\\
\hline
%\BSS{pnode}*(.5,0.5)\AC{A}
&
\BSS{cnode}*(.5,0.5)\AC{.2cm}\AC{A} & \BSS{Cnode}*[radius=.2cm](.5,0.5)\AC{A} \\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|c|c|}
\hline
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \psnode(.5,0.5){A}{content}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \cnodeput{45}(.5,0.5){M}{content}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \Cnodeput[radius=1cm]{45}(.5,0.5){M}{content}
\end{psgraph*} \\
\hline
\BSS{psnode}(.5,0.5)\AC{A}\AC{content} & \BSS{cnodeput}\AC{45}(.5,0.5) & \BSS{Cnodeput}[radius=1cm] \\
&
\AC{M}\AC{content} & \AC{45}(2,0)\AC{M}\AC{content} \\
\hline

\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \psnode*(.5,0.5){A}{content}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \cnodeput*{45}(.5,0.5){M}{content}
\end{psgraph*}
&
\begin{psgraph*}[axesstyle=none,xticksize= 0 1 ,yticksize=0 1 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(1,1){2cm}{2cm }
  \Cnodeput*[radius=1cm]{45}(.5,0.5){M}{content}
\end{psgraph*} \\
\hline
\BSS{psnode}*(.5,0.5)\AC{A}\AC{content} & \BSS{cnodeput}*\AC{45}(.5,0.5) & \BSS{Cnodeput}*[radius=1cm] \\
&
\AC{M}\AC{content} & \AC{45}(2,0)\AC{M}\AC{content}\\
\hline
\end{tabular}

\vspace{1cm}

\begin{tabular}{|c|}
\hline
Text \Cnodeput*[radius=1cm]{45}(0,0){M}{content} text \\
\hline\\ \\
Text \BS{Cnodeput}*[radius=1cm]\AC{45}(0,0)\AC{M}\AC{content} text \\
{\red {These nodes do not have dimension} !} \\
\hline
\end{tabular}

\subsection{Without coordinates}

\begin{tabular}{|c|c|c|}
\hline
\rnode{A}{content}
&
\Rnode{B}{content}
&
\rnode{C}{\psframebox{content}}
\\
\hline
\BSS{rnode}\AC{A}\AC{content}
&
\BSS{Rnode}\AC{B}\AC{content}
&
\BSS{rnode}\AC{C}\AC{\BS{psframebox}\AC{content}}
\\
\hline
&
\Rnode*{B}{content}
&
\rnode{C}{\psframebox*{content}}
\\
\hline
&
\BSS{Rnode}*\AC{B}\AC{content}
&
\BSS{rnode}\AC{C}\AC{\BS{}psframebox*\AC{content}}
\\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|c|}
\hline
\trinode{A}{content}
&
\trinode*{B}{content}
\\
\hline
\BSS{trinode}\AC{A}\AC{content}
&
\BSS{trinode}*\AC{B}\AC{content}
\\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|}\hline
Text \dianode{A}{content} text
\\
\hline
Texte \BS{dianode}\AC{A}\AC{content} text
\\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|}
\hline
\begin{psgraph*}[axesstyle=none,xticksize= 0 2 ,yticksize=0 2 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5 ](0,0)(0,0)(2,2){4cm}{4cm }
  \rput(1,1){\dianode{A}{content}}
\end{psgraph*}
\\
\hline
\BSS{rput}(1,1)\AC{\BS{dianode}\AC{A}\AC{content}}
\\
\hline
\end{tabular}

\subsubsection{Creation of multiple nodes}

\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{\BSS{dotnodes}[dotstyle=o](1, 0.5)\AC{A}(2, 2.5)\AC{B}(3, 1.5)\AC{C}}\\
\hline
\begin{psgraph}[axesstyle=none,xticksize=0 4,yticksize=0 4,subticks=0](0,0)(4,4){4cm}{4cm}
  \dotnodes[dotstyle=o](1, 0.5){A}(2, 2.5){B}(3, 1.5){C}
\end{psgraph}
&
\begin{psgraph}[axesstyle=none,xticksize=0 4,yticksize=0 4,subticks=0](0,0)(4,4){4cm}{4cm}
  \dotnodes[dotstyle=o](1, 0.5){A}(2, 2.5){B}(3, 1.5){C}
\end{psgraph} \\
\hline
\BS{dotnodes} & \BS{dotnodes*}  \\
\hline
\end{tabular}

\newpage

\section{Connections between nodes}

\subsection{Types of connections available \protect \footnote{fillcolor=white,linecolor=blue}}

\psset{fillcolor=white,fillstyle=none,linewidth=1pt}

\begin{tabular}{|l|c|c|}
\hline
& \textbf{without asterisk} & \textbf{with asterisk}\\
\hline
\BSS{ncline}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncline{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncline*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{nccurve}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \nccurve{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \nccurve*{->}{A}{B}
  \end{pspicture} \\
\hline
\BSS{ncarc}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncarc{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncarc*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{ncbar}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncbar{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncbar*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{ncdiag}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncdiag{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncdiag*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{ncdiagg}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncdiagg{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncdiagg*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{ncangle}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncangle{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncangle*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{ncangles}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncangles{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A}
  \dotnode[dotstyle=*](2,0){B}
  \ncangles*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{nccircle}\AC{->}\AC{A}\AC{.3cm}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \nccircle{->}{A}{.3cm}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \nccircle*{->}{A}{.3cm}
\end{pspicture} \\
\hline
\BSS{ncbox}\AC{->}\AC{A}\AC{B}
&
boxsize
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \ncbox*{A}{B}
\end{pspicture} \\
\hline
\BSS{ncarcbox}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \ncarcbox{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \ncarcbox*{A}{B}
\end{pspicture} \\
\hline
\BSS{ncloop}\AC{->}\AC{A}\AC{B}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,-.5){B}
  \ncloop[loopsize=.7cm]{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,-.5){B}
  \ncloop*[loopsize=.7cm]{A}{B}
\end{pspicture} \\
\hline
\end{tabular}

\subsubsection{Nodes as points}

\psset{fillcolor=white,fillstyle=none,linewidth=1pt}
%
\begin{tabular}{|l|c|c|}
\hline
&
\textbf{without asterisk} & \textbf{with asterisk} \\
\hline
\BSS{pcline}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcline{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcline*{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pccurve}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pccurve{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pccurve*{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcarc }\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcarc {->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcarc *{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcbar}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcbar{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcbar*{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcdiag}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcdiag{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag*{->}{A}{B}
\end{pspicture} \\
\hline
\BSS{pcdiagg }\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcdiagg {->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcdiagg *{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcangle}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcangle{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcangle*{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcangles}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcangles{->}(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \pcangles*{->}(A)(B)
\end{pspicture} \\
\hline
\BSS{pcbox}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \pcbox(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \pcbox*(A)(B)
\end{pspicture} \\
\hline
\BSS{pcarcbox}\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \pcarcbox(A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,0){A} \dotnode[dotstyle=*](2,0){B}
  \pcarcbox*(A)(B)
\end{pspicture} \\
\hline
\BSS{pcloop }\AC{->}(A)(B)
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,-.5){B}
  \pcloop [loopsize=.7cm](A)(B)
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,-.5){B}
  \pcloop *[loopsize=.7cm](A)(B)
\end{pspicture} \\
\hline
\end{tabular}

\section{Labels}
\subsection{Labels on the nodes}

\psset{fillcolor=yellow}
\begin{tabular}{|c| p{3cm}|p{8cm}|}
\hline
\multicolumn{3}{|c|}{syntax:  $\backslash$nput*[param]\{position=angle\}\{nom\}\{text\}  } \\
\hline
\BSS{nput}
&
\rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput{0}{A}{text}
&
\verb+\nput{0}{A}{text}+ \\
\hline
\BS{nput}* & \rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput*{0}{A}{text}
&
\verb+\nput*{0}{A}{text}+ \\
\hline
position=angle & \rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput*{45}{A}{à 45}\nput*{-45}{A}{à -45}
&
\verb+\nput*{45}{A} \{à 45\}+ \\
\hline
\textcolor{red}{labelsep}
&
\rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput*[labelsep=0.5cm]{0}{A}{text}
&
\verb+ \nput*[labelsep=0.5cm]{0}{A}{text}+ \\
\hline
\textcolor{red}{labelsep}
&
\rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput*[labelsep=-0.1cm]{0}{A}{text}
&
\verb+\nput*[labelsep=-0.1cm]{0}{A}{text}+ \\
\hline
\textcolor{red}{rot}
&
\rule[-1cm]{0pt}{2cm} \cnode(1,0){.2cm}{A} \nput*[rot=45]{0}{A}{rot=45}
&
\verb+\nput*[rot=45]{0}{A}{rot=45}+ \\
\hline
\end{tabular}

\newpage

\subsection{Options available}

\psset{fillcolor=white}
\begin{tabular}{|c| c |c|}
\hline
\multicolumn{3}{|c|}{\BS{}ncline[nodesep=.3cm]\AC{->}\AC{A}\AC{B}} \\
\hline &  &  \\
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,.5){B}
  \ncline[nodesep=.3cm]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,.5){B}
  \ncline[nodesepA=.2cm]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,.5){B}
  \ncline[nodesepB=.4cm]{->}{A}{B}
\end{pspicture} \\
\hline
\textcolor{red}{nodesep}=0.3cm & \textcolor{red}{nodesepA}=0.2cm & \textcolor{red}{nodesepB}=0.4cm \\
\hline
{\color{blue} By default: 0pt} & {\color{blue} By default: 0pt} & {\color{blue} By default: 0pt} \\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c| c |c|}
\hline
\multicolumn{3}{|c|}{ \BS{}ncarc[arcangle=90]\AC{->}\AC{A}\AC{B} } \\
\hline
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncarc[linestyle=dotted]{A}{B}
  \ncarc[arcangle=90]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncarc[linestyle=dotted]{A}{B}
  \ncarc[arcangleA=90]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncarc[linestyle=dotted]{A}{B}
  \ncarc[arcangleB=90]{->}{A}{B}
\end{pspicture} \\
\hline
\textcolor{red}{arcangle}=90  & \textcolor{red}{arcangleA}=90 & \textcolor{red}{arcangleB}=90 \\
\hline
{\color{blue} By default: 8} & {\color{blue} By default: 8} & {\color{blue} By default: : 8} \\
\hline
\multicolumn{3}{|c|}{\color{cyan} only for \BS{ncarc}!} \\
\hline
\end{tabular}
\bigskip

\begin{tabular}{|c| c |c|}
\hline
\multicolumn{3}{|c|}{ \BS{}ncdiag[angle=90]\AC{->}\AC{A}\AC{B}} \\
\hline
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[angle=90]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[angleA=15]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[angleB=180]{->}{A}{B}
\end{pspicture} \\
\hline
\textcolor{red}{angle}=90 & \textcolor{red}{angleA}=15 & \textcolor{red}{angleB}=180\\
\hline
{\color{blue} By default: 0} & {\color{blue} By default: 0} & {\color{blue} By default: 0} \\
\hline
\end{tabular}
\bigskip

\begin{tabular}{|c| c |c|}
\hline
\multicolumn{3}{|c|}{ \BS{}ncdiag[arm=1cm]\AC{->}\AC{A}\AC{B} } \\
\hline
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[arm=1cm]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[armA=1cm]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncdiag[linestyle=dotted]{A}{B}
  \ncdiag[armB=1cm]{->}{A}{B}
\end{pspicture} \\
\hline
\textcolor{red}{arm}=1cm & \textcolor{red}{armA}=1cm & \textcolor{red}{armB}=1cm \\
\hline
{\color{blue} By default: 10pt} & {\color{blue} By default: 10pt} & {\color{blue} By default: 10pt} \\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|c|c|} \hline
\begin{pspicture}(0,-1)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncline[offset=5pt]{->}{A}{B}
  \ncline[offset=5pt]{->}{B}{A}
\end{pspicture}
&
\begin{pspicture}(0,-1)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncline[offsetA=5pt]{->}{A}{B}
  \ncline[linestyle=dotted]{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-1)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncline[offsetB=5pt]{->}{A}{B}\ncline[linestyle=dotted]{A}{B}
\end{pspicture} \\
\hline
\BS{}ncline[\textcolor{red}{offset}=5pt]\AC{->}\AC{A}\AC{B}  & \BS{}ncline[\textcolor{red}{offsetA}=5pt]\AC{->}\AC{A}\AC{B}  & \BS{}ncline[\textcolor{red}{offsetB}=5pt]\AC{->}\AC{A}\AC{B} \\
\BS{}ncline[{\red offset}=5pt]\AC{->}\AC{B}\AC{A} & \BS{}ncline[linestyle=dotted]\AC{A}\AC{B} & \BS{}ncline[linestyle=dotted]\AC{A}\AC{B}
\\
\hline
{\color{blue} By default: 0pt } & {\color{blue} By default: 0pt} & {\color{blue} By default: 0pt} \\
\hline
\end{tabular}

\bigskip
\begin{minipage}[c]{.5\linewidth}
\begin{tabular}{|c|}
\hline
\begin{pspicture}(0,-1)(3 ,2)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,-.5){B}
  \ncloop[linestyle=dotted]{A}{B}
  \ncloop[loopsize=2cm]{A}{B}
\end{pspicture} \\
\hline
\BS{ncloop}[\textcolor{red}{loopsize}=2cm]\AC{A}\AC{B} \\
\hline
{\color{blue} By default: 1 cm} \\
\hline
\end{tabular}
\end{minipage}\hfill
\begin{minipage}[c]{.5\linewidth}
\begin{tabular}{|c|}
\hline
\\
\begin{pspicture}(0,-1)(3 ,.5)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,0){B}
  \ncarcbox[linestyle=dotted]{A}{B}
  \ncarcbox[boxsize=.2]{A}{B}
\end{pspicture} \\
\hline
\BS{ncarcbox}[\textcolor{red}{boxsize}=.2]\AC{A}\AC{B} \\
\hline
{\color{blue} By default: 0.4cm}   \\
\hline
{\cyan only for \BS{ncbox} and \BS{ncarcbox}!} \\
\hline
\end{tabular}
\end{minipage}

\bigskip

\begin{tabular}{|c|c|c|}
\hline
\begin{pspicture}(0,-1)(3 ,2)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,1.5){B}
  \nccurve[linestyle=dotted]{A}{B}
  \nccurve[ncurv=1]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-1)(3 ,2)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,1.5){B}
  \nccurve[linestyle=dotted]{A}{B}
  \nccurve[ncurvA=1]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-1)(3 ,2)
  \dotnode[dotstyle=*](1,-.5){A} \dotnode[dotstyle=*](2,1.5){B}
  \nccurve[linestyle=dotted]{A}{B}
  \nccurve[ncurvB=1]{->}{A}{B}
\end{pspicture} \\
\hline
\BS{}nccurve[\textcolor{red}{ncurv}=1]\AC{->}\AC{A}\AC{B} & \BS{}nccurve[\textcolor{red}{ncurvA}=1]\AC{->}\AC{A}\AC{B} & \BS{}nccurve[\textcolor{red}{ncurvB}=1]\AC{->}\AC{A}\AC{B} \\
\hline
{\color{blue} By default: 0.67} & {\color{blue} By default: 0.67} & {\color{blue} By default: 0.67 } \\
\hline
\multicolumn{3}{|c|}{\color{cyan} only for \BS{nccurve} and \BS{pccurve}!} \\
\hline
\end{tabular}

\bigskip

\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{personalization of the connections} \\
\hline
\begin{pspicture}(0,-.5)(3 ,2.5)
  \dotnode[dotstyle=*](.5,0){A} \dotnode[dotstyle=*](2,2){B}
  \ncdiagg[linearc=.3cm,doubleline=true,arrowscale=2]{->}{A}{B}
\end{pspicture}
&
\begin{pspicture}(0,-.5)(3 ,2.5)
  \dotnode[dotstyle=*](.5,0){A} \dotnode[dotstyle=*](2,2){B}
  \ncbar[linestyle=dashed,linewidth=3pt,dashcolor=red]{)-[}{A}{B}
\end{pspicture} \\
\hline
\parbox[b]{6cm}{\BS{}ncdiagg[linearc=.3cm,doubleline=true,
arrowscale=2]\AC{->}\AC{A}\AC{B}} &
\parbox[b]{6cm}{\BS{}ncbar[linestyle=dashed,linewidth=3pt,
dashcolor=red]\AC{)-[}\AC{A}\AC{B}}\\
\hline
\end{tabular}

\section{Labels on the connections}

\psset{shortput=nab,fillcolor=yellow}
\begin{tabular}{|p{3cm}| p{3cm}|p{8cm}|}
\hline
\rput[l](0,1){ncput}
\rput[l](0,0.25){nbput}
\rput[l](0,1.75){naput}
&
\begin{pspicture}(0,-1)(3 ,1)
  \dotnode[dotstyle=*](0,0){A}
  \dotnode[dotstyle=*](3,0){B}
  \ncline{->}{A}{B}
  \naput[npos=.3]{naput}
  \ncput{ncput}
  \nbput[npos=.7]{nbput}
\end{pspicture}
&
\rput[l](0,.25){\BS{ncline}\AC{->}\AC{A}\AC{B}\BSS{nbput}[\textcolor{red}{npos}{\red =.7}]\AC{nbput}}
\rput[l](0,1){\BS{ncline}\AC{->}\AC{A}\AC{B}\BSS{ncput}\AC{ncput}}
\rput[l](0,1.75){\BS{ncline}\AC{->}\AC{A}\AC{B}\BSS{naput}[{\red npos=.3}]\AC{naput}} \\
\hline
\rput[l](0,1){ncput*}
\rput[l](0,0.25){nbput*}
\rput[l](0,1.75){naput*}
&
\begin{pspicture}(0,-1)(3 ,1)
  \dotnode[dotstyle=*](0,0){A}
  \dotnode[dotstyle=*](3,0){B}
  \ncline{->}{B}{A}\naput*[npos=.3]{naput*}
  \ncput*{ncput*}
  \nbput*[npos=.7]{nbput*}
\end{pspicture}
&
\rput[l](0,.25){\BS{ncline}\AC{->}\AC{B}\AC{A}\BS{nbput}*[npos=.7]\AC{nbput}}
\rput[l](0,1){\BS{ncline}\AC{->}\AC{B}\AC{A}\BS{ncput}*\AC{ncput} }
\rput[l](0,1.75){\BS{ncline}\AC{->}\AC{B}\AC{A}\BS{naput}*[npos=.3]\AC{naput}}\\
\hline\\
\hline
\rput[l](0,1.5){[\textcolor{red}{nrot}=90]}
&
\begin{pspicture}(0,-1.5)(3 ,1.5)
  \dotnode[dotstyle=*](1.5,-1.2){A}
  \dotnode[dotstyle=*](1.5,1.2){B}
  \ncline{->}{B}{A}
  \naput*[nrot=90]{naput*}
  \ncput*[nrot=90]{ncput*}
  \nbput*[nrot=90]{nbput*}
\end{pspicture}
&
\rput[l](0,.5){\BS{ncline}\{->\}\{B\}\{A\}\BS{nbput}*[nrot=90]\AC{nbput}}
\rput[l](0,1.5){\BS{ncline}\AC{->}\AC{B}\AC{A}\BS{naput}*[nrot=90]\AC{naput}}
\rput[l](0,2.5){\BS{ncline}\AC{->}\AC{B}\AC{A}\BS{naput}*[nrot=90]\AC{naput}} \\
\hline
\end{tabular}

\section*{Examples}
% from doc
\begin{pspicture}[showgrid,arrowscale=2](5,5)
\pnode(4.5,0.5){MyNode}
\psdot(MyNode)
\pnode(! \psGetNodeCenter{MyNode}
MyNode.x 4 sub MyNode.y 4 add){MySecondNode}
\psdot(MySecondNode)
\ncline[linecolor=red]{<->}{MyNode}{MySecondNode}
\end{pspicture}

\begin{pspicture}[showgrid](5,5)
\rput(1.5,0.5){\trinode{CN}{NodeA}}
\rput(3.5,2.5){\trinode{EN}{NodeB}}
\pnode(! \psGetNodeCenter{CN}
CN.x 2 add CN.y 1 add ){MyCNode}
\ncline[linecolor=red]{<->}{MyCNode}{EN}
\ncline[linecolor=blue]{<->}{CN}{EN}
\end{pspicture}

\psscalebox{15}{\psDefBoxNodes{Age}{\color{red!50}\sffamily \"Age}}%
\pspolygon[fillstyle=solid,
fillcolor=blue!30,opacity=0.3](Age:tl)(Age:tr)(Age:br)(Age:bl)%
\psline[linestyle=dashed](Age:Bl)(Age:Br)%
\psdots(Age:tl)(Age:tC)(Age:tr)(Age:Cl)(Age:C)(Age:Cr)%
(Age:Bl)(Age:BC)(Age:Br)(Age:bl)(Age:bC)(Age:br)%
\pcline[arrows=<->,linecolor=blue,arrowscale=1.25](Age:tC)(Age:Br)
\uput[180](Age:tl){tl}\uput[180](Age:Cl){Cl}\uput[180](Age:Bl){Bl}\uput[180](Age:bl){bl}
\uput[90](Age:tC){tC} \uput[0](Age:C){C}
\uput[0](Age:BC){BC} \uput[-90](Age:bC){bC}
\uput[0](Age:tr){tr} \uput[0](Age:Cr){Cr} \uput[0](Age:Br){Br} \uput[0](Age:br){br}

\newpage

\hspace*{4cm}\rnode{B}{Node B}

\vspace*{2cm}

\rnode{A}{Node A}
\ncline{A}{B}
\pscircle*[linecolor=blue,opacity=0.4](!\psGetEdgeA{A}{B}){10pt}
\pscircle*[linecolor=blue,opacity=0.4](!\psGetEdgeB{A}{B}){10pt}

\begin{pspicture}(5,6)
\circlenode{A}{A}\quad\circlenode{C}{C}%
\quad\circlenode{E}{E}
\rput(0,4){\circlenode{B}{B}}
\rput(1,5){\circlenode{D}{D}}
\rput(2,6){\circlenode{F}{F}}
\psset{arrowscale=2,linearc=0.2,%
linecolor=red,armA=0.5, angleA=90,angleB=-90}
\ncdiag[lineAngle=20]{->}{A}{B}
\ncput*[nrot=:U]{line I}
\ncdiag[lineAngle=20]{->}{C}{D}
\ncput*[nrot=:U]{line II}
\ncdiag[lineAngle=20]{->}{E}{F}
\ncput*[nrot=:U]{line III}
\end{pspicture}

\begin{pspicture}[showgrid](-.5,-.5)(2.5,2.5)
\psset{arrows=->,arrowscale=1.5}
\pnode(2,1){P}\pnode(.5,1){Q}
\AtoB(Q)(P){QP}
\AplusB(Q)(P){R}
\psline(0,0)(P)\uput[-45](P){P}
\psline(0,0)(Q)\uput[135](Q){Q}
\psline(0,0)(QP)\uput[-70](QP){QP}
\psline(0,0)(R)\uput[160](R){R}
\psline[linestyle=dashed](Q)(P)
\psline[linestyle=dashed](Q)(R)
\psline[linestyle=dashed](P)(R)
\end{pspicture}

\begin{pspicture}[showgrid](-.5,-.5)(2.5,2)
\def\exn{cos(t) | sin(t)}
\psparametricplot[algebraic]{0}{2}{\exn}
\curvepnode{1}{\exn}{P}
\psdot(P)\uput[45](P){P}
\end{pspicture}

\begin{pspicture}[showgrid](-.5,-.5)(2.5,3)
\def\exn{t+t^2 | 2*Ex(-t)}
\psset{plotpoints=100}
\psparametricplot[algebraic]{0}{1}{\exn}
\curvepnodes{0}{1}{\exn}{P}
\psdot(P50)\uput[75](P50){P50}
\psdot(P99)\uput[75](P99){P99}
\end{pspicture}

\begin{pspicture}[showgrid](-.5,-.5)(3.5,4)
\def\pfn{t | t^2/4}
\psparametricplot[algebraic]{0}{3.5}{\pfn}
\curvepnode{2}{\pfn}{P}% sets P, Ptang
\normalvec(Ptang){Q}\uput[-45](P){P}
\psxline[linecolor=red]{<->}(P){-(Ptang)}{1.5(Ptang)}
\psxline[linecolor=blue]{->}(P){}{.5(Q)}%can use } for
{(0,0)}
\end{pspicture}
\end{document}

test-nodes-crop-01 test-nodes-crop-02 test-nodes-crop-03 test-nodes-crop-04 test-nodes-crop-05 test-nodes-crop-06 test-nodes-crop-07 test-nodes-crop-08 test-nodes-crop-09 test-nodes-crop-10 test-nodes-crop-11 test-nodes-crop-12

pablgonz commented 3 years ago

@hvoss49 I have read several times in the PStricks mail list that the driver for XeTeX has some limitations with node operations... those restrictions are also met with luapstricks?

pablgonz commented 3 years ago

@zauguin Do you know why this fails?

% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY -dPDFSETTINGS=/prepress ] }
% arara: clean: { extensions : [ aux, log, dvi, ps ] }
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\begin{document}
% math mode
\[
\setlength{\arraycolsep}{1.1cm}
\begin{array}{cc}
  \Rnode{a}{(X-A)} & \Rnode{b}{A} \\[1.5cm]
  \Rnode{c}{x} & \Rnode{d}{\tilde{X}}
\end{array}
\psset{nodesep=5pt,arrows=->} \everypsbox{\scriptstyle}
\ncline{a}{c}\tlput{r} \ncline{a}{b}\taput{u}
\ncline[linestyle=dashed]{c}{d}\tbput{b}
\ncline{b}{d}\trput{s}
\everypsbox{}
\begin{array}{cc}
 \rnode{a}{(X-A)} & \rnode{b}{a} \\[1.5cm]
 \rnode{c}{x} & \rnode{d}{\tilde{X}}
\end{array}
\psset{nodesep=5pt,arrows=->}\everypsbox{\scriptstyle}
\ncline{a}{c}\nbput{r} \ncline{a}{b}\naput{u}
\ncline[linestyle=dashed]{c}{d}\nbput{b}
\ncline{b}{d}\naput{s}
\]
\end{document}
! This can't happen (mlist1).
\]  ->\relax \ifmmode \ifinner \@badmath \else $$
                                                 \fi \else \@badmath \fi \ig...

l.32 \]
zauguin commented 3 years ago

https://github.com/zauguin/luapstricks/blob/ce696d89d040e9b128168781163942ae5d33abf9/luapstricks.lua#L2850

@pablgonz Sure, it fails because of this line ^^^

pablgonz commented 3 years ago

Ouch :)

hvoss49 commented 3 years ago

Just as a report, with the examples that I have adapted and others taken from the documentation... Everything is going perfect!!!


% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY ] }
% arara: clean: { extensions : [ aux, log, dvi, ps ] }
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\addtolength{\hoffset}{-1.5cm}
% short
\newcommand{\BSS}[1]{\textbf{\textbackslash{#1}}}
\newcommand{\AC}[1]{\{#1\}}
\newcommand{\BS}[1]{$\backslash$#1}
\begin{document}

I prefer the following header:

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress} % only for the test examples, can later be empty 
\documentclass[parskip=half-,DIV=13]{scrartcl}
\usepackage{pstricks}
[...]
\pagestyle{empty}
% short
\newcommand\BSS[1]{\textbf{\textbackslash{#1}}}
\newcommand\BS[1]{\textbackslash#1}
[...]
pablgonz commented 3 years ago

@zauguin In last commit (https://github.com/zauguin/luapstricks/commit/a3cf749896a1ae81c89a21f9dba602c9b5a6d8d2) solve display math mode, but inline fail :(

% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY -dPDFSETTINGS=/prepress ] }
% arara: clean: { extensions : [ aux, log, dvi, ps ] }
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\begin{document}
% OK
\[
  \psmatrix[colsep=1cm]
      & X \\
    Y & Z
  \endpsmatrix
  \everypsbox{\scriptstyle}%
  \psset{nodesep=3pt,arrows=->}
  \ncline{1,2}{2,1}
  \tlput{f}
  \ncline{1,2}{2,2}
  \trput{g}
  \ncline[linestyle=dotted]{2,1}{2,2}
  \tbput{h}
\]

% ! error:  (linebreak): invalid node with type whatsit and subtype 7
$
  \psmatrix[colsep=1cm]
      & X \\
    Y & Z
  \endpsmatrix
  \everypsbox{\scriptstyle}%
  \psset{nodesep=3pt,arrows=->}
  \ncline{1,2}{2,1}
  \tlput{f}
  \ncline{1,2}{2,2}
  \trput{g}
  \ncline[linestyle=dotted]{2,1}{2,2}
  \tbput{h}
$
\end{document}
pablgonz commented 3 years ago

@zauguin Thanks!!! math mode works now...one more

% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY -dPDFSETTINGS=/prepress ] }
% arara: clean: { extensions : [ aux, log, dvi, ps ] }
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\begin{document}

\begin{pspicture}(4,2.3)
\pspolygon(0,0)(4,2)(4,0)
\pcline[offset=12pt]{|-|}(0,0)(4,2)
\ncput*[nrot=:U]{Length}
\end{pspicture}
\hfill
\begin{pspicture}(3.5,1.5)
\cnode(0,0){.5cm}{root}
\cnode*(3,1.5){4pt}{A}
\cnode*(3,0){4pt}{B}
\cnode*(3,-1.5){4pt}{C}
\psset{nodesep=3pt,nrot=:U}
\ncline{root}{A}
\naput{above}
\ncline{root}{B}
\ncput*{on}
\ncline{root}{C}
\nbput{below}
\end{pspicture}
\hfill
\begin{pspicture}(4,3)
\rput[br](4,0){\ovalnode{B}{Node B}}
\rput[tl](0,3){\rnode{A}{\psframebox{Node A}}}
\nput[labelsep=0]{-70}{A}{%
\psarcn(0,0){.4cm}{0}{-70}
\uput{.4cm}[-35](0,0){\texttt{angleA}}}
\ncangle[angleA=-70,angleB=90,armB=1cm,linewidth=1.2pt]{A}{B}
\ncput[nrot=:U,npos=1]{\psframe[dimen=middle](0,0)(.35,.35)}
\end{pspicture}

\begin{pspicture}(4,3)
\rput[tl](0,3){\rnode{A}{\psframebox{Node A}}}
\rput[br](3.5,0){\ovalnode{B}{Node B}}
\ncangles[angleA=-90,arm=.4cm,linearc=.15]{A}{B}
\ncput*{d}
\nbput[nrot=:D,npos=2.5]{par}
\end{pspicture}

\begin{pspicture}[shift=*](4,2.5)
\rput[bl](.5,0){\rnode{A}{1}}
\rput[tr](3.5,2){\rnode{B}{2}}
\ncarcbox[nodesep=.2cm,boxsize=.4,linearc=.4,arcangle=50,linestyle=dashed]{<->}{A}{B}
\nbput[nrot=:U]{set}
\nbput[npos=2]{II}
\end{pspicture}
\end{document}

Outputs are different for dvips>ps2pdf and lualatex :(

zauguin commented 3 years ago

@hvoss49 The issue @pablgonz mentioned is caused by dvips's coordinate system: In pstricks.pro there is

/Rot { CP CP translate 3 -1 roll neg rotate NET  } def

where the neg is needed in dvips since there the regular coordinate system is reflected, but it leads to inverted rotations in LuaTeX since there no reflected coordinate system is used.

IIRC there was some indication in the .con file that there at least used to be a way to control this behavior in a backend dependent way (by setting \pstrotate?) but this no longer seems to be used (setting \pstrotate does not seem to have any effect). Is there some new way to set this or does this require changing the definition of Rot in pstricks.pro?

hvoss49 commented 3 years ago

Sorry, I missed that point. Some stuff is nearly 30 years old and I often do not remember why I did some code changes ... I fixed it inside pstricks

pablgonz commented 3 years ago

@hvoss49 Thanks, the commit (https://github.com/zauguin/luapstricks/commit/96930f2b5af000c3117e77066759c88fb87c2dc9) solves the problem of rotation also allows to obtain the correct output in pst-coil and pst-labo, but leaves no support for (obsolete):

\begin{pspicture}(4,2)
\pcline(0,0)(4,2)
\lput{:U}{\rput[r]{N}(0,.4){label}}
\end{pspicture}

Captura de pantalla -2021-09-01 08-08-05

and affects pst-eucl:

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress} % only for the test examples, can later be empty
\documentclass[parskip=half-,DIV=13]{scrartcl}
\usepackage{pstricks}
\usepackage{pst-eucl}
\pagestyle{empty}
\begin{document}
\begin{pspicture}[showgrid=true](-2,-2)(2,2)
\rput{18}{%
\pstGeonode[PosAngle={0,90,180,-90}](2,0){A}(2;72){B}
(2;144){C}(2;216){D}(2;288){E}}
\pstSegmentMark[SegmentSymbol=none]{A}{B}
\pstSegmentMark[linecolor=green]{B}{C}
\psset{linewidth=2\pslinewidth}
\pstSegmentMark[linewidth=2\pslinewidth]{C}{D}
\pstSegmentMark[MarkAngle=90]{D}{E}
\pstSegmentMark{E}{A}
\end{pspicture}
\end{document}

Captura de pantalla -2021-09-01 08-12-00

pablgonz commented 3 years ago

@hvoss49 Have you modified anything in pst-node?

I have compared the beautiful documentation you have uploaded and I have a couple of differences.

Example page 14 (pst-node-doc.pdf in README)

Captura de pantalla -2021-09-03 14-09-04

(local with last update)

Captura de pantalla -2021-09-03 14-11-58

Example page 29 (pst-node-doc.pdf in README)

Captura de pantalla -2021-09-03 14-13-27

(local with last update)

Captura de pantalla -2021-09-03 14-14-51

In addition, dvips/ps2pdf and lualatex output differ from each other

(dvips/ps2pdf)

Captura de pantalla -2021-09-03 14-17-12

(lualatex)

Captura de pantalla -2021-09-03 14-18-00

MWE:

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\begin{document}
\begin{pspicture}(4,4)
\rput[tl](0,4){\rnode{A}{\psframebox{Node A}}}
\rput[br](4,0){\ovalnode{B}{Node B}}
\ncangles[angleA=-90, angleB=135, armA=1cm, armB=.5cm,
linearc=.15]{A}{B}
\nput[labelsep=0]{-90}{A}{%
\psarcn(0,0){.4cm}{0}{-90}
\uput{.4cm}[-45](0,0){\texttt{angleA}}
\rput[tr](-2pt,0){%
\valign{%
\vfil#\vfil\cr
\hbox{\texttt{armA}\kern 1pt}\cr
\hbox{\psscaleboxto(.28,.95cm){\{}}\cr\cr}}}
\nput[labelsep=0]{135}{B}{%
\psarc(0,0){.4cm}{0}{133}
\uput{.4cm}[50.5](0,0){\texttt{angleB}}}
\ncput[nrot=:L,npos=2]{\psline(0,-.35)(-.35,-.35)(-.35,0)}
\ncput[npos=3.5]{%
\rput[r](-.8,0){\rnode{arm}{\texttt{armB}}}
\pnode{brak}}%
\ncline[nodesep=3pt]{->}{arm}{brak}
\end{pspicture}

\begin{pspicture}(4,2)
\pcline(0,0)(4,2)
\lput{:U}{\rput[r]{N}(0,.4){label}}
\end{pspicture}
\end{document}
hvoss49 commented 3 years ago

I'll have a look at it on Sunday ...

hvoss49 commented 3 years ago

or saturday :-) it is fixed and a new doc uploaded.