[Tex/LaTex] Do images have to be saved in a specific location before inserting them into LaTeX

graphicstexworks

I've been trying to insert an image into LaTeX using the [graphicx] package using TeXworks with very little success. The .PNG image I want to insert is currently just saved in my Windows Pictures library, so I was wondering if I have to have the image saved in a specific location before inserting it?

Best Answer

You have to put the images into a directory that is searched by LaTeX during the compilation. Usually, the easiest is to put it in the same directory as where the .tex file is.

You can as well use the \graphicspath command in your preamble to specify the directories searched for graphics. Remember to put each directory in a second pair of braces, like:

\graphicspath{{figures/}{/home/me/mygraphics}}

(This example is for linux, for Windows, you shall use the correct directory specification. Remember that this will make your document non-portable.)