Next Previous Contents

## The TeX family: processing, viewing and printing

In this section, TeX will mean any of the programs of the TeX "family", that is, tex, latex, amstex and amslatex. If I mean a particular program I will write it in small case. TeX assume that the files to be processed (not viewed or printed!) end in .tex

Processing

Perhaps the only difficulty with TeX is to decide what type of program (tex, latex....) one has to run on a given file. Of course, if the file has been written by you, it should be no problem to decide which one to use. However, if you got the file from the Internet, or by email, you will have to do some guessing. Here are some hints:

• Files to be processed with tex or amstex usually start with

\input

You can run it with
   tex file.tex

or
   amstex file.tex

(AMSTeX files might have something like \input amsppt).
• File to be processed with latex (amslatex is just latex) start with

\documenclass

for the latex version of LaTeX, or
   \documentstyle

for the older version.
You can always try one of the programs, and if it does not work, another one. As long as you just run TeX the original file will not be changed.

Viewing: xdvi, gv

After running TeX, a file called file.dvi (the original file was file.tex) will be created. This file contain the result of your TeX. To view it you need to be in an X-windows session (well, not quite so, but viewing a DVI file in a text console is not so nice). Just do


xdvi file.dvi

If you want to view the file that will be actually printed (as PostScript, or ps file), do first

dvips file.dvi

which will create file.ps You can view it with

gv file.ps

Or if that does not work try

ghostview file.ps


Printing

DVI (and PS) files can be printed with lpr or prtmgr The second program is menu driven and it has lots of options to print (different printers, output in both sides of the paper, several pages combined, selection of pages....). However, if you want to print directly you can do


lpr -Pprinter-name file.dvi

or file.ps printer-name stands for the name of the printer. Since new printers get added to the system I can't tell here what printers are available; try

/usr/sbin/lpc status

to see all availables printers. Or, if you prefer more complicate program, do

/usr/sbin/lpc status | grep ^[a-z]


xfig

You can easily create (basic) figures with xfig to be later included in a LaTeX file. the best way to call xfig is with the following (long) command


xfig -specialtext -latexfonts -startlatexFont default

Use the mouse to make the figure, save it, and then use the Export option to save it in PS format. Suppose the file has been saved as figure.ps; to include it in a LaTeX file just add the following lines at the point where you want the figure:

\begin{figure}[ht]
\centerline{\psfigure{figure=figure.ps,height=5cm,width=5.5cm}}
\caption{A figure in LaTeX}
\end{figure}

You can change the height and width to make it look nicer. The exact point where the figure will be printed may be not where you included the above lines; some time, due to line or page breaks, the figure will come in another, close, point of the file.

ispell

ispell is a program used to check spelling of files. In a text (ASCII) file you can use it like this:


ispell file-name

or like

ispell -x file-name

if you do not want a backup copy of your file to be made. For a file with TeX commands it is better to use ispell as this:

ispell -t -x file.tex

where the -t option will skip some of the TeX commands.

Here are some of the key strokes that you can use while doing ispell in a file:

key             action
----------------------------------------------
r               replace a wrong work
a               accept a wod for the rest of the ispell session
i               insert a work in your private dictionary
u               as i but accepting small/upper cases
space-bar       continue, do not make changes
x               exit
number          replace the work by the option with that number


Next Previous Contents