pstricks problem

Denis Girou Denis.Girou at idris.fr
Wed Apr 14 11:33:10 CEST 1999


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

The following message is a courtesy copy of an article
that has been posted to comp.text.tex as well.

>>>>> "Frank.Mueller" == Frank Mueller <meckccef at sp.zrz.tu-berlin.de> writes:

    Frank.Mueller> I use the pstricks package (including pst-node) to draw some
    Frank.Mueller> graphics. Why isn't the result of the following code an arrow,
    Frank.Mueller> positioned between the nodes? Instead, it appears to the upper
    Frank.Mueller> left of the graphic.
    Frank.Mueller>    If I use the command "ncline" instead of "ncLine", the arrow
    Frank.Mueller> gets to the (in the sense of "ncline") right position. I'd like a
    Frank.Mueller> centering relative to the centers of the nodes, not to the
    Frank.Mueller> borders.
    Frank.Mueller> %
    Frank.Mueller> % ---snip---

    Frank.Mueller> \documentclass{article}
    Frank.Mueller> \usepackage{pstricks}
    Frank.Mueller> \usepackage{pst-node}
    Frank.Mueller> \begin{document}
    Frank.Mueller> \begin{pspicture}(10,10)
    Frank.Mueller>   \pnode(2,5){Pin1}
    Frank.Mueller>   \pnode(8,5){Pin2}
    Frank.Mueller>   \ncLine{Pin1}{Pin2}
    Frank.Mueller>   \mput{\Large $\Rightarrow$}
    Frank.Mueller> \end{pspicture}
    Frank.Mueller> \end{document}

    Frank.Mueller> % ---snap---
    Frank.Mueller> %
    Frank.Mueller> % What could be the reason?

  This is a bug in the `pst-node' package (but very easy to solve). In fact,
it is a very old one, which was introduced in 1994 in the pst-beta.tex file
(used to build the PSTricks 97 distribution) as I verify that it doesn't
affect the pst-node.tex file of the 0.93a distribution but the rewriting of
the \ncLine at ii macro in the pst-beta.tex file.

  P.S. * Take care that the \mput macro was already declared obsolete in 1994
(betadoc2.ps documentation file, page 32). Use better \ncput, etc. today.

       * You can consider to use the "psmatrix" environment, which offer
a powerful way to build diagrams with nodes and connections (but it depend of
what you have to do).

  Thanks for the report. Correction is included below:

\documentclass{article}

\usepackage{pst-node}

\pagestyle{empty}

\begin{document}

\psset{subgriddiv=0,linecolor=red,linewidth=0.1}

\begin{pspicture}(5,5)\psgrid
  \pnode(1,4){Pin1}
  \pnode(4,4){Pin2}
  \ncLine{Pin1}{Pin2}
  \mput{\Large $\Rightarrow$}
\end{pspicture}

\vspace{2cm}

\makeatletter
\def\ncLine at ii#1#2{\nc at object{Open}{#1}{#2}{.5}%
% D.G. modification begin - Apr. 14, 1999
%{\tx at NCLine /LPutPos { xB xA yB yA \tx at LPutLine } def}}
{\tx at NCLine /LPutPos { xB yB xA yA \tx at LPutLine } def}}
% D.G. modification end
\makeatother

\begin{pspicture}(5,5)\psgrid
  \pnode(1,4){Pin1}
  \pnode(4,4){Pin2}
  \ncLine{Pin1}{Pin2}
  \mput{\Large $\Rightarrow$}
\end{pspicture}
\hfill
\begin{pspicture}(5,5)\psgrid
  \pnode(1,4){Pin1}
  \pnode(4,4){Pin2}
  \ncLine{Pin1}{Pin2}
  \ncput{\Large $\Rightarrow$}
\end{pspicture}

\end{document}

Denis Girou
-- 
---------------------------------------------------------------------------
Institut du De'veloppement et des Ressources en Informatique Scientifique |
Centre National de la Recherche Scientifique                              |
Ba^timent 506 - B.P. 167 - 91403 Orsay Cedex - France                     |
---------------------------------------------------------------------------

-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list