[pstricks] AlgParser inside raw coordinates (! PS code)
Christophe Jorssen
christophe.jorssen at free.fr
Wed Apr 30 23:15:23 CEST 2008
Le mercredi 30 avril 2008 à 23:02 +0200, Christophe Jorssen a écrit :
> Le mercredi 30 avril 2008 à 21:27 +0200, Herbert Voss a écrit :
> > Christophe Jorssen schrieb:
> >
> > > I don't understand why I get a postscript error with the felowing code.
> > > (expression) AlgParser cvx doesn't seem to put a number on the stack.
> > > Maybe I misunderstand something.
> > >
> [snip]
> >
> > cvx make it _executable_, but does not execute it
> >
> > \psdot[linecolor=blue](!
> > /X \lpar4*cos\lpar45\rpar\rpar\space AlgParser cvx def
> > /Y \lpar4*sin\lpar45\rpar\rpar\space AlgParser cvx def
> > X Y)%
> >
> >
> > \psdot[linecolor=red](*{Pi 4 div} {sin(x)})
> >
> > works also with the latest pstricks.
> >
>
> ok, got it. Thank you Herbert and Manuel.
>
> Is there a way to do the same without any def's (that is execute
> something excutable on the stack) ?
Yes... See the red book (p 55): the exec keyword.
\listfiles
\documentclass{article}
\usepackage{pstricks,pst-func}
\begin{document}
\SpecialCoor
\def\lpar{(}
\def\rpar{)}
\begin{pspicture}[showgrid=true](5,5)
\psdot(!5 45 cos mul 5 45 sin mul)
\psdot(!
\lpar 5*cos\lpar 45\rpar\rpar\space AlgParser cvx exec
\lpar 5*sin\lpar 45\rpar\rpar\space AlgParser cvx exec)
\end{pspicture}
\end{document}
--
Christophe
More information about the PSTricks
mailing list