[pstricks] Bookkeeping in pspicture environment

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Jul 22 17:29:47 CEST 2008


Christoph Bersch schrieb:

> Sorry, I see, that my example was too minimal to show the issue.
> The point is, that the parameter 'compname' is set only within an object 
> (i.e. in a surrounding  group). Therefore, I need the \xdef\@complist in 
> order to change \@complist outside of the group.
> The following example should now reproduce more exactly the problem:
> 
> \documentclass{article}
> \usepackage{pst-xkey}
> \usepackage{pstricks}
> \makeatletter
> \let\old at pspicture\pspicture
> \def\pspicture{\let\@complist\@empty\old at pspicture}%
> \define at key[psset]{}{compname}{%
>      \edef\pst at temp{#1}%
>      \ifx\pst at temp\@empty\else
>         \@expandtwoargs\in@{,#1,}{,\@complist,}%
>         \ifin@
>            \PackageWarning{}%
>               {^^Jcompname '#1' already used.^^J}%
>         \else
> 	 % Use definition of \XKV at addtolist@x with an \xdef instead
> 	 % of \edef in order to keep the bookkeeping global
>            \xdef\@complist{\@complist\ifx\@complist\@empty\else,\fi#1}%
>         \fi
>      \fi
> }%

I see, this is (only) a little bit easier ...

\documentclass{article}
\usepackage{pst-xkey}
\usepackage{pstricks}
\makeatletter
\def\@complist{}
\g at addto@macro{\endpspicture}{\gdef\@complist{}}
\define at key[psset]{}{compname}{%
      \edef\pst at temp{#1}%
...


Herbert



More information about the PSTricks mailing list