LaTeX Tutorials


While the typesetting markup language LaTeX is at first frustrating to most people used to Word, its power becomes clear rather quickly. A number of different samples are provided here. Each zip file below contains a tex file and the postscript output of that file, along with other saved postscript plots which are used in the files. In order to get a feel for creating files in LaTeX, feel free to make edits to the file, compile the tex file, and observe the changes in the postscript file. While getting accustomed to LaTeX, it is not a bad idea to simply copy the "guts" of one of the sample files and use that as a basis for writing your lab reports.




Compiling TeX Files


In order to actually go about compiling a tex file and producing a postscript file for printing, there are a few simple steps to follow (all of which are typed at the Unix prompt).


/home/username% latex filename.tex
/home/username% dvips filename.dvi
/home/username% gv filename.ps &
/home/username% lp filename.ps

The first step in the process compiles the tex file you have written. Often times, there will be error messages, which will (usually) point out the line where the problem occurs. Other times, warnings are printed. These occur most often when referencing a figure for the first time or when adding a new figure, and indicate that the internal labelling which LaTeX does might not be right. To solve the problem, simply repeat the first step a second time.


When you are just working on your paper, and want to compile and see how your paper looks, you do not need to worry about converting to postscript. Instead, you can simply view the dvi file in xdvi, which will instantly log changes after compilation of the tex file.


/home/username% latex filename.tex
/home/username% xdvi filename.dvi &