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 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?

share|improve this question
    
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
add comment

migrated from stackoverflow.com Jan 5 '12 at 23:46

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
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
show 4 more comments

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.