[pstricks] node name problem
Jean-Come Charpentier
Jean-Come.Charpentier at wanadoo.fr
Sat Sep 18 19:45:44 CEST 2004
Hello,
To answer at a question on ctt, I have build a code wich have some
problems. In fact, my problem was a node definition inside a double
\multido. The code bellow show what I want to make (this code work):
\makeatletter
\let\@nil\relax
\newcount\lastletter
\def\problem#1{%
\lastletter=1
\problem@#1\@nil
\begingroup
\psset{xunit=8mm,yunit=7mm}
\begin{pspicture}(0,0)(\lastletter,\lastletter)
\multido{\n=1+1}{\lastletter}{%
\multido{\N=1+1}{\lastletter}{%
\rput(\n.5,\N.5){\psframe(-0.5,0)(0.5,1)%
\rput(0,0.5){\Rnode{\n,\N}{\@nameuse{l\N}}}%
}
}
}
\ncarc[arcangle=-60]{->}{1,1}{\the\lastletter,\the\lastletter}
\end{pspicture}
}
\def\problem@#1#2\@nil{%
\def\arg{#2}%
\@namedef{l\the\lastletter}{#1}%
\ifx\empty\arg
\let\next\relax
\else
\advance\lastletter by1
\let\next\problem@
\fi
\expandafter\next\arg\@nil
}
\problem{ABCDEFGHIJKLMNOP}
In fact, I think that my problem was this: My labels had the syntax
p(<num>,<num>), in the exemple before, the line
\rput(0,0.5){\Rnode{\n,\N}{\@nameuse{l\N}}}%
was
\rput(0,0.5){\Rnode{p(\n,\N)}{\@nameuse{l\N}}}%
and the line
\ncarc[arcangle=-60]{->}{1,1}{\the\lastletter,\the\lastletter}
was
\ncarc[arcangle=-60]{->}{p(1,1)}{p(\the\lastletter,\the\lastletter)}
With the syntax "p(<num>,<num>)" TeX was not happy ... very angry in
fact :-). Why? I believed that labels name was *very* free. An other
behavior is funny: if the label is "p<num>/<num>", TeX is happy, dvips
is happy but gv is not happy. Why? Character "/" is understound as an
operator by gv? Why parenthesis and comma are prohibit? Is there other
characters prohibit?
Jean-Côme Charpentier
More information about the PSTricks
mailing list