[pstricks] pstroicks and xelatex

Herbert Voss Herbert.Voss at fu-berlin.de
Fri Dec 21 16:16:45 CET 2018

Am 21.12.18 um 13:54 schrieb Patrice MEGRET:

> I have a small problem with pstricks and xelatex.
> If I compile the example below with latex, everything works as expected.
> If I use xelatex, $\Delta y$ of the \ncput inside the \rput(0,1){…} is 
> misplaced. Indeed it is shifted by 1 cm above the \ncput as the \rput 
> was doing twice its job.


the xdvipdfmx program is not complete compatible to dvips.
This is the case for placing objects relativ to nodes.
\pcline defines its coordinates first as internal nodes
@@A and @@B. We can use this for a new macro. Maybe that I
will write a pstricks-xetex.tex which wioll collect all such

\def\NCput{\pst at object{NCput}}
\def\NCput at i#1{%
   \use at par
   \pst at getcoor{@@A}\pst at tempA
   \pst at getcoor{@@B}\pst at tempB
   \if at star\def\next{\rput*}\else\def\next{\rput}\fi
   	  \pst at tempA /yA ED /xA ED
   	  \pst at tempB /yB ED /xB ED
   	  xA xB add 2 div
   	  yA yB add 2 div \tx at UserCoor){#1}

   \pcline{<->}(1,1)(7,1)\ncput{$\Delta y$}%
   \rput(0,1){\pcline{<->}(1,1)(7,1)\NCput*{$\Delta y$}}



More information about the PSTricks mailing list