Tell me more ×
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.

How to pass PostScript expression to nodesep and offset when using ([...]node) syntax?

Edit: I just known that for angle, we can use PS expression such as angle={!30 60 add}.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}

\begin{document}
    \begin{pspicture}[showgrid](3,3)
        \pnode{A}
        \pnode
        [!
            60 cos 3 mul
            60 sin 3 mul
        ](A){B}
        \psline{->}(A)(B)
    \end{pspicture}

%   \begin{pspicture}[showgrid](3,3)
%       \pnode{A}
%       \psline(A){->}([nodesep=,offset=]A)
%   \end{pspicture}
\end{document}
share|improve this question

1 Answer

up vote 2 down vote accepted
+100

nodesep and offset are a length and must have a unit, at least the current one.

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

\begin{document}
    \begin{pspicture}[showgrid](3,3)
        \pnode{A}
        \pnode
        [!
            60 cos 3 mul
            60 sin 3 mul
        ](A){B}
        \psline{->}(A)(B)
    \end{pspicture}

\bigskip
   \begin{pspicture}[showgrid](3,3)
       \pnode{A}
       \psline{->}(A)(!\psGetNodeCenter{A} 
         A.x 60 cos 3 mul add 
         A.y 60 sin 3 mul add)
   \end{pspicture}

\end{document}

enter image description here

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.