TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
"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
up vote 4 down vote accepted

use the etex extension \dimexpr:

\newlength\OFFSET \OFFSET=1cm




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

share|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 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.