# Getting \includeonly functionality with import package

I had problems compiling with the `\includeonly` `\include` system since I had images in the document form different subdirectories. For example the main file would be at `/Main/MainFile.tex` and the included file at `/Main/Chapter1/Chapter1.tex` and one of the images would be at `/Main/Chapter1/Images/Image1.jpg` which was actually loaded through the `Chapter1` file as `\includegraphics{./Images/Image1}`.

I had the problem fixed with the `import` package using `\subimport{}{}`, but I don't have the `include` functionality of different `.aux` files which keeps the pagination and cross references intact.

-

You can tell LaTeX where to look for included pictures, using the `\graphicspath` setting. For example,
``````\graphicspath{{/data/experiments/plots/}{/data/simulations/}}
will prompt LaTeX to look for pictures relative to both these folders. You can then include e.g. `/data/experiments/plots/first/straightline.pdf` as `first/straightline`, and `/data/simulations/rollthedice.pdf` just as `rollthedice`.