[pstricks] [Problem] Spurious blank introduced by \pst at newnode in some special circumstances
Denis Girou
Denis.Girou at idris.fr
Wed Feb 21 19:21:06 CET 2001
Dominique Rodriguez <dominique.rodriguez at waika9.com> reported (some time
ago) a problem that was already encountered but without I truly understanded it
(it arrive only in some "special" circumstances). But working on the example
he sent me, I could diagnosed the problem and correct it, introducing a
\pst at killglue macro inside the \pst at newnode one.
* 00/11/09 pst-node.tex (97 patch 11): The \pst at newnode macro can introduce
a spurious blank in some special circumstances. I add a \pst at killglue macro
to solve the problem.
(reported by Dominique Rodriguez <dominique.rodriguez at waika9.com>)
Here was the test case I built from his example:
\documentclass[12pt,a4paper]{article}
\usepackage{pst-node}
\psset{subgriddiv=0,griddots=5}
\SpecialCoor
\newcommand{\Test}{%
\begin{pspicture}(4,4)\psgrid
\pnode(1,1){A}\rput(A){$\bullet$}
\pnode(2,2){B}\rput(B){$\bullet$}
\pnode(3,3){C}\rput(C){$\bullet$}
\end{pspicture}
%
\hfill
\def\MyNode(##1,##2)##3{\pnode(##1,##2){##3}\rput(##3){$\bullet$}}%
\begin{pspicture}(4,4)\psgrid
\MyNode(1,1){A}
\MyNode(2,2){B}
\MyNode(3,3){C}
\end{pspicture}
\hfill
%
\def\MyNode(##1,##2)##3{{\pnode(##1,##2){##3}\rput(##3){$\bullet$}}}%
\begin{pspicture}(4,4)\psgrid
\MyNode(1,1){A}
\MyNode(2,2){B}
\MyNode(3,3){C}
\end{pspicture}
\vspace{2cm}}
\pagestyle{empty}
\begin{document}
\Test
\makeatletter
\def\pst at newnode#1#2#3#4{%
% DG/SR modification begin - Nov. 9, 2000 - Patch 11
\pst at killglue
% DG/SR modification end
\leavevmode
\pst at getnode{#1}\pst at thenode
\pst at Verb{%
\pst at nodedict
{#3}
\ifx\psk at name\relax false \else \psk at name true \fi
\pst at thenode
#2
{#4}
\tx at NewNode
end}%
\global\let\psk at name\relax
\pstree at nodehook
\global\let\pstree at nodehook\relax}
\makeatother
\Test
\end{document}
Thanks to Dominique Rodriguez for his report.
D.G.
More information about the PSTricks
mailing list