Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

up vote 6 down vote accepted

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]
Name=Kile
Comment=LaTeX front end
Exec=kile %f
Terminal=false
Icon=/usr/share/pixmaps/kile.xpm
Type=Application
Categories=Office;Database
MimeType=text/x-bibtex

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

share|improve this answer
add comment

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

to

Exec=kile %F

and then Kile appears in the list.

share|improve this answer
    
Thank you, it seems to work now.For some reason there where no kile.desktop file. –  Ipsen Jun 7 '12 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 '12 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. –  Cumulus007 Aug 2 '12 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 '12 at 14:58
add comment

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?.

share|improve this answer
add comment

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

or

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

Here kde4 might be something else.

change the exec line from:

Exec=kile

to:

Exec=kile %F

and then Kile should appear in the list.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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