How to install Kile on Mac OS X

Oct 30, '07 07:30:02AM

Contributed by: yiannis

If you have ever used linux with KDE and you are writing on Latex, I am certain that you can recognise Kile as the best Latex editor around. This is a guide on how to use the excellent KDE Latex editor Kile on Mac OS X 10.4.10 (it should also work for 10.3) via Fink, MacTex, and Apple's X11. An Automator script wraps the appropriate commands up and lets you place Kile in your Applications folder. I used the latest KDE 3.5.8. wbr I will try to make this as analytic as I can, since I have not seen any other guide that delivers the full Kile power in Mac OS X.

NOTE: Before following this tutorial and if you do not desperately want Kile, try Texmaker. It may meet your needs.

Conventions: Any line starting with $ is a Terminal command that needs to be copied and pasted into Terminal (without the $), and then press Return to run it.

Requires: A broadband connection (it is a large download) and at least three hours' worth of patience. Apple's X11 and generally the Developer Tools are also required. You can install both from the OS X install CDs. I have not tried it, but XFree86 (the open source X11 on which Apple's one is based upon) should work equally well.

Read on for the detailed how-to.

A. The KDE bit using Fink.

  1. Download and install Fink, including Fink Commander. (You can do everything below using Fink Commander, which is a GUI tool for Fink.)
  2. Open Applications » Utilities » Terminal, and enter each of these commands:
      $ fink scanpackages
      $ fink selfupdate-rsync
      $ fink update-all
  3. Now you need to configure Fink to use the unstable tree and to not download binaries. Type fink configure in Terminal, and then...
  4. Repeat step two.
  5. Type fink install kdebase3 kdegraphics3 aspell aspell-en kdvi kpdf kile in Terminal, and press Return to all the questions so that the default answers are used. Then do something else, have a coffee, do your shopping or your laundry while Fink downloads and compiles KDE for you. It took almost three hours on my MacBook Pro 2.4Ghz Core2Duo with 4GB RAM.
That last command installs everything that Kile needs to work. We are installing KDE from the unstable tree, but we told fink that we want to recompile it and use no binary packages that usually break the installation up.

B. The Latex bit.
  1. I wanted to use the MacTex Latex distribution with Kile rather than the default teTex that is installed by Fink. I have two reasons for this:
    1. MacTex contains TexShop and TexLive 2007, whch is a more up-to-date Latex distro than teTex (teTex is not maintained as of May 2006)
    2. I would like my Latex configuration (e.g custom .sty, .bst etc. files) to be directly available to Kile by issuing sudo texhash in Terminal.
  2. Download MacTex from and install it.
However, the Latex distribution to be used remains your choice, and teTex or any other Latex distribution could be used equally well.

C. The final bit.
  1. Create a file named .bashrc in your home directory and add this line:
      PATH=$PATH:/usr/texbin:/sw/bin
    Save the file when done. This file tells xterm where it can find the Latex executables, Kile, Kpdf, Kdvi etc.

    The order in the path name above is necessary to be kept because I want Kile to use the TexLive 2007 executables rather than the teTex ones which were installed by fink. If you have any other Latex distribution, you can replace /usr/texbin with the path to your Latex executables directory.
  2. Open Aplications » Automator. Choose the Automator Library and from the next column drag the 'Run Shell Script' action to the right field. In the text box type:
      /usr/bin/open-x11 /sw/bin/kile;
    Then press Command-S. Give your workflow the name Kile, and choose its File Format to be Application and save in Applications.
You are done. Click on Kile in /Applications. Aaaahh, I almost forgot. The icon ... grab this image, and then use img2icns to convert the .png to .icns. From there, I am sure you know how to change the icon.

D. Inside Kile.
  1. If everything is OK, then Settings » System check should return with success, except for acroread, but who needs it? Also, all the embedded viewers KDVI, KPDF work.
  2. The aspell program is used for a spell checker (it is better than the default ispell in unix).
  3. I keep the default configuration of shortcuts in Kile. If you wish otherwise, you have to play with the Settings » Configure Shortcuts screen to make shortcuts that meet you specific needs.
SOME NOTES: [robg adds: I have not tested anything in this hint...]

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20071024061901344