[pstricks] Optional {} argument as in \psline{->}()()

Christoph Bersch usenet at bersch.net
Tue Apr 15 15:23:07 CEST 2008


Herbert Voss schrieb:
> Christoph Bersch schrieb:
> 
>> At the moment all my components are defined in the following way.
>>
>> \def\lens{\@ifnextchar[{\pst at lens}{\pst at lens[]}}
> 
> use always
> 
> \def\pstlens{\pst at object{pstlens}}
> \def\pstlens at i(#2)(#3)#4{%
>    \pst at killglue
>    \addbefore at par{...} % the defaults
>    \begingroup
>    \use at par
>    ....
>>     \pst at regNodes{#2}{#3}%
>>     \pst at draw@component{#1}{#4}\pst at draw@lens%
> 
>    \endgroup%
>    \ignorespaces}

I do not understand, why this is better, but I already changed my macros 
to use your suggested construction.

> Optional arguments should be passed by pst-xkey

That's the way I did it and I retain it. I thought using an optional 
argument would be more elegant, but it doesn't seem so :-)

Thank you,
Christoph



More information about the PSTricks mailing list