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:

    its caption

I am trying to replicate this using the following code

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

However, the format that I am getting is

    the path of image

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

Your filename contains spaces which LaTeX cannot handle.

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.

  • i renamed the file n now used the following code........ \begin{figure}[h] \centering \includegraphics[width=.75\linewidth]{E:/Arifah/MS/thesis/final thesis report/ComponentBasedSoftwareDevelopment.png} \caption{Component Based Software Development} \end{figure}............ – Arifah Azhar Jan 5 '12 at 19:09
  • it gives the same result i.e my path is being displayed – Arifah Azhar Jan 5 '12 at 19:09
  • 1
    @ArifahAzhar: There's still a space in ../final thesis report/... – Benjamin Bannier Jan 5 '12 at 19:09
  • 2
    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
  • 1
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.