[pstricks] extend scope of user defined Postscript variable

Alexander Grahn A.Grahn at fzd.de
Mon Jun 29 15:45:13 CEST 2009


On Mon, Jun 29, 2009 at 03:29:27PM +0200, Herbert Voss wrote:
>Alexander Grahn schrieb:
>
>> As I see, it is only possible by using a temporary file.
>
>also possible, but then you have to use the SDict dictionary
>
>\documentclass{minimal}
>\usepackage{pstricks}
>
>\special{! /hello (hello!!!) def}
>
>\begin{document}
>\pstVerb{SDict begin hello print end}
>foo
>\clearpage
>
>\pstVerb{SDict begin hello print end}
>foo
>\end{document}
>

I would prefere this one, because there is no need for files. However
it is not possible to change the value of the variable in the middle of
the document, `good bye!!!' is written 4 times to stdout during ps2pdf:

\documentclass{minimal}
\usepackage{pstricks}

\begin{document}
\special{! /hello (hello!!!) def}
\pstVerb{SDict begin hello print end}
foo
\clearpage
\pstVerb{SDict begin hello print end}
foo
\clearpage
\special{! /hello (good bye!!!) def}
\pstVerb{SDict begin hello print end}
foo
\clearpage
\pstVerb{SDict begin hello print end}
foo
\end{document}

--
Alexander


More information about the PSTricks mailing list