Hi,
I'm quite new to Latex and have come across a slight problem, or more of an inconvenience really, with inserting figures from different folders.
I am able to insert the figures i want from all the different folders i hav using:
\begin{figure}
\includegraphics{/dir1..../figure1.eps}
\end{figure}
However the directory locations are long and tedious to type out each time.
So my question is: Is there a way of defining the directories that will be used in the preamble, and then quickly referring back to these previously defined directories when I want to insert each figure?
... I hope my question makes sense...
Laura.
Graphics, Figures & Tables ⇒ Inserting figures from different folders
Inserting figures from different folders
Last edited by m.laura on Wed Aug 25, 2010 12:42 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Inserting figures from different folders
Hey Laura,
In fact, there is such a thing. The first three hits on Google with the keywords 'latex', 'figure', and 'directory' gave me the answers to that problem.
You are searching for the \graphicspath{} command.
A good idea for any sort of problem is to consult Google.
In fact, there is such a thing. The first three hits on Google with the keywords 'latex', 'figure', and 'directory' gave me the answers to that problem.
You are searching for the \graphicspath{} command.
A good idea for any sort of problem is to consult Google.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Inserting figures from different folders
A much better idea is to use the search function of forums like this. A search engine is not the universal remedy and its results mostly lead to forum threads anyway.mssm wrote:[…] A good idea for any sort of problem is to consult Google.
The \graphicspath command should be used with caution (see l2tabu).
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Inserting figures from different folders
Thanks for the help localghost, I've got the \graphicspath command working now so even though its not the best method it should be ok for my document.
And to mssm, I did try google first but I was having trouble defining exactly what I was looking for in a few words. Once you mentioned \graphicspath I was able to find an explanation online fairly easily though so thanks, I guess.

And to mssm, I did try google first but I was having trouble defining exactly what I was looking for in a few words. Once you mentioned \graphicspath I was able to find an explanation online fairly easily though so thanks, I guess.