[pstricks] Using \@ifnextchar in node definition

Christoph Bersch usenet at bersch.net
Wed Nov 11 16:42:25 CET 2009

Herbert Voss schrieb:
> Am 11.11.2009 13:37, schrieb Christoph Bersch:
>> how can I use commands that use \@ifnextchar to build node names? The
>> following does not work:
> PSTricks checks the first character of the coordinates to decide what
> kind of values are present. For nodes it compares the catcode of "a"
> with the first character of the argument. If it is the same catcode, it
> must be a node. This doesn't work with your \mynode, because it has
> another catcode than "a"

But then using raw coordinates or constructing the trailing part of the 
name should work, but it does not:

    \@ifnextchar[{\mynode at i}{\mynode at i[]}
\def\mynode at i[#1]#2{%
    \psdot(! \pst at nodedict N@\mynode{A} GetCenter \tx at UserCoor end)

Both variants give me the error
! Use of \psdot at ii doesn't match its definition.

Thank you,

More information about the PSTricks mailing list