Abstract
this brief article is about the advantages of using the LATEX document preparation system, and some of the disadvantages of using WYSIWYG word processing programs
Contents
1.1 What is a document typesetting program?
1.2 How is LATEXdifferent from a word processor (e.g. Word, Wordperfect)?
2 Is LATEXhard to learn?
3 What can I do with LATEX?
4 how much does LATEXcost and where do I get it?
5 Postscript — Why I am writing this?
1 what is LATEX?
LATEXis a document typesetting program.
1.1 What is a document typesetting program?
A document typesetting program takes some text and formats it for you, doing things like making a title page, putting the right number of words on a line, and the right number of lines on a page.
1.2 How is LATEX different from a word processor (e.g. Word, Wordperfect)?
Word processing programs do similar things. But they actually try do three things at once, namely:
There are obvious advantages and disadvantages to doing 3 things at once.
One of the advantages is that word processing programs are WYSIWYG (what you see is what you get), i.e. you get instant feedback, and your finished document will look exactly (or close to exactly) as it is while you are writing it. The other advantage is that you only need one program to create a document.
The disadvantages are actually the same as the advantages. A WYSIWYG editor is handy in some ways, but it also encourages you to spend too much time worrying about how your document looks, instead of focusing on content, which is the main reason for writing a document in the first place. Also, when working with large documents, WYSIWYG editors can become quite slow, especially if you have lots of tables, graphics, and/or equations. Also, a WYSIWYG editor forces you to only use one program, and usually these programs store your text in a proprietary format which can become obsolete over time. Using a LATEX based system, you can use whatever text editor you choose (e.g. vim, emacs, notepad, TextEdit, TeXShop, LyX), typeset the document with LATEX and then view it with whatever program you wish (e.g. Adobe Acrobat, xpdf, Apple’s Preview).
2 Is LATEX hard to learn?
Well, I am not going to lie to you and say that you can simply open a program, start typing, and 10 minutes later print off the final product, which you can do with Word or some other word processor. However, I do think it is easier to learn how to write a well structured and formatted document with LATEX than with Word. Why you might ask? Well, I actually had a lengthy discussion with a fellow graduate student in Linguistics at a pub earlier this year (yes, I was talking about LATEX at a bar — I am a big geek). I was telling her how much better LATEX was than Word, including quite a few features of LATEX that Word lacked. I was quite shocked to learn from her that Word does seem to have all the same standard features of LATEX (except for good handling of equations — it can do them, but it does not do them well. If you think it does handle them well, you obviously have not seen how much better LATEX can do them). The problem with Word though, is that many of these features are very well hidden, and since you can open Word and just start typing, it is very easy to never learn these features until it is almost too late.
What are these features you say? Some of them are very basic, such as:
- page numbering
- inserting the date the document was written
- consistently formatting chapter and section titles
The last of these is crucial. One of the very first things one learns when learning LATEX is how to structure the document (and let LATEX do the formatting for you). So instead of asking, “how do I make this particular text bold and large so it looks like the title of a section”, one asks “how do I make a section title”, and the answer is very easy —
section{title of the section}
|
To do this in word, one can use the “styles” feature, which I would estimate less than 10% of Word users actually use. (I have no empirical basis for coming up with this number; it is purely a hunch. But given that I never really bothered to learn how to use styles correctly, and I would consider myself a intermediate to advanced computer user, I doubt that many people do use styles).
Some of the more “advanced” features of LATEX depend on the author to write a well structured document. However, LATEX also strongly encourages, and in some senses forces the user to do so, so this is not a problem. Some of these features include:
- hyphenation — the default layout in LATEX uses fully justified margins, and tries to maximize the number of words it can fit on one line by adjusting the inter-word spacing. If the inter-word spacing for a particular line would be too big, then it will automatically hyphenate words, just like you see in newspapers, books, and magazines.
- automatically generating table of contents (including lists of tables, figures, and appendices). LATEX uses the section commands that you have used in your document to automatically generate a table of contents for you.
- floats — in LATEX figures and tables are so called “floating” environments. That is, they don’t necessarily show up exactly where you type them. There is a good reason for this. Have you ever had Word give you a half-empty page because of a graph not fitting in nicely? Or maybe Word split your table onto two pages, making it much more difficult to read?! By treating these as floats, LATEX calculates the optimal location to place figures and tables so you don’t have to worry about it.
- List formatting — just like this list. LATEX provides very simple commands for creating itemized, (aka bulleted), enumerated (aka numbered) and descriptive (like dictionary entries) lists. Creating a list looks like this:
begin{itemize}
item an item
item another item
item some embedded items
begin{itemize}
item an embedded item
item even further embedding
begin{itemize}
item LaTeX supports four levels of list embedding —
using more than four is very difficult to comprehend
as a reader.
begin{itemize}
item even further
end{itemize}
item indenting code is not necessary
end{itemize}
item but it is helpful
end{itemize}
item enough about lists
end{itemize}
which produces:
- an item
- another item
- some embedded items
- an embedded item
- even further embedding
- LATEX supports four levels of list embedding — using more than four is very difficult to comprehend as a reader.
- even further
- indenting code is not necessary
- LATEX supports four levels of list embedding — using more than four is very difficult to comprehend as a reader.
- but it is helpful
- enough about lists
As you can see, it is not very complicated at all. There are many helpful tutorials on the web. Just try searching for ‘latex tutorial’. Watch out when you are searching. If you are not specific enough, you might end up getting results for strange sexual fetish websites. Of course, a good way to learn anything is by example. Try looking at the LATEX source of this document. You might also be interested in the .pdf that was produced.
3 What can I do with LATEX ?
lots!
LATEX was originally designed primarily for writing articles and books, particularly ones with a lot of equations, as TEX was primarily designed to perform quality typesetting of math. However, LATEX is quite extensible, and since you can write new document classes for LATEX (and many others have already done much of this work you), it is easy to create all sorts of documents with LATEX. The main document classes which come with most LATEX distributions are:
- article
- book
- report
- letter
- minimal
plus other publicly available classes - poster (several different versions)
- presentations (several different versions)
- journal styles – many scientific journals provide classes which will format documents exactly the way they want them to be formatted. This means that you don’t have to worry about formatting at all – just content, and that is very handy
- webpages — in fact, this document was created with LATEX using the tex4ht program. I must admit that it is not the optimal way to make webpages, and certainly is not intended for creating full-blown websites. It is pretty handy for creating online documentation though, especially the fact that it auto-generates links (e.g. the table of contents) for you. It should be noted that the html code that it generates is not necessarily pretty though, as you will see if you look at the source of this document.
I am not attempting to toot my own horn, but since I have access to them, here a few examples of what I have done with LATEX:
- Greeting card
- Conference presentation (slides) and (handout) – generated from the exact same source!
- Conference poster and handout — again, generated from the exact same source
4 how much does LATEX cost and where do I get it?
First of all, you will be happy to hear that LATEX is free!
You can get LATEX in various ways. The easiest way nowadays is to download it from the internet. One slightly tricky thing about LATEX is that there are several different distributions of it. Since it is open-source software, and since it is composed of many different classes, packages, and extensions, different people have made different distributions of it, including what they think to be the most commonly used packages. There are also some operating specific distributions. Fortunately, LATEX runs on just about every operating system possible. Some of the most common distributions are miktex and tetex. Various distributions, as well as numerous packages are available on http://ctan.org (The Comprehensive TEX Archive Network)
5 Postscript — Why I am writing this?
I considered addressing this question at the beginning of this document, but for reasons soon to be clear, I decided it was more appropriate at the end. So why I am writing about this? There are lots of other people in the world who have written very similar documents, some of which I find very helpful and compelling, some of which are markedly less compelling. I was inspired to write this document by one of the less compelling documents I read recently which was linked to by http://reddit.com (a sort of news aggregating website). This article started off by talking about how if one is in academia, one may have tried to get some articles available only in some cryptic format like .dvi or .ps, and by the end was trying to convince people that they should learn LATEX. I think that this is a terrible approach to convince someone to learn something new. I think it is a better to start off with a positive attitude, and jump right into the meat of the matter. For this very reason, I decided to express my disappointment with the aforementioned article at the end of this one, instead of the beginning.
I hope that this document has inspired a few people to learn LATEX and to start writing well-structured documents, and start focusing on content, and keeping the format separate.