Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I used the following construct quite often:

\includegraphics[width=\textwidth/2]{pic.png}

But when I try to adjust the size a small bit, like this:

\includegraphics[width=\textwidth*0.45]{pic.png}

I get

! Package calc Error: `.' invalid at this point.

What am I doing wrong?

share|improve this question
add comment

2 Answers 2

up vote 18 down vote accepted

The calc package allows only division by integers or by reals which are announced as \real: so

\includegraphics[width=\textwidth*\real{0.45}]{pic}

will do, but

\includegraphics[width=0.45\textwidth]{pic}

works as well, doesn't require calc and is faster.

share|improve this answer
    
Thanks! I really should read a bit about TeX syntax - because this was not very obvious. –  Rogach Apr 23 '12 at 7:44
add comment

You can use

\includegraphics[width=0.45\textwidth]{pic.png}
share|improve this answer
add comment

Your Answer

 
discard

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.