C. David Sherrill
School of Chemistry and Biochemistry
Georgia Institute of Technology
Revised November 2000
setenv TEXHOME /home/users/sherrill setenv TEXINPUTS ../:./:$TEXHOME/TeX//:/usr/local/latex2html/texinputs/: setenv BIBINPUTS ../:./:$TEXHOME/Text/dsdb/:$TEXHOME/TeX//:/usr/local/latex2html/texinputs/: setenv BSTINPUTS ../:./:$TEXHOME/Text/dsdb/:$TEXHOME/TeX//:/usr/local/latex2html/texinputs/:
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 vi. The cursor will automatically go to the line that caused the error. Typing quit will quit LATEX without calling up vi.
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 dvips directly to a Postscript printer. Assuming your Postscript printer is set as the default printer, this is accomplished by
dvips filename.dvi
\cite{Sherrill:99:CI}When this occurs in the text, it automatically creates a citation (usually denoted by a number in brackets or a superscript) and a corresponding entry in the list of references. BibTeX is the program which looks through the given database(s) (files with a .bib suffix) to find the reference and place it in a local bibliography file (with a .bbl suffix). To use BibTeX, you need two lines in the .tex file such as:
\bibliographystyle{aip} \bibliography{jrncodes,mainbib-ds,c2h2,refs}This will format the bibliography in the AIP (American Institute of Physics) style and use the databases jrncodes, mainbib-ds, c2h2, and refs. All of these databases have the suffix .bib.
The procedure for using BibTeX is as follows: (1) Run LATEX once; (2) Run BibTeX once (e.g., bibtex filebasename) -- do not include a suffix here; (3) Run LATEX again to have it pick up the bibliography info; (4) Run LATEX once again to make sure the references are all in the right order and all filled in properly.
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.
Some documentation usually comes with the TeX package, you might look around for it. Several example files reside in sherrill/Text/Samples.