Getting Started with LATEX

Robert L. McDonald July 13, 2006

1 Introduction

This document is intended to help you get started with LATEX. Since part of the idea is to show you how it works, the file used to create this document is intro.. By the way, the web page you’re reading was created directly from a LATEX file. Keep reading to learn how. First, some terminology: TEX is the original typesetting program written by Donald Knuth. LATEX is a set of higher-level and more user-friendly commands built on top of TEX. LATEX2e is the latest version of LATEX. Take my word for it: you want to use LATEX2e, at least initially.

2 Mathematics

One of the really powerful things about LATEX is it’s ability to typeset math. Here is a simple example:

1   1 n Y = 1 − (1) n i 1 + i

You can give an equation a name (the above is called “eq:ex1”), and refer to it like this: equation (equation1). Here is the code for this equation:

\begin{equation} \label{eq:ex1} Y_{n} =\frac{1}{i}\left[1-\left( \frac{1}{1+i} \right)^n \right] \end{equation}

1 The command

\label{eq:ex1} gives the equation a name so you can refer to it and have the equation number remain correct. The other aspects of syntax should be apparent after comparing the code and the result. The syntax for entering equations becomes second nature after a while.

3 The Software

A good introduction to getting LATEX going on a Windows PC is here. This explains how to install a LATEX system (MikTeX), and also some of the im- portant helper programs like Ghostscript. Two excellent text editors are Emacs and WinEdt. The program TeX4HT (which is included with MikTeX) was used to create this web page from the LATEX document.

4 One File, Different Formats

The exact same file can be processed in different ways to produce different results.

Printed Document If I type “latex latex intro” followed by “yap latex intro” I get a displayed version of this document which I can print.

PDF File If I type “pdflatex latex intro” I get a pdf version of the docu- ment.

HTML document If I type “htlatex latex intro”, I get a web page.

5 Slide Shows

There are now some great packages for using LATEX to create Powerpoint-like slide shows. The choices are many and confusing. The best balance I have seen between power and clean design is PowerDot.

2 6 References

There are some excellent references on the web. You should definitely check out CTAN (the Comprehensive TeX Archive Network), especially this link, which has references for beginners. The so-called “(not-so) short guide” is excellent. If you are going to use LATEX you should plan to buy a few books. Some invaluable reference books are Lamport (1994), Kopka and Daly (2004), and Mittelbach and Goossens (2004). You will find that these don’t make much sense initially, but as you stick with it you’ll find them invaluable. I suggest that you not buy Knuth (1994), at least not initially. Knuth created TEX. But the TEXbook delves into the inner workings of TEX. When you’re ready for Knuth’s book, you’ll know it. Any commercial LATEX program, such as Scientific Word, is using LATEX2e. When you look at the .tex file which generated this document (here), notice that I supplied a reference to each book. LATEX handles the rest, supplying the citation and the bibiographic entry. All I can say is “Wow!” Here is the file containing the bibliographics references I’ve used.

7 Conversions and Graphics

There is software that will help you convert files from Word (for example) to LATEX, and vice versa. This is a pain. However, if you find you have to get material in one format to another, here is a page listing conversion programs. Personally I found the program WP2Latex a huge help, though not perfect. As for graphics, having wrestled with Windows metafiles (.wmf) files for quite a while, my suggestion is: use encapsulated postscript (EPS) wher- ever possible. If you find you do end up with Windows metafiles, I highly recommend wmf2eps to do the conversion to EPS.

References

Knuth, D. E., 1994, The TEXbook. Addison-Wesley, Reading, MA.

Kopka, H., and P. W. Daly, 2004, A Guide to LATEX. Addison-Wesley, Boston, MA, 4 edn.

3 Lamport, L., 1994, LATEX —A Document Preparation System. Addison- Wesley, Reading, MA, for LATEX2e, 2nd edn.

Mittelbach, F., and M. Goossens, 2004, The LATEXCompanion. Addison- Wesley, Boston, MA, 2 edn.

4