Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I recently discovered a strange behavior of a relative point translation of coordinates given by a node created by \rnode.

The docs tell that the coordinate form ([parameter]node) determines a coordinate relative to the geometrical center of the given node.

I wrote a picture, which output is not consistent with that. At least at first sight :)

Here's the code:

\begin{pspicture}(1,1)

    \rput(0.5,0.5){
      \rnode[t]{n-t}{%
        \rnode[b]{n-b}{%
         \rnode{n-c}{\Huge{X}}%
      }% 
    }%
  }%

  \psdot[dotsize=4pt, linecolor=red](n-t)
  \psdot[dotsize=3pt, linecolor=red](n-c)
  \psdot[dotsize=2pt, linecolor=red](n-b)

  \psdot[dotsize=4pt, linecolor=blue]([offset=0,nodesep=0]n-t)
  \psdot[dotsize=3pt, linecolor=blue]([offset=0,nodesep=0]n-c)
  \psdot[dotsize=2pt, linecolor=blue]([offset=0,nodesep=0]n-b)
\end{pspicture}

that yields this

enter image description here

If I had only read the code it would be clear for me that the blue dots cover the red dots. But not so in the compiled picture.

Is there an error in my reasoning?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

that is the internal behaviour of nodes placed by \rnode. Compare the following two nodes:

\documentclass{article}
\usepackage{pst-node}

\begin{document}
\psscalebox{3}{%
\begin{pspicture}[showgrid](4,2)
\psnode(3,1){A}{\Huge A}\psdot([offset=0pt]A) % uses internally \rnode
\pnode(1,1){B}\rput(B){\Huge B}\psdot([offset=0]B)
\end{pspicture}}

\end{document}

enter image description here

However, I'll have a look into the code to see if I can change the behaviour.

share|improve this answer
    
I am wondering if i can think that the coordinate form ([parameter]node) changed the context of node!? If i use a node in simple geometrical context it just designates a pair of coordinates. Or more specifically the coordinates of the center of node. Does ([parameter]node) change the meaning of node, so that it refers now to the boundary of the node? Maybe you can give an explanation for this behavior that is not beyond my understanding!? Best regards –  user1146332 Feb 12 '12 at 21:24
    
forr rnode the surronding offset is saved in an internal offset value and with offset=0 you move to the right edge. That behaviour cannot be changed for nodes which all have a contents, like rnode, boxnode and so on –  Herbert Feb 12 '12 at 21:34
    
Things become more clear now! Thanx for your fast replies... –  user1146332 Feb 12 '12 at 21:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.