I am looking to use find and replace to change my graphic file locations without the need to do each one individually.

So I currently have several



Is there a way at which I can find and replace to something like this

*find(\includegraphics[*]{/Chapter/Images/* *

where * is this thing I am trying to ignore and not change. This would result in


If anyone knows of a way I'd greatly appreciate it!

  • 1
    Assuming you use texstudio (as you tagged your question), you could do this with regex matches and capture groups. See for example, tex.stackexchange.com/questions/432218/… Jul 17, 2019 at 14:34
  • 6
    why do you need to do that at all? it is almost always better just to have \includegraphics[scale=0.5]{fig1} you can use \graphicspath{{Chapter/Images/}} so tex looks in the subdirectory. Jul 17, 2019 at 14:54

1 Answer 1


The best answer is the comment from @David Carlisle, but, just to make a regex exercise, in TeXStudio you should search for:


And subtitute with


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.