[Tex/LaTex] Prevent the file path of an image appearing above the image when using \begin{figure} \includegraphics{filepath}

graphics

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?

Best Answer

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.

Related Question