Knowledge Base > Text & Document Processing > TeX

Installing TeX


Adobe PDF Format

TeX (pronounced "tek") is a markup language for text and figures. TeX takes a plain-text file containing the marked-up text of a document and produces a typeset device independent file (DVI) that can be converted to PostScript, Adobe PDF, or printer control language and sent to a commercial publisher or a PostScript printer. TeX provides exceptionally strong support for mathematical formulas and symbols, and is the preferred format for almost every major science and technical journal published today.

TeX was developed in the late 1970s by Donald Knuth, now a Professor Emeritus of Computer Science at Stanford University. Knuth was writing a series of books titled The Art of Computer Programming, and thought the computer-generated typesetting was clunky and ugly. Like most computer scientists he decided he could build a better mousetrap (or computer typesetting program in this case), and began work on TeX. (Knuth was later awarded the Turing Award for his books.)

This document provides step-by-step instructions for installing a TeX distribution on your UNIX or Linux system. The most popular TeX distribution by far is teTeX, which is relatively easy to install, freely available, and contains lots of nifty extras. To install teTeX on your system, perform the following steps.

  1. Make sure you have the prerequisites for installing teTeX:

  2. Download the teTex source distribution and the texmf distribution (used to generate TeX fonts) from ctan.tug.org/tex-archive/systems/unix/teTeX/current/distrib/sources/ (I used teTeX-src-1.0.7.tar.gz and texmf-1.0.2.tar.gz for these instructions.) Place the distribution files in your build directory.

  3. Choose the directory you want to install teTeX in. /usr/local/teTeX seems to work well for most people. Become root and create the directory with:

    [root@mustafa /] mkdir /usr/local/teTeX
    [root@mustafa /] chmod 755 /usr/local/teTeX

  4. Create a subdirectory of your installation directory for texmf to live in. Most TeX-related tools and utilities expect texmf to be in a subdirectory of the installation directory named texmf - unless you have a really good reason for using another directory, sticking with the convention will save you a lot of trouble later on.

    [root@mustafa /] mkdir /usr/local/teTeX/texmf
    [root@mustafa /] chmod 755 /usr/local/teTeX/texmf

  5. Change your current directory to the texmf installation directory, and move in the texmf archive from your build directory.

    [root@mustafa /] cd /usr/local/teTeX/texmf
    [root@mustafa texmf] mv /export/home/build/teTeX-texmf-1.0.2.tar.gz .

  6. Once the archive has been moved, uncompress it and extract the archived files.

    [root@mustafa texmf] gzip -d teTeX-texmf-1.0.2.tar.gz
    [root@mustafa texmf] tar xfv teTeX-texmf-1.0.2.tar

    Optionally, you may delete the archive once the files have been extracted to save disk space.

    [root@mustafa texmf] rm teTeX-texmf-1.0.2.tar

  7. Change your current directory to your build directory, and uncompress the teTeX archive. After the archive has been uncompressed, extract the files from it.

    [lamont@mustafa texmf] cd /export/home/build
    [lamont@mustafa build] gzip -d texmf-1.0.2.tar.gz
    [lamont@mustafa build] tar xfv texmf-1.0.2.tar

  8. Change your current directory to teTeX-1.0 (which was created by the archive extraction). Run the configure program with the prefix option set to your installation directory and multiplatform support off. (Multiplatform support allows you to install multiple copies of TeX on one system - most sites have no need for this.)

    [lamont@mustafa build] cd teTeX-1.0
    [lamont@mustafa teTeX-1.0] ./configure --prefix=/usr/local/teTeX --disable-multiplatform

    While the configure program is running, a large amount of output will scroll up the screen.

  9. Build the teTeX distribution with make.

    [lamont@mustafa teTeX-1.0] make all

  10. Become root and install the teTeX binaries.

    [root@mustafa teTeX-1.0] make install strip

  11. Add /usr/local/teTeX/bin to the global path environment variable. On most systems, this is defined in /etc/profile (Remember that any currently open terminal sessions will have to be restarted for the changes to take effect.)

  12. By default, teTeX assumes you're using European-style A4 paper. If your site uses letter-size paper, you can use texconfig to change the default.

    [root@mustafa /] texconfig dvips paper letter
    [root@mustafa /] texconfig xdvi us

    If you run texconfig with no arguments, it will enter interactive mode and let you navigate through all of the configuration options with a curses-based dialog system. If you have the time, it's worth running to see what options are available.

  13. teTeX ships with documentation in the form of man pages. If you want to make these available to your users, copy them from the installation directory to the system manpage directory.

    [root@mustafa /] cp /usr/local/teTeX/man/man1/* /usr/share/man/man1

  14. If you want to save disk space, you can delete the build tree and the source distribution.

    [lamont@mustafa build] rm -rf teTeX-1.0
    [lamont@mustafa build] rm teTeX-src-1.0.7.tar.gz

Congratulations! You now have a working copy of TeX on your system.


Michael's Homepage      WKU-Linux