How to run LaTeXDavid Sherrill Fri Jan 26 11:00:04 EST 1996
What Is LaTeX?
Which LaTeX? Sometime in 1995, we at CCQC converted to LaTeX . I have not yet converted all my sample documents, but they should still work; the new LaTeX invokes a compatibility mode to process the old documents. All LaTeX files should begin with documentclass instead of the older documentstyle. If you have problems running the new LaTeX , it may be because you're running the wrong binary, or because the old environmental variables $TEXFONTS and $XDVIFONTS should no longer be used. How Do You Run LaTeX? After you have created a LaTeX file (which must end with a .tex suffix), you are ready to run LaTeX. To run LaTeX, type latex filename.texand LaTeX will format your file, assuming it conforms to the required syntax. Remember that the last line of your document needs to be
\end{document}
or else LaTeX will hang up and wait for more input. If this happens, use control-D to abort.
The information LaTeX prints as it does the formatting is rather confusing and generally unhelpful. If an error occurs, it is usually best to type exit. This causes LaTeX will quit and call up your default editor (e.g. vi). The cursor will automatically go to the line that caused the error. Typing quit will quit LaTeX without calling up the editor. If everything goes well, LaTeX will output a file with the same name as the input file, but with a .dvi extension (for ``device-independent'' format). LaTeX also produces some temporary files with .log and .aux extensions. The .log file may be of some use in tracking down errors. There is no reason to keep these files after you've printed out the document. You can examine the .dvi file by typing xdvi filename.dviThis will bring up a previewer screen. The mouse buttons cause magnification windows of different sizes to appear. There are icons to click for paging forward or backward in the document, or you can use the keys n and p. Use q to quit the xdvi previewer. To print out the document, you must convert the .dvi file to a Postscript file. This is accomplished using either of the programs dvips or dvi2ps. For certain cases involving graphics (via xfig), dvips seems to work better. There is generally no reason to store the Postscript file on disk; in most cases it is best to pipe the output of dvi2ps directly to the Postscript printer. This is accomplished by dvi2ps filename.dvi | lpr -Php3The program dvips automatically sends its output to the printer. If you need dvips to output to a file, use the -o flag, as in dvips -pp 1-5 -o filename.ps filename.dviThis example also shows how to print only pages 1-5, using the -pp flag. Where To Get Help The book of all knowledge for LaTeX is Leslie Lamport's LaTeX: A Document Preparation System, Addison-Wesley, 1986. Unfortunately, this book isn't always easy to read, and the index is badly organized. Other, more readable, books are also available. The best of the rest is The LaTeX Companion, by Michel Goossens, Frank Mittelbach, and Alexander Samarin (Addison-Wesley, 1994). This book contains lots of information and examples which are not in Lamport's book. However, it is meant as a companion, and not as a replacement for Lamport's book, so you may want to buy both books. There are some helpful documents in /usr/local/tex/inputs/latex and in /usr/local/tex/doc. Several example files reside in ~sherrill/Text/Samples. |
