## LaTeX forum ⇒ General ⇒ Regarding \graphicspath

LaTeX specific issues not fitting into one of the other forums of this category.
mecatuls
Posts: 17
Joined: Thu Jun 26, 2008 9:41 am

### Regarding \graphicspath

Hello,

I am using Miktex on windows xp with Texnic Centere for editing my tex files. At present I am writing my thesis that includes loads of figures in all of the chapters. I want to save images in different folders corresponding to chapter. Further I want to save images in different folders within each chapter folder. This is to make life easier for me, so that I can locate figure easily later on if I have to edit one of the figure among 100's.

Now the problem comes, when I put all of the figures in different folders as I mentioned above.
I use \graphicspath command to give absolute path of all of the folders.
But I get error saying that file could not be found.

I am specifying path as mentioned below

line 1---\graphicspath{{F://latex-files/figures/ch5/ld}}
line 2---\graphicspath{{F:/latex-files/figures/ch5/}}

Is there any way to include location with all subdirectories.
When I include path the way it is mentioned above, it gives me error saying that file (in directory ld) is missing.
If I interchange 'line 1' with 'line 2' Miktex gives me error saying that file (in directory ch5) is missing.

Can anyone sort out this issue.

Thanks

mecatuls
Posts: 17
Joined: Thu Jun 26, 2008 9:41 am
Hi,

Just to close the post. I found out the reason for that behavior.
I need to add all absolute paths in my preamble using

\graphicspath{{path1}{path2}{path3}{path4}}

For windows users, please make sure there are no empty spaces in the path.

Thanks

zroutik
Posts: 16
Joined: Fri Aug 14, 2009 8:23 am
I have just found out how to specify a recursive path:
\graphicspath{{pictures//}}
Note the double slash at the end of the directory name.

any directory tree under "pictures/" is searched in
\includegraphics[width=0.48\columnwidth]{picture.png}
command. Yupeee! Z

p.s. learned here: http://myitcv.org.uk/latex/tips_and_tricks.html where they use it for TEXINPUTS

localghost
Site Moderator
Posts: 9203
Joined: Fri Feb 02, 2007 12:06 pm
This command should be used with caution (see l2tabu).

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

zroutik
Posts: 16
Joined: Fri Aug 14, 2009 8:23 am
Thank you for the point,I understand it. I read the section in l2tabu and the consequent links with deeper explanation. But, in my case, defining TEXINPUTS on my three different computers and keeping track of it seems too much hassle. (On contrary, \graphicspath{{figures//}} works as a charm on all of my PCs.) I've just tried it, I'm unable to set TEXINPUTS from a cmd line or a .bat file (WinXP) and run latex seamlessly afterwards---a reboot is needed, and who knows what else. Unless I don't get a low-memory warning, I'm happy to latex my 200 pages longer by two and half seconds.
Regs, Zroutik

localghost wrote:This command should be used with caution (see l2tabu).