# Relative paths to tex files? [duplicate]

In the preamble of my tex document I can set `graphicspath`. Is it also possible to set a path to sub sections and tables, so I can do `\input{relative-path/filename.tex}` from any tex file and move that text file to any location?

I am not trying to import a package.

I want to be able to go from this directory structure:

``````images/image1.png
figures/figure1.tex
tables/table1.tex
section1/filename.tex
main.tex
``````

To this directory structure (i.e. change the location of `filename.tex` to a sub directory or move it to the root directory):

``````chapter1/images/image1.png
chapter1/figures/figure1.tex
chapter1/tables/table1.tex
chapter1/section1/filename.tex
chapter1/main.tex
``````

It will break, if main.tex contains `\input{chapter1/filename.tex}`. Can I avoid manually having to change that to `\input{chapter1/section1/filename.tex}` upon changing the directory structure?