Monday, March 24, 2008

TeX, LaTeX, LyX: Authors kit and more

If you are related to IT and computer industry, most probably you heard about these terms. Its all about documents preparation. If you have used Microsoft Word (sorry, no hyperlink here) or OpenOffice.org then you have already practiced with document processing systems.

So what is the difference between document preparation and processing? The latter are WYSIWYG systems. You take care of everything to see it as you want to get it. It is a convinient matter for small documents. However, if you are preparing a technical paper or a thesis then those won't save you much. In such complex documents you include figures, tables, complex equations and refer to them by numbers. You include a lot of citations and footnotes. You may even number your pages in different manners in the same document. You don't want to track such numberings so that moving any section around won't mess with the numbers.

You might say Word supports many such features. In Word you have to format eveything, nevertheless you may select styles to be applied to different sections. Changing the format of the style will make you pass over all formatted instances. On the contrary, in TeX, the typesetting system, you only define your logical structure instead of formatting constructs. You define \title, \author, \chapter, \section, \subsection... and the TeX (or LaTeX) compiler will take care of the formatting according to \documentclass, whether it is book, article, CV or whatever.

If you aim at posting your paper to a technical conference, you have to abide to formatting rules of the conference. This is simply done by downloading the class files specific to that conference (usually available at the conference site) and including them in your document. Just run the LaTeX compiler and you instantly have a PostScript/PDF conforming to the conference style.


TeX, LaTeX? What is the difference? TeX is a macro language invented by Donald Knuth in the late 1970s It include simple commands to define logical structure and formatting. It is something like assembly code, noboy writes in TeX. LaTeX is a bundle of macro definitions that abstracts TeX in easy-to-write macros (\section, \title, ...). You write your documents in LaTeX and run the LaTeX compiler to generate DVI (DeVice Independant) files that can be viewed with Evince or KDVI. You may run dvips to generate PostScripts or pdflatex directly on the LaTeX source to generate PDFs. There are many other ways to convert between such formats.

Another reason why Word is not adequate for complex documents is that it may even crash! I know examples where some MS Office documents crashed when became quite complex. They left their owner with locked documents that are rendered useless.
MS Office stands against openness. When you write your docuemtns in Word and send them to others, you are urging them to purchase Microsoft products to see your "closed-format" document. OpenOffice could be a solution, but Microsoft deliberately changes its format almost from version to version. You may read more about this format conflict.

For LaTeX newbies, it is not easy to be productive. You have to be very familiar with LaTeX to play with it. LyX is a front-end software for LaTeX. It is WYSIWYM, as they claim: What You See Is What You Mean! You define logical structure through menus, toolbars and keyboard shortcuts and you instantly get an immediate near-preview of the format. LyX has a special language syntax (TeX, LaTeX and LyX all store files in ASCII format and can be edited with any usual text editor). However, you can export your document in LaTeX, PS, PDF,... etc.

My experience with such tools suggests boot-straping with LyX as a fast startup with TeX. The more you work, the more you know about LaTeX. At a certain stage, when you find LyX restrictive, you will export in LaTeX and continue writing in LaTeX. You may Kile for that to autocomplete commands and easily generate DVIs and PostScripts.

No comments: