[pstricks] Correct use of \coor

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Feb 1 08:01:31 CET 2012


Am 31.01.2012 23:13, schrieb Andrew Parsloe:

> A first posting to this list. Can someone give me an example in which
> the PSTricks command \coor is used correctly? The manual says "Convert
> one or more PSTricks coordinates to a pair of numbers (using pt units),
> and insert them in the Postscript code." This leads me to suppose that
> (by way of illustration)
>
> \pscustom{\SpecialCoor\psline(!\coor(3,4))}
>
> should draw a line from the origin to (3,4), but it doesn't. I get an
> error message "Argument of \coor has an extra }. Paragraph ended before
> \coor was complete. Paragraph ended before \special at coor was complete."
> What am I doing wrong?

\pscustom makes only sense for filled areas, e.g. an area under a
function or special curves. The following three examples all
do the same

\documentclass{minimal}
\usepackage{pstricks}
\SpecialCoor
\begin{document}

\begin{pspicture}[showgrid](3,4)
\psline(3,4)
\end{pspicture}
%
\begin{pspicture}[showgrid](3,4)
\psline(! 3 4)
\end{pspicture}
%
\begin{pspicture}[showgrid](3,4)
\pscustom{
   \moveto(0,0)
   \coor(3,4)
   \code{lineto}
}
\end{pspicture}

\end{document}

Herbert


More information about the PSTricks mailing list