0

I want to include a picture in my project that I have going in latex right now. This is the location of the file:

Location on Mac

And this is how it's included in my project in latex (I've included the packages graphicx and float as well):

Project code

But this is the error code that I get and the picture will not show up in my .pdf when I run the code:

enter image description here

I have no clue as to why latex can't find the picture or how to solve this. Anyone got any ideas?

  • 1
    In which folder is your .tex file located? The space in the absolute might be a problem, so I suggest to use a relative path instead. – samcarter_is_at_topanswers.xyz Dec 29 '18 at 13:21
  • 1
    It would be nice if you could include the code as text instead of images – samcarter_is_at_topanswers.xyz Dec 29 '18 at 13:22
  • 1
    What is matex? Do you mean mactex? – samcarter_is_at_topanswers.xyz Dec 29 '18 at 13:24
  • Yes I mean Mactex, my bad! Ok so I solved the problem by just putting the picture in the LatexProject folder and not in a seperate Figures folder in the LatexProject folder. In the code I just changed the location to look for the figure from "Macintosh...." to "LiteratureReviewPic.jpg" and now the pic is in my project. I'm new to Latex so I don't know how to copy my code in here, sorry about that one. I still don't understand why it can't find the pic if I put it in a Figures folder inside of the LatexProject folder tho. – Stijn Botteldoorne Dec 29 '18 at 13:36
  • 1
    Short version: spaces and other special characters in file paths are bad. – samcarter_is_at_topanswers.xyz Dec 29 '18 at 14:17
  • To avoid the problem you could use a relative path. E.g. if your tex file is in the "LatexProject" folder use \includegraphics[height=7.62cm]{./Figures/LiteratureReviewPic} – samcarter_is_at_topanswers.xyz Dec 29 '18 at 14:19
  • Ok thanks this really helped. I'll probably have to handle references the same way then. Does it matter what type of file the LiteratureReviewPic file is? Like, does it matter if it's JPG or PNG when you use the relative path? – Stijn Botteldoorne Dec 29 '18 at 14:42
  • As long as the file type is supported by your tex engine, it does not matter what type it is. In fact it is good practice to just give the file name without the type, then tex will automatically choose the one with the preferred file type in case there are multiple images with the same name. For example if you have both a test.pdf and a test.png it will choose the test.pdf because the quality of a vector graphic is better than a pixel graphic. – samcarter_is_at_topanswers.xyz Dec 29 '18 at 14:46

0 Answers0