Closed pablgonz closed 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
?
@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 \]
@pablgonz Sure, it fails because of this line ^^^
Ouch :)
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}
[...]
@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}
@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
:(
@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
?
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
@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}
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}
@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)
(local with last update)
Example page 29 (pst-node-doc.pdf in README)
(local with last update)
In addition, dvips/ps2pdf
and lualatex
output differ from each other
(dvips/ps2pdf
)
(lualatex
)
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}
I'll have a look at it on Sunday ...
or saturday :-) it is fixed and a new doc uploaded.
Just as a report, with the examples that I have adapted and others taken from the documentation... Everything is going perfect!!!