[pstricks] Defining an option similar to 'dash'

Christoph Bersch usenet at bersch.net
Mon May 26 21:35:32 CEST 2008


I am trying to define an option which is similar to 'dash' in pstricks.tex:

\usepackage{pstricks, pst-xkey}
% a dummy option
\define at key[psset]{}{newoption}{\edef\psk at newoption{#1}}%
\define at key[psset]{}{lens}{%
  \pst at expandafter\psset@@lens{#1} {0} {0} %
            {\pst at missing} {\pst at missing} {}\@nil
\def\psset@@lens#1 #2 #3 #4 #5\@nil{%
%    newoption=#4 % <- using this does not give the correct error
\psset{lens=1 2 3 4}
\psset{lens=1 2 3}
\psset{lens=1 2}

This way it works and gives me the correct error message

! Missing number or dimension. 0 substituted.
\@pstrickserr ... immediate help.}\errmessage {#1}
l.25 \psset{lens=1}

However, when I use 'newoption' instead of the 'linewidth' in the last
assignment, it results in an

! Undefined control sequence.
\@pstrickserr #1#2->\begingroup \newlinechar `\

                                                 \edef \pst at tempc
l.25 \psset{lens=1}

I suppose it has to do something with the \pssetlength which is used
when setting 'linewidth' compared to the \edef in the 'newoption'.
What do I have to change in order to get the correct error message using
the 'newoption=#4' in \psset@@lens?

Thank you,

More information about the PSTricks mailing list