Graphics, Figures & TablesInserting figures from different folders

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
m.laura
Posts: 2
Joined: Fri Aug 20, 2010 8:53 pm

Inserting figures from different folders

Post by m.laura »

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.
Last edited by m.laura on Wed Aug 25, 2010 12:42 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

mssm
Posts: 4
Joined: Thu Aug 19, 2010 7:46 pm

Re: Inserting figures from different folders

Post by mssm »

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.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Inserting figures from different folders

Post by localghost »

mssm wrote:[…] A good idea for any sort of problem is to consult Google.
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.

The \graphicspath command should be used with caution (see l2tabu).


Best regards
Thorsten
m.laura
Posts: 2
Joined: Fri Aug 20, 2010 8:53 pm

Re: Inserting figures from different folders

Post by m.laura »

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.
Post Reply