Posted by: thegooddoc | October 21, 2007

Getting Started with LaTeX

As a researcher, a huge portion of my job is spent writing reports, papers, proposals, research notes, etc. So, for me, the choice of tools for writing is critical. While I do use Microsoft Office for a fair portion of my work (you can’t avoid it if you do any cooperative work), my tools of choice are Emacs for editing, and LaTeX for document processing. Here, I’ll try to explain why, and give a few tips for getting going with this outstanding tool. Where appropriate, I’ll just summarize and link, and I’m going to avoid going into a lot of history for LaTeX, as you can find that info elsewhere. This is a topic that I’ll come back to fairly often, and will provide bite-sized chunks of tips and tidbits as they occur to me.

What is, and Why use, LaTeX?

Why not just use Word? MS Word (or WYSIWIG in general) is a great tool for writing, particularly for fairly short and simple documents. It’s easy to use, and easy to abuse. For more complicated documents, reports, books, and similar, I find it just becomes too much of a hassle to wrangle Word into working for me.

LaTeX is a text-based system that supports documents of just about any complexity and length. It isn’t a WYSIWIG tool, although you can find ways to get that also. This is, in my opinion, one of LaTeX’s great strengths – you focus on your content, rather than on fiddling with formatting and styles. For example, if you want to start a new section of a document and need to provide a header, you simply type:

\section{This is the title of my section}\label{sec:mine}

and LaTeX will format it appropriately, based on the type of document you’re creating. If it’s right to do so, LaTeX will number the section for you, and can also easily provide cross-referencing to that section number (or to just about anything else, e.g. page numbers, equation numbers, figure numbers, etc.). Here, you could say “see Section~\ref{sec:mine}”, and you’d end up with “see Section 1″ (assuming that was section 1). This really is simpler, easier, and far more robust than what you can do in Word. Later, if you add a section ahead of this one, it’d get renumbered, as would your cross-reference. Note also that the “label” part is optional, but it seems better to include it, just in case you want to do a cross-reference later on. This is just a simple example, meant to entice you into the rabbit hole.

LaTeX (actually, its eco-system, including BibTeX) provides great support for including references and bibliographies. Word, in combination with other programs (e.g. EndNote) can do this, but it’s just not as clean, at least for my style of working. If you need to include equations, LaTeX is vastly superior to using something like MS Equation Editor.

In any case, there are many reasons why you should consider using LaTeX. But, I must say that it’s not for the faint-of-heart, and the learning curve for a tool like this is somewhat steep, and long (a lifetime to really learn, I suspect). I find it’s useful to think a bit about “why” you’d want to subject yourself to the pain you are about to go through (i.e., what’s in it for you, and what you’ll have when you’re done!). One good summary is LaTeX – the very idea.

Learning and reference books

There are numerous books on getting going with LaTeX, and detailed references for once you’re up to speed. I suggest Leslie Lamport’s excellent LaTeX: A Document Preparation System (2nd Edition) (Addison-Wesley Series on Tools and Techniques for Computer Typesetting).

For reference, or as you get further along, I really like Kopka’s book, Guide to LaTeX (4th Edition) (Tools and Techniques for Computer Typesetting).

Finally, if you’re buying into this whole-hog, and know you’ll want a fairly complete and useful set of books, just go straight for The The LaTeX Companions, Revised Boxed Set: A Complete Guide and Reference for Preparing, Illustrating, and Publishing Technical Documents (2nd Edition).

Related tools

You’ll need to install LaTeX (unless you’re on Linux, in which case it may already be there). In any case (and even for Linux), I personally recommend the TeX Live distribution. There are others, and depending on your platform (Win, Mac, Linux), you may be happier with a different distribution. I’m not going to say much here, as you’ll be able to find many detailed references on how to get, install, and configure LaTeX. For starters, check out the TeX User’s Group (TUG) Getting Started with TeX, LaTeX, and Friends.

You’re going to spend your itme in an editor, or an integrated environment. As you might guess, I’d recommend Emacs. But, there are plenty of good text editors out there (you could even just use Notepad or, for reasons I’ll go into another day, Wordpad). There are also some fine integrated environments, and I’ve used a couple of these off and on for years. I was very happy with, and can fully recommend, the TeXniCenter integrated environment. It’s very complete, and a great tool. I eventually felt it was a bit too much for my needs, and I then migrated to WinShell. I really liked this tool (even better than TeXniCenter, for me), and only left it behind when I finally took my bold (some might say foolhardy) leap into Linux. The install is simple, shouldn’t be a problem. You’ll be better off to install this before you try to go any further with LaTeX. For the Mac, you should give MacTeX a look, along with the front-end TeXShop.

Other tips and resources

Something very cool that I came across while writing this: The Visual LaTeX FAQ. This is such an innovative way to present an FAQ, I’m going to spend a bit of time going over it, as I expect I’ll learn some tricks I’ve been wondering about at a low level for years, but haven’t been sufficiently motivated to bother to look into them.

A few simple example LaTeX documents: the really small small2e, the slightly less small sample2e, and the more comprehensive (whacking big) The Not So Short Introduction to LaTeX2e by Tobias Oetiker, also as PDF. In the spirit of those ridiculous “Teach yourself brain surgery in 24 hours” books, this one is subtitled “Or LaTeX 2e in 138 minutes”.

General resources: the TeX user’s group, the Comprehensive TeX Archive Network (CTAN), and the PracTeX Journal.

And finally, a couple of discussions about getting going with LaTeX, why you might want to bother, and some of the troubles you’ll find (and overcome) along the way:

“The beginner’s forest of LaTeX,” by Theresa Song Loong, and “LaTeX isn’t for everyone but it could be for you,” by Andy Roberts

Thanks, and happy LaTeXing.


Leave a response

Your response:

Categories