I am using MikTex 2.9 and TeXstudio for my TeX preparation. I would like to set the path to my figures
folder, which contains all the figures, plots etc. required for my work.
I used \graphicspath
to set the directory, but it gives me an error message:
\documentclass[12pt]{article}
\usepackage{graphicx}
\graphicspath{D:/LATEX/Reports@IIT/figures}
\begin{document}
\includegraphics[width=4.5cm,height=4cm,angle=0]{logo.jpg}
\end{document}
Error: Package pdftex.def Error: File `logo.jpg' not found
However, when I prepend the filenames of the images with the same path in the \includegraphics
command, it works just fine:
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=4.5cm,height=4cm,angle=0]{D:/LATEX/Reports@IIT/figures/logo.jpg}
\end{document}
Why is \graphicspath
not setting the path?
/
afterfigures
ingraphicspath
?\graphicspath
works the same irrespective of platform\logo.jpg
. The file name is simply being appended to the path, so if both are weird, but together make a sensible path name, it will work. If the graphics path was terminated by/
you could also access subfolders in your graphics stash withSubfolder/logo.jpg
.