LaTeX is a typesetting system which is very popular with computer scientists and engineers.

The .tex files on this Web site are written in the LaTeX language. You can read them as is, if you like; the embedded LaTeX commands are distracting, but you still can get the general idea of what is going on. However, it is much easier to view them out in processed form. Here is how to do this.

Now, say you have copied a LaTeX source file to your own directory, and named it g.tex. Note: Some of the .tex files do "includes" of .eps (or .PS) files, which are Encapsulated Postscript, output of the xfig drawing program. So, if you copy a .tex file from a given directory, make sure to copy all the .eps files from that directory too, and similarly for .sty LaTeX style files. (One file which you may need but may be missing is fancyheadings.sty; click here to obtain it.) Then type

```  latex g.tex
```

which produces an output file, g.dvi (which is why it is necessary to do this in your own directory).

Note: You may find that you get a fonts error message. If so, execute

```  unsetenv TEXFONTS
```

By the way, for some LaTeX features you must run latex more than once. For instance, if you do page referencing (e.g. "the note on page 37"), you must run latex twice. If you use \tableofcontents, you may have to run latex several times, in order for the page numbers to be correct. (This is because the table of contents itself occupies one or more pages.)

At this point you may either view the processed file in an X11 window, or print a hard copy. (In order to save paper, try viewing first.)

To view in an X11 window, type

```   xdvi g.dvi &
```

(Note: If there are included .eps files, some versions of xdvi will not display those files, and you will see blank space where the graphics should be. In such cases, you will have to resort to using dvips -f as discussed below.) If the fonts are uncomfortably small, click on one of the Shrink icons; move around within the image using the arrow keys.

To print a hard copy of the file

```   dvips g.dvi
```

You can also make a Postscript version of the file. This is nice, because it can be printed on most laser printers. It is also convenient if you wish to e-mail your document to a friend who does not know LaTeX. To make the Postscript file, type

```   dvips -f < g.dvi > g.ps
```

The Postscript output file g.ps can be viewed from an X window by using either gs or ghostview, or you can make a hard copy by

```   lpr g.ps
```

These days PDF files are more generally useful than Postscript, e.g. for Web use. One can use utilities like dvipdf to convert DVI to Postscript, but it is much easier simply to use pdflatex instead of latex in the first place. View/print using xpdf (faster) or Acroread.