[pstricks] TeX-Macro in PS coordinates?

Michael Sharpe msharpe at ucsd.edu
Tue Nov 16 02:52:57 CET 2010


On Nov 15, 2010, at 2:11 PM, Plamen Tanovski wrote:

> Hi,
> 
> Is it possible to use TeX macros in PS coordinates? I use some
> coordinates with postscript code, but want to include some parameters
> as TeX macro:
> 
> \documentclass{article}
> \usepackage{pstricks}
> \def\paramet{12}
> \begin{document}
> \SpecialCoor
> \begin{pspicture}(2,2)
> \psdot(! \paramet 2)
> \end{pspicture}
> \end{document}
> 
> LaTeX goes fine, but viewing the code with gs produces an error:
> 
> Error: /stackunderflow in --exch--
> Operand stack:
>   3471.23
> Execution stack:
>   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
> Dictionary stack:
>   --dict:1150/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--   --dict:175/300(L)--   --dict:38/200(L)--   --dict:109/200(L)--
> Current allocation mode is local
> Last OS error: 2
> GPL Ghostscript 8.71: Unrecoverable error, exit code 1

All TeX macros are expanded before being sent to PostScript, but in the process, spaces may be absorbed , and you have to remember to write

> \psdot(! \paramet\space 2)



More information about the PSTricks mailing list