In order to be more noticeable, I present my comment as a new question here.


\uput with the following syntax

enter image description here

accept 5 arguments. I have tested the last four arguments that they can be represented in RPN. The first argument is the only one cannot be represented in RPN.


Why can the first argument of \uput not be represented in RPN? Is it a bug? You can try \uput{! 2 sqrt}[!0]{!0}(!0 0){Hello World} to put Hello World \sqrt{2} unit length away to the right of the origin (0,0), but it fails.

  • This isn't an issue about RPN. You're trying to pass postscript code through the arguments. I haven't played too much with \uput. As I get a chance today, I'll look at this. – A.Ellett May 6 '13 at 19:17
  • @A.Ellett: So the first argument cannot accept RPN expression? – kiss my armpit May 6 '13 at 19:26
  • Postscript is written in RPN. After an initial look at pstricks.tex, it looks like \uput isn't designed to accept Postscript arguments. – A.Ellett May 6 '13 at 19:49
  • @A.Ellett: Can you guess the reason why it was designed without supporting RPN for the first argument? You can make your comment as your answer. – kiss my armpit May 6 '13 at 19:56
  • @A.Ellett: you do not understand the meaning and definition of the different arguments. \uput understands PS arguments. – user2478 May 12 '13 at 5:53

This isn't an issue about RPN or not. This is about the ability to pass Postscript commands through \uput. This doesn't seem to work. I'm drawing a complete blank why. Someone better acquainted with the internals of pstricks can explain that.

But, I'm assuming that you want to be able to make some kind of contextually dependent decisions on how text is placed (if not, then just write the actual values in). You can use a bit of expl3 magic to get this done as in the following code:

\DeclareDocumentCommand{\fpsqrt}{ m }
        \fp_eval:n {  #1 ^ ( 1 / 2 ) }        


    \uput{ \fpsqrt{2} }[0]{30}( 0, 0){Hello World}


This results in

enter image description here

  • I usually use fp package. So I can summarize that it is a bug in PSTricks. :-) – kiss my armpit May 6 '13 at 20:50
  • I didn't recommend fp only because the documentation is so poor. – A.Ellett May 6 '13 at 20:52
  • But its syntax is more beautiful. :D – kiss my armpit May 6 '13 at 20:53

For the newest pstricks package, the labelsep of \uput can accept RPN expression (without unit) and it takes the active unit.

    \pscircle(1,1){!2 sqrt}
    \uput{!2 sqrt}[45](1,1){\qdisk(0,0){2pt}}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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