%7D%7BA%7D%EA%B0%80%20%EC%9D%B4%EC%83%81%ED%95%9C%20NA.x%EC%99%80%20NA.y%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
\documentclass[preview,border=2cm]{standalone}
\usepackage{pst-tools}
\usepackage{pst-node}
\psset{saveNodeCoors}
\begin{document}
\section*{With pnode}
\begin{pspicture}(3,3)
\pnode(1,1){A}
\rput(0,3){\psPrintValue{N-A.x}}
\rput(0,0){\psPrintValue{N-A.y}}
\end{pspicture}
\section*{With nodexn}
\begin{pspicture}(3,3)
\nodexn{(1,1)}{A}
\rput(0,3){\psPrintValue{N-A.x}}
\rput(0,0){\psPrintValue{N-A.y}}
\end{pspicture}
\end{document}
편집하다
나는 변수 \nodexn
의 존재를 존중하지 않고 초기화되지 않은 상태로 남아 있는 검사를 강력하게 믿습니다 .saveNodeCoors
N-<node_name>.x
N-<node_name>.y
\documentclass[preview,border=1cm]{standalone}
\usepackage{pst-tools}
\usepackage{pst-node}
\psset{saveNodeCoors}
\begin{document}
\psLoop{5}{%
\begin{pspicture}(3,3)
\pnode(1,1){A}
\rput(0,2){\psPrintValue{N-A.x}}
\rput(0,1){\psPrintValue{N-A.y}}
%
\nodexn{(1,1)}{B}
\rput(2,2){\psPrintValue{N-B.x}}
\rput(2,1){\psPrintValue{N-B.y}}
\end{pspicture}
\qquad}
\end{document}
답변1
에서는 버그가 아니지만 \nodexn
에서는 버그로 간주될 수 있습니다 saveNodeCoors
. 예를 들어 를 사용할 때 동일한 동작을 볼 수 있습니다 \pnode(1,1){A}\pnode(A){C}
. 오류는 에서도 발생합니다 . 해당 매크로가 및 \nodexn
에 좌표를 저장하기 위해 값이 로드되는 내부 노드를 정의하기 때문입니다 .N-<node>.x
N-<node>.y
\documentclass[preview,border=1cm]{standalone}
\usepackage{pst-tools}
\usepackage{pst-node}
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}(5,3)
\pnode(1,1){A}
\rput(0,2){\psPrintValue{N-A.x}}
\rput(0,1){\psPrintValue{N-A.y}}
%
\nodexn{(1,1)}{B}
\rput(2,2){\psPrintValue{N-B.x}}
\rput(2,1){\psPrintValue{N-B.y}}
%
\pnode(A){C}
\rput(4,2){\psPrintValue{N-C.x}}
\rput(4,1){\psPrintValue{N-C.y}}
\end{pspicture}
\end{document}
그것은 다음을 제공합니다:
저장 시 Postscript 변환 행렬이 새 노드를 저장할 때의 것과 동일하지 않기 N-<node>.x
때문에 이런 일이 발생합니다. N-<node>.y
그리고 이 오류는 이전 노드에서 좌표를 로드할 때만 나타납니다. 이는 내부적으로 좌표가 로드되는 임시 노드를 사용하는 with \pnode(A){C}
또는 with 에서 발생합니다.\nodexn
\pst@newnode
오류를 수정하기 위해 다음 변경 사항을 적용했습니다 .
라인 교체
\ifPst@saveNodeCoors
\ifx\relax#3\relax 0 0 \else #3 \tx@UserCoor \fi
~와 함께
\ifPst@saveNodeCoors
\ifx\relax#3\relax
0 0
\else
gsave
tx@Dict begin
STV CP T
end
#3 \tx@UserCoor
grestore
\fi
이러한 변경 사항이 포함된 다음 예는 올바른 결과를 제공합니다.
\documentclass[preview,border=1cm]{standalone}
\usepackage{pst-tools}
\usepackage{pst-node}
\makeatletter
% the following is the definition from pst-node.tex v 1.30, with the mentioned changes
\def\pst@newnode#1#2#3#4{%
\pst@killglue
\leavevmode
\pst@getnode{#1}\pst@thenode
\pst@Verb{
\ifPst@saveNodeCoors
\ifx\relax#3\relax
0 0
\else
gsave
tx@Dict begin
STV CP T
end
#3 \tx@UserCoor
grestore
\fi
% startGlobal
% \tx@UserCoor
/N-#1.y\space exch def
/N-#1.x\space exch def
% endGlobal
\fi
\pst@nodedict
{#3}
\ifx\psk@name\relax false \else \psk@name true \fi
\pst@thenode
#2
{#4}
\tx@NewNode
end
}%
%
\global\let\psk@name\relax%
\pstree@nodehook%
\global\let\pstree@nodehook\relax}
\makeatother
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}(5,3)
\pnode(1,1){A}
\rput(0,2){\psPrintValue{N-A.x}}
\rput(0,1){\psPrintValue{N-A.y}}
%
\nodexn{(1,1)}{B}
\rput(2,2){\psPrintValue{N-B.x}}
\rput(2,1){\psPrintValue{N-B.y}}
%
\pnode(A){C}
\rput(4,2){\psPrintValue{N-C.x}}
\rput(4,1){\psPrintValue{N-C.y}}
\end{pspicture}
\end{document}
편집하다
pst-node.tex
이 문제는 버전 에서 수정되었습니다 1.32 2014-02-03
.