LaTeX basics

First of all, meaning and pronunciation. TeX is the original math typesetting program developed around 1980 by Donald Knuth. It is pronounced like "tech" as in high-tech. The X is the Greek letter chi, making the "ch" sound at the end of "tech". In the original documentation for TeX, there is much discussion of "gluing" together objects and "stretching" space between objects that make up a page. Latex is a sticky natural product that forms the basis for rubber, and I believe that is the reason for the word LaTeX. LaTeX is built on top of TeX. It was written in the early 1980's by Leslie Lamport.  It has more built in high level functions than TeX, and so tends to be more user friendly. As far as I can tell, LaTeX is not an attempt to sound French; it is probably not La TeX, or "The TeX". The reason for the funny alternation of capital and lowercase letters is that TeX and LaTeX, when typeset properly like this:, are all capital letters but in different point sizes and different height above and below the baseline. Alternating uppercase and lowercase mimics this.

File types

LaTeX files are not as self-contained as, say, Word documents. However, their file sizes are generally smaller.  Here is a very basic description.

A LaTeX source file should be given the extension .tex. It is a text file, one you can edit with Notepad or SimpleText, unlike Word documents, which you can only edit with Word. The LaTeX source file contains the text of your documents plus the commands that indicate how text and equations should be formatted.  In this way, it is a little bit like computer code or raw HTML.

LaTeX source files must be processed by a program that knows how to interpret the various commands embedded in them. On a PC, you can download various implementations of LaTeX, such as MiKTeX. On the Macintosh, you can use OzTeX. On a UNIX machine, you should be able to install latex itself. I will generically refer to these programs as latex.  Note that the program texify may be the actual program that is used to process a document.

When latex processes a LaTeX source file called example.tex, it creates a file called example.dvi. dvi stands for DeVice Independent. It is an older format than .pdf, and was intended to be what it says, a format that many different devices (computer platforms) can handle. Each computer platform has its own programs that can view (some say preview) .dvi files. On a PC, MikTex comes with YAP (Yet Another Previewer), on the Macintosh, a dvi previewer is built into OzTeX, and on a UNIX machine, you can usually find a program called xdvi.  latex also produces a .aux and .log file, which we don't need to worry about now.

The usual progression when composing a document in LaTeX is to type the .tex file using a text editor, then process it using latex, then view the .dvi output using a previewer. Compared to Word, this seems pretty clunky, I know. It is mostly due to the fact that LaTeX was developed on a UNIX platform, and that's how UNIX programs tend to be structured. Why? It's more modular and easier to have many people involved in the development, rather than one monolithic software development company.  On balance, that's a good thing.

You can't send a .dvi file to a printer. Most printers accept PostScript (.ps) input. On a PC, you can open the .dvi file with YAP to print it. With OzTeX, you can select File, Print. In UNIX, you first use a program such as dvips to convert the .dvi file to a .ps file, then send the .ps file to the printer using a command like lp file.ps.

Finally, once you create a LaTeX document, you may wish to share the output electronically with others, either by emailing it as an attachment or by posting it on a web page. People who don't use TeX or LaTeX don't usually have .dvi and .ps previewers installed, but they often have Adobe Acrobat Reader, which can read and display .pdf (Portable Document Format) files. On a PC, you will probably use pdflatex to process the LaTeX source code and produce .pdf output automatically. Or you can use a DVI to PDF converter like dvipdfm, which comes with MiKTeX.  On a Macintosh, you can use Adobe Distiller (use Sherlock to search for it, then run it) to convert a .ps file to a .pdf file, then use Acrobat reader to view it. In UNIX, you can use dvipdf or ps2pdf.  The main disadvantage to directly producing .pdf output from latex when editing your .tex source file is that once Adobe Reader has a file open, latex cannot modify the file on the disk.  dvi previewers like YAP do not have this problem.