13

Here is what I am trying to do. I am writing a document which has many figures. In order to manage the figures it is very convenient for me to keep different types of figures in different folders. Now in the .tex file how can I change the graphicspath to the folder that my graphics are in. If there are multiple different folders where my graphics are located then I shall like to change the directory multiple times. Can you suggest how to do this?

  • You can find a lot of related topics on the right margin of this post. – Sigur Jan 25 '15 at 21:38
24

Use \graphicspath in the preamble

as in:

\documentclass{article}
\usepackage{graphicx}

\graphicspath{{./img/}{./pictures/}}

\begin{document}
    \includegraphics{one}   %picture named one in directory img
    \includegraphics{two}   %picture named two in directory img
    \includegraphics{three} %picture named three in directory pictures
\end{document}
  • Not with the comma in between. – egreg Jan 25 '15 at 21:49
  • The comma might not be strictly needed, but I prefer it because I think it improves readability. – Maarten Dhondt Jan 25 '15 at 21:51
  • 8
    Well, it's wrong: the argument to \graphicspath should be simply a sequence of {...} with nothing between them. – egreg Jan 25 '15 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.