pkg://Linux-HOWTOs.tar.gz:1682658/TeTeX-HOWTO
downloads
The teTeX HOWTO: The Linux-teTeX Local Guide
Robert Kiesling
v2.9.1, 21 August 1997
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 by Robert A. Kiesling.
Permission is granted to copy this document, in whole or in part, pro
vided that credit is given to the author and the Linux Documentation
Project. Registered trademarks are the property of their respective
holders. Please send all complaints, suggestions, errata, and any
miscellany to kiesling@terracom.net, so I can keep this document as
complete and up to date as possible.
1. Introduction.
FAQ No. 1. My computer just ate NINE high density diskettes' worth of
data. WHAT HAPPENED?
Answer: Installing teTeX on Chanel3, my Compaq laptop, was like
dropping a 20-foot concrete bridge section exactly into place from a
height of 50 feet. teTeX is a big package. Even so, it is a
moderately complete implementation of TeX 3.1415 and LaTeX 2e for
Linux systems. TeX is a big subject anyway, so you can expect to
spend the rest of your computing career keeping up-to-date on the
latest in the world of TeX. That is to say, installing and using
teTeX is not for the faint of heart. Nor is it for day trippers.
This package requires serious quality time.
Thomas Esser, the author of teTeX, has gone to great lengths to make
the package fast, complete, and easy to use. Because TeX is
implemented for practically every serious computer system in the
world---and quite a few ``non-serious'' ones---implementors must
provide the installation facilities for all of them. This accounts in
part for teTeX's size. It also accounts for the fact that the pieces
necessary to make a workable teTeX installation are spread all over
your friendly neighborhood CTAN archive.
CTAN is the Comprehensive TeX Archive Network, a series of anonymous
FTP sites which archive TeX programs, macros, fonts, and
documentation. You'll probably become familiar with at least one CTAN
site. In this document, a pathname like ~CTAN/contrib/pstricks means
``look in the directory contrib/pstricks of your nearest CTAN site.''
See section ``Appendix A'' for a current list of CTAN sites and their
mirror sites.
Fortunately, some considerate Linux Distribution implementors have
assembled the necessary pieces for us. teTeX comes with all the major
Linux distributions.
However, if you don't have the Slackware, RedHat, or Debian GNU/Linux
distribution, you can install teTeX from its official CTAN
distribution. In some cases this may be more desirable. See Section
3 for details.
If you already have teTeX installed on your system and want to jump
directly into figuring out how to use it, skip this section and the
next, and go directly to section ``Using teTeX''.
2. What is TeX? What is LaTeX? What is teTeX?
teTeX is an implementation of TeX for UNIX systems. It is the work of
Thomas Esser, te@informatik.uni-hannover.de. In the Linux versions of
teTeX, the executable programs themselves run under Linux and the
fonts are provided in form usable by the Linux-teTeX system. (The
sections covering teTeX installation concentrate on the i386 versions
of Linux. Installing teTeX for MkLinux or Linux for the Alpha should
require only substituting the appropriate binary-program archive in
the installation process.) The rest of the code, TeX and LaTeX
itself, is portable across various machines.
In addition to the executable programs, the distribution includes all
of the TeX and LaTeX package, metafont and its sources, bibtex(1),
makeindex(1), and all 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.
In comparison with other implementations of TeX, the installation of
teTeX is almost trivial, even without the Linux distribution packages,
if you don't count the effort necessary acquire the distributions via
anonymous FTP or insert and remove several dozen distribution
diskettes by hand. If your teTeX distribution arrived on a CD-ROM,
even less effort is required to install it.
TeX is a typesetting system developed by Professor Donald Knuth of
Stanford University. It is a lower-level typesetting language that
powers all of the higher-level packages like LaTeX. Essentially,
LaTeX is a set of TeX macros which 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. Which brings us to the next answer,
Answer: You have it backwards! I want to know what exactly I need to
get before I can have TeX on my system!
It's important to remember that TeX only handles the typesetting part
of the document preparation. Generating output with 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 typeset the input file
document with TeX to produce a device-independent output file, called
a .dvi file.
You also need output drivers for your printer and video display.
These output drivers translate TeX's .dvi output to display your
typeset document on the screen or on paper. This software is
collectively known as ``dviware.'' For example, TeX itself only makes
requests for fonts. It is up to the .dvi output translator to provide
the actual font to the display device if necessary, regardless of
whether it is the screen or a printer. This extra step may seem
overly complicated, but the abstraction allows documents to display
the same on different devices with no change to the original document.
In fact, 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.
(See the sections ``Characters and type styles'' and ``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 .tfm (TeX font metric) files. To generate
the other fonts you will need, it is simply a matter of installing the
metafont sources. teTeX's .dvi utilities will invoke metafont
automatically and generate the Computer Modern fonts you need, on-the-
fly.
By the way, the letters of the word ``TeX'' are Greek, tau-epsilon-
chi. This is not a fraternity. Instead, it is the root of the Greek
word, techne, which means art and/or science. ``TeX'' is not
pronounced like the first syllable in "Texas." The chi has no English
equivalent, but TeX is generally pronounced so that it rhymes with
``yecch,'' to use Professor Knuth's example from The TeXBook (see
below). When writing, "TeX," on character devices, always use the
standard capitalization, or the \TeX{} macro in typesetting. This is
how TeX is distinguished from other typesetting systems.
Speaking of typing, any of the editors which work under Linux---
nvi(1), jed(1), joe(1), jove(1), vi(1), vim(1), stevie(1), emacs(1),
microemacs---will work to prepare a TeX input file, as long as the
editor reads and writes plain-vanilla ASCII text. My preference is
emacs(1), the GNU version. There are several reasons for this:
· Emacs' TeX and LaTeX modes obviate the need for a stand-alone TeX
shell.
· Emacs can automatically insert TeX-style, ``curly quotes,'' as you
type, rather than the "ASCII-vanilla" kind.
· Emacs has integrated support for texinfo and makeinfo, a hypertext
documentation system.
· Emacs is widely supported. Version 19.34, for example, is included
in the major U.S. Linux distributions.
· Emacs does everything except butter the toast in the morning.
· Emacs is free.
There's a lot of software to assemble. In the meantime, you can start
in ``learning'' TeX and LaTeX. Remember that teTeX and the font
packages have been designed as two separate entities: The teTeX
executable programs and shell scripts, as distributed with Linux, have
been built specifically for the system, but the CM, DC, American
Mathematical Society, or other font distributions work on many
different platforms. While you are working on assembling the files,
you can take a few breaks to locate some of the documentation you will
need.
2.1. Resources for further information.
There are user manuals available both commercially and via the
Internet. Judging by the number of mentions they receive in the
Usenet comp.text.tex newsgroup, the most useful---and
definitive---commercially available texts for beginners are:
LaTeX: A Document Preparation System, by Leslie Lamport, 272 pp. If
you're using LaTeX instead of plain TeX (highly recommended), this is
the definitive reference.
If you must use plain TeX, The TeXBook by Donald Knuth, 483 pp., is
the definitive reference. It is also necessary if you plan to do any
serious class, package, or macro writing for LaTeX.
The LaTeX Companion, by Michel Goosens, Frank Mittelbach, and
Alexander Samarin, 530 pp., is more advanced than the Lamport, above.
If you are approaching TeX or LaTeX for the first time, you may feel
lost reading this. (I was.) However, when you need to add extension
packages, like PSNFSS (See the section titled, ``Using PostScript
fonts''.), or bibtex(1), a bibliography indexing program, this book is
one of the most highly regarded on the market.
At your nearest CTAN site you can retrieve these documents for free:
The Not So Short Introduction to LaTeX2e, by Tobias Oetiker, Hubert
Partl, Irene Hyna, and Elisabeth Schlegl, 69 pp. This wonderful
document is located at ~CTAN/packages/TeX/info/lshort/*.
You can get a PostScript or .dvi version of the document ready for
printing, or the native LaTeX document. There is also a version
available in German: lkurz.*. Make sure to read the README file before
assembling!
A Gentle Introduction to TeX: A Manual for Self-Study, by Michael
Doob, 91 pp. You can find this document at:
~CTAN:packages/TeX/info/gentle.tex. Almost of necessity, this document
covers less ground than its LaTeX counterpart, above. However, it
will get you to the same place as the LaTeX manuals. If you must use
plain TeX for your documents, this document clarifies many of the
complexities of plain TeX and makes its use almost easy.
``IMPRINT: The Newsletter of Digital Typography,'' edited by Robert
Kiesling. I realize that this is BLATANT and SHAMELESS self-
promotion. But, you should know anyway, that IMPRINT is a free,
ASCII-text newsletter which is available via e-mail. IMPRINT appears
approximately monthly and covers a broad range of text processing and
digital imaging topics, both beginning and advanced. Many of the
items covered apply directly or indirectly to TeX'ing. The emphasis
is on production of industry-standard typeset and printed material.
To subscribe to IMPRINT, send a brief, human-readable message to me at
imprint@macline.com.
The LaTeX Catalogue is a bibtex(1) database of available LaTeX
packages, compiled and maintained by Graham Williams. It's included
with teTeX, and the most recent version is available on the World Wide
Web. Do you need a package that prints borders, or makes margin
notes? You'll find that the package you need is listed here. The
LaTeX Catalogue is located in your local teTeX library in the
directory teTeX/texmf/doc/Catalog, and on the Web at
http://cbr.dit.csiro.au/~gjw. See section ``LaTeX extension packages
and other resources'' for further details about LaTeX packages.
Thomas Merz's Ghostscript Manual, which is the Ghostscript appendix of
his book, PostScript Acrobat/PDF: Applications, Troubleshooting, and
Cross-Platform Publishing. It is available from the Ghostscript Home
Page (see the section ``Ghosctscript V. 5.03''), or from Merz's home
page, http://www.muc.de/~tm/.
There are, of course, other guides available to using TeX and LaTeX.
They cover different aspects of these systems to varying degrees. The
reference documents cited above, however, are the most comprehensive
in scope that I have seen and are aimed at beginners (or near-
beginners).
If the going gets especially tough, you can probably do a little extra
shopping at Office Max, Office Depot, Staples, or your local
stationer, and pick up several reams of three-hole punched, photocopy
paper, two or three, three-inch binders, and some index tabs. When it
comes time to print the documents, you'll need a place to keep them,
and they seem to be more useful if they are kept on paper. This must
be one of the stranger phenomena of technical documentation.
You will note, however, that the references mentioned above are
hardware-independent. They won't tell you a thing about running teTeX
specifically. Many of them, in fact, refer to some mythical ``Local
Guide.'' This, and several of the documents that come bundled with
teTeX, comprise the less-than-mythical Local Guide to installing and
operating teTeX with Linux.
3. Installation notes.
All of the major Linux distributions include packaged versions of
teTeX, and each distribution has its own idiosyncrasies. The
packaging methods of each distribution are, for the most part,
incompatible. If you try to install teTeX from another distribution,
you may succeed in installing the package, but you're certain to mess
up the package-management database on your system. When installing
teTeX, please consult the section below that corresponds to your Linux
distribution.
Installing teTeX is surprisingly easy for a package of this magnitude.
This document covers only the major free U.S. Linux distributions,
because I haven't had time to obtain or install European Linux
distributions like S.u.S.E.
However, the generic, teTeX distribution isn't any harder to install
than the Linux packages. See section ``Generic CTAN distribution'',
below.
You should consider installing the generic teTeX distribution from the
CTAN archives if:
· Your system isn't based on one of the standard Linux distributions.
· You don't have root privileges on your system.
· You want or need to have the very latest version of teTeX, or
LaTeX.
· You don't have enough disk space available for a full installation.
· You want to install teTeX somewhere instead of the /usr file
system.
· 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 source distribution. See
section ``Installing the source distribution'', below.
· You want the latest versions of teTeX's public domain Type 1 fonts,
which are significantly better than the fonts included in earlier
releases.
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(1)
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?
Ghostscript V. 5.03 allows printing of PostScript documents on non-
PostScript printers, and allows previewing of PostScript documents on
VGA monitors and X Window System displays. If you already have a
PostScript printer, you won't need Ghostscript simply to print
PostScript documents. Ghostscript has many other capabilities,
however, which are beyond the scope of this HOWTO.
APSFILTER can automate document post processing and printing, and make
life with your printer a lot easier. See the section titled
``APSFILTER''.
For information on how to install a printer daemon and generally
configure printers for Linux, see the section titled ``The lpd(8)
daemon'', and consult the Printing-HOWTO.
3.1. Generic CTAN distribution, V. 0.4.
You can retrieve the files from one of the CTAN archives listed in
section ``Appendix A''. In the examples below, the files were
retrieved from the CTAN archive at ftp.tex.ac.uk.
3.1.1. Installing the binary distribution.
3.1.1.1. Minimal installation.
First, FTP to ftp.tex.ac.uk and cd to the directory
ctan/tex-archive/systems/unix/teTeX/distrib/
Retrieve the files
INSTALL.bin
install.sh
and place them in the top-level directory where you want to install
teTeX, for example, /var/teTeX if you plan to install teTeX in the
/var file system.
Print out the INSTALL.bin 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
ctan/tex-archive/systems/unix/teTeX/distrib/base/latex-base.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/base/tetex-base.tar.gz
You'll also need one of two archives which contain the executable
teTeX programs. Retrieve the archive file
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linux.tar.gz
if your system uses the Linux ELF shared libraries, ld.so(1) of at
least version 1.73, and clibs of at least version 5.09. If it
doesn't, retrieve the archive
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linuxaout.tar.gz
which is compiled for systems that use the older, a.out-format static
libraries.
Then, following the instructions in the file INSTALL.bin, execute the
command
sh ./install.sh
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 config
ure the basic teTeX system, see section ``Base system configuration'',
below.
To install the remaining packages, see the next section.
3.1.1.2. Complete installation.
To perform a complete teTeX installation, retrieve the archive files
listed in the previous section, as well as the following files:
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
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
sh ./install.sh
3.1.1.3. Base system configuration.
The install.sh 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
/home/john.q.public/teTeX
and, after returning to the main menu, select ``I'' to proceed with
the installation. Note that the directory must not exist already: the
install.sh 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
/home/john.q.public/texfonts
or, if you want the generated fonts to be accessible by all users on
the system, specify a directory like
/var/texfonts
I would recommend that you not, however, use the default
/var/tmp/texfonts 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 install.sh 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 $PATH environment variable, and the
directories where the man pages and info files reside to your $MANPATH
and $INFOPATH environment variables. For example, add the statements
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"
to your ~/.bash_profile if you use bash(1) as your shell, or to your
~/.profile if you use another shell for logins.
Log out, and then log in again, so the environment variables are
registered. Then, run the command
texconfig confall
to insure that the installation is correct.
Next, you can configure teTeX for you specific hardware. See section
``Post-installation configuration details'', below.
3.1.2. Installing the source distribution.
To install teTeX V. 0.4 from the source code, ftp to a CTAN site like
ftp://ftp.tex.ac.uk and retrieve the files
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
Read over the instructions in INSTALL.src, then su to root and unpack
the files in a directory for which you have read-write-execute
permissions.
Remember to use the p argument to tar(1), and also remember to unset
the noclobber option of bash(1). You can do this with the
counterintuitive command
set +o noclobber
Note that the argument +o to set unsets a variable, just exactly back
wards from what you might expect.
The file teTeX-lib-0.4pl8.tar.gz will create the directory create the
directory teTeX-src-0.4 Print out the file INSTALL.src and keep it
nearby for the following steps. cd to the ./teTeX-src-0.4 directory,
and, per the instructions in the INSTALL.src file, edit to the
absolute path of the parent teTeX directory. This will be the
subdirectory teTeX 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 TETEXDIR to
/home/john.q.public/teTeX
The rest of the Makefile options are pretty generic. With gcc(1) ver
sion 2.7.2 and later, you should not need to make any further adjust
ments 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 USE_DIALOG, USE_NCURSES, and
HAVE_NCURSES variables are set correctly for your system, because the
dialog program needs the ncurses library to be installed. A
ncurses(3x) library is included in the source distribution, so the
default values in the Makefile should work fine. If you can't get
ncurses(3x) to compile or link, texconfig(1) can also be run from the
command line.
If you've done everything correctly up to this point, you should be
able to type make world 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 $PATH,
$MANPATH, and $INFOPATH to include the teTeX directories. The
statements which would be added to the file ~/.bash_profile, in the
example, above, would be
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"
The $PATH variable is different in the source distribution than in the
binary distribution. Note that here the path to the binaries is
teTeX/bin/i386-linux instead of simply teTeX/bin as in the binary dis
tribution.
At this point you can run texconfig confall to ensure that the paths
have been set correctly, and then proceed to configure teTeX as in the
binary distribution. See the section ``Post-installation
configuration details'', below.
3.2. Linux packages.
3.2.1. Slackware 3.2.
First, ftp to your nearest Linux archive site. Mine is
wuarchive.wustl.edu. Then find the directory with the Slackware
distribution diskettes. On wuarchive.wustl.edu, this is
systems/linux/sunsite/distributions/Slackware/slakware/.
Linux sites which mirror sunsite.unc.edu will store these diskettes in
the directory distributions/Slackware/slakware/. teTeX, the full
package, is contained on the Slackware disk series t. So, grab all
nine disks' worth of the t series, disks t1 - t9. Be sure to keep them
in order, too. Either store the files in separate subdirectories
labeled t1 - t9 on a hard drive partition, or on diskettes, and label
the diskettes t1 through t9. We're going to install them by hand.
This isn't difficult. The Slackware installer creates the directories
and unpacks the files. It also provides descriptions of each module
in the distribution, which allows you to decide whether you want to
install it or not. In the case of teTeX, however, you are simply
going to install everything, because that's what you should do anyway.
Let's assume that you have all nine diskettes' worth of the Slackware
teTeX distribution ready at hand, organized as described above.
You'll have a lot of files which have the extension .tgz. This is
shorthand for a tar(1) archive compressed with gzip(1). The names all
fit the 8+3 filename limitations of MS-DOG. Aren't you glad you
decided to scrap your DOG partitions and install Linux instead? You
can use a MS-DOG hard disk partition or DOG-format diskettes to store
the files. The archives also begin with the letters tb, td, or tm,
and so on, which is the implementors' shorthand for TeX binary, TeX
documentation, TeX macro, and so on. The difference to you is
academic, because you'll be installing everything anyway.
Simply fire up the Slackware install utility. You needn't concern
yourself with reconfiguring the system, so select the option to add
new software. Select the appropriate source media (diskettes, HD
partition, or CD-ROM), specify that you want to install the Slackware
t series, and that you do not want to be prompted -- simply install
all the archives on the Slackware t series diskettes. You'll be
prompted to insert each diskette in the floppy drive if you're
installing from diskettes. If you're installing from a hard drive or
CD-ROM, no more intervention is required by you.
3.2.1.1. Manual Slackware install.
This section is for people who, for one reason or another, would like
to install teTeX manually from a Linux package.
Let's assume that you've assembled the Slackware teTeX distribution on
floppy diskettes labelled t1 thru t9. Mount the t1 diskette like this
mount /dev/fd0 /mnt
if your Linux configuration is a standard configuration. Actually,
any mount point will do. You'll simply need to substitute the appro
priate path spec in the next few steps.
The next thing you want to do is create the teTeX top-level directory.
teTeX's internal paths are specified relative to its binary program
files, but the Slackware distribution is archived relative to the root
directory. So the top-level teTeX directory is:
/usr/lib/teTeX
For each of the .tgz archive files in the distribution, copy the
archive file to the /usr/lib/teTeX directory and repeat the following
commands:
You should be logged in as root and in the top-level directory, /, for
these steps. I've used the tb-xfig.tgz archive for demonstration
purposes. Of course, you'll want to substitute the name of whichever
archive you're unpacking.
cp /mnt/tb-xfig.tgz /usr/lib/teTeX
tar -zxvf /usr/lib/teTeX/tb-xfig.tar # v to see what's going on!
rm /usr/lib/teTeX/tb-xfig.tgz
Most Slackware packages that I've seen also include an install script,
which the Slackware installer executes after unpacking the files.
Look in the directory /install after you've unpacked the files. If
there's a script there called doinst.sh, execute that, as root, by
typing
sh < /install/doinst.sh
It may be alarming to watch all those filenames scrolling of the top
of the screen as the archives are unpacked. Relax! Take a break, and
freshen up your coffee (or grab another JOLT from the refrigerator, or
otherwise replenish whatever you're drinking). There's only a few
more steps you need to perform to install teTeX. They're covered in
Section 4.
3.2.2. Debian GNU/Linux, V. 1.3.
Installing teTeX from Debian packages is truly trivial. ftp the most
recent stable versions of the teTeX archive files from ftp.debian.org.
The teTeX distribution is located in the directory
pub/debian/bo/binary-i386/tex
Retrieve the following Debian archive files via anonymous FTP (remem
bering to set binary mode for the transfers).
tetex-base_0.4pl6-5.deb
tetex-bin_0.4pl6-8.deb
tetex-dev_0.4pl6-8.deb
tetex-doc_0.4pl6-1.deb
tetex-extra_0.4pl6-4.deb
Once the files are safely transferred to your local hard disk, su to
root, and install them using the dpkg(1) utility:
dpkg -i tetex-base_0.4pl6-5.deb
dpkg -i tetex-bin_0.4pl6-8.deb
dpkg -i tetex-dev_0.4pl6-8.deb
dpkg -i tetex-doc_0.4pl6-1.deb
dpkg -i tetex-extra_0.4pl6-4.deb
Installation will take some time, because the Debian archives contain
the shell scripts necessary to check for old TeX installations, build
the TeX and LaTeX .fmt files, build the path-searching database, and
see to other configuration details. However, once they are finished,
you should have an operational teTeX installation that needs only to
be configured for the details of your local system; see section
``Post-installation configuration details''.
3.2.3. RedHat V. 4.2.
Presumably, you could install only selected portions of the teTeX
RedHat distribution, but consistent with the philosophy of the other
sections, it is assumed that you will eventually need all of the
facilities provided by teTeX, and so you should install the complete
distribution.
To install teTeX from RedHat Linux RPM packages, under RedHat Linux v.
4.2, ftpto sunsite.unc.edu and cd to the directory
pub/Linux/distributions/redhat/current/i386/RedHat/RPMS/
Set binary mode for the transfers and retrieve the following files:
tetex-0.4pl8-5.i386.rpm
tetex-latex-0.4pl8-5.i386.rpm
tetex-afm-0.4pl8-5.i38 6.rpm
tetex-dvilj-0.4pl8-5.i386.rpm
tetex-dvips-0.4pl8-5.i386.rpm
tetex-xdvi-0.4pl8-5.i386.rpm
tetex-texmf-src-0.4pl8-5.i386.rpm
This last file may not be strictly necessary. It contains the LaTeX
sources, if you want to install LaTeX yourself. If you're thinking of
upgrading LaTeX independently of the binaries in the future, this
archive could be useful to have around:
Simply install the files above in the order given, using the rpm -i
command, and proceed to the section, ``Post-installation configuration
details''.
3.3. Ghostscript V. 5.03.
Ghostscript development is rapid, and the changes which are
incorporated into every new version are significant. Therefore, it's
worth the effort to install the version of Ghostscript that is
available on its home page, http://www.cs.wisc.edu/~ghost.
At the time of this writing, the current version is 5.03. The
Ghostscript archive for Linux is composed of the following files:
ghostscript-5.03gnu.tar.gz
ghostscript-5.03jpeg.tar.gz
ghostscript-5.03libpng.tar.gz
ghostscript-5.03zlib.tar.gz
ghostscript-fonts-std-5.03.tar.gz
ghostscript-fonts-other-5.03.tar.gz
What is Ghostscript, and why do you need it? Technically, Ghostscript
is a Raster Image Processor. It translates PostScript code into many
common, bit-mapped formats, like those understood by your printer or
screen, whether or not they are equipped with PostScript. In
practical terms, Ghostscript allows you to use Type 1 fonts, and mix
text and graphics on any printer or video display that Ghostscript
knows about.
The quality of the fonts which come with the program have improved
steadily in the last several versions as well. Or maybe it's that
more recent versions of Ghostscript have improved font rendering. In
either case, this is of real benefit for Linux users, who may not be
able to spend hundreds of dollars on commercial fonts. Because
Ghostscript is able to read the font requests made by dvips(1),
Ghostscript's font library provides the fonts, not teTeX. But the
font metrics files for Ghostscript's font library, which have the
extension .afm, are already included in the teTeX distribution.
For information about using Ghostscript, see the file use.txt in the
Ghostscript distribution, and the Linux Documentation Project's
Printing-HOWTO. There's also a Ghostscript manual available from the
Internet. See section ``Resources for further information''
Or, install APSFILTER and let that run Ghostscript automatically.
(See section ``APSFILTER'').
A final, significant note: I would recommend that you compile
Ghostscript for your own system, if possible. Combining different
versions of Ghostscript and svgalib can quickly become confusing. The
version of Ghostscript which is included in the Slackware AP set is
version 2.6.2 and does not have X support compiled in. You might also
have trouble finding the correct svgalib versions for it. There is
supposedly a version of Ghostscript with X11 support in the Slackware
XAP distribution series, and presumably in the other Linux
distributions, though I haven't tried them. Compiling Ghostscript for
your own system is far easier, it seems to me.
It's also important to remember that there are two Ghostscript
releases in distribution: the commercial, Aladdin Ghostscript, and GNU
Ghostscript, which lags behind Aladdin Ghostscript by several years.
This is due to Ghostscript's unique licensing arrangement. See the
Printing-HOWTO for more information about Ghostscript licensing.
svgalib support for GNU Ghostscript 3.33 is included in a small
archive which contains a .diff file. Ghostscript 3.33 for X is also
configured for JPEG support, so you should include the JPEG library
sources as well. The relevant archives can be found at any GNU
distribution site, like ftp://prep.ai.mit.edu/pub/gnu.
3.4. APSFILTER.
There are software packages which will simplify your life, and
APSFILTER is one of them. Written by Andreas Klemm, APSFILTER works
with any BSD-compatible printer daemon (which means that you have the
lpd(8) program and an /etc/printcap file; see below), and provides
transparent printer support for ASCII, DVI, and PostScript files, as
well as files compressed by gzip(1), compress(1), and other data
compression software.
Once you have successfully installed APSFILTER, you can print a
PostScript file to whatever printer you have, by typing
lpr file.ps
Or, to print an ASCII file without PostScript translation, you can
type
lpr -Praw file.asc
Amazing.
APSFILTER is surprisingly easy to install, considering that it works
with many disparate elements of your system. Installing the generic
APSFILTER distribution, however, does require that you have a current
gcc(1) compiler on hand, because APSFILTER builds some of its filters
during installation. Some distributions of Linux, however, provide a
pre-built version, so check your specific distribution first.
In any event, you will need a correctly installed Ghostscript and
lpd(8) installation for APSFILTER to work. The most recent APSFILTER
is located in the Linux Archives at
ftp://sunsite.unc.edu/pub/Linux/system/printing/.
3.5. The lpd(8) daemon.
There are wide variations in printers and configurations. Setting up
a working printer daemon is no mean feat. If you're using teTeX on an
individual system, you could simply dump the output to the printer
device driver file, but this is less than desirable. You lose the
filtering capabilities of the printer daemon. If you're printing on a
network, having a working printer daemon is a must.
The basic UNIX program for printer management on BSD-style systems is
lpd(8). When you print a file with lpr(1) you are really sending the
file to a print queue. lpd(8) prints files in the order they're
queued. Other printer utilities include lpq(1), which displays the
contents of the print queue, and lprm(1), which removes (dequeues)
files from the print queue.
The printer daemon can perform other tasks, like transparently
filtering output from various programs (using filter programs like
APSFILTER, above), accept print jobs from other machines on a network,
send print jobs to various printers if you have more than one
connected, and hold print output until you've refilled the paper feed
tray.
The Printing-HOWTO explains the process of setting up a working
printer daemon in detail. Many Linux distributions already have
configured lpd(8) suites. Check there first, because it will save you
considerable work. They're usually archived, strangely enough, using
the name lpr, so search for that program. There is also a printer
daemon suite available from the Linux archives, at
ftp://sunsite.unc.edu/pub/Linux/system/printing.
4. Post-installation configuration details.
The first thing you'll want to do is look at Thomas Esser's README
file. It contains a lot of hints on how to configure teTeX for your
output device (i.e., printer). The README file is located in the
directory
/usr/lib/teTeX/texmf/doc/tetex
Read the file over with the command (the path in the following exam
ples is that of the Slackware distribution):
less /usr/lib/teTeX/texmf/doc/tetex/README
or, print it out with the command
cat /usr/lib/teTeX/texmf/doc/tetex/README >/dev/lp0
assuming that your printer is connected to /dev/lp0. Substitute the
device driver file that your printer is connected to, as appropriate.
Or, better still, print it using the lpr(1) command:
lpr /usr/lib/teTeX/texmf/doc/tetex/README
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. If you don't have one of the packages, or
want to install a printer daemon yourself, see section ``The lpd(8)
daemon''
Print out the teTeX-FAQ. 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 teTeX-
FAQ is viewable via the texconfig utility.
Next, you want to define a directory to store your own TeX format
files. teTeX searches the directories listed by the $TEXINPUTS
environment variable for local TeX input files. On Chanel3, I added
the line
export TEXINPUTS=".:~/texinputs:"
to the system-wide /etc/profile file. Individual users can set their
own local $TEXINPUTS directory, by adding the line in their ~/.profile
or ~/.bash_profile if bash(1) is the default shell. The $TEXINPUTS
environment variable tells teTeX to look for users' individual TeX
style files in the ~/texinputs directories under each user's home
directory. It is critical 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 /usr/lib/teTeX/bin 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
the front your $PATH with the following line in your ~/.profile or
~/.bash_profile:
export PATH="~/tetex/bin:"$PATH
Now, log in as root and run texconfig per the instructions in the
teTeX-FAQ 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 texhash program. This ensures that teTeX's internal
database is up to date. The database is actually a ls-lR file. You
must run texhash every time you change the system configuration, or
teTeX will not be able to locate your changes.
4.1. What if my printer isn't included?
The teTeX distribution comes with only a limited selection of DVI
output drivers: dvips(1), 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 dvips(1) 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 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
own DVI driver using the templates available there. The library's URL
is ftp://ftp.math.utah.edu/pub/tex/dvi/.
5. Using teTeX.
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
``Hello, World!''
as Professor Knuth suggests in the The TeXBook, we'll produce a couple
of teTeX's own documents in order to test it.
The next section, ``Printing the documentation'', is really a tutorial
for operating teTeX. It covers printing the documentation included
with teTeX (which is in LaTeX and ``cookbook'' than a tutorial. It
discusses how to format LaTeX documents, and covers a few of the
commands and environments of the more commonly used document classes.
The section ``LaTeX extension packages and other resources'' tells how
to use the many pre-existing LaTeX packages to customize documents to
your specifications.
5.1. Printing the documentation.
You should be logged in as root 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 texconfig 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 root, 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
/usr/lib/teTeX/texmf/doc/tetex.
The LaTeX source for the manual is called TETEXDOC.tex. (The editors,
like emacs(1), can tell the difference.) There is also a file
TETEXDOC.dvi included with the distribution, which you might want to
keep in a safe place---say, another directory ---in case you want to
test your .dvi drivers later. With that out of the way, type
latex TETEXDOC.tex
LaTeX will print several warnings. The first,
LaTeX Warning: Label(s) may have changed. Rerun to get the
cross-references right.
is standard. It's common to build a document's Table of Contents by
LaTeXing the document twice. So, repeat the command. The other warn
ings 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. (If you're really inquisitive, look at one of the TeX
references for a discussion of \hbox and \vbox.)
teTeX will have generated several files from TETEXDOC.tex. The one
that we're interested in is TETEXDOC.dvi. 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 xdvi(1).
For the present, let's assume that you have a HP LaserJet II. You
would give the command
dvilj2 TETEXDOC.dvi
which will write a PCL output file from TETEXDOC.dvi, including soft
fonts which will be downloaded to the LaserJet. This is not a feature
of TeX or LaTeX, but a feature provided by dvilj2(1). Other .dvi
drivers provide features which are relevant to the devices they sup
port. dvilj2(1) will fill the font requests which were made in the
original LaTeX document with the the closest equivalents available on
the system. In the case of a plain-text document like TETEXDOC.tex,
there isn't much difficulty. All of the fonts requested by TETEX
DOC.tex will be generated by metafont, which is automatically invoked
by dvilj2(1) and generates the fonts if they aren't already present.
(If you're running dvilj2(1) for the first time, the program needs to
generate all of the fonts, which could take up to several days if
you're using a really slow machine.) There are several options which
control font generation via dvilj2(1); they're outlined in the manual
page. At this point, you shouldn't need to operate metafont directly.
If you do, then something has gone awry with your installation. All
of the .dvi drivers will invoke metafont directly via the kpathsea
path-searching library---also beyond the scope of this document---and
you don't need to do any more work with metafont for the present---all
of the metafont sources for the Computer Modern font library are pro
vided.
You can print TETEXDOC.lj with the command
lpr TETEXDOC.lj
You may need to install a printer filter that understands PCL. Look
at the Printing-HOWTO for details.
T