0

This question already has an answer here:

beginning of my file

I want to include a .png file that is called Screenshot 1 and is in folder Screenshotsforassignment, but typing \includegraphics{Screenshot 1} gives me the error:

LaTex Error: File 'Screenshot 1' not found.

Does anybody know how to fix this?

Edit: I solved it!

marked as duplicate by Werner graphics Dec 17 '17 at 17:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

David Carlisle almost certainly identified the problem: Do not use spaces in file names. Also avoid underscore, because it is a special character in TeX.

Sometimes you can deal with this by escaping the offending space (or underscore). But even when that works, it is something you are likely to forget, then the problem will re-appear and you won't remember why.

So, change the image file name to Screenshot-1.png and also remember that the names are case-sensitive.

EDIT: This may also happen if there are spaces (or underscores) in the folder structure leading to the image. Also, if you use absolute paths on Windows, be sure that use use C://folder/subfolder rather than C:\folder\subfolder.

If you already have a folder structure and/or file names with spaces or underscores, and you do not wish to change the names, you can try escaping the characters like this:

folder\ name\ with\ spaces/folder\_name\_with\_underscores

Also see if that is done in your graphicspath.

If you do a lot of screenshots, perhaps you can change your operating system settings, so that the file name is saved without space or underscore.

  • I tried changing the name but I'm still getting the same error, do you know what else might be causing the error? Do you think the error might be in the \graphicspath line? this is where the file is stored. – Mathijs Moonen Dec 17 '17 at 17:19
  • @MathijsMoonen See my edited answer. If that still does not help, then I do not know more. I looked at your images. – user139954 Dec 17 '17 at 17:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.