# Input files relative to main file when using subfiles [closed]

I'm writing a report where I use the package `subfiles` to include different parts of my report.

``````\input{misc/variables.tex}
``````

will include my variables file perfectly and render the subfiles. But if I try to render a subfile it complains about the filepath, as the relative path is different in the subfile.

I would like to use paths relative to the main file, so I can compile just parts of the subfile, while still including files with `\input`. I can't use absolute paths as the report is shared in a repository, where the others don't have the same absolute path.

Any ideas?

-
Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. –  Claudio Fiandrino Mar 4 at 14:33
Isn't it enough to give (again) a relative path in `misc/variables.tex`, starting at `.../misc` now? –  vonbrand Mar 4 at 16:51
To have a chance to get answers, this will need more detail, and in particular a full minimal working example we can work from. –  Joseph Wright Aug 9 at 20:10