A previous version of TeXstudio was aware or the location of your TeX files. In the current version, when opening a file, I always start from my home directory. The ini-file (or the configuration options in the tool) does not seem to contain a variable that controls this behavior. Is there any way to make the TeXstudio "Open" command start in a different directory?

2 Answers 2


I will start under the assumption that everything is empty and that we have to create the project from scratch.

Open texstudio from the start menu, whatever form it takes in your particular system.

Click on File -> New

Click on Wizards -> Quick start -> Select document class

Click File -> Save. You will get a file manager enabling you to create a suitable directory. In my example I will create /home/leif/MyDirectory. Save the file as myfileA.tex.

Click File -> Session -> Save session... and give it a suitable name (MySession.txss2).

Exit texstudio and open it again.

Click File -> Session -> .../MySession.txss2. You will get the document myfileA.tex opened.

Repeat the steps File->New, Wizards -> Quick start and File -> Save. Use the name myfileB.tex.

Exit texstudio

%%%%%%%%%%%%%%%%%% Final step %%%%%%%%%%%%%%%

Open it again. File -> Session -> .../MySession.txss2. Now you have myfileA.tex opened and you can click on File -> Open to open myfileB.tex for example. You are in fact in .../MyDirectory as you wanted.

All the previous steps exiting and opening texstudio were of course only to create all directories and sessions.

It is possible that it is important to go into Options->ConfigureTexStudio and select "Show Advanced Options" at the bottom left of the window. When this is selected you get a group called Session. In my window I have selected "Store relative paths". Above this there is "Restore Previous Sessions at Startup". Maybe that setting suits your workflow.

  • I am sorry. You do your best to answer my question. Maybe I did not ask it clear enough. The problem is not in opening a recently opened file. It is in opening a new file. I have too many files to just have them all open, or even recent. Your steps did not help. My session file (.txss2) is in the same directory as the files I want to open. Still, when opening a new file in that directory, it starts at $HOME. Also my advanced options do not have a group called Session (Texstudio 4.8.0). 2 days ago
  • Sorry I couldn't help. My version is TeXstudio 4.7.3. Perhaps I will have the same problem when Fedora upgrades it, who knows.
    – user162405
    2 days ago

Since you didn't specify your operating system, I can only answer in a very general way, which is to point you to the relevant page in the manual. I have tested this thing in Fedora Linux, TeXstudio 4.7.3.

The concept you want in Texstudio is 'Sessions', and the relevant manual page is https://texstudio-org.github.io/advanced.html

I would also recommend that you become familiar with working in the terminal. Not only for texstudio, but for TeX/LaTeX in general. A tool like Texstudio is excellent, and I use it all the time, but as soon as there is a problem I open a terminal window and type 'latex filename' (or pdflatex or lualatex etc.) I will then be able to see all the warnigs and errors from the tex system. In that case the answer to your question is

> cd MyDirectory
> texstudio myfile &

Works in Linux/Windows/Mac.

If I was too terse in my answer, please feel free to ask more questions.

  • My OS is Linux/Mint. Unfortunately "Session" does nothing for me. It remembers the files that are open, but still starts in my home directory when opening files. I checked the session file, but there seems to be nothing there that allows me to configure this. Also the "manual page" you refer to says nothing more than how to load/restore a session. May 14 at 6:49
  • I am sorry I didn't find your comment until just now (20:51:15 CEST). I checked, and it works as I expected. I plan to give a complete answer with a number of screenshots, but unfortunately that cannot be until tomorrow afternoon.
    – user162405
    May 14 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .