Graphics, Figures & Tables ⇒ Inserting figures from different folders
Inserting figures from different folders
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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Inserting figures from different folders
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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Inserting figures from different folders

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.