LDP/LDP/howto/linuxdoc/TeTeX-HOWTO.sgml

2321 lines
98 KiB
Plaintext

<!doctype linuxdoc system>
<article>
<title>The teTeX HOWTO: The Linux-teTeX Local Guide
<author>Robert Kiesling
<date>v3.7, 9 November 1998
<abstract>
This document covers the basic installation and usage of the teTeX TeX
and LaTeX implementation under the major U.S. Linux distributions, and
auxiliary packages like Ghostscript. Contents of the teTeX HOWTO: The
Linux-teTeX Local Guide are Copyright (C) 1997, 1998 by Robert A. Kiesling.
The exact terms of copying are given in the introduction and the
appendices. Registered trademarks are the property of their
respective owners. Please send all complaints, suggestions, errata,
and any miscellany to <htmlurl url="mailto:kiesling@ix.netcom.com"
name = "kiesling@ix.netcom.com">, so I can keep this document as
complete and up to date as possible.
</abstract>
<toc>
<sect>Introduction.
<P>
<sect1>Copyright.
<P>
The teTeX-HOWTO is copyright (C) 1997, 1998 by Robert Kiesling.
Permission is granted to make and distribute verbatim copies of this
manual provided that the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that
the sections entitled, ``Distribution,'' and, ``GNU General Public
License,'' are included exactly as in the original, and provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions. except that the sections entitled, ``Distribution,'' and,
``GNU General Public License,'' may be included in a translation
approved by the Free Software Foundation instead of in the original
English. Please refer to Section
<ref id="copyright" name="Distribution and Copyright"> for terms of copying.
<sect1>Software described in this document.
<P>
TeX handles only the formatting part of the document preparation.
Generating output from TeX is like compiling source code into object
code, which still needs to be linked. You prepare an input file with
a text editor----what most people think of as ``word processing''---
and format the input file document with TeX to produce a
device-independent output file, called a <tt>.dvi</tt> file.
You also need a program or two to translate TeX's <tt>.dvi</tt> output
for your screen and printer. These programs are collectively known as
``dviware.'' For example, TeX itself only makes requests for fonts.
It is up to the <tt>.dvi</tt> output translator to provide the actual
font for the output regardless of whether the medium is a video screen
or paper. This extra step may seem overly complicated, but the
abstraction allows documents to display the same on different devices
with little or no change to the original document.
<sect2>teTeX.
<P>
TeX is implemented for practically every serious computer system in
the world---and quite a few ``non-serious'' ones---so implementors
must provide the installation facilities for all of them. This
accounts in part for teTeX's complexity, in addition to the inherent
complexity of any TeX installation. It also accounts for the fact
that installing the system yourself is a significant task, and unless
you are already familiar with TeX, it is easy to get lost in the
numerous executable programs, TeX files, documentation, and fonts.
Fortunately, teTeX is part of the GNU/Linux distribution. You can
install the package much more easily using GNU/Linux installation
tools. You may already have teTeX installed on your system. If so,
you can skip ahead to Section <ref id="sec-using" name="Using teTeX">.
However, if you want to install the package, the archives necessary
for a workable teTeX installation are on the CTAN archive network.
There is a list of these sites in Section <ref id="ctan-list"
name="CTAN site list">.
CTAN is the Comprehensive TeX Archive Network, a series of anonymous
FTP sites that archive TeX programs, macros, fonts, and documentation.
In the course of using TeX you'll probably become familiar with at
least one CTAN site. In this document, a pathname like
<tt>&tilde;CTAN/contrib/pstricks</tt> means ``look in the directory
<tt>contrib/pstricks</tt> of your nearest CTAN site.''
The installation of the generic teTeX distribution described in
Section <ref id="ctan-install" name="Installing the CTAN teTeX
distribution"> concentrates on the Intel versions of Linux.
Installing teTeX on other hardware should require only substituting
the appropriate executable program archive in the installation
process.
In addition to the executable programs, the distribution includes all
of the TeX and LaTeX package, <tt>metafont</tt> and its sources,
<tt>bibtex, makeindex,</tt> and <em>all</em> of the
documentation... more than 4 megabytes' worth. The documentation
covers everything you will forseeably need to know to get started.
So, you should install all of the documents. Not only will you
eventually read them, the documents themselves provide many examples
of ``live'' TeX and LaTeX code.
TeX was written by Professor Donald Knuth of Stanford University. It
is a lower-level typesetting language for all of the higher-level
packages like LaTeX. Essentially, LaTeX is a set of TeX macros that
provide convenient, predefined document formats for end users. If you
like the formats provided by LaTeX, you may never need to learn
bare-bones TeX programming. The difference between the two languages
is like the difference between assembly language and C. You can have
the speed and flexibility of TeX, or the convenience of LaTeX.
By the way, the letters of the word ``TeX'' are Greek,
tau-epsilon-chi. It is not a fraternity, but the root of the Greek
word, <em>techne,</em> which means art and/or science. ``TeX'' is not
pronounced like the first syllable in ``Texas.'' The <em>chi</em> has
no English equivalent, but TeX is generally pronounced so that it
rhymes with ``yecch,'' to use Professor Knuth's example from <em>The
TeXBook,</em> which is one of the standard TeX references. When
writing, ``TeX,'' on character devices, always use the standard
capitalization, or the <tt>&bsol;TeX{}</tt> macro in typesetting.
<sect2>Text editors.
<P>
Any of the editors that work under Linux---<tt>jed, joe, jove,
vi, vim, stevie,</tt> Emacs, and microemacs---will work to prepare a
TeX input file, as long as the editor reads and writes plain-vanilla
ASCII text. My preference is GNU Emacs. There are several reasons
for this:
<itemize>
<item>You can format, preview and print documents with Emacs's
TeX and LaTeX modes.
<item>Emacs can automatically insert TeX-style, ``curly
quotes,'' as you type, rather than the &dquot;ASCII-vanilla&dquot;
kind.
<item>Emacs has integrated support for Texinfo, a hypertext
documentation system.
<item>Emacs is widely supported. Versions 19.34 and later, for example,
are included in the major U.S. Linux distributions. The most recent
version from the GNU archives is 20.3.
<item>Emacs does everything except butter the
toast in the morning.
<item>Emacs is free.
</itemize>
<sect2><tt>dvips</tt>.
<P>
Tomas Rokicki's <tt>dvips</tt> generates Postscript from a
<tt>.dvi</tt> file. In addition, it runs Metafont if necessary to
generate the bit mapped fonts it needs or uses Postscript fonts for
the output. It can also crop and resize pages and perform graphics
translations from instructions in a TeX or LaTeX file,
The <tt>dvips</tt> program is part of the teTeX distribution. It is
discussed fully in Section <ref id="dvips"
name="Mixing text and graphics with <tt>dvips</tt>">
<sect2>Fonts.
<P>
Much of TeX's, and therefore LaTeX's, complexity, arises from its
implementation of various font systems, and the way these fonts are
specified. A major improvement of LaTeX 2e over its predecessor was
the way users specify fonts, the former New Font Selection Scheme.
They're discussed in Section <ref id="characters" name="Characters and
type styles">, Section <ref id="tex-font-commands" name="TeX Font
Commands">, and Section <ref id="postscript-fonts" name="Using Postscript
fonts">.)
teTeX comes distributed with about a dozen standard fonts preloaded,
which is enough to get you started. Also provided are the font
metrics descriptions, in <tt>.tfm</tt> (TeX font metric) files. To
generate the other fonts that you need, it is simply a matter of
installing the <tt>metafont</tt> sources. teTeX's <tt>.dvi</tt>
utilities will invoke <tt>metafont</tt> automatically and generate the
Computer Modern fonts you need.
<sect>Using teTeX.<label id="sec-using">
<P>
Theoretically, at least, everything is installed correctly and is
ready to run. teTeX is a very large software package. As with any
complex software package, you'll want to start by learning teTeX
slowly, instead of being overwhelmed by its complexity.
At the same time, we want the software to do something useful. So
instead of watching TeX typeset
<verb>
``Hello, World!''
</verb>
as Professor Knuth suggests, we'll produce a couple of teTeX's own
documents in order to test it.
<sect1>Printing the documentation. <label id="print-documentation">
<P>
You should be logged in as <tt>root</tt> the first few times you run
teTeX. If you aren't, Metafont may not be able to create the
necessary directories for its fonts. The <tt>texconfig</tt> program
includes an option to make the font directories world-writable, but if
you're working on a multi-user system, security considerations may
make this option impractical or undesirable.
In either instance, if you don't have the appropriate permissions to
write to the directories where the fonts are stored, Metafont will
complain loudly because it can't make the directories. You won't see
any output because you have a bunch of zero-length font characters.
This is no problem. Simply log out, re-login as <tt>root,</tt> and
repeat the offending operation.
The nice thing about teTeX is that, if you blow it, no real harm is
done. It's not like a compiler, where, say, you will trash the root
partition if a pointer goes astray. What, you haven't read the teTeX
manual yet? Of course you haven't. It's still in the distribution,
in source code form, waiting to be output.
So, without further delay, you will want to read the teTeX manual.
It's located in the directory
<verb>
/usr/lib/teTeX/texmf/doc/tetex.
</verb>
The LaTeX source for the manual is called <tt>TETEXDOC.tex</tt>. (The
<tt>.tex</tt> extension is used for both TeX and LaTeX files. Some
editors, like Emacs, can tell the difference.) There is also a file
<tt>TETEXDOC.dvi</tt> included with the distribution, which you might
want to keep in a safe place---say, another directory ---in case you
want to test your <tt>.dvi</tt> drivers later. With that out of the
way, type
<verb>
latex TETEXDOC.tex
</verb>
LaTeX will print several warnings. The first,
<verb>
LaTeX Warning: Label(s) may have changed. Rerun to get the
cross-references right.
</verb>
is standard. It's common to build a document's Table of Contents by
LaTeXing the document twice. So, repeat the command. The other
warnings can be safely ignored. They simply are informing you that
some of the FTP paths mentioned in the documentation are too wide for
their alloted spaces. Sections <ref id="para-dimen" name="Paragraph
styles and dimensions"> and <ref id="tolerances" name="Tolerances">
describe horizontal spacing in more detail.
teTeX will have generated several files from <tt>TETEXDOC.tex.</tt>
The one that we're interested in is <tt>TETEXDOC.dvi.</tt> This is the
device-independent output which you can send either to the screen or
the printer. If you're running teTeX under the X Windows System, you
can preview the document with <tt>xdvi</tt>.
For the present, let's assume that you have a HP LaserJet II. You
would give the command
<verb>
dvilj2 TETEXDOC.dvi
</verb>
which writes a PCL output file from <tt>TETEXDOC.dvi</tt>, including
soft fonts which will be downloaded to the LaserJet. This is
<em>not</em> a feature of TeX or LaTeX, but a feature provided by
<tt>dvilj2</tt>. Other <tt>.dvi</tt> drivers provide features that
are relevant to the devices they support. <tt>dvilj2</tt> tries to
fill the font requests which were made in the original LaTeX document
with the closest equivalents available on the system. In the case
of a plain text document like <tt>TETEXDOC.tex</tt>, there isn't much
difficulty. All of the fonts requested by <tt>TETEXDOC.tex</tt> will
be generated by <tt>metafont</tt>, which is automatically invoked by
<tt>dvilj2</tt>, if the fonts aren't already present. (If you're
running <tt>dvilj2</tt> for the first time, the program may need to
generate all of the fonts.) There are several options that control
font generation via <tt>dvilj2</tt>. They're outlined in the manual
page. At this point, you shouldn't need to operate <tt>metafont</tt>
directly. If you do, then something has gone awry with your
installation. All of the <tt>.dvi</tt> drivers will invoke
<tt>metafont</tt> directly via the kpathsea path-searching
library---the discussion of which is beyond the scope of this
document---and you don't need to do any more work with
<tt>metafont</tt> for the present---all of the <tt>metafont</tt>
sources for the Computer Modern font library are provided.
You can print <tt>TETEXDOC.lj</tt> with the command
<verb>
lpr TETEXDOC.lj
</verb>
You may also need to install a printer filter that understands PCL.
The nine-page <em>teTeX Guide</em> provides some useful information
for further configuring your system, some of which I have mentioned,
much that this document doesn't cover.
Some of the information in the next section I haven't been able to
test, because I have a non-Postscript HP Deskjet 400 color ink jet
printer connected to the computer's parallel port. However, not
owning a Postscript printer is no barrier to printing text and
graphics from your text documents. Ghostscript is available in most
Linux distributions and it could already be installed on your system.
<sect>TeX commands.
<P>
Preparing documents for TeX typesetting is easy. Make sure there's a
blank line between the paragraphs of a plain text file, and run file
through the TeX program with the command
<verb>
tex your_text_file
</verb>
The result will be a file of the same base name and the extension
<tt>.dvi</tt>. TeX formats the text in 10-point, Computer Modern
Roman, single-spaced, with justified left and right margins. If you
receive error messages from special characters like dollar signs,
escape them with a backslash character, <tt>&bsol;</tt>, and run TeX
on the file again. You should be able to process the resulting file
with the <tt>.dvi</tt> file translator of your choice (see above) to
get printed output.
One peculiarity of TeX input is that you must use opening and closing
quotes, which are denoted in the input file with the grave accent and
single quote characters. Emacs' TeX mode does this for you
automatically.
<verb>
"These are ASCII-type quotes."
``These are `TeX-style' quotes.''
</verb>
<sect1>Command overview.
<P>
Commands in TeX start with a backslash (``&bsol;''). For example, the
command to change the spacing between lines is
<verb>
\baselineskip=24pt
</verb>
The baseline is the bottom of the characters on a line, not counting
descenders. The distance between the baseline of one line and the
next is the <tt>&bsol;baselineskip</tt>, and is assigned a value of 24
points.
Measurements or dimensions in TeX are often given in the following
units:
<verb>
pt % Point 1/72 in.
pc % Pica: 12 pt.
in % Inch: 72.27 pt.
cm % Centimeter: 2.54 cm = 1 in.
mm % Millimeter: 10 mm = 1 cm.
</verb>
Some commands do not take assignments. For example:
<verb>
\smallskip % Approximately 3 pt.
\medskip % Two \smallskips.
\bigskip % Two \medskips.
</verb>
A <tt>&bsol;smallskip</tt> inserts a 3 pt. vertical space in the
document. The measurements are approximate because TeX needs to
adjust the dimensions for page breaks, section headings, and other
units of vertical space. This is true for horizontal spacing as well.
<verb>
\hsize=6.5in
</verb>
This command sets the line length to a width of 6.5 inches. TeX tries
to fill the line by adjusting the spacing between words, and some
letters. If TeX cannot fill a line to within its tolerances, it
produces a warning message, and adjusts the horizontal spacing within
the line as best it can. Formatting tolerances are discussed in
Section <ref id="tolerances" name="Tolerances">.
There are many other commands that specify horizontal and vertical
dimensions and tolerances, and the most commonly use commands are
described below.
<sect1>Font commands. <label id="tex-font-commands">
<P>
In TeX, the default font is 10 pt. Computer Modern Roman. To specify
a typeface, like italic, bold, or monospaced, use the following
commands.
<verb>
\rm % Roman (the default).
\it % Italics.
\bf % Bold.
\tt % Monospaced (teletype).
\sl % Oblique (slanted).
</verb>
The commands change the typeface where they appear in the text, as in
this example.
<verb>
This text is Roman, \it and this text is italic. \bf This text is
bold, and \rm this text is in Roman again.
</verb>
To specify a font for your document, use the<tt>&bsol;font</tt>
command.
<verb>
\font\romantwelve=cmr12
</verb>
This creates the font command <tt>&bsol;romantwelve</tt>, which, when
used in the text, changes the font to Computer Modern Roman, 12 point.
<verb>
\romantwelve
This is the Computer Modern Roman font at 12 points.
</verb>
For information about the fonts in the teTeX distribution
look at the file:
<verb>
/usr/lib/teTeX/texmf/doc/fonts/fontname/fontname.dvi
</verb>
If you want to print a sample of a font, TeX the file
<verb>
/usr/lib/teTeX/texmf/tex/plain/base/fontchart.tex
</verb>
and fill in the name of the font you want to print at the prompt.
You can also change the size of a font to get different effects.
Font magnification is exponential, and specified with the
<tt>scaled &bsol;magstep</tt> command, which is placed after the font
specification.
<verb>
\font\sfmedium=cmss12 scaled \magstep 1
</verb>
This command will give you a sans serif font that is 120 percent the
size of the 12-point Computer Modern sans serif font. Fonts can be
magnified in steps from 0 to 5. Each step provides and additional
120 percent magnification.
<sect1>Paragraph styles and dimensions. <label id="para-dimen">
<P>
As mentioned above, TeX typesets text in 10-point Computer Modern
Roman by default. The length of a line is the value of
<tt>&bsol;hsize</tt>, which defaults to 6.5 in. If you want to change
the value of <tt>&bsol;hsize</tt> to 5.5 in. for example, use this
command.
<verb>
\hsize=5.5in
</verb>
In TeX a <em>dimension</em> is an adjustable unit of length, either
horizontal or vertical. The amount by which a dimension can be
increased or decreased can be specified in its definition. Closely
related to a dimension is a <em>skip,</em> which is a dimension that
is placed in one of TeX's internal registers. Skips are defined with
the <tt>&bsol;newskip</tt> command. The <tt>&bsol;smallskip</tt>
dimension, as defined by TeX is:
<verb>
\newskip\smallskipamount \smallskipamount=3pt plus 1pt minus 1pt
</verb>
The <tt>&bsol;smallskip</tt> command is shorthand for:
<verb>
\vskip\smallskipamount
</verb>
There are a number of dimensions that control the page layout. They
are summarized in Section <ref id="tex-page" name="Page layout">.
TeX formats paragraphs with justified left and right margins. If you
want the text to be left justified only, use this command:
<verb>
\raggedright
</verb>
To typeset a line that is justified to the right margin, use the
<tt>&bsol;rightline</tt> command:
<verb>
\rightline{This is the line to be typeset.}
</verb>
The <tt>&bsol;line</tt> command typesets the text of its argument to
fill the entire line.
<verb>
\line{This text will be spaced to fit the entire line.}
</verb>
The <tt>&bsol;hfil</tt> command adds space to fill out the line where
it occurs. So, for example, the <tt>&bsol;rightline</tt> command is
equivalent to:
<verb>
\line{\hfilThis line will be right justified.}
</verb>
To typeset a line that is centered, use the <tt>&bsol;centerline</tt>
command.
<verb>
\centerline{This is the line to be centered.}
</verb>
To change the left margin, set the value of <tt>&bsol;hoffset</tt>, as
in this example:
<verb>
\hoffset=1.5in
</verb>
The <tt>&bsol;parindent</tt> command specifies the amount that the
first line of every paragraph is indented.
<verb>
\parindent=.5in
</verb>
Two other dimensions, <tt>&bsol;leftskip</tt> and
<tt>&bsol;rightskip</tt>, will indent the right and left margins,
respectively, of the paragraphs that come after them.
<verb>
\leftskip=.5in
\rightskip=.5in
</verb>
The control word <tt>&bsol;narrower</tt> is equivalent to:
<verb>
\leftskip=\parindent
\rightskip=\parindent
</verb>
That is, <tt>&bsol;narrower</tt> narrows the paragraph margins by the
value of <tt>&bsol;parindent</tt>
As mentioned in the previous section, the <tt>&bsol;baselineskip</tt>
specifies the distance between lines. The default is 12 pt. To
approximate double-spaced text, use the following command.
<verb>
\baselineskip=\baselineskip*1.6
</verb>
The <tt>&bsol;parskip</tt> command specifies the distance in addition
to <tt>&bsol;baselineskip</tt> between paragraphs. By default, no
extra space is added, but the distance between paragraphs can stretch
as much as 1 pt. to fill the page correctly. To put a blank line
between paragraphs, use this command:
<verb>
\parskip=\baselineskip
</verb>
<sect2>Tolerances. (What are those black rectangles after every line?)<label id="tolerances">
<P>
TeX normally formats text to strict tolerances. If, for some reason,
text cannot be formatted to within those tolerances, TeX produces a
warning message and formats the text the best it can. If the text
must be stretched too much to fit the line, TeX warns you that the
<tt>&bsol;hbox</tt> is underfull. Text that must be squeezed to fit
in the line produces an overfull <tt>&bsol;hbox</tt> warning.
For each overfull <tt>&bsol;hbox</tt>, TeX places a <em>slug</em>, a
black rectangle, after the line. The slug indicates that the line
could not be formatted to within the specifications set by the
<tt>&bsol;hbadness</tt> parameter.
The fit of the text within its specified dimensions is measured by its
<em>badness</em>, which is a number between 0 and 10000. A badness of
0 is a perfect fit, and a badness of 10000 means that the line
probably will never fit. The default value of <tt>&bsol;hbadness</tt>
is 1000. If you set <tt>&bsol;hbadness</tt> to 10000, TeX does not
report underfull lines.
Sometimes TeX allows a line to extend past the right margin. This is
an aesthetic decision on the part of TeX's author. The amount is
determined by the <tt>&bsol;hfuzz</tt> parameter, which defaults to
0.1 pt. If the text does not fit within the line, the
<tt>&bsol;tolerance</tt> parameter determines how TeX will handle the
overfull <tt>&bsol;hbox</tt>. The default value of
<tt>&bsol;tolerance</tt> is 200. Setting <tt>&bsol;tolerance</tt> to
1000 suppresses overfull <tt>&bsol;hbox</tt> warnings and the printing
of slugs.
<sect1>Page layout. <label id="tex-page">
<P>
In addition to the left margin and line length dimensions that are
described in the previous section, TeX also lets you specify top and
bottom margins, and vertical spacing.
Like the <tt>&bsol;hsize</tt> and <tt>&bsol;hoffset</tt> dimensions
described in the previous section, TeX also provides the
<tt>&bsol;vsize</tt> and <tt>&bsol;voffset</tt> commands. The default
for <tt>&bsol;vsize</tt> is 8.9 in., and <tt>&bsol;voffset</tt> defaults
to 0.
Normally, teTeX places the beginning of the first line of text 1
in. below the top of the paper and 1 in. from the left edge. You can
start the text closer to the top of the page with the command:
<verb>
\voffset=-0.5in
</verb>
If you want to add vertical space in a document, the commands
<tt>&bsol;smallskip</tt>, <tt>&bsol;medskip</tt>, and
<tt>&bsol;bigskip</tt> will add approximately 3, 6, and 12 points of
blank vertical space. These measurements are approximate; TeX will
adjust them by as much as 1 pt. so the page is filled correctly.
The <tt>&bsol;vfill</tt> command adds an adjustable vertical space
between paragraphs on a page. It is infinitely stretchable, so it
will add vertical space to fill as much of the rest of the page as
possible. If you want to specify a dimension, use
<tt>&bsol;vskip</tt> as in:
<verb>
\vskip 10pt
</verb>
The commands <tt>&bsol;hss</tt> and <tt>&bsol;vss</tt> are similar to
<tt>&bsol;hfil</tt> and <tt>&bsol;vfill</tt>, but they provide
dimensions that are infinitely shrinkable as well as infinitely
stretchable.
The <tt>&bsol;vskip</tt> and <tt>&bsol;vfill</tt> commands produce
flexible lengths. They do not add space where no text exists; for
example, at the top of a page. Use <tt>&bsol;vglue</tt> if you want
to add an absolute space.
TeX fills the <tt>&bsol;vsize</tt> dimension with as much text as
possible before it starts a new page. To force a page break, use the
<tt>&bsol;vfill &bsol;eject</tt> sequence. If <tt>&bsol;vfill</tt> is
not used, the text before the <tt>&bsol;break</tt> will be spaced to
fill the page.
If you want TeX to be more flexible about its vertical page sizing,
place the <tt>&bsol;raggedbottom</tt> command in your document. TeX
will then adjust the bottom margin of each page slightly to make
vertical spacing more consistent.
<sect1>Page numbers, headers, and footers.
<P>
teTeX by default places the page number at the bottom center of the
page. If you want to change the location and style of the page
number, you can specify alternate headers and footers by changing
definitions of <tt>&bsol;headline</tt> and <tt>&bsol;footline</tt>.
The default value for <tt>&bsol;footline</tt> contains the
<tt>&bsol;folio</tt> command, which prints the page number. The
default value for <tt>&bsol;headline</tt> is <tt>&bsol;hfil</tt>, so
a blank line is printed.
The <tt>&bsol;pageno</tt> command is a synonym for TeX's internal page
counter. You can change the page number by changing the value of
<tt>&bsol;pageno</tt>. If <tt>&bsol;pageno</tt> is negative, the
numbers are printed as Roman numerals.
<verb>
\pageno=10
\pageno=-1
</verb>
The command <tt>&bsol;nopagenumbers</tt> is shorthand for:
<verb>
\headline={\hfil}
\footline={\hfil}
</verb>
The default footline also contains the font command
<tt>&bsol;tenrm</tt>, which sets the page number's font to 10-point
Roman. If you want to print the page number in 12-point Roman, for
example, you would first define a 12-point Roman font, and use that in
the definition of <tt>&bsol;footline</tt>. Font commands are
discussed in Section <ref id="tex-font-commands" name="Font commands">.
<verb>
\font\twelvrm=cmr12
\footline={\hss\twelvrm\folio\hss}
</verb>
You can put a <em>rule</em>, a horizontal line, at the top of each
page by redefining <tt>&bsol;headline</tt> as:
<verb>
\headline={\hrulefill}
</verb>
To specify different headers for even and odd pages use the
<tt>&bsol;ifodd</tt>command, which has the form:
<verb>
\ifodd[condition][true-action]\else[false-action
</verb>
An example <tt>&bsol;headline</tt> that uses different headers for
even and odd pages would be:
<verb>
\headline={\ifodd\pageno odd-page-header \else even-page-header}
</verb>
The <tt>&bsol;ifodd</tt> statement uses the first argument if the page
number is odd, and the second argument otherwise.
<sect1>Titles and macros.
<P>
TeX provides only the <tt>&bsol;beginsection</tt> macro for section
headings. It leaves a space above its argument, prints the text of
the heading in bold type, adds a <tt>&bsol;smallskip</tt> after the
text of the heading, and starts the next paragraph with no indent.
The LaTeX chapter and section commands described below add section
numbering, and will print the section names and numbers in the page
headings, and automatically add the sections to the Table of Contents.
In plain TeX, you must write these functions yourself. The
<tt>&bsol;def</tt> command allows you to define new commands. Suppose
you want to print a chapter title. First you define the font that you
want to use. A large, sans serif font for chapter titles would be
defined like this:
<verb>
\font\chapterfontsans=cmss12 scaled \magstep 4
</verb>
You can use the <tt>&bsol;chapterfontsans</tt> command anywhere you want
to switch to this font, which is approximately 24 points in height.
However, in this example, it will be used primarily in the command
<tt>&bsol;chaptertitlesans</tt>. Here is its definition:
<verb>
\def\chaptertitlesans#1{\hbox{}\bigskip\bigskip
\noindent{\leftline{\chapterfontsans#1}}
\par\bigskip\bigskip\noindent}
</verb>
The first line, <tt>&bsol;hbox{}&bsol;bigskip</tt>, anchors a 12-point
space at the top of the page by placing an empty <tt>&bsol;hbox{}</tt>
there. The line with the chapter title is not indented, nor is the
paragraph which immediately follows it. If you place a blank line
between the <tt>&bsol;sschaptertitle</tt> macro and the next
paragraph, the final <tt>&bsol;noindent</tt> applies to the blank
line, not the text of the following paragraph. To format correctly,
use the <tt>&bsol;sschaptertitle</tt> as in this example:
The <tt>#1</tt> statement in the definition is replaced by the first
argument to <tt>&bsol;chaptertitlesans</tt>; that is, the title of the
chapter. Parameters TeX definitions are declared with <tt>#1</tt>,
<tt>#2</tt>, <tt>#3</tt>, and so on. An example usage of
<tt>&bsol;chaptertitlesans</tt> would be:
<verb>
\chaptertitlesans{Chapter 1}
This is the starting text of the first paragraph of the chapter.
The paragraph will not be indented. The chapter's title is
"Chapter 1."
</verb>
<sect>LaTeX commands. <label id="print-your-own">
<P>
<sect1>Document structure.
<P>
Documents formatted for LaTeX have a few more rules, but with complex
documents, LaTeX can greatly simplify the formatting process.
Essentially, LaTeX is a document markup language which tries to
separate the output style from the document's logical content. For
example, formatting a section heading with TeX would require
specifying 36 points of white space above the heading, then the
heading itself set in bold, 24-point type, then copying the heading
text and page number to the Table of Contents, then leaving 24 points
of white space after the heading. By contrast, LaTeX has the
<tt>&bsol;section{}</tt> command, which does all of the work for you.
If you need to change the format of the section headings throughout
your document, you can change the definition of
<tt>&bsol;section{}</tt> instead of the text in the document. You can
see where this would save hours of reformatting for documents of more
than a dozen pages in length.
All LaTeX documents have three sections: a <em>preamble,</em> the
<em>body</em> text, and a <em>postamble</em>. These terms are
standard jargon and are widely used by TeXperts.
The preamble, at a minimum, specifies the type of document to be
produced---the <em>document class</em>---and a statement which signals
the beginning of the document's body text. For example:
<verb>
\documentclass{article}
\begin{document}
</verb>
The document's postamble is usually very simple. Except in
specialized cases, it contains only the statement:
<verb>
\end{document}
</verb>
Note the <tt>&bsol;begin{document}</tt> and
<tt>&bsol;end{document}</tt> pairing. In LaTeX, this is called an
<em>environment</em>. All text must appear within an environment, and
many commands are effective only in the environments in which they're
called. The <tt>document</tt> environment is the only instance where
LaTeX enforces this convention, however. That is, it's the only
environment that is required in a document. (An exception is
<tt>letter</tt> class, which also requires you to declare
<tt>&bsol;begin{letter}</tt> and <tt> &bsol;end{letter}</tt>. See the
section <ref id="letter-class" name="Letters">.) However, many
formatting features are specified as environments. They're described
in the following sections.
The document classes can be called with arguments. For example,
instead of the default, 10-point type used as the base point size, as
in the previous example, we could have specified
<verb>
\documentclass[12pt]{article}
</verb>
to produce the document using 12 points as the base point size. The
document class, <em>article,</em> makes the necessary adjustments.
There are a few document classes which are commonly used. They're
described below. The <em>report</em> class is similar to
<em>article</em> class, but produces a title page and starts each
section on a new page. The <em>letter</em> class includes special
definitions for addresses, salutations, and closings, a few of which
are described below.
You can include canned LaTeX code, commonly known as a
<em>package,</em> with the <tt>&bsol;usepackage{}</tt> command.
<verb>
\usepackage{fancyhdr}
</verb>
The command above would include the LaTeX style file
<tt>fancyhdr.sty</tt> from one of the <tt>TEXINPUTS</tt> directories,
which you and teTeX specified during installation and setup processes.
<verb>
\documentclass{article}
\usepackage{fancyhdr}
\begin{document}
</verb>
Note that the <tt>&bsol;usepackage{}</tt> declarations are given
before the <tt>&bsol;begin{document}</tt> statement; that is, in the
document preamble.
<tt>fancyhdr.sty</tt> extends the <tt>&bsol;pagestyle{}</tt> command
so that you can create custom headers and footers. Most LaTeX
document classes provide headers and footers of the following standard
page styles:
<verb>
\pagestyle{plain} % default pages style -- page number centered at
% the bottom of the page.
\pagestyle{empty} % no headers or footers
\pagestyle{headings} % print section number and page number at the
% top of the page.
\pagestyle{myheadings} % print custom information in the page heading.
</verb>
Everything on a line to the right of the percent sign is a comment.
The <tt>&bsol;pagestyle{}</tt> command doesn't take effect until the
following page. To change the headers and footers on the current page, use
the command
<verb>
\thispagestyle{the_pagestyle}
</verb>
<sect1>Characters and type styles. <label id="characters">
<P>
Character styles are partially a function of the fonts specified in
the document. However, bold and italic character emphasis should be
available for every font present on the system. Underlining, too, can
be used, though its formatting presents special problems. See section
<ref id="latex-packages" name="LaTeX extension packages and other
resources">, below.
You can specify text to be emphasized in several ways. The most
portable is the <tt>&bsol;em</tt> command. All text within its scope
is italicized by default. For example:
<verb>
This word will be {\em emphasized.}
</verb>
If you have italicized text that runs into text which is not
italicized, you can specify an italic correction factor to be used.
The command for this is <tt>&bsol;/</tt>; that is, a backslash and a
forward slash.
<verb>
This example {\em will\/} print correctly.
This example will {\em not} print correctly.
</verb>
Slightly less portable, but still acceptable in situations where
they're used singly, are the commands <tt>&bsol;it</tt>,
<tt>&bsol;bf</tt>, and <tt>&bsol;tt</tt>, which specify that the
characters within their scope be printed using italic, bold, and
monospaced (teletype) typefaces, respectively.
<verb>
{\tt This text will be printed monospaced,}
{\it this text will be italic,} and
{\bf this text will be bold\dots} all in one paragraph.
</verb>
The command <tt>&bsol;dots</tt> prints a series of three periods for
ellipses, which will not break across a line.
The most recent version of LaTeX, which is what you have, includes
commands which account for instances where one emphasis command would
supersede another.
<verb>
This is {\it not {\bf bold italic!}}
</verb>
What happens is that teTeX formats the text with the italic typeface
until it encounters the <tt>&bsol;bf</tt> command, at which point it
switches to boldface type.
To get around this, the NFSS scheme of selecting font shapes requires
three parameters for each typeface: shape, series, and family. Not all
font sets will include all of these styles. LaTeX will print a
warning, however, if it needs to substitute another font.
You can specify the following font shapes:
<verb>
\textup{text} % upright shape (the default)
\textit{text} % italic
\textsl{text} % slanted
\textsc{text} % small caps
</verb>
These are the two series that most fonts have:
<verb>
\textmd{text} % medium series (the default)
\textbf{text} % boldface series.
</verb>
There are generally three families of type available.
<verb>
\textrm{text} % Roman (the default)
\textsf{text} % sans serif
\texttt{text} % typewriter (monospaced, Courier-like)
</verb>
Setting font styles using these parameters, you can combine effects.
<verb>
\texttt{\textit{This example likely will result in a font
substitution, because many fonts don't include a typewriter italic
typeface.}}
</verb>
The font family defaults to Computer Modern, which is a bit-mapped
font. Other font families are usually Postscript-format Type 1 fonts.
See section <ref id="postscript-fonts" name="Using PostScript fonts">
for details on how to specify them.
There are also many forms of accents and special characters which are
available for typesetting. This is only a few of them. (Try
typesetting these on your own printer.)
<verb>
\'{o} \`{e} \^{o} \"{u} \={o} \c{c} `? `!
\copyright \pounds \dag
</verb>
Finally, there are characters which are used as meta- or escape
characters in TeX and LaTeX. One of them, the dollar sign, is
mentioned above. The complete set of meta characters, which need to be
escaped with a backslash to be used literally, is:
<verb>
# $ % & _ { }
</verb>
There are also different alphabets available, like Greek and Cyrillic.
LaTeX provides many facilities for setting non-English text, which are
covered by some of the other references mentioned here
<sect1>Margins and line spacing.
<P>
Changing margins in a TeX or LaTeX document is not a straightforward
task. A lot depends on the relative indent of the text you're trying
to adjust the margin for. The placement of the margin-changing
command is also significant.
For document-wide changes to LaTeX documents, the
<tt>&bsol;evensidemargin</tt> and <tt>&bsol;oddsidemargin</tt>
commands are available. They affect the left-hand margins of the
even-numbered and odd-numbered pages, respectively. For example,
<verb>
\evensidemargin=1in
\oddsidemargin=1in
</verb>
adds on inch to the left-hand margin of the even and odd pages <em>in
addition</em> to the standard one-inch, left-hand margin. These
commands affect the entire document and will shift the entire body of
the text right and left across a page, regardless of any local indent,
so they're safe to use with LaTeX environments like
<tt>verse</tt> and <tt>list</tt>.
Below is a set of margin-changing macros which I wrote. They have a
different effect than the commands mentioned above. Because they use
plain TeX commands, they're not guaranteed to honor the margins of any
LaTeX environments which may be in effect, but you can place them
anywhere in a document and change the margins from that point on.
<verb>
%% margins.sty -- v. 0.1 by Robert Kiesling
%% Copies of this code may be freely distributed in verbatim form.
%%
%% Some elementary plain TeX margin-changing commands. Lengths are
%% in inches:
%% \leftmargin{1} %% sets the document's left margin in 1 inch.
%% \leftindent{1} %% sets the following paragraphs' indent in
%% 1 inch.
%% \rightindent{1} %% sets the following paragraphs' right margins
%% %% in 1 inch.
%% \llength{3} %% sets the following lines' lengths to 3 inches.
%%
\message{Margins macros...}
\def\lmargin#1{\hoffset = #1 in}
\def\lindent#1{\leftskip = #1 in}
\def\rindent#1{\rightskip = #1 in}
\def\llength#1{\hsize = #1 in}
%%
%% (End of margins macros.}
</verb>
Place this code in a file called <tt>margins.sty</tt> in your local
<tt>&dollar;TEXINPUTS</tt> directory. The commands are explained in
the commented section of the file. To include them in a document, use
the command
<verb>
\usepackage{margins}
</verb>
in the document preamble.
While we're on the subject, if you don't want the right margin to be
justified, which is the default, you can tell LaTeX to use ragged
right margins by giving the command:
<verb>
\raggedright
</verb>
Setting line spacing also has its complexities.
The <em>baselineskip</em> measurement is the distance between lines of
text. It is given as an absolute measurement. For example,
<verb>
\baselineskip=24pt
</verb>
or even better:
<verb>
\setlength{\baselineskip}{24pt}
</verb>
The difference between the two forms is that <em>setlength</em> will
respect any scoping rules that may be in effect when you use the
command.
The problem with using baselineskip is that it also affects the
distance between section headings, footnotes, and the like. You need
to take care that baselineskip is correct for whatever text elements
you're formatting. There are, however, LaTeX macro packages, like
<tt>setspace.sty,</tt> which will help you in these circumstances.
See section <ref id="latex-packages" name="LaTeX extension packages
and other resources">.
<sect1>Document classes.
<P>
LaTeX provides document classes which provide standardized formats for
documents. They provide environments to format lists, quotations,
footnotes, and other text elements. Commonly used document classes
are covered in the following sections.
<sect2>Articles and reports.
<P>
As mentioned above, the <tt>article</tt> class and the <tt>report</tt>
class are similar. The main differences are that the report class
creates a title page by default and begins each section on a new page.
Mostly, though, the two document classes are similar.
To create titles, abstracts, and bylines in these document classes,
you can type, for example,
<verb>
\title{The Breeding Habits of Cacti}
\author{John Q. Public}
\abstract{Description of how common desert cacti search
for appropriate watering holes to perform their breeding
rituals.}
</verb>
in the document preamble. Then, the command
<verb>
\maketitle
</verb>
given at the start of the text, will generate either a title page in
the report class, or the title and abstract at the top of the first
page, in the article class.
Sections can be defined with commands that include the following:
<verb>
\section
\subsection
\subsubsection
</verb>
These commands will produce the standard, numbered sections used in
technical documents. For unnumbered sections, use
<verb>
\section*
\subsection*
\subsubsection*
</verb>
and so on.
LaTeX provides many environments for formatting displayed material.
You can include quoted text with the <tt>quotation</tt> environment.
<verb>
\begin{quotation}
Start of paragraph to be quoted...
... end of paragraph.
\end{quotation}
</verb>
For shorter quotes, you can use the <tt>quote</tt> environment.
To format verse, use the <tt>verse</tt> environment.
<verb>
\begin{verse}
Because I could not stop for death\\
He kindly stopped for me
\end{verse}
</verb>
Notice that you must use the double backslashes to break lines in the
correct places. Otherwise, LaTeX fills the lines in a verse
environment, just like any other environment.
Lists come in several flavors. To format a bulleted list, the
<tt>list</tt> environment is used:
<verb>
\begin{list}
\item
This is the first item of the list.
\item
This is the second item of the list...
\item
... and so on.
\end{list}
</verb>
A numbered list uses the <tt>enumerate</tt> environment:
<verb>
\begin{enumerate}
\item
Item No. 1.
\item
Item No. 2.
\item
\dots
\end{enumerate}
</verb>
A descriptive list uses the <tt>description</tt> environment.
<verb>
\begin{description}
\item{Oven} Dirty, needs new burner.
\item{Refrigerator} Dirty. Sorry.
\item{Sink and drainboard} Stained, drippy, cold water faucet.
\end{description}
</verb>
<sect2>Letters. <label id="letter-class">
<P>
The <tt>letter</tt> class uses special definitions to format business
letters.
The <tt>letter</tt> environment takes one argument, the address of the
letter's addressee. The <tt>address</tt> command, which must appear
in the document preamble, defines the return address. The
<tt>signature</tt> command defines the sender's name as it appears
after the closing.
The LaTeX source of a simple business letter might look like this.
<verb>
\documentclass[12pt]{letter}
\signature{John Q. Public}
\address{123 Main St.\\Los Angeles, CA. 96005\\Tel: 123/456-7890}
\begin{document}
\begin{letter}{ACME Brick Co.\\100 Ash St.\\San Diego, CA 96403}
\opening{Dear Sir/Madam:}
With regard to one of your bricks that I found on my living room
carpet surrounded by shards of my broken front window...
(Remainder of the body of the letter.)
\closing{Sincerely,}
\end{letter}
\end{document}
</verb>
Note that the addresses include double backslashes, which specify
where the line breaks should occur.
<sect>LaTeX extension packages and other resources. <label id="latex-packages">
<P>
We mentioned above that using underlining as a form of text emphasis
presents special problems. Actually, TeX has no problem underlining
text, because it is a convention of mathematical typesetting. In
LaTeX, you can underline words with the command:
<verb>
\underline{text to be underlined}
</verb>
The problem is that underlining will not break across lines, and, in
some circumstances, underlining can be uneven. However, there is a
LaTeX macro package, ready-made, that makes underlining the default
mode of text emphasis. It's called <tt>ulem.sty</tt>, and is one of
the many contributed LaTeX packages that are freely available via the
Internet.
To use <tt>ulem.sty</tt>, include the command:
<verb>
\usepackage{ulem}
</verb>
in the document preamble.
The packages which are available for LaTeX include:
<descrip>
<tag/ifthen /Include conditional statements in your documents.
<tag/initials /Defines a font for initial dropped capitals.
<tag/sanskrit /Font and preprocessor for producing documents in Sanskrit.
<tag/recipe /A LaTeX2e class to typeset recipes.
<tag/refman /Variant report and article styles.
</descrip>
To make the path given in the Catalogue into a fully-qualified URL,
concatenate the path to the host name URL and top-level path of the CTAN
archive you wish to contact. For example, the top-level CTAN
directory of the site <htmlurl url="ftp://ftp.tex.ac.uk"
name="ftp.tex.ac.uk"> is <tt>ctan/tex-archive</tt>. The complete
URL of the directory of the <bf>refman</bf> package would be:
<verb>
ftp://ftp.tex.ac.uk/ctan/tex-archive/ +
macros/latex/contrib/supported/refman =
ftp://ftp.tex.ac.uk/ctan/tex-archive/macros/latex/contrib/supported/refman/
</verb>
Some packages have more than one file, so only the path to the
package's directory is given.
When you have the URL in hand, you can retrieve the package from one
of the CTAN archive sites listed in section <ref id="ctan-list"
name="Appendix A">. You can download a complete list of the archive's
contents as the file <tt>FILES.byname</tt>, in the archive's top-level
directory. You can also search the archive on line for a keyword with
the <tt>ftp</tt> command
<verb>
quote site index <keyword>
</verb>
<sect>Mixing text and graphics with <tt>dvips</tt>. <label id="dvips">
<P>
In general, this section applies to any TeX or LaTeX document which
mixes text and graphics. teTeX, like most other TeX distributions, is
configured to request Computer Modern fonts by default. When printing
documents with Type 1 scalable fonts or graphics, font and graphics
imaging is the job of <tt>dvips</tt>. <tt>dvips</tt> can use either
Computer Modern bit mapped fonts or Type 1 scalable fonts, or any
combination of the two. First, let's concentrate on printing and
previewing some graphics.
You will probably want to follow this procedure any time a LaTeX
source document has the statement
<verb>
\includepackage{graphics}
</verb>
in the document preamble. This statement tells LaTeX to include the
text of the <tt>graphics.sty</tt> package in the source document.
There are other commands to perform graphics operations, and the
statements in plain-TeX documents may not clue you in whether you need
to use <tt>dvips</tt>. The difference will be apparent in the
output, though, when the document is printed with missing figures and
other graphics.
So, for now, we'll concentrate on printing documents which use the
LaTeX <tt>graphics.sty</tt> package. You might want to take a look at
the original TeX input. It isn't included in the teTeX distribution,
but it is available at
<verb>
~CTAN/macros/latex/packages/graphics/grfguide.tex.
</verb>
What the teTeX distribution does include is the <tt>.dvi</tt> output
file, and it is already TeXed for you. There is a reason for this,
and it has to do with the necessity of including Type 1 fonts in the
output in order for the document to print properly. If you want to
LaTeX <tt>grfguide.tex,</tt> see the next section. For now, however,
we'll work on getting usable output using <tt>dvips</tt>.
The file <tt>grfguide.dvi</tt> is located in the directory
<verb>
texmf/doc/latex/graphics
</verb>
The first step in outputting <tt>grfguide.dvi</tt> is to translate it
to Postscript. The program <tt>dvips</tt> is used for this. It
does just exactly what its name implies. There are many options
available for invoking <tt>dvips</tt>, but the simplest (nearly)
form is
<verb>
dvips -f -r <grfguide.dvi >grfguide.ps
</verb>
The <tt>-f</tt> command switch tells <tt>dvips</tt> to operate as a
filter, reading from standard input and writing to standard output.
<tt>dvips</tt> output can be configured so its output defaults to
<tt>lpr</tt>.
If you can print Postscript directly to your printer via
<tt>lpr</tt>, you can simply type
<verb>
dvips -r grfguide.dvi
</verb>
The <tt>-r</tt> option tells dvips to output the pages in reverse
order so they stack correctly when they exit a printer. Use it or
not, as appropriate for your output device.
Depending on whether you still have the fonts that <tt>dvilj2</tt>
generated from the last document, <tt>dvips</tt> and metafont may
or may not need to create new fonts needed by <tt>grfguide.dvi.</tt>
Eventually, though, <tt>dvips</tt> will output a list of the pages
translated to Postscript, and you will have your Postscript output
ready to be rendered on whatever output device you have available.
If you're lucky (and rich), then you have a Postscript-capable printer
already and will be able to print <tt>grfguide.ps</tt> directly. You
can either spool the output to the printer using <tt>lpr</tt>. If
for some reason your printer software doesn't work right with
Postscript files, you can, in a pinch, simply dump the file to
printer, with
<verb>
cat grfguide.ps >/dev/lp0
</verb>
or whichever port your printer is attached to, though this is not
recommended for everyday use.
If you want or need to invoke Ghostscript manually, this is the
standard procedure for its operation. The first thing you want to do
is invoke Ghostscript to view its command line arguments, like this:
<verb>
gs -help | less
</verb>
You'll see a list of supported output devices and sundry other
commands. Pick the output device which most nearly matches your
printer. I generally produce black-and-white text and use the
<tt>cdjmono</tt> driver, which drives a color Deskjet in monochrome
(black and white) mode.
The command line I would use is:
<verb>
gs -dNOPAUSE -sDEVICE=cdjmono -sOutputFile=/tmp/gs.out grfguide.ps -c quit
</verb>
This will produce my HP-compatible output in the <tt>/tmp</tt>
directory. It's a good idea to use a directory like <tt>/tmp,</tt>
because <tt>gs</tt> can be particular about access permissions, and
you can't (and shouldn't) always count on being logged in as
<tt>root</tt> to perform these steps. Now you can print the file:
<verb>
lpr /tmp/gs.out
</verb>
Obviously, this can all go into a shell script. On my system, I have
two simple scripts written, <tt>pv</tt> and <tt>pr,</tt> which simply
outputs the Postscript file either to the display or the printer.
Screen previewing is possible without X, but it's far from ideal. So,
it's definitely worth the effort to install XFree86 to view the output
on the screen..
The order of commands in a <tt>gs</tt> command line is significant,
because some of the options tell Ghostscript to look for pieces of
Postscript code from its library.
The important thing to remember is that <tt>grfguide.dvi</tt> makes
requests for both Computer Modern bit mapped and Type 1 scaled fonts.
If you can mix scalable and bit mapped fonts in a document, you're
well on the way to becoming a TeXpert.
<sect1>What if my printer isn't supported?
<P>
The teTeX distribution comes with only a limited selection of DVI
output drivers: <tt>dvips</tt>, drivers for Hewlett Packard
LaserJets, and nothing else. You have two options if you have a
printer which isn't LaserJet-compatible: You can use <tt>dvips</tt>
and Ghostscript, which I would recommend anyway, for reasons already
mentioned, or you can investigate other dviware sources.
A limited number of DVI drivers have been ported to Linux and are
available as pre-built binaries. They are located in the Linux
archives at <htmlurl
url="ftp://sunsite.unc.edu/pub/Linux/apps/tex/dvi/"
name="ftp://sunsite.unc.edu/pub/Linux/apps/tex/dvi/">.
The master dviware libraries are maintained at the University of Utah
archives. If you can't find a DVI driver there that supports your
printer, chances are that it doesn't exist. You can also write your
<em>own</em> DVI driver using the templates available there. The
library's URL is <htmlurl url="ftp://ftp.math.utah.edu/pub/tex/dvi/"
name="ftp://ftp.math.utah.edu/pub/tex/dvi/">.
<sect>Using Postscript fonts. <label id="postscript-fonts">
<P>
It used to be that public domain, Type 1 fonts were much poorer
quality than Computer Modern bit mapped fonts. This situation has
improved in the last several years, though, but matching the fonts is
up to you. Having several different font systems on one machine can
seem redundant and an unnecessary waste of disk space. And the
Computer Modern fonts can seem, well, a little too <em>formal</em> to
be suitable for everyday use. It reminds me sometimes of bringing out
the good China to feed the dog. At least you don't need to spend a
bundle on professional quality fonts any longer.
One of the major improvements of LaTeX2e over its predecessor was the
inclusion of the New Font Selection Scheme. (It's now called PSNFSS.)
Formerly, TeX authors would specify fonts with commands like
<verb>
\font=bodyroman = cmr10 scaled \magstep 1
</verb>
which provides precision but requires the skills of a type designer
and mathematician to make good use of. Also, it's not very portable.
If another system didn't have the font <tt>cmr10</tt> (this is TeX
nomenclature for Computer Modern Roman, 10 point, with the default
medium stroke weight), somebody would have to re-code the fonts
specifications for the entire document. PSNFSS, however, allows you
specify fonts by family (Computer Modern, URW Nimbus, Helvetica,
Utopia, and so forth), weight (light, medium, bold), orientation
(upright or oblique), face (Roman, Italic), and base point size. (See
the section <ref id="characters" name="Characters and type styles"> for a
description of the commands to specify typefaces.) Many fonts are
packaged as families. For example, a Roman-type font may come
packaged with a sans serif font, like Helvetica, and a monospaced
font, like Courier. You, as the author of a LaTeX document, can
specify an entire font family with one command.
There are, as I said, several high-quality font sets available in the
public domain. One of them is Adobe Utopia. Another is Bitstream
Charter. Both are commercial quality fonts which have been donated to
the public domain.
These happen to be two of my favorites. If you look around one of the
CTAN sites, you will find these and other fonts archived there. There
are enough fonts around that you'll be able to design documents the
way you want them to look, and not just English text, either. TeX was
originally designed for mathematical typesetting, so there is a full
range of mathematical fonts available, as well as Cyrillic, Greek,
Kana, and other alphabets too numerous to mention.
The important thing to look for is files which have either the
<tt>.pfa</tt> or <tt>.pfb</tt> extension. They indicate that these
are the scalable fonts themselves, not simply the metrics files. Type
1 fonts use <tt>.pfm</tt> metric files, as opposed to the
<tt>.tfm</tt> metric files which bit mapped fonts use. The two font
sets I mentioned above are included in teTeX distributions, as well as
separately.
What I said above, concerning the ease of font selection under PSNFSS,
is true in this instance. If we want to use the Charter fonts in our
document instead of Computer Modern bit mapped, all that is necessary
is include the LaTeX statement
<verb>
\renewcommand{\familydefault}{bch}
</verb>
in the document preamble, where ``bch'' is the common designation for
Bitstream Charter. The Charter fonts reside in the directory
<verb>
/usr/lib/teTeX/texmf/fonts/type1/bitstrea/charter
</verb>
There you'll see the <tt>.pfb</tt> files of the Charter fonts:
<tt>bchb8a.pfb</tt> for Charter Bold, <tt>bchr8a.pfb</tt> for Charter
Roman, <tt>bchbi8a.pfb</tt> for Charter Bold Italic. The ``8a'' in
the font names indicates the character encoding. At this point you
shouldn't need to worry much about them, because the encodings mostly
differ for 8-bit characters, which have numeric values above 128
decimal. They mostly define accents and non-English characters. The
Type 1 font encodings generally work well for Western alphabets
because they conform to the ISO 8859 standards for international
character sets, so this is an added benefit of using them.
To typeset a document which has Charter fonts selected, you would give
the command
<verb>
pslatex document.tex
</verb>
<tt>pslatex</tt> is a variant of teTeX's standard <tt>latex</tt>
command which defines the directories where the Type 1 fonts are, as
well as some additional LaTeX code to load. You'll see the notice
screen for <tt>pslatex</tt> followed by the status output of the TeX
job itself. In a moment, you'll have a <tt>.dvi</tt> file which
includes the Charter font requests. You can then print the file with
<tt>dvips</tt>, and <tt>gs</tt> if necessary.
Installing a Type 1 font set is not difficult, as long as you follow a
few basic steps. You should unpack the fonts in a subdirectory of the
<tt>/usr/lib/teTeX/texmf/fonts/type1</tt> directory, where your other
Type 1 fonts are located, and then run <tt>texhash</tt> to let the
directory search routines know that the fonts have been added. Then
you need to add the font descriptions to the file <tt>psfonts.map</tt>
so <tt>dvips</tt> knows they're on the system. The format of the
<tt>psfonts.map</tt> file is covered in a couple different places in
the references mentioned above. Again, remember to run the
<tt>texhash</tt> program to update the teTeX directory database.
It is definitely an advantage to use the X Windows System with teTeX---
XFree86 under Linux---because it allows for superior document
previewing. It's not required, but in general, anything that allows
for easier screen previewing is going to benefit your work, in terms
of the quality of the output. However, there is a tradeoff with speed
of editing, which is much quicker on character-mode displays.
<sect>Appendix A: CTAN site list. <label id="ctan-list">
<P>
This is the text of the file <tt>CTAN.sites,</tt> which is available
in the top-level directory of each CTAN archive or mirror site.
<verb>
In order to reduce network load, it is recommended that you use the
Comprehensive TeX Archive Network (CTAN) host which is located in the
closest network proximity to your site. Alternatively, you may wish to
obtain a copy of the CTAN via CD-ROM (see help/CTAN.cdrom for details).
Known mirrors of the CTAN reside on (alphabetically):
cis.utovrm.it (Italia) /TeX
ctan.unsw.edu.au (NSW, Australia) /tex-archive
dongpo.math.ncu.edu.tw (Taiwan) /tex-archive
ftp.belnet.be (Belgium) /packages/TeX
ftp.ccu.edu.tw (Taiwan) /pub/tex
ftp.cdrom.com (West coast, USA) /pub/tex/ctan
ftp.comp.hkbu.edu.hk (Hong Kong) /pub/TeX/CTAN
ftp.cs.rmit.edu.au (Australia) /tex-archive
ftp.cs.ruu.nl (The Netherlands) /pub/tex-archive
ftp.cstug.cz (The Czech Republic) /pub/tex/CTAN
ftp.duke.edu (North Carolina, USA) /tex-archive
ftp.funet.fi (Finland) /pub/TeX/CTAN
ftp.gwdg.de (Deutschland) /pub/dante
ftp.jussieu.fr (France) /pub4/TeX/CTAN
ftp.kreonet.re.kr (Korea) /pub/CTAN
ftp.loria.fr (France) /pub/unix/tex/ctan
ftp.mpi-sb.mpg.de (Deutschland) /pub/tex/mirror/ftp.dante.de
ftp.nada.kth.se (Sweden) /pub/tex/ctan-mirror
ftp.oleane.net (France) /pub/mirrors/CTAN/
ftp.rediris.es (Espa\~na) /mirror/tex-archive
ftp.rge.com (New York, USA) /pub/tex
ftp.riken.go.jp (Japan) /pub/tex-archive
ftp.tu-chemnitz.de (Deutschland) /pub/tex
ftp.u-aizu.ac.jp (Japan) /pub/tex/CTAN
ftp.uni-augsburg.de (Deutschland) /tex-archive
ftp.uni-bielefeld.de (Deutschland) /pub/tex
ftp.unina.it (Italia) /pub/TeX
ftp.uni-stuttgart.de (Deutschland) /tex-archive (/pub/tex)
ftp.univie.ac.at (\"Osterreich) /packages/tex
ftp.ut.ee (Estonia) /tex-archive
ftpserver.nus.sg (Singapore) /pub/zi/TeX
src.doc.ic.ac.uk (England) /packages/tex/uk-tex
sunsite.auc.dk (Denmark) /pub/tex/ctan
sunsite.cnlab-switch.ch (Switzerland) /mirror/tex
sunsite.icm.edu.pl (Poland) /pub/CTAN
sunsite.unc.edu (North Carolina, USA) /pub/packages/TeX
wuarchive.wustl.edu (Missouri, USA) /packages/TeX
Known partial mirrors of the CTAN reside on (alphabetically):
ftp.adfa.oz.au (Australia) /pub/tex/ctan
ftp.fcu.edu.tw (Taiwan) /pub2/tex
ftp.germany.eu.net (Deutschland) /pub/packages/TeX
ftp.gust.org.pl (Poland) /pub/TeX
ftp.jaist.ac.jp (Japan) /pub/TeX/tex-archive
ftp.uu.net (Virginia, USA) /pub/text-processing/TeX
nic.switch.ch (Switzerland) /mirror/tex
sunsite.dsi.unimi.it (Italia) /pub/TeX
sunsite.snu.ac.kr (Korea) /shortcut/CTAN
Please send updates to this list to <ctan@urz.uni-heidelberg.de>.
The participating hosts in the Comprehensive TeX Archive Network are:
ftp.dante.de (Deutschland)
-- anonymous ftp /tex-archive (/pub/tex /pub/archive)
-- gopher on node gopher.dante.de
-- e-mail via ftpmail@dante.de
-- World Wide Web access on www.dante.de
-- Administrator: <ftpmaint@dante.de>
ftp.tex.ac.uk (England)
-- anonymous ftp /tex-archive (/pub/tex /pub/archive)
-- gopher on node gopher.tex.ac.uk
-- NFS mountable from nfs.tex.ac.uk:/public/ctan/tex-archive
-- World Wide Web access on www.tex.ac.uk
-- Administrator: <ctan-uk@tex.ac.uk>
</verb>
<sect>Appendix B: Installing the CTAN teTeX distribution. <label
id="ctan-install">
<P>
The generic, teTeX distribution isn't any harder to install than the
Linux packages. See section <ref id="generic-CTAN" name="Generic CTAN
distribution">, below.
You should consider installing the generic teTeX distribution from the
CTAN archives if:
<itemize>
<item>Your system isn't based on one of the standard Linux
distributions.
<item>You don't have root privileges on your system.
<item>You want or need to have the very latest version of teTeX, or LaTeX.
<item>You don't have enough disk space available for a full
installation.
<item>You want to install teTeX somewhere instead of the <tt>/usr</tt> file
system.
<item>You would like to share your teTeX installation with other UNIX
variants or platforms on a network. In this case, you should
strongly consider installing from the <em>source</em> distribution.
See section
<ref id="generic-CTAN" name="Installing the source distribution">, below.
<item>You want the latest versions of teTeX's public domain Type 1
fonts, which are significantly better than the fonts included in
earlier releases.
</itemize>
A complete installation of the binary distribution requires 40-50 Mb
of disk space, and building the distribution from the source code takes
about 75 Mb, so you should make sure that the disk space is available
before you start. You don't need to have the GCC compiler
or the X Windows System installed (although X certainly helps because
it is much easier to preview documents on-screen). All you need is an
editor that is capable of producing plain ASCII, text (see section
2). What could be simpler?
You can retrieve the files from one of the CTAN archives listed in
section <ref id="ctan-list" name="Appendix A">. In the examples
below, the files were retrieved from the CTAN archive at <htmlurl
url="ftp://ftp.tex.ac.uk" name="ftp.tex.ac.uk">.
<sect1>Installing the binary distribution.
<P>
<sect2>Minimal installation. <label id="minimal-installation">
<P>
First, FTP to <htmlurl
url="ftp://ftp.tex.ac.uk/ctan/tex-archive/systems/unix/teTeX/contrib"
name="ftp.tex.ac.uk"> and <tt>cd</tt> to the directory
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/
</verb>
Retrieve the files
<verb>
INSTALL.bin
install.sh
</verb>
and place them in the top-level directory where you want to install
teTeX, for example, <tt>/var/teTeX</tt> if you plan to install teTeX
in the <tt>/var</tt> file system.
Print out the <tt>INSTALL.bin</tt> file. Keep this file handy,
because it describes how to install a minimal teTeX installation. The
minimal installation requires only 10-15 MB of disk space, but it is
recommended that you install the complete teTeX package if at all
possible. For a minimum installation, you'll need the files
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/base/latex-base.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/base/tetex-base.tar.gz
</verb>
You'll also need one of two archives which contain the executable
teTeX programs. Retrieve the archive file
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linux.tar.gz
</verb>
if your system uses the Linux ELF shared libraries, <tt>ld.so</tt>
of at least version 1.73, and clibs of at least version 5.09. If it
doesn't, retrieve the archive
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linuxaout.tar.gz
</verb>
which is compiled for systems that use the older, a.out-format static
libraries.
Then, following the instructions in the file <tt>INSTALL.bin</tt>,
execute the command
<verb>
sh ./install.sh
</verb>
while in the top-level teTeX installation directory. (Make sure that
the teTeX archives are located there, too.) After a few moments, the
installation program will warn you that you are missing some of the
teTeX packages. However, if you're planning only a minimal teTeX
installation, you should ignore the warnings and proceed. To
configure the basic teTeX system, see section <ref id="base-config"
name="Base system configuration">, below.
To install the remaining packages, see the next section.
<sect2>Complete installation. <label id="complete-installation">
<P>
To perform a complete teTeX installation, retrieve the archive files
listed in the previous section, as well as the following files:
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/doc/ams-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/bibtex-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/eplain-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/fonts-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/general-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/generic-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/latex-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/makeindex-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/metapost-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/doc/programs-doc.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/ams-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/dc-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/ec-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/misc-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/postscript-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/fonts/sauter-fonts.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/amstex.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/bibtex.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/eplain.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/latex-extra.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/metapost.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/pictex.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/pstricks.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/texdraw.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/goodies/xypic.tar.gz
</verb>
All of these files should be placed in the top-level directory where
you want teTeX to reside. As with the minimal installation, execute
the command
<verb>
sh ./install.sh
</verb>
<sect1>Base system configuration. <label id="base-config">
<P>
The <tt>install.sh</tt> script, after determining which teTeX archive
series are present, will present you with a menu of options. The only
setting you need to make at this point is to set the top-level
directory where you want teTeX installed, by selecting the ``D'' option.
You must, of course, choose a directory in whose parent directory you
have write permissions. For example, if you are installing teTeX in
your home directory, you would specify the teTeX installation
directory as
<verb>
/home/john.q.public/teTeX
</verb>
and, after returning to the main menu, select ``I'' to proceed with the
installation. Note that the directory must not exist already: the
<tt>install.sh</tt> script must be able to create it.
An option which you should consider enabling, is setting an
alternative directory for generated fonts. Even if you plan to use
only Postscript-format, Type 1 scalable fonts, occasionally you'll
process a file that requires the Computer Modern fonts. Enabling this
option requires that you enter the directory to use. You must have
write permissions for the parent directory. Following the example
above, you could specify
<verb>
/home/john.q.public/texfonts
</verb>
or, if you want the generated fonts to be accessible by all users on
the system, specify a directory like
<verb>
/var/texfonts
</verb>
I would recommend that you <em>not,</em> however, use the default
<tt>/var/tmp/texfonts</tt> directory for this option, because the
generated fonts could be deleted after the next reboot, and the fonts
will need to be generated again the next time they're needed.
After you've selected the option ``I'', and <tt>install.sh</tt> has
installed the archives, set various permissions, and generated its
links and format files, the program will exit with a message telling
you to add the teTeX binary directory to your <tt>&dollar;PATH</tt>
environment variable, and the directories where the man pages and info
files reside to your <tt>&dollar;MANPATH</tt> and
<tt>&dollar;INFOPATH</tt> environment variables. For example, add the
statements
<verb>
export PATH=$PATH:"/home/john.q.public/teTeX/bin"
export MANPATH=$MANPATH":/home/john.q.public/teTeX/man"
export INFOPATH$=INFOPATH":/home/john.q.public/teTeX/info"
</verb>
to your <tt>&tilde;/.bash_profile</tt> if you use <tt>bash</tt> as
your shell, or to your <tt>&tilde;/.profile</tt> if you use another
shell for logins.
Log out, and then log in again, so the environment variables are
registered. Then, run the command
<verb>
texconfig confall
</verb>
to insure that the installation is correct.
Next, you can configure teTeX for you specific hardware. See section
<ref id="post-install" name="Post-installation configuration
details">, below.
<sect1>Installing the CTAN source distribution. <label id="generic-CTAN">
<P>
To install teTeX V. 0.4 from the source code, <tt>ftp</tt> to a CTAN
site like <htmlurl url="ftp://ftp.tex.ac.uk"
name="ftp://ftp.tex.ac.uk"> and retrieve the files
<verb>
ctan/tex-archive/systems/unix/teTeX/distrib/INSTALL.src
ctan/tex-archive/systems/unix/teTeX/distrib/sources/README.texmf-src
ctan/tex-archive/systems/unix/teTeX/distrib/sources/teTeX-lib-0.4pl8.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/sources/teTeX-src-0.4pl7.tar.gz
</verb>
Read over the instructions in <tt>INSTALL.src</tt>, then <tt>su</tt>
to root and unpack the files in a directory for which you have
read-write-execute permissions.
Remember to use the <tt>p</tt> argument to <tt>tar</tt>, and also
remember to unset the <tt>noclobber</tt> option of <tt>bash</tt>.
You can do this with the counterintuitive command
<verb>
set +o noclobber
</verb>
Note that the argument <tt>+o</tt> to <tt>set</tt> <em>un</em>sets a
variable, just exactly backwards from what you might expect.
The file <tt>teTeX-lib-0.4pl8.tar.gz</tt> will create the directory
<tt>./teTeX</tt>. The file <tt>teTeX-src-0.4pl7.tar.gz</tt> will
create the directory <tt>teTeX-src-0.4</tt> Print out the file
<tt>INSTALL.src</tt> and keep it nearby for the following
steps. <tt>cd</tt> to the <tt>./teTeX-src-0.4</tt> directory, and, per
the instructions in the <tt>INSTALL.src</tt> file, edit
<tt>./Makefile</tt>. You need to set the <tt>TETEXDIR</tt> variable
to the absolute path of the parent teTeX directory. This will be the
subdirectory <tt>teTeX</tt> of the directory where you unpacked the
source and library archives. For example, if you unpacked the
archives in your home directory, you would set <tt>TETEXDIR</tt> to
<verb>
/home/john.q.public/teTeX
</verb>
The rest of the <tt>Makefile</tt> options are pretty generic. With
GCC version 2.7.2 and later, you should not need to make
any further adjustments unless you have a non-standard compiler and
library setup, or want the compiler to perform some further
optimizations, or for some other reason. Check that the
<tt>USE_DIALOG</tt>, <tt>USE_NCURSES</tt>, and <tt>HAVE_NCURSES</tt>
variables are set correctly for your system, because the
<tt>dialog</tt> program needs the ncurses library to be installed. A
<tt>ncurses</tt> library is included in the source distribution,
so the default values in the <tt>Makefile</tt> should work fine. If
you can't get <tt>ncurses</tt> to compile or link,
<tt>texconfig</tt> can also be run from the command line.
If you've done everything correctly up to this point, you should be
able to type <tt>make world</tt> in the top-level source directory,
and relax until the teTeX executables are built. This can take a few
hours.
After the build has completed, set the environment variables
<tt>&dollar;PATH, &dollar;MANPATH</tt>, and <tt>&dollar;INFOPATH</tt>
to include the teTeX directories. The statements which would be added
to the file <tt>&tilde;/.bash_profile</tt>, in the example, above,
would be
<verb>
export PATH=$PATH":/home/john.q.public/teTeX/bin/i386-linux"
export MANPATH=$MANPATH":/home/john.q.public/teTeX/man"
export INFOPATH=$INFOPATH":/home/john.q.public/teTeX/info"
</verb>
The <tt>&dollar;PATH</tt> variable is different in the source
distribution than in the binary distribution. Note that here the path
to the binaries is <tt>teTeX/bin/i386-linux</tt> instead of simply
<tt>teTeX/bin</tt> as in the binary distribution.
At this point you can run <tt>texconfig confall</tt> to ensure that
the paths have been set correctly, and then proceed to configure teTeX
as in the binary distribution. See the
section <ref id="post-install" name="Post-installation configuration
details">, below.
<sect1>Post-installation configuration details. <label id="post-install">
<P>
The first thing you want to do is look at Thomas Esser's
<tt>README</tt> file. It contains a lot of hints on how to configure
teTeX for your output device (i.e., printer). The <tt>README</tt>
file is located in the directory
<verb>
/usr/lib/teTeX/texmf/doc/tetex
</verb>
Read the file over with the command (the path in the following
examples is that of the Slackware distribution):
<verb>
less /usr/lib/teTeX/texmf/doc/tetex/README
</verb>
or, print it out with the command
<verb>
cat /usr/lib/teTeX/texmf/doc/tetex/README >/dev/lp0
</verb>
assuming that your printer is connected to <tt>/dev/lp0</tt>.
Substitute the device driver file that your printer is connected to,
as appropriate.
Or, better still, print it using the <tt>lpr</tt>
command:
<verb>
lpr /usr/lib/teTeX/texmf/doc/tetex/README
</verb>
You should have installed the printer daemon that is included with
your distribution of Linux. If not, do that now, per the instructions
that come with the package.
Print out the <tt>teTeX-FAQ.</tt> Keep the FAQ handy because it
contains useful hints for configuring teTeX's output drivers for your
printer. We'll get to that in a moment. In more recent releases of
teTeX, the <tt>teTeX-FAQ</tt> is viewable via the <tt>texconfig</tt>
utility.
Next, you want to define a directory to store your own TeX
format files. teTeX searches the directories listed by the
<tt>&dollar;TEXINPUTS</tt> environment variable for local TeX input
files:
<verb>
export TEXINPUTS=".:~/texinputs:"
</verb>
to the system-wide <tt>/etc/profile</tt> file. Individual users can
set their own local <tt>&dollar;TEXINPUTS</tt> directory, by adding
the line in their <tt>&tilde;/.profile</tt> or
<tt>&tilde;/.bash_profile</tt> if <tt>bash</tt> is the default
shell. The <tt>&dollar;TEXINPUTS</tt> environment variable tells
teTeX to look for users' individual TeX style files in the
<tt>&tilde;/texinputs</tt> directories under each user's home
directory. It is <em>critical</em> that a colon appear before and
after this directory. teTeX is going to append its own directory
searches to your own. You want to have teTeX search the local format
files first, so it uses the local versions of any of the standard
files you have edited.
Add the <tt>/usr/lib/teTeX/bin</tt> directory to the system-wide path
if you're installing teTeX as root. Again, if you're installing a
personal copy of teTeX, add the directory where the teTeX binaries are
located to <em>the front</em> your <tt>&dollar;PATH</tt> with the
following line in your <tt>&tilde;/.profile</tt> or
<tt>&tilde;/.bash_profile</tt>:
<verb>
export PATH="~/tetex/bin:"$PATH
</verb>
Now, log in as <tt>root</tt> and run <tt>texconfig</tt> per the
instructions in the <tt>teTeX-FAQ</tt> and choose the printer that is
attached to your system. Make sure that you configure teTeX for both
the correct printer and printer resolution.
Finally, run the <tt>texhash</tt> program. This ensures that teTeX's
internal database is up to date. The database is actually a
<tt>ls-lR</tt> file. You <em>must</em> run <tt>texhash</tt> every
time you change the system configuration, or teTeX will not be able to
locate your changes.
<sect>Appendix C: Distribution and Copyright. <label id="copyright"
<P>
<sect1>Distribution.
<P>
teTeX is <em>free software;</em> this means everyone is free to use
the software and free to redistribute it on certain conditions. The
package is not in the public domain. It is copyrighted and there are
restrictions on its distribution, but these restrictions are designed
to permit everything that a good cooperating citizen would want to do.
What is not allowed is to try to prevent others from further sharing
any version of free software that they might get from you. The
precise conditions are found in the GNU General Public License that
comes with many of the software packages and also appears following
this section.
One way to get a copy of the package is from someone else who has
it. You need not ask for our permission to do so, or tell any one
else; just copy it. If you have access to the Internet, you can get
the latest distribution versions by anonymous FTP. See the chapter
``Sources'' for more information.
You may also receive the software when you buy a computer. Computer
manufacturers are free to distribute copies on the same terms that apply
to everyone else. These terms require them to give you the full
sources, including whatever changes they may have made, and to permit
you to redistribute these packages received from them under the usual
terms of the General Public License. In other words, the program must
be free for you when you get it, not just free for the manufacturer.
You can also order copies of GNU software from the Free Software
Foundation on CD-ROM. This is a convenient and reliable way to get a
copy; it is also a good way to help fund our work. (The Foundation has
always received most of its funds in this way.) An order form is
included many distribution, and on our web site in
http://www.gnu.ai.mit.edu/order/order.html. For further
information, write to
<verb>
Free Software Foundation
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA
USA
</verb>
The income from distribution fees goes to support the foundation's
purpose: the development of new free software, and improvements to our
existing programs.
If you use GNU software at your workplace, please suggest that the
company make a donation. If company policy is unsympathetic to the idea
of donating to charity, you might instead suggest ordering a CD-ROM from
the Foundation occasionally, or subscribing to periodic updates.
<sect1>GNU GENERAL PUBLIC LICENSE
<P>
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
<bf>Preamble.</bf>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
<bf>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</bf>
<itemize>
<item>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The ``Program'' below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term,``modification.'') Each licensee is addressed as ``you.''
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
<item>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
<item>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
1. You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
2. You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
3. If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
<item>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
2. Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
3. Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
<item>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
<item>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
<item>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
<item>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
<item>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
<item>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and ``any
later version,'' you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
<item>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
<bf>NO WARRANTY</bf>
<item>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
<item>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</itemize>
<bf>END OF TERMS AND CONDITIONS</bf>
<sect1>How to Apply These Terms to Your New Programs
<P>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.
<verb>
[one line to give the program's name and an idea of what it does.
Copyright (C) 19[yy] [name of author]
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
</verb>
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
<verb>
Gnomovision version 69, Copyright (C) 19[yy] [name of author]
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
</verb>
The hypothetical commands ``<tt>show w</tt>'' and ``<tt>show c</tt>''
should show the appropriate parts of the General Public License. Of
course, the commands you use may be called something other than
``<tt>show w</tt>'' and ``<tt>show c</tt>''; they could even be
mouse-clicks or menu items---whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary. Here is a sample; alter the names:
<verb>
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
by James Hacker.
[signature of Ty Coon] 1 April 1989
Ty Coon, President of Vice
</verb>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</article>