When using the following for my main TeX file Graduation_report.tex, in the main folder:






and the following for my subfile Introduction.tex (which is in the folder Introduction)





I get the error 'Preamble.tex not found'. However, when I just paste my Preamble in the main file (Graduation_report.tex), instead of using \input, it works. Is there a solution to input my preamble in the main file? So that I can create my preamble in a separate TeX file and still run my subfiles separately with the same preamble.

  • Where exactly is Preamble.tex in relation to Graduation_report.tex?
    – daleif
    Jun 7, 2017 at 14:43
  • 2
    Using subfiles with sub-directories isn't a good idea. You could extend environment variable TEXINPUTS or modify \input@path similar to package import. Jun 7, 2017 at 14:48
  • daleif, my Preamble.tex is in the same folder as Graduation_report.tex
    – Bas
    Jun 7, 2017 at 19:32
  • Yes, but ./Introduction/Introduction.tex is not. Subfiles package causes ./Introduction/Introduction.tex to be compiled with ./Graduation_report.tex preamble, therefore the complier searches \input{Preamble.tex} (you can omit .tex) inside the folder ./Introduction/. May 19, 2018 at 17:28

1 Answer 1


Solved it by defining the input path for the preamble in my main file.


% Define path Preamble



  • I didn't do that and it worked. It may be because I have \usepackage{subfiles} outside of Preamble.tex May 12, 2021 at 18:45

You must log in to answer this question.

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