I use XFig to draw most of my figures (how old am I?) and I find convenient to export in "LaTeX+PDF" format, in which a simple LaTeX source. e.g., fig03.pdf_t (the extension is fixed), is created. That file takes care of typesetting, using the document settings, and uses \includegraphics from the graphicx package to include, in our example, the file fig03.pdf in a picture environment.
I usually have the XFig sources and the exported files in a ./figures sub-directory and I have \graphicspath{{figures/}} in the document source.
So far … but sometimes I like to put in evidence, in the document directory, a particular figure or I'm just lazy or confused and some of my figures are in ./ rather than in ./figures/.
I'd like to be able to write
\input\get{fig03}
and have LaTeX find the file for me.
How do I define the \get command?
In its most basic formulation \get just scans ./ and ./figures/ but it seems reasonable that this can be customized setting a list in the way of \graphicspath

foo.pngis in thefiguressubdirectory andbar.pngis in the current directory, `\documentclass{article} \usepackage{graphicx}\graphicspath{{figures/}}
\begin{document}
\includegraphics{foo} \includegraphics{bar}
\end{document}` finds both files.
– frougon Jan 23 '20 at 11:06\includegraphicsfinds both but I'm using, I have to use\inputto read into my document the LaTeX source prepared by XFig – gboffi Jan 23 '20 at 11:18tikzorpict2e, (the latter cannot do hatches), and onlyinputone file (input{fig03.tikz}), or copy-paste the entire file into the latex document. The tikz-output is superior to latex+pdf output. Also, did you have a look at theimportpackage, which provides some search-path setting machinery? – tkl Jan 29 '20 at 16:05