Publishing High-Quality Documents with Kile

TeX and LaTeX produce impeccably laid-out documents, and are the only practical way to show some mathematical equations. This GUI tool acts as an "integrated development environment" for the command-line document preparation tools.

Discerning typesetters have long relied on Tex and LaTeX for impeccable-looking documents. Now they have a front-end that works under Linux and BSD and brings control of the compilers and related utilities under the comprehensive graphical user interface. Authors and editors who use Kile can get increased productivity in the document creation business. This article will highlight some of Kile's key features which make it so attractive to newcomers to LaTeX.

Beginning at the beginning

Typesetting in LaTeX takes the user through several stages on the way to the ultimate document. First, the user prepares a LaTeX file or files using a text editor, checking syntax and the LaTeX commands and keywords. The next step is compiling the prepared LaTeX document, followed by reading of error messages and taking necessary actions on their correction, before compiling the document again. Once the error messages are gone, check the document visually and, if necessary, revise the input file again. For example, edit the file to chane settings for an image or table formatting, then compile the LaTeX file once more.

When, after several iterations, everything is finally arranged as desired, the document can be printed or stored into electronic formats including the "device-independent format" (DVI), Postscript, PDF or HTML. This is done with the traditional utilities, including dvi2ps, dvi2pdf, and latex2html.

LaTeX is a document preparation system based on the TeX typesetting language. TeX, LaTeX, and related tools are integrated into the teTeX distribution, maintained by Thomas Esser. But although the tools are easy to install and available on all the common Linux distributions, the process can appear discouraging to many new LaTeX users. Yet, the exceptional typographical quality of the created documents is well worth the effort. But that is not to say that the TeX and LaTeX community should be deprived of the benefits offered by the graphical working environments. Under Linux and BSD, a quest for increased productivity in typesetting with LaTeX has led to several popular programs that integrate the features of the compilers with numerous stand-alone utilities from the teTeX distribution.

Competition among LaTeX front ends, a Software Darwinism theory, could explain why Kile (KDE Integrated LaTeX Editor, latest stable version 1.9.3) is a number one choice for many existing users. It is fair to say that the term "LaTeX editor" does not do all the justice to Kile in view of its distinctive set of features. Instead, we could refer to it as a complex, yet easy to use, working environment that, among other things, centralizes access to LaTeX and related tools, including Postscript and PDF translators.

Kile is published under GPL, and source code can be downloaded from the Kile home page. Debian GNU/Linux users can, of course, most readily fetch Kile with:

sudo apt-get install kile

Kile is also packages for Ubuntu and for RPM-based distributions including OpenSUSE, Mandriva, and Fedora. Check your distribution's package manager, or search rpmfind.net.

Interface Impressions

With the complete suite of teTeX applications already installed, KILE takes the user for a ride in the fastest lane immediately after the first run. With the exhibited level of integration, it is easy to forget that it is an external front-end to teTeX and not a native part. Of course, the largest portion of Kile's work space is occupied by the text editor where the input files are displayed. Below the text editor is the area reserved for the stream of information provided by various external applications, and there is also a shell console for the quick communication with the operating system.

Figure 1: The main Kile edit window includes a pane for managing files within a project, a text editing area and a display for messages from external programs.

Vertically aligned next to the text editing area are the icons that change contents of the multi-functional panel farther on the left side of the main Kile window. With the basic view on, the panel lists all open files constituting a current LaTeX project. When writing lengthy publications it is always better to split the text into several smaller chapter/section files which are easier to manipulate. At the same time, the text encoding of choice can be selected for the cases when the writing and displaying of texts in non-English languages is on the agenda.

Apart from the last one, all other views for this panel are related to the hundreds of supported mathematical symbols for which Kile will insert the right LaTeX reserved word into the editor. TeX and LaTeX are all about math, and a whole branch of the Kile's menu supports the mathematical environments and symbols defined by the American Mathematical Society (AMS). This should provide all the coverage that the majority of users may ever need when typesetting technical texts. In rare circumstances when that may not be the case, one can always consult Scott Pakin's work "The Comprehensive LaTeX Symbol List" with references to the corresponding LaTeX packages containing more than three thousand symbols.

Figure 2: Kile offers easy access to the American Mathematical Society's mathematical symbols.

The last icon with MP (Metapost) label presents another gem: a complete list of Metapost commands. According to the its creator John Hobby, Metapost is a language for creating technical figures based on professor Knuth's earlier Metafont. Metapost, as the name suggests, produces the output in Postscript and facilitates access to specialized features including the integration of graphics and text. Speaking of Postscript, a higher-level approach to its integration with LaTeX is undertaken with the most interesting package called PSTricks. PSTricks allows you to include code snippets for Postscript drawings directly into a document.

In the meantime we continue the tour of the Kile's user interface. The mission critical toolbar controls are there to invoke programs, external to Kile, that will perform a certain action on the active LaTeX document. With almost everything in the interface being configurable, the controls can be easily customized through a set of options accessed from the main menu "Settings/Configure Shortcuts/Toolbars/Kile".

