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.
\documentclass{standalone}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\begin{pspicture}(0cm,0cm)(17cm,24cm)
\newdimen{\FotoHeight}
\newdimen{\PictureHeight}
\PictureHeight=24cm
\settoheight{\FotoHeight}{\includegraphics[width=24cm]{picture.ps}}
\multiply\FotoHeight by 0.5 %This is working
\multiply\PictureHeight by 0.5 %This is throwing the error message
\end{pspicture}
\end{document}
Best Answer
No, neither is working.
Leaving out the
pspicture
which is not relevant, we can reduce the example towhich prints
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 ofpspicture
(I'm dubious if you need it at all), but in the document preamble.