<div dir="auto">I am writing a de-psfragger, to change the labels made with psfrag (and bound to latex - dvips - pstopdf workflow) to something more modern like pinlabel.<div dir="auto"><br></div><div dir="auto">The Perl routine is already working quite nicely on a (single) file that contains all figures, parsing the TeX, EPS and changing them accordingly.</div><div dir="auto"><br></div><div dir="auto">I am not really happy with the kludge I came up for descending on a tree of files connected by</div><div dir="auto"><br></div><div dir="auto">  \input</div><div dir="auto">  \include</div><div dir="auto">  \usepackage</div><div dir="auto"><br></div><div dir="auto">taking into consideration the values of</div><div dir="auto"><br></div><div dir="auto">  TEXINPUTS</div><div dir="auto">  GraphicsPath</div><div dir="auto"><br></div><div dir="auto">(and may be others).</div><div dir="auto"><br></div><div dir="auto">What is the proper way to handle this?  What packages do you know that does a good job at it? Anything to suggest?</div><div dir="auto"><br></div><div dir="auto">I guess this is common to any translator that is written in something other than TeX. Is there a framework for doing a reliable traversal of a TeX tree of files in this way?</div><div dir="auto"><br></div><div dir="auto">Many thanks,</div><div dir="auto">Paulo Ney<br></div><div dir="auto"><br></div></div>