I want to automate the process of inputting tex files from subfolders. Previously I managed to automate the inclusion of images from "images" subfolder within the subfolder of each subfile. I would like to do the same for tex files. Please have a look at: Is it possible to use includegraphics with relative path with subfolder, inside subfiles?
Now I want to add a modifier, so that
%subfolder1/subfile1.tex
\input{fig1.tex}
would add subfolder1/fig1.tex in the file, while
%subfolder2/subfile1.tex
\input{fig1.tex}
would add subfolder2/fig1.tex to my file.

\subinput{}to use in an analogous way? – cfr Nov 18 '15 at 02:27\edef\CurrentFileDir{\currfiledir}and\renewcommand{\myimagedir}{\CurrentFileDir images/}.\input{\myimagedir fig_matlab_sinemodulation}seems to work. Is there any easier way to do it? – sajid Nov 18 '15 at 05:14\subinput{fig_matlab_sinemodulation}- a wrapper around\input{}, in other words. – cfr Nov 18 '15 at 14:28\graphicspath{}is not considered good practice, by the way. That said, bad practice works well for me since I use it all the time. – cfr Nov 18 '15 at 23:27#to##:(. I always forget this.) – cfr Nov 19 '15 at 18:09