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 have a problem with the following code. The lines from h6 and h7 are supposed to start right below h6 and h7 and not at the left of h6 and h7. This worked with tree-dvips but pstricks seems to decide differently about the position where the line starts. Is it possible to force pstricks to take bottom instead of bottom left?

\documentclass{minimal}
\usepackage{pstricks,pst-node}


\psset{nodesep=5pt} %,linewidth=0.8pt,arrowscale=2}
\psset{linewidth=0.5pt}
\begin{document}

\begin{tabular}{@{}ccc@{}}
                               & \rnode{h0}{h0}                & \\[8ex]
\rnode{h1}{h1:every(x, \rnode{h1h3}{h2}, \rnode{h1h2}{h3})}      &                              & \rnode{h5}{h5:some(y, \rnode{h5h7}{h6}, \rnode{h5h6}{h7})}\\[8ex]
\rnode{h3}{h2:dog(x)}           & ~~~~~\rnode{h7}{h6:cat(y)}         & \\[6ex]
                               & \rnode{h4}{h4:chase(e, x, y)}\\
\end{tabular}
{\psset{linestyle=dashed}%
\ncline{h0}{h5}%
\ncline{h0}{h1}%
\ncline{h5h6}{h4}%
\ncline{h1h2}{h4}%
}%
\ncline{h1h3}{h3}%
\ncline[angleA=-90]{h5h7}{h7}%


\end{document}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

The default location for the anchor in an \rnode is in the centre of the node. With the notation \rnode[<refpoint>]{<name>}{<stuff>} (see the pstricks documentation, section 30 Nodes, p 59) you can specify an alternative <refpoint>, say [b] (section 24 Placing and rotating whatever, p 42):

enter image description here

I've also decreased the nodesepA value (the node separation from the origin node) to 3pt to make it clear that it's pointing to the correct node:

enter image description here

\documentclass{minimal}
\usepackage{pstricks,pst-node}% http://ctan.org/pkg/{pstricks,pst-node}

\psset{nodesep=5pt,linewidth=0.5pt}
\begin{document}

\begin{tabular}{@{}ccc@{}}
  & \rnode{h0}{h0} & \\[8ex]
  \rnode{h1}{h1:every(x, \rnode{h1h3}{h2}, \rnode{h1h2}{h3})} & & \rnode{h5}{h5:some(y, \rnode[b]{h5h7}{h6}, \rnode[b]{h5h6}{h7})} \\[8ex]
  \rnode{h3}{h2:dog(x)} & ~~~~~\rnode{h7}{h6:cat(y)} & \\[6ex]
  & \rnode{h4}{h4:chase(e, x, y)} \\
  \end{tabular}
{\psset{linestyle=dashed}%
 \ncline{h0}{h5}%
 \ncline{h0}{h1}%
 \ncline[nodesepA=3pt]{h5h6}{h4}%
 \ncline{h1h2}{h4}%
}%
\ncline{h1h3}{h3}%
\ncline[nodesepA=3pt]{h5h7}{h7}%

\end{document}​
share|improve this answer

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.