Document Preparation

LaTeX and TeX

TEX is
a document preparation system developed at Stanford University by Donald Knuth. It allows a user to typeset a document by embedding commands within a text file; it is a public-domain package that is available for a range of different platforms. TEX is an extremely complex program and is difficult to learn and master; LATEX is a set of macros that makes the document creation process a bit easier.

Using TEX or LATEX is a three-step process:

  1. Create a source file containing text and valid TEX commands. You create the source file using whatever text editor you use for editing any other text file.

  2. Run the TEX or LATEX processor (as appropriate) to produce a device-independent (DVI) file. The LATEX processor is the LATEX command, which takes the name of the source file as an argument. The TEX processor is the TEX command.

  3. Translate the DVI file for a specific device, sending the output to a printer. This is done using the PTEX command.

Two books are standard references for TEX users: The TEXbook, by Donald Knuth, and LATEX: A Document Preparation System, by Leslie Lamport. Both are published by Addison-Wesley and are available in the Johns Hopkins book store in Gilman Hall. A number of other books are available to help you learn TEX. Beginning LATEX users do not need The TEXbook.

Beginners should look at the document First Grade TEX: A Beginner's TEX Manual, by Arthur L. Samuel, and A Sample Document Produced with LATEX, or Getting Your Ducks in a Row, by Rusty Whitman. A copy of both documents is available on line--check with the Science Software Support Office for details.

All TEX and LATEX users should get a copy of the manual Using TEX and LATEX at STScI, which was written by Harry Payne in November 1992 and explains how TEX is used and how to troubleshoot common problems. There is also a chapter about using TEX and LATEX in the STScI Software Guide.


TEXSPELL is a spelling checker that is sensitive to embedded TEX and LATEX commands.

Figure 5.6 shows a sample TEXSPELL screen. In this example, the program doesn't know that "SCIVAX" is really a word here at the Institute. You could press the key to insert the word "SCIVAX" into a personal dictionary file, PERSDICT.DAT, in your home directory so that the program never again picks up "SCIVAX" as an incorrect word. You can browse through the personal dictionary file to see what's in it, but don't try to edit the file yourself or the file will never again work with TEXSPELL.

Figure 5.6: Sample TEXSPELL Screen

To use TEXSPELL, you first create your TEX file and then type the following command:

$ TEXSPELL filename
When the program is done, press the key to quit and any spelling corrections will be saved as the program

Figure 5.6: - Sample TEXSPELL Screen

Generated with CERN WebMaker