Using
LATEX Rensselaer at Hartford
Nov 2, 2000
For LATEX Version 2.09
LATEX runs on a variety of computers
at many different sites. This document tells you how to use
LATEX on Rensselaer at Hartford Unix sites running the standardly
distributed Unix version of TEX and LATEX. It is not about
LATEX itself, which is described in the manual-LATEX: A Document
Preparation System, available from Addison-Wesley (ISBN 0-201-15790-X).
If you have a question that you can't answer
by reading the manual and this document, ask Technical and
Information Services Staff. They should also be informed of
any possible LATEX bugs or undocumented anomalies.
1 Getting Started
1.1 Running a Sample File
Before preparing your own documents, you may want to get acquainted
with LATEX by running it on a sample input file. First make
your own copy of the file sample.tex by typing the following
Unix command:
cp /home/common/tutorials/latex/sample.tex
.
(You must type the space followed by the period at the end.
This and all other Unix commands are ended by typing return.)
A copy of the file sample.tex is now in your current directory;
you can edit it just like any other file. If you destroy or
mess up your copy, typing the above command again gets you
a fresh one.
Next, run LATEX on the file sample.tex by typing:
latex sample
When LATEX has finished, it will have produced the file sample.dvi
in your directory. You can print this file by typing the command:
dvips [-Pprinter] sample.dvi
The output will be produced on your site's
local postscript printer. The ``-P'' and printer arguments
are optional. After it has been printed, you can delete sample.dvi
by typing
rm sample.dvi
LATEX users can use the dviselect command on the file sample.tex
by typing:
dviselect -i sample.dvi -o outfile.dvi firstpage:lastpage
For example, if you have a 6 page LATEX dvi file called paper.dvi,
a two page dvi file, temp.dvi, consisting of only the third
and fourth pages can be created using the following command:
dviselect -i paper.dvi -o temp.dvi 3:4
The temp.dvi file can be printed on the laser printer using
the standard dvips command. See the dviselect manual page
for further details.
1.2 Preparing and Running LATEX on
Your Own Files
You must use a text editor to prepare an input file for LATEX.
Contact your computer's administrator for more information
on the text editors available to you. The easiest way to start
learning about LATEX is by examining the file small.tex with
your text editor. You can obtain your own copy of this file,
in your directory, by typing the command
cp /home/common/tutorials/latex/small.tex
.
After you have prepared your file, whose name should have
the extension tex, you must run it through LATEX and print
the output. Follow the instructions in Section 1.1, except
substitute the first name of your file for ``sample''. Remember
to save disk space by deleting the dvi file after printing
the output.
When running LATEX on your own file you will
probably get error messages ending with a ?.
Some of your options are:
- <return> To continue
past this error.
- i <command> <return>
To replace bad or misspelled command in your text with another.
- e To get directly into
the vi editor at the place where the error is.
- h For help messages.
- x To exit.
TEX may write an * and stop without any error message. This
is probably due to a missing \end{document} command, but other
errors can cause it. Type \stop <return> to continue.
If you want to stop LATEX in the middle of
its execution, perhaps because it is printing a seemingly
unending string of uninformative error messages, type Control-C
(press C while holding down the key labeled CTRL ). This will
make LATEX stop as if it had encountered an ordinary error,
and you can return to Unix command level by typing X, as described
in the manual. If typing Control-C doesn't work, typing Control-Z
will get you immediately to Unix command level, but this will
leave a stopped job hanging around. A stopped job won't hurt
anything and will usually disappear when you log out, but
it forces you to type two successive logout commands to log
out.
To use the spell program for finding spelling
errors in a LATEX input file named myfile.tex, type the following
command:
detex myfile.tex | spell
This will type a list of possibly misspelled words on your
terminal. If you'd rather have the output written to a file
named foo.bar, type
detex myfile.tex | spell >foo.bar
1.3 Previewing LATEX Documents
LATEX documents may be previewed on the Sun workstations by
using the following command.
1.3.1 xdvi
Under X or OpenWindows environments use xdvi command by typing:
xdvi myfile.dvi
See the xdvi manual page for more information.
2 Carrying On
2.1 LATEX on Unix
The only special problems in using LATEX caused by the Unix
operating system involve the way Unix handles files. The first
problem arises because, when a program starts to write a file,
Unix destroys the previous version of that file. Thus, if
an error forces you to stop LATEX prematurely (by typing Control-C
or Control-Z ), then the files that LATEX was writing are
incomplete, and the previous complete versions have been destroyed.
You probably don't care about the output on the dvi file,
but, if you are making a table of contents or using cross-referencing
commands, then LATEX also writes one or more auxiliary files
that it reads the next time it processes the same input file.
If the auxiliary files are incomplete because LATEX was stopped
before reaching the end of its input file, then the table
of contents and cross-references will be incorrect the next
time LATEX is run on the same input file. You will have to
run LATEX a second time to get them right. If you want to
avoid having to run LATEX twice after making an error-for
example, if your input is very long-then you should save copies
of these auxiliary files before running LATEX. An input file
named myfile.tex and all the auxiliary files produced by LATEX
from it are included in the Unix file specifier myfile.*.
Use the Unix cp command to save copies of these files.
The second problem in using LATEX on Unix
involves the files that LATEX reads. The file whose name you
type with Unix's latex command is called the root file. In
addition to reading the root file, LATEX also reads the files
specified by \input and \include commands. With the Unix directory
system, LATEX must know not only the names of these file but
also on what directories they are. It will have no problem
finding the correct files if you follow two simple rules:
- Run LATEX from the directory containing
the root file.
- Keep all files specified by \input and
\include commands in the same directory as the root file.
If you follow these rules, you never have
to type an Unix path specifier when using LATEX.
You should never break the first rule, otherwise
LATEX will have trouble finding auxiliary files. (To run LATEX
on someone else's file, copy the file to your directory.)
If you break the second rule, specifying a file from another
directory in an \input or \include command, you must use a
complete path name. For example, to include the file hisfile.tex
from Jones' directory /foo/bar, you can type
\include{/udir/jones/foo/bar/hisfile}
A ~ character may not appear in the argument
of an \input or \include command, so you can't use a file
name such as ~jones/foo/bar/hisfile.
For people who don't like to obey rules,
here is exactly how LATEX finds its files. The root file is
found by Unix according to its usual rules. LATEX's auxiliary
files are read and written in the directory from which it
is run. All file names specified in the LATEX input, including
the names of document-style (sty) files specified by the \documentstyle
command, are interpreted relative to the directory from which
LATEX is run. If LATEX does not find a file starting in this
directory, it looks in the system directory /usr/local/lib/tex/inputs.
You can change the directories in which LATEX looks for its
input files by setting the environment variable TEXINPUTS.
Putting the command
setenv TEXINPUTS :.:/udir/jones/myown:/usr/local/tex/macros:
in your .login file causes LATEX to look
for files first in the current directory, then in Jones' /myown
directory, and then in the system directory. You might want
to do this if your name is Jones and you have your own personal
document-style files in your /myown directory.
2.2 Document Styles
2.2.1 Special Styles
The only document styles or style options currently available
here that are not described in the manual are the proc and
the galley style options for making camera-ready copy for
conference proceedings.
2.2.2 The proc Style Option
The proc option is used with the article document style. It
produces two-column output for ACM and IEEE conference proceedings.
The command \copyrightspace makes the blank space at the bottom
of the first column of the first page, where the proceedings
editor will insert a copyright notice. This command works
by producing a blank footnote, so it is placed in the text
of the first column. It must go after any \footnote command
that generates a footnote in that column.
LATEX automatically numbers the output pages.
It's a good idea to identify the paper on each page of output.
Placing the command
\markright{Jones---Foo}
in the preamble (before the \begin{document} command) prints
``Jones-Foo'' at the bottom of each page.
2.2.3 The galley Style Option
The galley option is used with the article document style.
It produces two-column output for Rensselaer at Hartford Computer
Science Conference Proceedings.
A sample document, galley.tex, can be copied
to your directory by typing the following command:
cp /home/common/tutorials/latex/galley.tex
.
You can run LATEX on galley.tex in the usual way.
2.3 Where
the Files Are
All LATEX files mentioned in the manual, including the sty
and doc files, are in the directory /apps/net/tex/inputs.
Fonts are stored in /apps/net/tex/fonts. The *.tfm files are
used by TEX and LATEX. The *.*pk files are pixel files used
by pstex and other device drivers.
2.4 Running
lablst.tex and idx.tex
A list of labels and citations in an input file is printed
by running LATEX on the input file lablst.tex, which is done
by typing
latex lablst
LATEX will then ask for the name of the input file, which
should be typed without an extension, and for the name of
the main document style (e.g., article), used by that file.
The index entries on an idx file are printed by running LATEX
on the file idx.tex, which is done by typing
latex idx
LATEX will ask for the name of the idx file, which is typed
without an extension.
2.5 Differences
from the Manual
All LATEX features described in the manual are provided by
the Unix implementation.
2.6 Fonts
Almost all the symbols available on our fonts can be generated
by ordinary LATEX commands. However, there are type sizes
not obtainable by LATEX's size-changing commands with the
ordinary document styles. Consult a local TEX expert to find
the TEX name for such a font.
Tables and allow you to determine if the
font for a type style at a particular size is preloaded, loaded
on demand, or unavailable.
size default (10pt) 11pt option 12pt option
\tiny 5pt 6pt 6pt
\scriptsize 7pt 8pt 8pt
\normalsize 10pt 11pt 12pt
\large 12pt 12pt 14pt
\Large 14pt 14pt 17pt
\LARGE 17pt 17pt 20pt
\huge 20pt 20pt 25pt
\Huge 25pt 25pt 25pt
Table 1: Type sizes for LATEX size-changing commands.
\it \bf \sl \sf \sc \tt
5pt D D X X X X
6pt X D X X X X
7pt P D X X X X
8pt P D D D D D
9pt P P D D D P
10pt P P P P D P
11pt P P P P D P
12pt P P P P D P
14pt D P D D D D
17pt D P D D D D
20pt D D D D D D
25pt X D X X X X
Table 2: Font classes: P = preloaded, D = loaded on demand,
X = unavailable.
Table 1 tells you what size of type is used
for each LATEX type-size command in the various document-style
options. For example, with the 12pt option, the \large declaration
causes LATEX to use 14pt type. Table 2 tells, for every type
size, to which class of fonts each type style belongs. For
example, in 14pt type, \bf uses a preloaded font and the other
five type-style commands use load-on-demand fonts. Roman (\rm)
and math italic (\mit) fonts are all preloaded; the \em declaration
uses either italic (\it) or roman.
2.7 Special Versions
No foreign-language or other special versions of LATEX are
currently available at Rensselaer at Hartford.
Back to top
|