# Problem inserting a figure in LaTeX

I am writing a research paper using LaTeX.

I have certain images to insert. Now when we observe the images from the research paper, they have the following format:

    image
its caption


I am trying to replicate this using the following code

    \begin{figure}[h]
\centering
\includegraphics[width=.75\linewidth]{E:/Arifah/MS/thesis/final thesis report/Component           Based Software Development.png}
\caption{Component Based Software Development}
\end{figure}


However, the format that I am getting is

    the path of image
image
caption


Now, how do I remove the path?

• Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, even though this question already has an accepted answer. – Werner Jan 5 '12 at 23:54

Either renamce your file to not contain spaces, or if you run pdflatex try the grffile package which should make it work even with spaces.
• @ArifahAzhar: There's still a space in ../final thesis report/... – Benjamin Bannier Jan 5 '12 at 19:09
• Removing spaces in your path isn’t a good solution – you are destroying your paths! A better solution is to use relative instead of absolute image paths. Works perfectly. Or, if those paths still contain spaces, set up a base path for your graphics using the options of the graphics package, and escape the spaces … the documentation of the package contains clues, if I remember correctly. – Konrad Rudolph Jan 5 '12 at 19:24
• depending on your operating system, you might be able to define symbolic links which do not contain spaces. E.g. with Linux, ln -s PathToGraphicsDirectory MyGraphics and you could then use \graphicspath{MyGraphics} in your LaTeX file – prettygully Jan 6 '12 at 0:53