Question: I have a figure `fig_name.eps` with the surrounding text in `fig_name.tex`.

They are in a sub directory called fig\_dir. I used the following in the beginning of my document to change the path for `input`.

```
\makeatletter
\def\input@path{{/path/to/fig_dir/}}
\makeatother

```

I am using `\input{fig_name}` to include the figure. On compilation it shows error that file not found. What did I do wrong?

Edit : I am adding a MWE below.

```
\documentclass[a4paper,fleqn,usenatbib]{mnras}

\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{epsfig}

%TO INCLUDE FIGURES FROM FOLDER NAMED fig_dir
\makeatletter
\def\input@path{{/path/to/fig_dir/}}
\makeatother

\begin{document}
%THIS ONE WORKS FINE
   \begin{figure}
      \includegraphics[width=7cm]{fig_dir/bla_bla.png}
      \caption{bla_bla}
   \end{figure}

%THIS ONE DOESN'T
   \begin{figure}
       \centering
       \resizebox{!}{0.30\textwidth}{\input{fig_name}}
       \caption{fig_name}
   \end{figure}
\end{document}

```

Answer: 
gnuplot's `epslatex` terminal creates two files `fig_name.tex` and `fig_name.eps`.
You have to call `fig_name.tex` from your main file with `\input{fig_name}`, but this one will load `fig_name.eps` with an `\includegraphics` command. Open `fig_name.tex` with an editor and will find a line with contents:

```
\put(0,0){\includegraphics{fig_name}}%

```

So the easyest solution would be to add a `\graphicspath` command with the `subfiles` folder and call the `.tex` file with `\input{subfile/fig_name}`.

Now suppose gnuplot created `mytest.tex` and `mytest.eps`, and both are stored in subfolder `gnuplot`. Following code works:

```
\documentclass{article}
\usepackage{graphicx}

\graphicspath{{gnuplot/}}

\begin{document}

\input{gnuplot/mytest}

\end{document}

```
Too long for a comment. The following works fine for me:

```
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{graphics}

\makeatletter
\def\input@path{{Sub_dir/}}
\makeatother

\begin{document}

Some random text.
\begin{figure}[tbp]
    \centering
    \resizebox{0.5\textwidth}{!}{Where are you? \input{HereAmI}}
    \caption{My figure}
\end{figure}

\end{document}

```

Save the above code in a certain directory, then create, inside that same directory, a subdirectory named `Sub_dir`; save the following code in a file named `HereAmI.tex` placed inside `Sub_dir`:

```
Here am~I\@!

```

Does this work correctly?