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 have inserted an image in my LaTeX document and the image always displays with the file path of the image directly above it. How can I prevent this file path from displaying?

I am inserting the image like this:

\begin{figure}
\centering
    \includegraphics{C:/Users/Name/Pictures/image1.png}
\caption{a caption}
\label{fig:reference}
\end{figure}

Here is a working example of document that produces this behaviour:

\documentclass{article}

\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics{C:/Users/Name/Pictures/image 1.png}

\end{figure}

\end{document}

The image was inserted using the TeXnicCenter Insert>Picture function.

When I generate the pdf document, directly above any image (I have inserted multiple images using this technique) the file path displays above the image, in the case above it would show: "file\path\of\image", how can I prevent this from displaying?

share|improve this question
2  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. You're probably loading some package or using some option that causes this behaviour. –  Jake Sep 25 '11 at 7:46
1  
This is caused by the draft option, either for the graphicx package or the class. –  Joseph Wright Sep 25 '11 at 7:50
2  
Is file\path\of\image meant to be a normal path or really three macros? You need to use / not `` even under MS Windows, AFAIK. –  Martin Scharrer Sep 25 '11 at 7:54
    
@Martin: Sorry it is just meant to be an imaginary file path. I will update the question to better reflect this. –  Aesir Sep 25 '11 at 7:58
    
Can you post the log you get for your example: it is fine for me. By the way, it's not a good idea to provide the pdftex option for the graphicx package. Unless you are using dvipdfmx, graphicx will pick up automatically on the correct driver. –  Joseph Wright Sep 25 '11 at 8:00
show 7 more comments

3 Answers

up vote 7 down vote accepted

Avoid special characters (blank spaces, underscores, …) in the name and the path of the file. For extended file name processing try the grffile package from the oberdiek bundle.

share|improve this answer
    
Thanks for all the help everybody. Loading the package grffile has sorted the problem! –  Aesir Sep 25 '11 at 11:56
add comment

Normally you shouldn't use white spaces or special characters in path. To use them you can load the package grffile

Alternatively you can use:

\includegraphics[]{\string"path"}
share|improve this answer
    
@diabonas: Thanks. –  Marco Daniel Sep 25 '11 at 11:33
add comment

Another common reason for the same problem is one may use "draft" mode.

For example,

\documentclass[draft,a4paper,11pt]{report}

Simply removing the draft option will solve the problem.

share|improve this answer
add comment

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.