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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a LaTeX document with the apacite and graphicx package. The issue is when I include an image either using figure with an enclosed \includegraphics or \includegraphics by itself it shows the image with the file name to the side.

For example:

            |             |
            |    BOX 1    |  

I do not want it to write Error1.jpg. Would show the image but it seems I do not have enough rep.

This is an example tex file to show the error (with Windows XP, using Miktex 2.8).


\includegraphics{Example Error1.jpg}
\includegraphics{Example Error1.jpg}
\caption{This is the caption of the figure.}
share|improve this question

You should also avoid other special characters like underscores in the complete path and the name of the file. But you can use the grffile package for extended file processing. For this case, just add the following line:

share|improve this answer
The grffile is recommended. Another solution for spaces is enclosing the file name between ": \includegraphics{"Example Error1"}, but this may break if babel is used. – egreg May 15 '12 at 23:10
Simply \usepackage{grffile} is sufficient to fix this. Thanks! – Ben Voigt Jan 2 '13 at 15:35
FYI, when I used grffile for my dissertation to include many small PDF figures it took an order of magnitude longer to compile. – edallme Mar 10 '13 at 7:55

Old post, but you can do the following.

\includegraphics{"Example Error1".jpg}
share|improve this answer
This should definitely be the chosen answer. – LondonRob Jun 9 '14 at 14:11
I used the answer given by Claudio Fiandrino of simply adding "" around the file name for example, \includegraphics{"Example Error1".jpg} – user80627 Jun 23 '15 at 3:40

I found the answer while writing this since I wrote ExampleError1.jpg when doing the example image. The problem is that graphicx doesn't seem to like the spaces in the file name and it assumes it should write it. I tried writing Example\ Error1.jpg but it didn't like it either. The solution I propose is that write these filenames without spaces.

share|improve this answer

Your Answer


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.