Using Ubuntu 12.04. I would like to choose kile as the default application for tex files, but I run into problems. I go through

"right click" -> properties -> open with -> show other applications

but kile is not in the list, so how can I choose kile?

Am I missing something obvious?


5 Answers 5


The answer given by Yusuf is correct but in my case it was incomplete. Since I had no Kile.desktop file in my /usr/share/applications (the .desktop association is hidden, as Cumulus007 points out), I had to create it and simply writing Exec=kile %F isn't enough. This is what I put inside the Kile.desktop file I created using Yusuf's instructions:

[Desktop Entry]
Comment=LaTeX front end
Exec=kile %f

This finally allowed me to select Kile as the default application to open .tex files.


Open the application desktop file in /usr/share/applications and check if the "Exec" line end with this value: "%F". If that is not the case, then you'll have to append this value to this line. Here is the command used to edit the desktop file:

gksu gedit /usr/share/applications/<filename>.desktop

change the exec line from



Exec=kile %F

and then Kile appears in the list.

  • Thank you, it seems to work now.For some reason there where no kile.desktop file. Jun 7, 2012 at 14:49
  • I'm having the same issue but when I go to the folder /usr/share/applications there are no .desktop files, just application files with no extensions. The file for Kile isn't there, how can I create it?
    – Gabriel
    Aug 1, 2012 at 14:14
  • Ubuntu reads .desktop files according to the FreeDesktop specification, thus displaying them as application launchers. Follow Yusuf Felly's instructions on how to create the desktop file.
    – user77111
    Aug 2, 2012 at 13:43
  • I thought that just adding Exec=kile %F should make it work, but that's not enough. I've added an answer explaining why it wasn't working in my case. Cheers.
    – Gabriel
    Aug 2, 2012 at 14:58

Open the application desktop file (in this case, kile.desktop) in "/usr/share/applications" and check if the Exec line ends with this: %F. If that is not the case, then you'll have to append this value to this line (with a prepending space, if needed). Here is the command used to edit the desktop file:

gksu gedit /usr/share/applications/kile.desktop


gksu gedit /usr/share/applications/kde4/kile.desktop

Here kde4 might be something else.

change the exec line from:



Exec=kile %F

and then Kile should appear in the list.


Kile isn't default in "Ubuntu". You need to install it (and its Qt/KDE dependencies) yourself using a Software manager or sudo apt-get install kile. If you wish, you can first run apt-get install -s --no-install-recommends kile to see, as a simulation, what else will come with Kile even without the recommends.

After you've installed Kile, it's possible you still won't see it as an option in the context menu as you have experienced. That may be a consequence of missing a .desktop file as described in detail here: How do I set kile as the default application for .tex files?.


My situation was a little different, but I believe the answer could be helpful here.

I am using ubuntu 16.04; the default application for opening .tex files was RStudio (i.e. when double-clicking on a tex file, it was opened in RStudio). The kile.desktop file already had the Exec=kile %F ending. To open a foo.tex file with kile (or texmaker) I had to right-click, and choose open with.

The permanent solution to change the deafult program for me was:

  • open Files
  • right click on the .tex file
  • go to Properties
  • go to Open With
  • click on Texmaker (or Kile) and click set as default

I don't know how to do this in the command line.

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.