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 am attempting to solve my own problem How to rotate the label such that its base line is parallel to the bisector? with the most elegant approach, i.e., passing a node as an angle argument of \uput.

The following cases are ordered from the less elegant (but successful) to the more elegant (but fail).

  • Case 1: Success to pass literal constants.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
        \uput{1}%
        [
            !3 1 sub 2 1 sub atan
        ]
        {
            !3 1 sub 2 1 sub atan
        }(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}
    
    \end{document}
    
  • Case 2: Fail to use \psGetNodeCenter.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
        \uput{1}%
        [
            !\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub A.x O.x sub atan 
        ]
        {
            !\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub A.x O.x sub atan
        }(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}
    
    
    \end{document}
    
  • Case 3: Fail to pass a node.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
        \uput{1}[(A)]{(A)}(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}    
    
    \end{document}
    

How to pass a node as the angle argument of \uput?

share|improve this question

1 Answer 1

up vote 1 down vote accepted
+50
\documentclass{article}
\usepackage{pst-eucl}
\begin{document}

\begin{pspicture}[showgrid](4,4)
    \pstGeonode[PosAngle={-135,90}](1,1){O}(2,3){A}
    \pstGeonode([nodesep=2]O){X}
    \psline[linestyle=dashed](O)(X)
    \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
    \pcline(O)(A)\ncput*[nrot=:U]{\textcolor{red}{$\pi-\theta$}}
\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.