# includegraphics - Problem with compiling

I am actually writing a latex file in which I would like to insert pictures. I have the following preambule:

\documentclass[a4paper, french]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{xspace}


In my text, I tried to insert a picture with the following code:

\begin{figure}
\begin{picture}
\includegraphics[scale=0.5]{Deltoidalicositetrahedron.jpg}
\end{picture}
\end{figure}


I am using TexShop version 2.38 and I tried to compile with LaTeX. It worked on the computer of a friend using the same TexShop version. However on my computer it doesn't work. Here is what the console complains about:

./bio mol adn.tex:57: Use of \pictur@ doesn't match its definition.
<argument> \includegraphics

l.57   \includegraphics
[scale=0.5]{Deltoidalicositetrahedron.jpg}

?


Has anyone ever encounter the same problem?

As usual, thanks in advance.

-
Does removing the .jpg help? –  Seamus Apr 7 '11 at 12:12
I don't think you need the picture environment, either... –  Seamus Apr 7 '11 at 12:12
In a normal latex this can never work. The picture environment (which is the wrong environment anyway) expects an argument in round braces (coordinates). Use simply the \includegraphics. Use the figure-environment around it, if you want your graphics to float. –  Ulrike Fischer Apr 7 '11 at 12:34
Even without the picture environment it does not work. The .jpg extension is no problem either. –  Thomas Connor Apr 7 '11 at 20:57
If you're still getting error messages after removing the picture environment, doesn't the error message change? That information would be helpful in diagnosing the problem. –  Matthew Leingang Apr 7 '11 at 23:05

You can use the picture environment but you need to proceed like that :

\documentclass{scrartcl}
\usepackage{graphicx}

\begin{document}

In my text, I tried to insert a picture with the preceding code:

\setlength{\unitlength}{1cm} % fix unit

\newsavebox{\mybox}
\savebox{\mybox}{\includegraphics[scale=0.5]{Deltoidalicositetrahedron.jpg}}
% we save the picture

\begin{figure}
\begin{picture}(6,4) % you need to add dimensions
\put(0,0){\usebox{\mybox}}
\end{picture}
\end{figure}
\end{document}


Now you can use macros from picture to decorate or add what you want

With a picture

\documentclass{scrartcl}
\usepackage{graphicx}

\begin{document}

In my text, I tried to insert a picture with the preceding code:
\setlength{\unitlength}{1cm}

\newsavebox{\mybox}
\savebox{\mybox}{\includegraphics[scale=0.25]{ant.png}}
\begin{figure}
\begin{picture}(8,6)
\put(0,0){\usebox{\mybox}}
\put(2,2.5){\oval(6,5)}
\end{picture}
\end{figure}

\end{document}


-
It's possible with the dimensions of \mybox (\wd\mybox \ht\mybox and \dp\mybox) to set the dimensions of the picture environment. If the OP don't need the picture environment, I agree with the others comments. –  Alain Matthes Apr 7 '11 at 13:30
As I said in the other comments, the picture environment is not the problem. –  Thomas Connor Apr 7 '11 at 20:54
@Thomas Sorry, the picture environment is the problem, because you use it with a bad manner. You need to add (x,y) dimensions of the picture! I compile your code so you can use the picture environment but correctly. –  Alain Matthes Apr 7 '11 at 21:26

Following Seamus and Ulrike this is all you need:

\documentclass{book}
\usepackage{graphicx}

\begin{document}
\begin{figure}
\includegraphics[scale=0.5]{Deltoidalicositetrahedron.jpg}
\end{figure}
\end{document}

-
The picture environment is not the problem. Even without it it does not work. –  Thomas Connor Apr 7 '11 at 20:56