Enjoyify your LaTeX workflow: Kile, Xe(La)TeX and SyncTeX.

Obviously, writing a thesis an’ all, these days I’m pretty interested in ways to make my working environment as pleasant and smooth as possible. I do, after all, spend a lot of time in it.

Recently, I’ve spent quite some time searching for the right LaTeX-editor, and I must confess to be quite picky. None of them are all that I want, but a few almost are. My wish list includes: Xe(La)TeX support, code folding, clever and/or configurable keyboard shortcuts for compiling and viewing, auto completion, integration with the Gnome desktop, a simpl(ifiabl)e interface and a few more things.

To cut a long story – and possibly a later blogpost – short; after having sacrificed the Gnome integration, I think I’ve finally settled on using Kile on my laptop running Ubuntu 10.04. Kile was already a very attractive candidate despite it’s heavy KDE library dependencies, with its combination of customizable interface and keyboard shortcuts, XeLaTeX support, code folding, auto completion, lots of help functions and wizards. But what finally made it for me was to learn that Kile, with an extra ionstall of Okular and the right options set, also supports backwards navigation (that is, from PDF to .tex source file) with the SyncTeX library. Maybe you need to try it before yu realize just how convenient that is. Here’s how it works.

Open the Kile configuration window, navigate to Tools -> Build in the left hand menu, choose XeLaTeX in the middle column, and make sure the options are set as on this screenshot:

Kile configuration: XeLaTeX

Kile configuration: XeLaTeX

Second, select the “QuickBuild” tool. As configuration, choose “XeLaTeX + Preview (Okuar)” rather than Preview (Embedded) as I have chosen. Make sure the configuration looks as in this screen shot (You are of course free to add extra runs of XeLaTeX, BibTeX etc.):

Kile configuration: QuickBuild

Kile configuration: QuickBuild.

Now the QuickBuild command builds the synchronization info and embeds it in the PDF that is sent to the PDF viewer. This could in theory be done by any LaTeX client with configurable build commands – or, or course, from the command line. But on Linux only Okular supports SyncTeX.

To enable this, open the Okular preferences and change the default editor from Kate to Kile as shown below:

Okular configuration

Okular configuration.

This should be it! Now you can run QuickBuild from the Kile toolbar or by hitting Alt+1, and Okular will pop up with a document:

SyncTex in action

SyncTex in action.

Now if you find a spelling error or similar, Shift+ Left Click on that sentence, and voilá!, you are taken to the appropriate line in your .tex source to correct the error or write down that little spiffy witticism while it’s still hot.


About lusepuster

Født medio 1979. Astrofysikstuderende. Kommunist. Musikelsker. Computernørd.
This entry was posted in Computers, LaTeX, Physics, Science. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s