Take the 2-minute tour ×
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.

I am using MikTex 2.9 and TeXstudio for my TeX preparation. I want to give a path to my figures folder containing all the figures, plots etc. required for my work. I used \graphicspath to give the direction, I got error, while \includegraphics works fine. Why \graphicspath gives error.

\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

\documentclass[12pt]{article}

\usepackage{graphicx}

\begin{document}

\includegraphics[width=4.5cm,height=4cm,angle=0]{D:/LATEX/Reports@IIT/figures/logo.jpg}

\end{document}

This works fine.

share|improve this question
1  
What happen if you add / after figures in graphicspath? –  Ludovic C. Oct 18 '13 at 8:02
    
@percusse: why is miktex relevant in this question? –  In PSTricks we trust Oct 18 '13 at 8:35
    
@Marienplatz It's a windows machine and paths are system dependent. If somebody else needs a windows solution miktex is a viable option. –  percusse Oct 18 '13 at 8:58
2  
@percusse But \graphicspath works the same irrespective of platform –  Joseph Wright Oct 18 '13 at 10:16
    
@JosephWright Also true. But that's not people search unfortunately, including me. Added TeXLive too so hopefully both can end up here. –  percusse Oct 18 '13 at 18:02

2 Answers 2

up vote 26 down vote accepted
\graphicspath{{D:/LATEX/Reports@IIT/figures/}}

Try it!

More general case:

\graphicspath{{subdir1/}{subdir2/}{subdir3/}...{subdirn/}}

The ... is not the part of the syntax for sure! It is there just to represent something like 1,2,3,...,n in a set theory.

share|improve this answer
1  
Thank you. It is working –  Litun Oct 18 '13 at 8:23

Every specific path shoud be ended by /, and contained by a pair of braces. Try:

\graphicspath{{D:/LATEX/Reports@IIT/figures/}}
share|improve this answer
    
Thank you. It is working –  Litun Oct 18 '13 at 8:25

Your Answer

 
discard

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.