I have a problem trying to get my maindocument to compile a subdocument, with an included figure.

I have the following file-structure setup:

    / ch1.tex

And so my mainfile.tex document has the following preamble:

 %    end preamble

And in my subfile.tex I have the following setup:


Now, when I compile the subfile.tex, the image is rendered nice and fine, but when I try to compile, the mainfile.tex, i get the following error from LaTeX:

LaTeX Error: File '.fig/image' not found

The image in question is a pdf-file which I have stored in a subdirectory inside the directory where the subfile.tex is located, as should be clear from the above structure. I really can't see where it goes wrong? Is it something to do with the order in which the packages are loaded or is it something else entirely?

I really don't get why the above code does not work as intended?

Any help is much appreciated!


1 Answer 1


I solved it myself by providing the graphicspath arguments with both the paths relative to the subfile and from the mainfile as so:


This way, both the subfile and the mainfile is able to find the correct folder for the figures.

  • Genius! It's a workaround, but it works.
    – Ufos
    Jan 15, 2019 at 15:37
  • For further clarification, in subfile.tex, the new command is \includegraphics[scale=0.1]{image}
    – David
    Jul 23, 2019 at 20:59

You must log in to answer this question.

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