[Tex/LaTex] TeXStudio Autocomplete or suggest image path

auto-completiongraphicstexstudio

I am writing a report in TexStudio. I recently exported the report from sharelatex. In sharelatex, it autocompletes or suggests the image file location. But I can't make TeXstudio do the same thing. Do anyone no what I am doing wrong?

Since I have very many images in different folders (see picture), this is a problem.

I have no problem compiling.
the graphics path is added using \graphicspath{{./figure/}}
I have also added the folder path under adv. editoradditional search paths.

Do anyone know how I can make TeXStudio autocomplete image paths.

Photo over the project with many subfolders containing images

Best Answer

This might not work on Windows: https://sourceforge.net/p/texstudio/bugs/2163/


To activate file completion, use the Ctrl + Space.

For example, if you have a file structure like

.
├── demo.tex
└── figure
    ├── IMGP9039.jpg
    └── otherfigs
        └── IMGP9647.jpg

In demo.tex, you write \includegraphics{}, and place the cursor between the braces, like so:

texstudio

When you hit Ctrl + Space, you'll see this:

texstudio 2

Hit the down arrow key to select the figure folder, and hit Enter to enter it:

texstudio 3

Move through folders until you find the correct one, and select the file you're after. Hit Enter again, and you're done.