[pstricks] Bookkeeping in pspicture environment

Christoph Bersch usenet at bersch.net
Tue Jul 22 16:08:41 CEST 2008


in the next pst-optexp version I want to integrate some kind of 
bookkeeping for named objects. The names are defined with a parameter 
'compname'. The names are registered in a global list and before every 
new definition it is checked if the name was already used.

Now this bookkeeping should be local in every pspicture environment. I 
thought of doing this by redefining \pspicture as follows:

\let\old at pspicture\pspicture
\def\pspicture{\let\@complist\@empty\old at pspicture}%

A working example would then be

\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
             {^^Jcompname '#1' already used.^^J}%
	 % Use definition of \XKV at addtolist@x with an \xdef instead
	 % of \edef in order to keep the bookkeeping global
%  \psset{compname=Name}

This seems to work... The problem does not raise any PackageWarning, 
only when uncommenting the last \psset{...} it is raised, as expected.

Are there any problems to be expected with my solution or do you have a 
better suggestion how to solve this issue?

Thank you,

More information about the PSTricks mailing list