[pstricks] Using \@ifnextchar in node definition
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Wed Nov 11 18:31:04 CET 2009
Am 11.11.2009 16:42, schrieb Christoph Bersch:
>
> But then using raw coordinates or constructing the trailing part of the
> name should work, but it does not:
no, the \mynode{A} is not fully expanded when reading the
coordinates. That is the problem.
Herbert
> \documentclass{article}
> \usepackage{pst-node}
> \SpecialCoor
> \makeatletter
> \def\mynode{%
> \@ifnextchar[{\mynode at i}{\mynode at i[]}
> }%
> \def\mynode at i[#1]#2{%
> #2%
> }%
> \makeatother
> \begin{document}
> \begin{pspicture}(5,5)
> \pnode(2,2){A}
> \makeatletter
> \psdot(! \pst at nodedict N@\mynode{A} GetCenter \tx at UserCoor end)
> \makeatother
> %
> \pnode(1,1){AA}
> \psdot(A\mynode{A})
> \end{pspicture}
> \end{document}
>
> Both variants give me the error
> ! Use of \psdot at ii doesn't match its definition.
>
>
> Thank you,
> Christoph
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
>
More information about the PSTricks
mailing list