[pstricks] Bug in pstricks-add?

Christoph Bersch usenet at bersch.net
Tue Oct 10 10:05:15 CEST 2006


Hi,

the first small error is in line 1272 of pstricks-add.tex (v2.80), which
should be

  \psLDNode(#1)(#2){#3}{@temp at lnput}

instead of

  \psLDNode(A)(B){#3}{@temp at lnput}

With this correction the following code does not work properly:

\listfiles
\documentclass{article}
\usepackage{pstricks-add}
%
\begin{document}
\begin{pspicture}(5,5)
  \psgrid
  \pnode(0,5){A1}
  \pnode(5,0){A2}
  \nlput(A1)(A2){2}{\psframe(-1,-0.5)(1,0.5)}
  \psline(A1)(A2)
\end{pspicture}
\end{document}

The file compiles fine, but when viewing the output with gv, I get the
following postscript error:

Error: /typecheck in subGPL Ghostscript 8.01: Unrecoverable error, exit
code 1

Operand stack:
   142.264   -0.000130008   -0.00013121   142.264   ()   Alpha
-0.00013121   ()
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--
  --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1
  3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop
.runexec2   --nostringval--   --nostringval--   --nostringval--   2
%stopped_push   --nostringval--   --nostringval--


\listfiles gives the following

 *File List*
 article.cls    2001/04/21 v1.4e Standard LaTeX document class
  size10.clo    2001/04/21 v1.4e Standard LaTeX file (size option)
pstricks-add.sty    2005/03/03 package wrapper for pstricks-add.tex (hv)
pstricks.sty    2005/10/07 v0.25 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex    2006/04/29 v1.14c `PSTricks' (tvz)
  xcolor.sty    2004/07/04 v2.00 LaTeX color extensions (UK)
   color.cfg    2001/08/31 v1.1 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks-add.tex    2006/09/25 v2.80 `PSTricks-add' (hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2005/11/25 v2.5e package option processing (HA)
 xkeyval.tex    2005/11/25 v2.5e key=value parser (HA)


If I copy the relevant code for \nlput from pstricks-add.tex (line 1253
to 1276) and do not include pstricks-add.sty, it works. Maybe this helps
to find the bug.
The following code (with the mentioned copying) works properly:

\listfiles
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-node}
\makeatletter
\SpecialCoor
\def\psLDNode(#1)(#2)#3#4{%
% #1: node A  #2: node B  #3: dimen measured from A  #4: node name
  \pst at getcoor{#1}\pst at tempA%
  \pst at getcoor{#2}\pst at tempB%
  \pssetlength\pst at dima{#3}%
  \pnode(!%
    \pst at tempA /YA exch \pst at number\psyunit div def
    /XA exch \pst at number\psxunit div def
    \pst at tempB /YB exch \pst at number\psyunit div def
    /XB exch \pst at number\psxunit div def
    /dx XB XA sub def
    /dy YB YA sub def
    /angle dy dx Atan def
    /length \pst at number\pst at dima \pst at number\psunit div def
    XA length angle cos mul add YA length angle sin mul add ){#4}%
}
\def\nlput{\pst at object{nlput}}
\def\nlput at i(#1)(#2)#3#4{%
  \begin at SpecialObj
  \psLDNode(#1)(#2){#3}{@temp at lnput}
  \pcline[linestyle=none](#1)(@temp at lnput)%
  \ncput[npos=1]{#4}%
  \end at SpecialObj
} %
\makeatother
%
\begin{document}
\begin{pspicture}(5,5)
  \psgrid
  \pnode(0,5){A1}
  \pnode(5,0){A2}
  \nlput(A1)(A2){2}{\psframe(-1,-0.5)(1,0.5)}
  \psline(A1)(A2)
\end{pspicture}
\end{document}

Thanks for your help
Christoph



More information about the PSTricks mailing list