TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a \graphicspath command at the beginning of a document (the main document):


I have sub-documents into which I insert images (actually SVG files from Inkscape):


These sub-documents may be inserted into different main documents.

But they need some information about images to be included so I need to do this:


Problem: this overrides my first \graphicspath declaration: my logo images (and extras/images) are not found anymore (generating errors) after I insert the \graphicspath{{/another/path/images/}}

My question: how could I append an entry to the \graphicspath ?

Or is there a variable that contains the \graphicspath value so I can re-use it ?


EDIT: I already tried this, but it does not work :

share|improve this question
up vote 6 down vote accepted

The variable containing the paths is \Ginput@path, so you can define


and \appendtographicspath{{../images/}} should do. Remember the braces around the path; you can add several paths.

This addition is global. You might want to extend the macro for “prepending”; in this case, use etoolbox:


With \appto and \preto the additions would be local, but I don't think it's good.

share|improve this answer
I works perfectly. A question: the order is important only if I have several images with the same name, isn't it ? – lauhub Apr 15 '14 at 8:43
@lauhub Yes. Note that using \graphicspath slows down the searching process, so more often visited directories should go first. – egreg Apr 15 '14 at 9:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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