next up previous


Using on UNIX Systems



Running or , Previewing, and Printing

There are three steps to using or on Linux, Cygwin, and other UNIX environments:
1.
Prepare your or file using a UNIX editor, such as emacs, vi or gedit.
2.
Process the file by running , , or pdf.
3.
Preview and/or print the result.
Prepare your source file using your favorite UNIX editor, giving it a name that ends with the extension .tex (for example, myfile.tex). The file will contain both your text and the or commands to format the text.

If you are unfamiliar with and , we recommend learning . To get started, see the training web page, http://www.rpi.edu/dept/arc/training/latex/, and pick up Memo RPI109, Text Formatting with , at the VCC Help Desk or from the web.

If you are planning to write a thesis, be sure to view the thesis web page at
http://helpdesk.rpi.edu/update.do?artcenterkey=325 and read the recommended documentation, especially ARC Memo 110, Preparing a Thesis with , and Creating a PDF File from a LaTeX Thesis.

The commands below illustrate how to process an example file called myfile.tex, preview the result on your screen, and prepare a PostScript or PDF file for printing. The following commands assume that the file myfile.tex contains your (or ) code. Note that the filename extensions .tex and .dvi are optional when running -related programs.

To process the .tex file

   latex myfile             Note that you may omit the .tex extension.
       or                    
   tex myfile               Output from or will be placed in the file myfile.dvi.
       or
   pdflatex myfile          Out from pdf will be placed in myfile.pdf.  

To preview the result

   xdvi myfile &            Displays output on the screen.
                            Note that you may omit the .dvi extension.

To prepare a PostScript file for subsequent printing or converting to PDF

   dvips myfile             Processes myfile.dvi, putting PostScript output in myfile.ps.    
   dvips myfile -o          If the above command sends the output to the default printer,
                            append -o to put output in the file myfile.ps.    

You can use the -pp option on the dvips command to process selected pages from the .dvi file:

   dvips -pp6-9 myfile [-o] Puts pages 6 through 9 in the file myfile.ps.

Responding to Errors

When the or encounters a syntax error, it will emit an error message ending with a ``?'' prompt. The most common way to respond is either to press Return to continue and hope for the best, or to type x to exit the program, fix the error, and try again.

If the program stops with a * prompt, it is awaiting input from you. It usually means you have forgotten to end the document. For enter \end{document}; for enter \end.

If the program does not recognize the name of the input file you specified, It will stop and ask you for another filename. If you don't want to enter a new filename at this point, you can quit the program by pressing Ctrl-d (that is, hold down the Ctrl key, press "d", and then release both keys). This sequence can be used any time to stop or in the middle of its execution.

Packages

If you sometimes have formatting requirements which are not handled easily by the core program, you may be able to solve your problem by using a package. Many enhancements to are provided by packages. Some packages, for example the graphicx package for including graphics files, are part of every distribution; many others are almost always included; and some less frequently-used packages can be downloaded if needed. A package consists of one or more files that contain extra definitions and macros. The file names usually have the extension .sty. To use a package, you must first load it in your preamble with a command of the form:
   \usepackage{package}
To find out about the packages available, see The Catalogue Online at
http://texcatalogue.sarovar.org/.

For More Information about

The training web page, http://www.rpi.edu/dept/arc/training/latex/, has many links to useful documents including an FAQ, a longer tutorial more complete than Memo RPI.109, further information on math, lists of symbols, and the graphics examples listed below.

Information on including graphics

For a short explanation and examples on including graphics, see:
http://www.rpi.edu/dept/arc/training/latex/Examples/graphics.pdf
and be sure to view the following .tex file to see the commands used to create it:
http://www.rpi.edu/dept/arc/training/latex/Examples/graphics.tex

The example file exrotating.pdf and it's corresponding file exrotating.tex show how to include landscape figures and tables:
http://www.rpi.edu/dept/arc/training/latex/Examples/exrotating.pdf
http://www.rpi.edu/dept/arc/training/latex/Examples/exrotating.tex

Official documentation for the 's graphics bundle is in grfguide.pdf; look for it on your system. The information on the graphicx package is in Section 4.4.

For an exhaustive treatment of including graphics, see Using Imported Graphics in 2e. You can find it at http://www.ctan.org/tex-archive/info/epslatex.pdf.

About this document ...

Published by Academic and Research Computing, RPI, Troy, NY 12180
next up previous
Send comments to consult@rpi.edu.