old-www/HOWTO/TeTeX-HOWTO-9.html

382 lines
17 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The teTeX HOWTO: The Linux-teTeX Local Guide: Appendix B: Installing the CTAN teTeX distribution. </TITLE>
<LINK HREF="TeTeX-HOWTO-10.html" REL=next>
<LINK HREF="TeTeX-HOWTO-8.html" REL=previous>
<LINK HREF="TeTeX-HOWTO.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="TeTeX-HOWTO-10.html">Next</A>
<A HREF="TeTeX-HOWTO-8.html">Previous</A>
<A HREF="TeTeX-HOWTO.html#toc9">Contents</A>
<HR>
<H2><A NAME="ctan-install"></A> <A NAME="s9">9. Appendix B: Installing the CTAN teTeX distribution. </A></H2>
<P>The generic, teTeX distribution isn't any harder to install than the
Linux packages. See section
<A HREF="#generic-CTAN">Generic CTAN distribution</A>, below.
<P>You should consider installing the generic teTeX distribution from the
CTAN archives if:
<UL>
<LI>Your system isn't based on one of the standard Linux
distributions. </LI>
<LI>You don't have root privileges on your system.</LI>
<LI>You want or need to have the very latest version of teTeX, or LaTeX.</LI>
<LI>You don't have enough disk space available for a full
installation.</LI>
<LI>You want to install teTeX somewhere instead of the <CODE>/usr</CODE> file
system.</LI>
<LI>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
<A HREF="#generic-CTAN">Installing the source distribution</A>, below.</LI>
<LI>You want the latest versions of teTeX's public domain Type 1
fonts, which are significantly better than the fonts included in
earlier releases.</LI>
</UL>
<P>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?
<P>You can retrieve the files from one of the CTAN archives listed in
section
<A HREF="TeTeX-HOWTO-8.html#ctan-list">Appendix A</A>. In the examples
below, the files were retrieved from the CTAN archive at
<A HREF="ftp://ftp.tex.ac.uk">ftp.tex.ac.uk</A>.
<P>
<H2><A NAME="ss9.1">9.1 Installing the binary distribution.</A>
</H2>
<P>
<P>
<H3><A NAME="minimal-installation"></A> Minimal installation. </H3>
<P>
<P>First, FTP to
<A HREF="ftp://ftp.tex.ac.uk/ctan/tex-archive/systems/unix/teTeX/contrib">ftp.tex.ac.uk</A> and <CODE>cd</CODE> to the directory
<PRE>
ctan/tex-archive/systems/unix/teTeX/distrib/
</PRE>
Retrieve the files
<PRE>
INSTALL.bin
install.sh
</PRE>
and place them in the top-level directory where you want to install
teTeX, for example, <CODE>/var/teTeX</CODE> if you plan to install teTeX
in the <CODE>/var</CODE> file system.
<P>Print out the <CODE>INSTALL.bin</CODE> 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
<PRE>
ctan/tex-archive/systems/unix/teTeX/distrib/base/latex-base.tar.gz
ctan/tex-archive/systems/unix/teTeX/distrib/base/tetex-base.tar.gz
</PRE>
You'll also need one of two archives which contain the executable
teTeX programs. Retrieve the archive file
<PRE>
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linux.tar.gz
</PRE>
if your system uses the Linux ELF shared libraries, <CODE>ld.so</CODE>
of at least version 1.73, and clibs of at least version 5.09. If it
doesn't, retrieve the archive
<PRE>
ctan/tex-archive/systems/unix/teTeX/distrib/binaries/i386-linuxaout.tar.gz
</PRE>
which is compiled for systems that use the older, a.out-format static
libraries.
<P>Then, following the instructions in the file <CODE>INSTALL.bin</CODE>,
execute the command
<PRE>
sh ./install.sh
</PRE>
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
<A HREF="#base-config">Base system configuration</A>, below.
<P>To install the remaining packages, see the next section.
<P>
<H3><A NAME="complete-installation"></A> Complete installation. </H3>
<P>To perform a complete teTeX installation, retrieve the archive files
listed in the previous section, as well as the following files:
<PRE>
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
</PRE>
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
<PRE>
sh ./install.sh
</PRE>
<H2><A NAME="base-config"></A> <A NAME="ss9.2">9.2 Base system configuration. </A>
</H2>
<P>The <CODE>install.sh</CODE> 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
<PRE>
/home/john.q.public/teTeX
</PRE>
and, after returning to the main menu, select ``I'' to proceed with the
installation. Note that the directory must not exist already: the
<CODE>install.sh</CODE> script must be able to create it.
<P>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
<PRE>
/home/john.q.public/texfonts
</PRE>
or, if you want the generated fonts to be accessible by all users on
the system, specify a directory like
<PRE>
/var/texfonts
</PRE>
I would recommend that you <EM>not,</EM> however, use the default
<CODE>/var/tmp/texfonts</CODE> 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.
<P>After you've selected the option ``I'', and <CODE>install.sh</CODE> 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 <CODE>$PATH</CODE>
environment variable, and the directories where the man pages and info
files reside to your <CODE>$MANPATH</CODE> and
<CODE>$INFOPATH</CODE> environment variables. For example, add the
statements
<PRE>
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"
</PRE>
to your <CODE>~/.bash_profile</CODE> if you use <CODE>bash</CODE> as
your shell, or to your <CODE>~/.profile</CODE> if you use another
shell for logins.
<P>Log out, and then log in again, so the environment variables are
registered. Then, run the command
<PRE>
texconfig confall
</PRE>
to insure that the installation is correct.
<P>Next, you can configure teTeX for you specific hardware. See section
<A HREF="#post-install">Post-installation configuration details</A>, below.
<P>
<H2><A NAME="generic-CTAN"></A> <A NAME="ss9.3">9.3 Installing the CTAN source distribution. </A>
</H2>
<P>To install teTeX V. 0.4 from the source code, <CODE>ftp</CODE> to a CTAN
site like
<A HREF="ftp://ftp.tex.ac.uk">ftp://ftp.tex.ac.uk</A> and retrieve the files
<PRE>
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
</PRE>
<P>Read over the instructions in <CODE>INSTALL.src</CODE>, then <CODE>su</CODE>
to root and unpack the files in a directory for which you have
read-write-execute permissions.
<P>Remember to use the <CODE>p</CODE> argument to <CODE>tar</CODE>, and also
remember to unset the <CODE>noclobber</CODE> option of <CODE>bash</CODE>.
You can do this with the counterintuitive command
<PRE>
set +o noclobber
</PRE>
Note that the argument <CODE>+o</CODE> to <CODE>set</CODE> <EM>un</EM>sets a
variable, just exactly backwards from what you might expect.
<P>The file <CODE>teTeX-lib-0.4pl8.tar.gz</CODE> will create the directory
<CODE>./teTeX</CODE>. The file <CODE>teTeX-src-0.4pl7.tar.gz</CODE> will
create the directory <CODE>teTeX-src-0.4</CODE> Print out the file
<CODE>INSTALL.src</CODE> and keep it nearby for the following
steps. <CODE>cd</CODE> to the <CODE>./teTeX-src-0.4</CODE> directory, and, per
the instructions in the <CODE>INSTALL.src</CODE> file, edit
<CODE>./Makefile</CODE>. You need to set the <CODE>TETEXDIR</CODE> variable
to the absolute path of the parent teTeX directory. This will be the
subdirectory <CODE>teTeX</CODE> 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 <CODE>TETEXDIR</CODE> to
<PRE>
/home/john.q.public/teTeX
</PRE>
The rest of the <CODE>Makefile</CODE> 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
<CODE>USE_DIALOG</CODE>, <CODE>USE_NCURSES</CODE>, and <CODE>HAVE_NCURSES</CODE>
variables are set correctly for your system, because the
<CODE>dialog</CODE> program needs the ncurses library to be installed. A
<CODE>ncurses</CODE> library is included in the source distribution,
so the default values in the <CODE>Makefile</CODE> should work fine. If
you can't get <CODE>ncurses</CODE> to compile or link,
<CODE>texconfig</CODE> can also be run from the command line.
<P>If you've done everything correctly up to this point, you should be
able to type <CODE>make world</CODE> in the top-level source directory,
and relax until the teTeX executables are built. This can take a few
hours.
<P>After the build has completed, set the environment variables
<CODE>$PATH, $MANPATH</CODE>, and <CODE>$INFOPATH</CODE>
to include the teTeX directories. The statements which would be added
to the file <CODE>~/.bash_profile</CODE>, in the example, above,
would be
<PRE>
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"
</PRE>
The <CODE>$PATH</CODE> variable is different in the source
distribution than in the binary distribution. Note that here the path
to the binaries is <CODE>teTeX/bin/i386-linux</CODE> instead of simply
<CODE>teTeX/bin</CODE> as in the binary distribution.
<P>At this point you can run <CODE>texconfig confall</CODE> to ensure that
the paths have been set correctly, and then proceed to configure teTeX
as in the binary distribution. See the
section
<A HREF="#post-install">Post-installation configuration details</A>, below.
<P>
<H2><A NAME="post-install"></A> <A NAME="ss9.4">9.4 Post-installation configuration details. </A>
</H2>
<P>The first thing you want to do is look at Thomas Esser's
<CODE>README</CODE> file. It contains a lot of hints on how to configure
teTeX for your output device (i.e., printer). The <CODE>README</CODE>
file is located in the directory
<PRE>
/usr/lib/teTeX/texmf/doc/tetex
</PRE>
Read the file over with the command (the path in the following
examples is that of the Slackware distribution):
<PRE>
less /usr/lib/teTeX/texmf/doc/tetex/README
</PRE>
or, print it out with the command
<PRE>
cat /usr/lib/teTeX/texmf/doc/tetex/README >/dev/lp0
</PRE>
assuming that your printer is connected to <CODE>/dev/lp0</CODE>.
Substitute the device driver file that your printer is connected to,
as appropriate.
<P>Or, better still, print it using the <CODE>lpr</CODE>
command:
<PRE>
lpr /usr/lib/teTeX/texmf/doc/tetex/README
</PRE>
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.
<P>Print out the <CODE>teTeX-FAQ.</CODE> 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 <CODE>teTeX-FAQ</CODE> is viewable via the <CODE>texconfig</CODE>
utility.
<P>Next, you want to define a directory to store your own TeX
format files. teTeX searches the directories listed by the
<CODE>$TEXINPUTS</CODE> environment variable for local TeX input
files:
<PRE>
export TEXINPUTS=".:~/texinputs:"
</PRE>
to the system-wide <CODE>/etc/profile</CODE> file. Individual users can
set their own local <CODE>$TEXINPUTS</CODE> directory, by adding
the line in their <CODE>~/.profile</CODE> or
<CODE>~/.bash_profile</CODE> if <CODE>bash</CODE> is the default
shell. The <CODE>$TEXINPUTS</CODE> environment variable tells
teTeX to look for users' individual TeX style files in the
<CODE>~/texinputs</CODE> 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.
<P>Add the <CODE>/usr/lib/teTeX/bin</CODE> 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 <CODE>$PATH</CODE> with the
following line in your <CODE>~/.profile</CODE> or
<CODE>~/.bash_profile</CODE>:
<PRE>
export PATH="~/tetex/bin:"$PATH
</PRE>
Now, log in as <CODE>root</CODE> and run <CODE>texconfig</CODE> per the
instructions in the <CODE>teTeX-FAQ</CODE> and choose the printer that is
attached to your system. Make sure that you configure teTeX for both
the correct printer and printer resolution.
<P>Finally, run the <CODE>texhash</CODE> program. This ensures that teTeX's
internal database is up to date. The database is actually a
<CODE>ls-lR</CODE> file. You <EM>must</EM> run <CODE>texhash</CODE> every
time you change the system configuration, or teTeX will not be able to
locate your changes.
<P>
<HR>
<A HREF="TeTeX-HOWTO-10.html">Next</A>
<A HREF="TeTeX-HOWTO-8.html">Previous</A>
<A HREF="TeTeX-HOWTO.html#toc9">Contents</A>
</BODY>
</HTML>