I am trying to create a pspicture where some lengths are calculated in dependency of the size of the pspicture and an included graphic but I am getting the following error message

Illegal unit of measure (pt inserted).

when using the \multiply command with one of these length (see minimal example at the end). The previous \multiply command is working and I cannot figure out, why the second \multiply command does not work. I really hope somebody can help me.


\multiply\FotoHeight by 0.5 %This is working
\multiply\PictureHeight by 0.5 %This is throwing the error message
  • Welcome to TeX.SX! I get no error from the code (after adding \usepackage{graphicx}, of course). Anyway, neither operation works in the way you wish to.
    – egreg
    Mar 28, 2017 at 15:50
  • I added the \usepackage{graphicx} to the example.
    – Vanessa
    Mar 29, 2017 at 8:35

2 Answers 2


No, neither is working.

Leaving out the pspicture which is not relevant, we can reduce the example to





\multiply\FotoHeight by 0.5 
\multiply\PictureHeight by 0.5


which prints

.5 .5

as readily verified. You can't use a non integer factor for \multiply. So both dimensions are set to zero and the “illegal” tokens are printed.

What you should do is


By the way, you shouldn't declare \newdimen in the body of pspicture (I'm dubious if you need it at all), but in the document preamble.

  • Thank you for the solution. You are right, I do not actually need \newdimen, I used now \newlength and worked with \setlength{FotoHeight}{0.5\FotoHeight}. I did not stumble over any additional problems with this.
    – Vanessa
    Mar 29, 2017 at 8:33




You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .