I've read that LaTeX image directories can be searched recursively with the \graphicspath command by including a double slash at the end - i.e. \graphicspath{{../my_images//}}.

However, the recursive part of this doesn't seem to be happening. I've tried several different iterations, including / vs \, absolute paths, and pdftex vs latex. Any ideas what is wrong? Google has turned up nothing but confirmation that this should work. I'm on Windows 7 using Miktex 2.9. I've not had the opportunity to try this on another platform.

  • Where did you read that? Recursive path search through \graphicspath is impossible.
    – AlexG
    Commented Aug 11, 2011 at 7:12
  • @Alexander: While it is impossible to list directory contents in pure TeX, it should be possible with \write18 or LuaTeX. Commented Aug 11, 2011 at 7:14
  • Actually, this (recursive search) seems to be a good idea for a LaTeX package. Is there one yet? Commented Aug 11, 2011 at 7:18
  • I've not seen it work but is stated in the LaTeX wiki section on \includegraphics: "The last command searches the files recursively because of the double slash "//"."
    – mas
    Commented Aug 11, 2011 at 9:57
  • 1
    It is also stated in an accepted answer on this site in relation to MikTeX.
    – mas
    Commented Aug 11, 2011 at 10:27

1 Answer 1


To summarise the responses in the comments:

(a) For many platforms, ending the specified path to \graphicspath with a double-slash does not invoke recursion through directories below that.

(b) For some users, ending the path to \graphicspath with a double slash does invoke recursion. All the cases I have seen documented and where the platform was mentioned were MikTeX users, e.g. see an accepted answer on this site. At the time of writing the LaTeX Wiki also mentions this behaviour.

As the OP put in a comment, it "shouldn't work, but there are instances of it working". There was general agreement that it would be a handy feature, especially given that any overhead of time and memory would likely be of little consequence to most users.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .