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

Short version: a subimport-ed file has correct relative path when using \includegraphics, but incorrect relative path when using \includepdf.

Long version:

File a.tex is located in my main a directory 'a_dir'. It incorporates a file b.tex (which is located in directory 'a_dir/b_dir/') using '\subimport{b_dir/b.tex}'. b.tex includes a number of images, that are located in the directory 'a_dir/b_dir/images/'.

b.tex uses both the commands \includegraphics and \includepdf (the latter from the pdfpages package). When a.tex is compiled, the \includegraphics command works fine, but the \includepdf command looks for the images in the (non-existent) directory 'a_dir/images' - it is looking for them relative to a.tex, not b.tex!

I can't simply change the path in b.tex as I also compile that file on its own. How can I get pdfpages to look in the path relative to the file it is located, not the main compiling file?

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 4 '13 at 16:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

We need a MWE here: without it the description alone doesn't allow us to answer. – Joseph Wright Aug 4 '13 at 16:18