[Tex/LaTex] Set the default path to images directory

environment-variablesgraphics

I have a project written in LaTeX, that has many pictures (about 1000) which I have divided into 4 folders: letter, legal, booklt and screen for different purposes.
I have a folder called "images" containing all the images of the project, and here comes my question:

How do I add this folder so that latex finds it by default?

I have read the documentation for TeXLive(2011/2012) and http://www.tex.ac.uk/cgi-bin/texfaq2html?label=graphicspath on "environment variable TEXINPUTS".

I'm using TeXLive 2012 on Fedora 17; can someone clarify if this possible or is it better to use:

\graphicspath{...}

For now I edit the .bashrc file and add:

export TEXINPUTS=~/images//:${TEXINPUTS}

but I'm not sure if that's the best way to do things.

Best Answer

With that many files you are probably best to ignore the latex \graphicspath macro (which implements a linear iteration through directories via tex macros) and (a) put the directories under a // TEXINPUTS path as you suggest and then (b) re-hash the kpath search database using mktexlsr or texhash or a config in your IDE (depending on the system you use) then latex will find the files without having to traverse the file system to look for them and things will be quicker.

Related Question