# Prevent the file path of an image appearing above the image when using \begin{figure} \includegraphics{filepath}

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?

-
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
This is caused by the draft option, either for the graphicx package or the class. – Joseph Wright Sep 25 '11 at 7:50
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

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.

-
Thanks for all the help everybody. Loading the package grffile has sorted the problem! – Aesir Sep 25 '11 at 11:56

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"}

-
@diabonas: Thanks. – Marco Daniel Sep 25 '11 at 11:33

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.

-