# Thread: Problem inserting image in LaTeX file

1. ## Problem inserting image in LaTeX file

When I try to insert an image, all that comes up is the file name. There is no picure. I am using TeXnicCenter, and use the following conversion: LaTeX --> PDF

Here is the code I typed:
Code:
 \textbf{5}
\begin{figure}
\centering
\includegraphics{file.JPG}
\caption{r(t) graph}
\label{Fig 1}
\end{figure}
Any ideas?

Thanks

2. Originally Posted by shilz222
When I try to insert an image, all that comes up is the file name. There is no picure. I am using TeXnicCenter, and use the following conversion: LaTeX --> PDF

Here is the code I typed:
Code:
 \textbf{5}
\begin{figure}
\centering
\includegraphics{file.JPG}
\caption{r(t) graph}
\label{Fig 1}
\end{figure}
Any ideas?

Thanks
I always have trouble with graphics.

You could try making sure that the case of the file name is correct (try file.jpg)

Other than that all I can suggest is that you convert the jpg to an encapsulated postscript file, that always seems to work.

Another possibility is convert the graphic to a pdf file and try including that.

And yet another; rather than go from LaTeX to pdf directly, go to postscript and use ghostview/script to convert to pdf.

Finally every combination of the above.

Finally finally check that the "usepackage[driver]{graphicsx}" (or whatever you are using) is there and you are using the correct driver.

RonL

3. Thanks, I have the image in my file now (had to add another package). The only thing now is that the file name of the image is being shown also (even though I didn't type it as a caption).

I can't seem to get rid of it. So like the file name is this form: C:\My Documents \ blah \ blah (and this appears on the screen)

Thanks for the help.

4. Originally Posted by shilz222
Thanks, I have the image in my file now (had to add another package). The only thing now is that the file name of the image is being shown also (even though I didn't type it as a caption).

I can't seem to get rid of it. So like the file name is this form: C:\My Documents \ blah \ blah (and this appears on the screen)

Thanks for the help.

Is that the direction you wanted to go? I tried putting images within the LaTeX and the web address pops up for it.

5. I am not sure what you mean... I am using TeXnic Center.

6. This is what I am talking about

7. has anyone had this problem before?

8. What about working on EPS extension?

Try to convert your file into a EPS one.

9. you must remove draft from documentclass - I have been bitten by this just now. At least I suppose we had the same problem.

10. ## same problen

Hello,

I was wondering if you manage to solve this problem couple of years ago?

I have the same, when i insert the figure the title of the file appears on the top. I tried everything, but it still insert it.

I am using TexShop on Mac, I insert the figure in pdf format.

I don't have the draft option on.

Thank you

11. Hello,

Use the package
Code:
\usepackage{graphicx}
And then :
Code:
\begin{figure}[!h]
\centering
\includegraphics[height=10cm,width=10cm]{C:/path/name.jpeg}
\caption{$\mathcal B(5,1/6)$ : $m<1$}
\end{figure}
Be careful with the extension, it can be .jpeg, .JPG, .png, .jpg and maybe others.

Plus, put C:/../../.. instead of C:\..\..\.. and it will work (at least it always work for me)

The [!h] will help you put the figure where you want to. But if there isn't enough space if it's at the bottom of the page, it will be put on top of the next page and the text will fill the bottom of the previous page.
If you want to avoid it, use \newpage, that's the only solution I can see.
Don't take care of the warning you'll get when you compile. Not that important.

Note : I'm using TeXmaker, so I don't know if all this stuff will work on TeXshop or anyother program, but I guess it will.

12. thank you, I put:

\begin{figure}[h]
\begin{center}
\includegraphics[width=16cm]{FIGURES THESIS/FIGURES THESIS CHAPTER 2/All data coverage SLP.pdf}
\end{center}
\caption{Data coverage (\%) ICOADS SLP for four time periods}
\label{fig:fig2.1}
\end{figure}

but it still does put the FIGURES THESIS/FIGURES THESIS CHAPTER 2/All data coverage SLP.pdf on the top of the picture, as a title

13. [!h], not [h]

and put the whole path

14. \begin{figure}[!h]
\begin{center}
\includegraphics[width=16cm]{/Users/irinafoska/PhD/FIGURES THESIS/FIGURES THESIS CHAPTER 2/All data coverage SLP.pdf}
\end{center}
\caption{Data coverage (\%) ICOADS SLP for four time periods}
\label{fig:fig2.1}
\end{figure}

still the same

15. now, the remaining possibility is that your figure is too big to be put where it is, so it is put on a new page !

make a try in a new document with only a few lines before and after, just to see where it is put

Page 1 of 2 12 Last