I am using \pst@divide to divide a length in half

\addlength{\DIST}{\RLEN} % does not work. 

the problem is that \pst@divide returns a float and I need it to be a length because later I add another length to the result using \addlength. Any suggestion how to covert from a float to a length or maybe how to add two float values.

  • "does not work" does not work for me. Please post the actual error message. Normally you simply need to add a unit (pt) if non is included. – Martin Scharrer Jun 14 '12 at 19:30
  • "does not work" means that it has the value 0 – Inquirer Jun 14 '12 at 19:38
  • That's the problem with "does not work". It can man 1.000 different things. – Martin Scharrer Jun 14 '12 at 19:40
  • Sorry, I shall keep that in mind next time :) – Inquirer Jun 14 '12 at 19:41

use the etex extension \dimexpr:

\newlength\OFFSET \OFFSET=1cm




However, you can always use \addtolength\DIST{\XX pt} if \XX is not a length

| improve this answer | |
  • Thanks! That's a much more simpler way for me to do these distance calculations :) – Inquirer Jun 14 '12 at 19:18

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.