I always open about 8 separate .tex files when I'm using texmaker, all from different directories. This is very inefficient so I was wondering is there some command I can use on the terminal to make texmaker automatically open all these files when it starts?


1 Answer 1


Not tested answer for Ubuntu (or debian based) since I don't have TeXmaker installed.

In your


folder, you possibly have a texmaker.desktop file.

If it is not there find it for your system (If you can already use texmaker with open with there is such a file. If not you can add it.)

If you open it with a texteditor like nano, you will find something like:

[Desktop Entry]
GenericName=LaTeX Editor
GenericName[fr]=Editeur LaTeX
Comment=LaTeX Editor
Comment[fr]=Editeur LaTeX

Command for opening:

sudo gedit /usr/share/applications/texmaker.desktop

(Or nano instead of gedit... or whatever)

At the end of the line Exec=texmaker if you add %U you will get:

Exec=texmaker %U

This way texmaker can used with "open with" to open files or folders.

If now you make the line like:

Exec=texmaker /home/Desktop/myFolderWith8Files/ %U

then, whenever you use "open with"... it will open the selected files or folder and the "default" /home/Desktop/myFolderWith8Files/ folder

  • Thats seems like a good option my home laptop thanks! However, I really need to be able to do this from my work machine and unfortunately I've just check that texmaker.desktop file and it is read-only. Is the a workaround for this? Oct 22, 2017 at 9:01
  • You can try in ~/.local/share/applications
    – koleygr
    Oct 22, 2017 at 10:37
  • sudo vi texmaker.desktop Jan 13, 2018 at 14:54

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.