Behind the dialog "Configure Kile" is the true connection with the underlying compilers and the DVI drivers/translators/previewers. The user can choose the default compiler (pdftex, pdflatex) or the DVI tool for a particular task and they will become available through the designated icon on the Kile toolbar. Apart from the toolbar, all mandatory tasks like the compilation of the current document, translation from DVI into Postscript or PDF and the preview of created documents are represented individually in the menu "Build". The "QuickBuild" includes the entire process from compilation to the document preview stage, releasing the user from obligation of running each one separately. "Selection Build" is an option that is especially useful when a lot of editing is done over a large document. In order to save the compilation time over the entire project, it will only compile and display the selected part of the input file where the last changes were made.

Figure 3: Behind the scenes, Kile lets you set the options that you pass to external format conversion, spell checking, and other tools.

Yet another conversion utility available through Kile is latex2html, which will generate interlinked HTML pages from the LaTeX project, ready for publication on line. Latex2html is installed separately and, although it is not part of the teTeX distribution, it is indispensable when the technical writings need to be presented quickly on the Web, as the HTML version of the LaTeX document is obtained effortlessly in the same way as Postscript or PDF files. The most important feature is the conversion of mathematical formulas into static image files for inclusion with the web page sources. A trade off in typesetting is inevitable at this point but even the most complex formulas will be displayed with satisfactory enough quality.

When checking the accuracy of the user's input, Kile can also help with tracing LaTeX command syntax errors and can point to the documents segments where the so-called bad boxes are detected in the LaTeX input files. Bad boxes are areas where the compiler thinks that the text has not be typeset to its high standards. Whenever these messages occur, Kile jumps to the incriminated lines with the forward/backward navigation toolbar buttons.

You can check that all the necessary external tools are installed, using the menu item "Settings/System Check". Its purpose is to test-run the TeX/LaTeX compilers, the DVI translators and graphical previewers. Once the test is completed, you'll see a full trouble-shooting report about the current configuration.

As stated earlier, the menu "Settings/Configure Kile" leads to the main configuration window. A set of items found on the "Build" tab reveals the actual shell command and the name of the console application executed when some action is performed within Kile. Where possible (and practical), the predefined programs can be substituted with other applications. For example, the preview of DVI, Postscript and PDF files is done by default with the external programs KDVI, KGhostview or KPDF (for this purpose, Kile temporarily switches from the basic "text editing" into "preview" mode; for return, the "Editor View" button becomes available).

But, for those preferring non-KDE previewers (or in the situation when they are not available with the KDE bundle) programs such as Xdvi, Xpdf, gv or Adobe Acrobat Reader can be used instead. Depending on the type of these applications, the "Advanced" tab can offer a clue about the extra settings which need to be adjusted when you change the default programs.

Figure 4: Preview mode shows pages as they will be printed.

Kile as a Text Editor

If it has not been developed with TeX and LaTeX in mind, the KILE editor would be ranked among the best general purpose text editors available today on Unix/BSD and Linux platforms. Kile's editing functionality beats lightweight editors such as Kate or Gedit. The official syntax of the TeX and LaTeX compilers will be traditionally shown in color over the regular text contents but not only typesetting language is supported. A visit to the menu "Tools/Highlights" will bring forth a list of more than 100 supported programming and symbolic languages, including C, Perl, Python, Matlab, Octave, and R. Source code highlighting will come to rescue when preparing publications containing lengthy source code listings.

Every entry in the menus "Edit" and "View", no matter how ordinary the task it performs, is well thought out and implemented and many of these will appeal to programmers. For generic text editing settings, the dialog behind "Settings/Configure Editor" will offer plenty of options designed to provide comfort during the work.

However, it is Kile's numerous editing features specifically for LaTeX typesetting that had attracted its large army of fans in the first place. These include help for quick navigation around the current LaTeX document, indexing, cross-referencing, adding graphics and working with bibliography entries. To spoil the users (and save them from laborious typing) every time when the beginning of a new command is recognized in the input file, Kile's editor will bring a list of all matching LaTeX commands for auto-completion. Needless to say, the entire list of all standard reserved keywords can be accessed from the menu branches "LaTeX". And the menu "Wizard" will offer a time-efficient way of including the environmental block commands which define tables, mathematical equations or graphics which abound in complex technical publication.

For any new publication, Kile can kick-off the works with a comprehensive document setup dialog accessed from the menu "Wizard/Quickstart". Here, the document class (article, book, report) and basic properties (encoding, font size, default aligning for formulas, number of text columns etc.) are established, and you can choose additional packages that will be used for creating the publication. The list of supported LaTeX packages is not exhaustive in this dialog, but it will nevertheless quickly form the basic structure of the document and allow you to focus directly on creative writing. The structure of the document can be modified later at any stage to suit the final project by manually adding any other LaTeX package available from the Comprehensive TeX Archive Network (CTAN).

Figure 5: The Quick Start wizard lets you start a new document with consistent layout options.

Related:
1 2 Page 1
Page 1 of 2
Take IDG’s 2020 IT Salary Survey: You’ll provide important data and have a chance to win $500.