(A copy of this chapter is in the distribution file `kpathsea/INSTALL'.) The procedure for Kpathsea (and Web2c, etc.) configuration and installation follows. If trouble, see section Common problems, a copy of which is in the file `kpathsea/BUGS'.
Installing TeX and friends for the first time can be a daunting experience. Thus, you may prefer to skip this whole thing and just get precompiled executables: see section `unixtex.ftp': Obtaining TeX. This section explains what to do if you wish to take the defaults for everything (installing under `/usr/local'), and generally to install in the simplest possible way. Most steps here refer to corresponding subsection in the next section which explains how to override defaults and generally gives more details.
configure
.
make
.
0 0 * * * cd /usr/local/share/texmf && /bindir/MakeTeXls-RSee section Filename database generation, and section Filename database (
ls-R
).
MakeTeXPK
(and added to the filename database).
This will take some time. Don't be alarmed; they will be created only
this first time (unless something is wrong with your path definitions).
By default, MakeTeXPK
assumes `/usr/local/share/texmf/fonts'
is globally writable. If you need a different arrangement,
see section `MakeTeX' configuration.
See section `MakeTeX' scripts.
Most sites need to modify the default installation procedure in some
way, perhaps merely changing the prefix from `/usr/local', perhaps
adding extra compiler or loader options to work around configure
bugs. This section explains how to override default choices. For
additional distribution-specific information:
These instructions are for Unix systems. Other operating-system specific distributions have their own instructions. The code base itself supports Amiga, DOS, OS/2, and VMS. Following are the same steps as in the previous section (which describes the simplest installation), but with much more detail.
Here is a table showing the disk space needed for each distribution (described in the next section). The `(totals)' line reflects the `texk' source distribution and `texmflib'; the individual distributions don't enter into it. Sizes are in megabytes. All numbers are approximate. @multitable {distribution} {.tar.gz} {unpacked} {compiled} {installed}
The archive @url{ftp://ftp.tug.org/tex/texk.tar.gz} contains all of the Kpathsea applications I maintain, and the library itself. For example, since NeXT does not generally support X11, you'd probably want to skip `xdvik' (or simply remove it after unpacking `texk.tar.gz'. If you are not interested in all of them, you can also retrieve them separately:
If you want to use the Babel LaTeX package for support of non-English typesetting, you may need to retrieve additional files. See the file `install.txt' in the Babel distribution.
If the search paths for your installation differ from the standard
TeX directory structure (see section `Introduction' in A Directory Structure for TeX files), edit the file `kpathsea/texmf.cnf.in'
as desired, before running configure
. For example, if you have
all your fonts or macros in one big directory.
You may also wish to edit the file `MakeTeXnames.cnf', either
before or after installation, to control various aspects of
MakeTeXPK
and friends. See section `MakeTeX' configuration.
You do not need to edit `texmf.cnf.in' to change the default
top-level or other installation directories (only the paths).
You can and should do that when you run configure
(next step).
You also do not need to edit `texmf.cnf.in' if you are willing to
rely on `texmf.cnf' at runtime to define the paths, and let the
compile-time default paths be incorrect. Usually there is no harm in
doing this.
The section below explains default generation in more detail.
The purpose of having all the different files described in the section
above is to avoid having the same information in more than one place. If
you change the installation directories or top-level prefix at
configure
-time, those changes will propagate through the whole
sequence. And if you change the default paths in `texmf.cnf.in',
those changes are propagated to the compile-time defaults.
The Make definitions are all repeated in several Makefile's; but
changing the top-level `Makefile' should suffice, as it passes down
all the variable definitions, thus overriding the submakes. (The
definitions are repeated so you can run Make in the subdirectories, if
you should have occasion to.)
By default, the bitmap font paths end with `/$MAKETEX_MODE', thus
including the device name (usually a Metafont mode name such as
`ljfour'). This distinguishes two different devices with the same
resolution--a write/white from a write/black 300dpi printer, for
example.
However, since most sites don't have this complication, Kpathsea
(specifically, the kpse_init_prog
function in
`kpathsea/proginit.c') has a special case: if the mode has not been
explicitly set by the user (or in a configuration file), it sets
MAKETEX_MODE
to /
. This makes the default PK path, for
example, expand into .../pk//
, so fonts will be found even if
there is no subdirectory for the mode (if you arranged things that way
because your site has only one printer, for example) or if the program
is mode-independent (e.g., pktype
).
To make the paths independent of the mode, simply edit
`texmf.cnf.in' before installation, or the installed
`texmf.cnf', and remove the `$MAKETEX_MODE'.
See section `MakeTeX' script arguments, for how this interacts with MakeTeXPK
.
See section TeX directory structure, for a
description of the default arrangement of the input files that comprise
the TeX system. The file `kpathsea/HIER' is a copy of that
section.
This section describes how the default paths are constructed. You may wish to ignore the whole mess and simply edit `texmf.cnf' after it is installed, perhaps even copying it into place beforehand so you can complete the installation, if it seems necessary. To summarize the chain of events that go into defining the default paths:
$(var)
for a
string @var@
. The variables in question are the one that
define the installation directories.
#define
's in
`paths.h'. These values will be the compile-time defaults; they
are not used at runtime unless no `texmf.cnf' file can be found.
(That's a lie: the compile-time defaults are what any extra :'s in
`texmf.cnf' expand into; but the paths as distributed have no extra
:'s, and there's no particular reason for them to.)
configure
Run sh configure options
(in the top-level directory, the
one containing `kpathsea/'), possibly using a shell other than
sh
(see section configure
shells).
configure
adapts the source distribution to the present system
via #define
's in `*/c-auto.h', which are created from the
corresponding `c-auto.h.in'. It also creates a `Makefile' from
the corresponding `Makefile.in', doing `@var@' and
`ac_include' substitutions).
configure
is the best place to control the configuration,
compilation, and installed location of the software, either via
command-line options, or by setting environment variables before
invoking it. For example, you can disable MakeTeXPK
by default
with the option `--disable-maketexpk'.
See section configure
options.
configure
shells
If you have Bash, the GNU shell, use it if sh
runs into trouble
(see section `Top' in Bash Features).
Most Bourne shell variants other than Bash cannot handle
configure
scripts as generated by GNU Autoconf (see section `Top' in Autoconf). Specifically:
ksh
ash
Ultrix /bin/sh
configure
options
For a complete list of all configure
options, run `configure
--help' or see section `Running configure
scripts' in Autoconf (a copy is in the file `kpathsea/CONFIGURE').
The generic options are listed first in the `--help' output, and
the package-specific options come last. The environment variables
configure
pays attention to are listed below.
Options particularly likely to be useful are `--prefix',
`--datadir', and the like; see section configure
scenarios.
This section gives pointers to descriptions of the `--with' and
`--enable' options to configure
that Kpathsea-using programs
accept.
configure
environment
configure
uses the value of the following environment variables in
determining your system's characteristics, and substitutes for them in
Makefile's:
gcc
if it's installed, otherwise
cc
.
gcc
,
`-g' otherwise. CFLAGS
comes after any other options. You
may need to include -w
here if your compilations commonly have
useless warnings (e.g., NULL redefined
), or configure
may
fail to detect the presence of header files (it takes the messages on
standard error to mean the header file doesn't exist).
configure
script often does only preprocessing (e.g., to check for the existence
of #include files), and CFLAGS
is not used for this. You may
need to set this to something like
`-I/usr/local/include/wwwhatever' if you have the libwww library
installed for hyper-xdvik (see `xdvik/INSTALL').
configure
.
Provided for enabling or disabling program features, as documented in
the various program-specific installation instructions. DEFS
comes before any compiler options included by the distribution
`Makefile's or by configure
.
LDFLAGS
comes before
any other linker options.
configure
scenariosHere are some common installation scenarios:
configure --with-x-toolkit
configure
and make
:
configure --prefix=texmf --datadir=texmf make texmf=texmf
lndir
script from the X11
distribution, or with the `--srcdir' option:
configure --srcdir=srcdir
configure --prefix=texmf --datadir=texmf \ --bindir=texmf/arch/bin --libdir=texmf/arch/lib make texmf=texmf(Unless you make provisions for architecture-specific files in other ways, e.g., with Depot or an automounter.)
env CFLAGS="-g -O" sh configure ...For a potential problem if you optimize, see section TeX or Metafont failing.
You can compile Kpathsea as a shared library on a few systems, by
specifying the option `--enable-shared' when you run
`configure'.
The main advantage in doing this is that the executables can then share
the code, thus decreasing memory and disk space requirements.
On some systems, you can record the location of shared libraries in a
binary, usually by giving certain options to the linker. Then
individual users do not need to set their system's environment variable
(e.g., LD_LIBRARY_PATH
) to find shared libraries. If you want to
do this, you will need to add the necessary options to LDFLAGS
yourself; for example, on Solaris, include something like
`-R${prefix}/lib'. (Unfortunately, making this happen by default
is very difficult, because of interactions with an existing installed
shared library.)
Currently, shared library support is implemented only on SunOS 4
(Solaris 1) and SunOS 5 (Solaris 2). If you're interested and willing
in adding support for other systems, please see the `configure'
mode in the `klibtool' script, especially the host-specific case
statement around line 250.
make
make
(still in the top-level directory). This also creates the
`texmf.cnf' and `paths.h' files that define the default search
paths, and (by default) the `plain' and `latex' TeX formats.
You can override directory names and other values at make
-time.
`make/paths.make' lists the variables most commonly reset. For
example, `make default_texsizes=600' changes the list of fallback
resolutions.
You can also override each of configure
's environment variables
(see section configure
environment). The Make variables have the same names.
Finally, you can supply additional options via the following variables.
(configure
does not use these.)
make
's. You may need
to include assignments to the other variables here via XMAKEARGS
;
for example: `make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"'.
It's generally a bad idea to use a different compiler (`CC') or
libraries (LIBS
) for compilation than you did for configuration,
since the values configure
determined may then be incorrect.
Adding compiler options to change the "universe" you are using
(typically BSD vs. system V) is generally a cause of trouble. It's
best to use the native environment, whatever that is; configure
and the software usually adapt best to that. In particular, under
Solaris 2.x, you should not use the BSD-compatibility library
(`libucb') or include files (`ucbinclude').
If you want to use the Babel LaTeX package for support of non-English
typesetting, you need to modify some files before making the LaTeX
format. See the file `install.txt' in the Babel distribution.
The basic command is the usual make install
. For security
issues, see section Security.
The first time you install any manual in the GNU Info system, you should
add a line (you choose where) to the file `dir' in your
`$(infodir)' directory. Sample text for this is given near the top
of the Texinfo source files (`kpathsea/kpathsea.texi',
`dvipsk/dvips.texi', and `web2c/doc/web2c.texi').
If you have a recent version of the GNU Texinfo distribution installed
(@url{ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz} or later), this
should happen automatically.
On the offchance that this is your first Info installation, the
`dir' file I use is included in the distribution as
`etc/dir-example'.
You may wish to use one of the following targets, especially if you are
installing on multiple architectures:
make install-exec
to install in architecture-dependent
directories, i.e., ones that depend on the $(exec_prefix)
Make
variable. This includes links to binaries, libraries, etc., not just
"executables".
make install-data
to install in architecture-independent
directories, such as documentation, configuration files, pool files, etc.
If you use the Andrew File System, the normal path (e.g.,
prefix/bin) only gets you to a read-only copy of the files, and
you must specify a different path for installation. The best way to do this
is by setting the `prefix' variable on the make
command
line. The sequence becomes something like this:
configure --prefix=/whatever make make install prefix=/afs/.system.name/system/1.3/@sys/whatever
With AFS, you will definitely want to use relative filenames in
`ls-R' (see section Filename database (ls-R
)), not absolute filenames. This
is done by default, but check anyway.
The basic command is make distclean
. This removes all files
created by the build.
Alternatively,
make mostlyclean
if you intend to compile on another
architecture. For Web2c, since the generated C files are portable,
they are not removed. If the lex
vs. flex
situation
is going to be different on the next machine, rm
web2c/lex.yy.c
.
make clean
to remove files created by compiling, but leave
configuration files and Makefiles.
make maintainer-clean
to remove everything that the Makefiles can
rebuild. This is more than `distclean' removes, and you should
only use it if you are thoroughly conversant with (and have the necessary
versions of) Autoconf.
make extraclean
to remove other junk, e.g., core files, log
files, patch rejects. This is independent of the other `clean'
targets.
You will probably want to set up a cron
entry on the appropriate
machine(s) to rebuild the filename database nightly or so, as in:
0 0 * * * cd texmf && /bindir/MakeTeXls-R
See section Filename database (ls-R
).
Although the MakeTeX...
scripts make every effort to add
newly-created files on the fly, it can't hurt to make sure you get a
fresh version every so often.
If Kpathsea cannot otherwise find a file, for some file types it is configured by default to invoke an external program to create it dynamically (see section `MakeTeX' configuration). This is most useful for fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as the Sauter and DC fonts), since any given document can use fonts never before referenced. Trying to build all fonts in advance is therefore impractical, if not impossible. The script is passed the name of the file to create and possibly other arguments, as explained below. It must echo the full pathname of the file it created (and nothing else) to standard output; it can write diagnostics to standard error.
The following file types can run an external program to create missing
files: `pk', `tfm', `mf', `tex'; the scripts are
named `MakeTeXPK', `MakeTeXTFM', `MakeTeXMF', and
`MakeTeXTeX'.
In the absence of configure
options specifying otherwise,
everything but `MakeTeXTeX' will be enabled by default. The
configure
options to change the defaults are:
--without-maketexmf-default --without-maketexpk-default --without-maketextfm-default --with-maketextex-default
The configure
setting is overridden if the environment variable
or configuration file value named for the script is set; e.g.,
`MAKETEXPK' (see section `MakeTeX' script arguments).
As distributed, all the scripts source a file
`texmf/web2c/MakeTeX.site' if it exists, so you can override
various defaults. See `MakeTeXcommon', for instance, which defines
the default mode, resolution, directory permissions, some special
directory names, etc. If you prefer not to change the distributed
scripts, you can simply create `MakeTeX.site' with the appropriate
definitions (you do not need to create it if you have nothing to put in
it). `MakeTeX.site' has no special syntax; it's an arbitrary
Bourne shell script. The distribution contains a sample
`MakeTeX.site' for you to copy and modify as you please (it is not
installed anywhere).
In addition, you can configure a number of features with the
MT_FEATURES
variable, which you can define:
By default, MakeTeXPK
installs fonts into the standard TeX
directory structure (see section TeX directory structure). It uses aliases and directory names from the Fontname
distribution (see section `Introduction' in Fontname). Most of
the options here change that.
MakeTeXmkdir
to create directories append-only, i.e., set
their sticky bit (see section `Mode Structure' in GNU File Utilities). This feature is silently ignored on non-Unix platforms
(e.g. Windows/NT and MS-DOS) which don't support similar functionality.
MT_FEATURES
variable is empty (i.e., `MakeTeX' scripts
behave as if the original `MakeTeXnames.cnf' defines
`MT_FEATURES="dosnames"'). However, if you set MT_FEATURES
on `MakeTeX.site' or in the environment, or edit
`MakeTeXnames.cnf', you need to set `dosnames' explicitly.
MakeTeXPK
-generated fonts under the directory named
by VARTEXFONTS
; the default value in `kpathsea/texmf.cnf.in'
is `/var/tex/fonts', as recommended by the Linux File System
Standard (but unless `varfonts' is enabled, nothing cares about
that value).
The `varfonts' setting in MT_FEATURES
is overridden by the
USE_VARTEXFONTS
environment variable: if set to `1', the
feature is enabled, and if set to `0', the feature is disabled.
The following table shows the default name of the script for each
possible file types. (The source is the variable kpse_make_specs
in `kpathsea/tex-make.c'.)
Some of these names are overridden by an environment variable
specific to the program--for example, DVIPSMAKEPK
for Dvipsk.
Currently, only the name of `MakeTeXPK' script can be customized in
this way.
If a MakeTeX...
script fails, the invocation is appended to a
file `missfont.log' (by default) in the current directory. You can
then execute the log file to create the missing files after fixing the
problem.
If the current directory is not writable and the environment variable or
configuration file value TEXMFOUTPUT
is set, its value is
used. Otherwise, nothing is written. The name `missfont.log' is
overridden by the MISSFONT_LOG
environment variable or
configuration file value.
The first argument to a `MakeTeX' script is always the name of the file to be created. In the default `MakeTeXPK' implementation, from three to five additional arguments may also passed, via environment variables:
KPATHSEA_DPI
).
MAKETEX_BASE_DPI
),
i.e., the assumed resolution of the output device.
mag
variable
(MAKETEX_MAG
).
mode
variable (MAKETEX_MODE
). Otherwise, (the default)
MakeTeXPK
guesses the mode from the resolution. See section TeX directory structure.
DESTDIR
or
MTP_DESTDIR
or a compile-time default). If this argument is not
supplied, the mode name is appended to the root destination directory.
Kpathsea sets KPATHSEA_DPI
appropriately for each
attempt at building a font. It's up to the program using Kpathsea to
set the others. (See section Calling sequence.)
You can change the way the external scripts are called by setting the
environment variable named as the script name, but all
capitals---MAKETEXMF
, for example. If you've changed the script
name by setting (say) DVIPSMAKEPK
to `foo', then the spec is
taken from the environment variable FOO
. The value of the
variable that defines how to call the script (MAKETEXMF
in our
example) can contain any variable references, to the above variables or
any others; when the script is invoked, the name of the file to be
created is put after whatever this variable expands to. For
example, if you have set `MAKETXMF=my_private_maketexmf foo bar'
then Kpathsea will issue the following command to build `cmr11.mf':
my_private_maketexmf foo bar cmr11
You can use names of other variables in the above definition of
MAKETEXMF
above, in which case these variables are expanded when
Kpathsea processes the definition of MAKETEXMF
.
For MakeTeXPK
only, you can further tailor the specification for
the arguments passed to the script. By default, the spec for
MakeTeXPK
as built into Kpathsea is this:
$KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE
In contrast to what happens when you define MAKETEXPK
, the name
of the file to be created is put on the command line before the
expansion of these variables. By defining your own values for some or
all of these variables, you can change how the script that produces
`.pk' files is invoked. Since this feature is not needed for
scripts other than MakeTeXPK
(and indeed is rarely used even in
that case), it is not currently supported for other scripts.
The convention of passing the name of the file to be created
as the first argument cannot be changed.
Besides the tests listed in section Simple installation, you can try running `make check'. This includes the torture tests (trip, trap, and mptrap) that come with Web2c (see section `Torture tests' in Web2c).
None of the programs in the TeX system require any special system
privileges, so there's no first-level security concern of people gaining
illegitimate root access.
A TeX document, however, can write to arbitrary files, e.g.,
`~/.rhosts', and thus an unwitting user who runs TeX on a random
document is vulnerable to a trojan horse attack. This loophole is
closed by default, but you can be permissive if you so desire in
`texmf.cnf'. See section `tex invocation' in Web2c. MetaPost has
the same issue.
Dvips, Xdvi, and TeX can also execute shell commands under some
circumstances. To disable this, see the `-R' option in section `Option details' in Dvips, the xdvi man page, and section `tex invocation' in Web2c, respectively.
Another security issue arises because it's very useful--almost
necessary--to make arbitrary fonts on user demand with MakeTeXPK
and friends. Where do these files get installed? By default, the
MakeTeXPK
distributed with Kpathsea assumes a globally writable
`texmf' tree; this is the simplest and most convenient approach,
but it may not suit your situation.
The first restriction you can apply is to make newly-created directories
under `texmf' be append-only with an option in
`MakeTeXnames.cnf'. See section `MakeTeX' configuration.
Another approach is to establish a group (or user) for TeX files,
make the `texmf' tree writable only to that group (or user), and
make MakeTeXPK
et al. setgid to that group (or setuid to that
user). Then users must invoke the scripts to install things. (If
you're worried about the inevitable security holes in scripts, then you
could write a C wrapper to exec the script.)
Finally, using a central writable `texmf' tree may be completely
impossible, because it's on an NFS filesystem that you cannot export
read/write, or AFS is in use, or simply because "it's policy". Then
you must resort to each user's machine having its own local directory of
dynamically-created fonts; again, `MakeTeXnames.cnf' has an option
to do this, and again, see section `MakeTeX' configuration.
This section describes the default installation hierarchy of the distribution. It conforms to both the GNU coding standards and the TeX directory structure (TDS) standard. For rationale and further explanation, please see those documents. The GNU standard is available as @url{ftp://prep.ai.mit.edu/pub/gnu/standards/standards.texi} and mirrors. The TDS document is available from `CTAN:/tex-archive/tds' (see section `unixtex.ftp': Obtaining TeX).
You can change the default paths in many ways (see section Changing search paths). One common desire is to put everything (binaries and all)
under a single top-level directory such as `/usr/local/texmf' or
`/opt/texmf'---in the terms used below, make prefix and
texmf the same. For specific instructions on doing that,
see section configure
scenarios.
Here is a skeleton of the default directory structure, extracted from the TDS document:
prefix/ installation root (`/usr/local' by default) bin/ executables man/ man pages include/ C header files info/ GNU info files lib/ libraries (`libkpathsea.*') share/ architecture-independent files texmf/ TDS root bibtex/ BibTeX input files bib/ BibTeX databases base/ base distribution (e.g., `xampl.bib') misc/ single-file databases pkg/ name of a package bst/ BibTeX style files base/ base distribution (e.g., `plain.bst', `acm.bst') misc/ single-file styles pkg/ name of a package doc/ additional documentation dvips/ `.pro', `.ps', `psfonts.map' fonts/ font-related files type/ file type (e.g., `tfm', `pk') mode/ type of output device (types `pk' and `gf' only) supplier/ name of a font supplier (e.g., `public') typeface/ name of a typeface (e.g., `cm') dpinnn/ font resolution (types `pk' and `gf' only) metafont/ Metafont (non-font) input files base/ base distribution (e.g., `plain.mf') misc/ single-file packages (e.g., `modes.mf') pkg/ name of a package (e.g., `mfpic') metapost/ MetaPost input files base/ base distribution (e.g., `plain.mp') misc/ single-file packages pkg/ name of a package support/ support files for MetaPost-related utilities (e.g., `trfonts.map') mft/ `MFT' inputs (e.g., `plain.mft') tex/ TeX input files format/ name of a format (e.g., `plain') base/ base distribution for format (e.g., `plain.tex') misc/ single-file packages (e.g., `webmac.tex') local/ local additions to or local configuration files for format pkg/ name of a package (e.g., `graphics', `mfnfss') generic/ format-independent packages hyphen/ hyphenation patterns (e.g., `hyphen.tex') images/ image input files (e.g., Encapsulated PostScript) misc/ single-file format-independent packages (e.g., `null.tex'). pkg/ name of a package (e.g., `babel') web2c/ implementation-dependent files (`.pool', `.fmt', `texmf.cnf', etc.)
Some concrete examples for most file types:
/usr/local/bin/tex /usr/local/man/man1/xdvi.1 /usr/local/info/kpathsea.info /usr/local/lib/libkpathsea.a /usr/local/share/texmf/bibtex/bst/base/plain.bst /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk /usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf /usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm /usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa /usr/local/share/texmf/metafont/base/plain.mf /usr/local/share/texmf/metapost/base/plain.mp /usr/local/share/texmf/tex/plain/base/plain.tex /usr/local/share/texmf/tex/generic/hyphen/hyphen.tex /usr/local/share/texmf/web2c/tex.pool /usr/local/share/texmf/web2c/tex.fmt /usr/local/share/texmf/web2c/texmf.cnf
This chapter is @url{ftp://ftp.tug.org/tex/unixtex.ftp}, last updated 1 February 1997. Also available as @url{http://www.tug.org/unixtex.ftp}. The IP address is currently [158.121.106.10], and the canonical host name is currently `tug.cs.umb.edu'. It is also in Kpathsea source distributions as `etc/unixtex.ftp' (although the network version is usually newer). Mail @email{kb@mail.tug.org} with comments or questions.
Following are general instructions for Unix or other sites who wish to acquire the Web2c distribution, (plain) TeX, LaTeX (2e), BibTeX, Metafont, MetaPost, DVI processors for the X window system, PostScript, the PCL language in the HP LaserJet, and related programs. They are oriented towards building from the original sources, though some information on alternative packages is included in the last section. See also @url{http://www.tug.org/web2c}, the Web2c and Kpathsea home page.
Please consider joining the TeX Users Group (TUG) to help support the maintenance and development of the programs you retrieve. Email @email{tug@tug.org} or see @url{http://www.tug.org} for information and a membership form.
For actual installation instructions after obtaining the necessary sources, see section Installation. A copy is in the distribution file `kpathsea/INSTALL'.
In many places we refer to CTAN:. This is both a host name and a directory name. Here are some primary locations:
@url{ftp://ftp.cdrom.com/pub/tex/ctan} (California, USA) @url{ftp://ftp.dante.de/tex-archive} (Germany) @url{ftp://ftp.tex.ac.uk/tex-archive} (England)
CTAN has many mirrors worldwide; see the top-level file `README.mirrors' from one of the sites above, or finger @email{ctan@ftp.tug.org}, or see @url{http://www.tug.org/CTAN.sites}. A list current as of the time of distribution is in the top-level file `./MIRROR'.
You can also access CTAN via the World Wide Web, Gopher, electronic mail, or NFS. The same `README.mirrors' file explains how.
You will need to retrieve some or all of the following archives, depending on your needs (don't forget to set binary mode for file transfers):
All that said, the originating host for the software above is `ftp.tug.org'. You can retrieve these distributions (but not much else) from the `tex/' directory on that host.
Numerous organizations distribute various TeX CD-ROM's:
If you know of additional TeX CD-ROM distributions to add to this list, please inform @email{kb@mail.tug.org}.
You can obtain a complete TeX distribution, including Web2c, on tape. Contact:
Pierre MacKay / Denny Hall, Mail Stop DH-10 / Department of Classics University of Washington / Seattle, WA 98195 / USA phone: 206-543-2268; email: @email{unixtex@u.washington.edu}
At this writing, the distribution is available in tar
format on
1/4 inch 4-track QIC-24 cartridges and 4mm DAT cartridges, and the
cost is US$210. Make checks payable to the University of Washington,
drawn on a U.S. bank. Purchase orders are acceptable, but they carry an
extra charge of $10 to pay for invoice processing. Overseas sites,
please add $20 for shipment via air parcel post, or $30 for shipment via
courier.
Many other TeX implementations are available in `CTAN:/systems', including ready-to-run distributions for Unix, Amiga, Acorn, VMS, Macintosh, DOS, and Windows (in various forms). Although Web2c has support in the source code for many operating systems, and in fact some of the other distributions are based on it, it's unlikely to work as distributed on anything but Unix. (Please contribute improvements!)
The Unix distribution alluded to above is the teTeX distribution. This includes both complete sources and precompiled binaries for many popular Unix variants, including Linux. It is based on Web2c, and contains many other TeX-related programs as well.
The host labrea.stanford.edu is the original source for the files for which Donald Knuth is directly responsible: `tex.web', `plain.tex', etc. However, unless you want to build your TeX library tree ab initio, it is more reliable and less work to retrieve these files as part of the above packages. In any case, labrea is not the canonical source for anything except what was created by Stanford TeX project, so do not rely on all the files available at that ftp site being up-to-date.
(A copy of this chapter is in the file `kpathsea/BUGS'.) If you have problems or suggestions, please report them to @email{tex-k@mail.tug.org} using the bug checklist below. Please report bugs in the documentation; not only factual errors or inconsistent behavior, but unclear or incomplete explanations, typos, wrong fonts, ...
Before reporting a bug, please check below to be sure it isn't already known (see section Common problems). Bug reports should be sent via electronic mail to @email{tex-k@mail.tug.org}, or by postal mail to 135 Center Hill Road / Plymouth, MA 02360 / USA. The general principle is that a good bug report includes all the information necessary for reproduction. Therefore, to enable investigation, your report should include the following:
make
program you are using (the output of uname -a
is a
start on the first two, though often incomplete). If the bug involves
the X window system, include X version and supplier information as well
(examples: X11R6 from MIT; X11R4 from HP; OpenWindows 3.3 bundled with
SunOS 4.1.4).
configure
. This is recorded in the
`config.status' files.
If you are reporting a bug in `configure' itself, it's probably
system-dependent, and it will be unlikely the maintainers can do
anything useful if you merely report that thus-and-such is broken.
Therefore, you need to do some additional work: for some bugs, you can
look in the file `config.log' where the test that failed should
appear, along with the compiler invocation and source program in
question. You can then compile it yourself by hand, and discover why
the test failed. Other `configure' bugs do not involve the
compiler; in that case, the only recourse is to inspect the
configure
shell script itself, or the Autoconf macros that
generated configure
.
KPATHSEA_DEBUG
to `-1' before running the program. Please look at the log
yourself to make sure the behavior is really a bug before reporting it;
perhaps "old" environment variable settings are causing files not to
be found, for example.
shar
, available from @url{ftp://prep.ai.mit.edu/pub/gnu} is
a convenient way of packaging multiple (possibly binary) files for
electronic mail. If you feel your input files are too big to send by
email, you can ftp them to @url{ftp://ftp.tug.org/incoming} (that
directory is writable, but not readable).
NULL
value being dereferenced, for
example), please send the details along. If the program involved is
TeX or Metafont, and the crash is happening at apparently-sound code,
however, the bug may well be in the compiler, rather than in the program
or the library (see section TeX or Metafont failing).
Web2c and Kpathsea in general are discussed on the mailing list @email{tex-k@mail.tug.org}. To join, email @email{tex-k-request@mail.tug.org} with a line consisting of
subscribe you@your.preferred.email.address
in the body of the message. You do not need to join to submit a report, nor will it affect whether you get a response. There is no Usenet newsgroup equivalent (if you can be the one to set this up, email `tex-k-request'). Traffic on the list is fairly light, and is mainly bug reports and enhancement requests to the software. The best way to decide if you want to join or not is read some of the archives from @url{ftp://ftp.tug.org/mail/archives/tex-k/}. Be aware that large data files are sometimes included in bug reports. If this is a problem for you, do not join the list. If you only want announcements of new releases, not bug reports and discussion, join @email{tex-archive@math.utah.edu} (via mail to @email{tex-archive-request@math.utah.edu}). If you are looking for general TeX help, such as how to use LaTeX, please use the mailing list @email{info-tex@shsu.edu} mailing list, which is gatewayed to the `comp.text.tex' Usenet newsgroup (or post to the newsgroup; the gateway is bidirectional).
Kpathsea provides a number of runtime debugging options, detailed below
by their names and corresponding numeric values. When the files you
expect aren't being found, the thing to do is enable these options and
examine the output.
You can set these with some runtime argument (e.g., `-d') to the
program; in that case, you should use the numeric values described in
the program's documentation (which, for Dvipsk and Xdvik, are different
than those below). It's best to give the `-d' (or whatever) option
first, for maximal output. Dvipsk and Xdvik have additional
program-specific debugging options as well.
You can also set the environment variable KPATHSEA_DEBUG
; in this
case, you should use the numbers below. If you run the program under a
debugger and set the variable kpathsea_debug
, also use the
numbers below.
In any case, by far the simplest value to use is `-1', which will
turn on all debugging output. This is usually better than guessing
which particular values will yield the output you need.
Debugging output always goes to standard error, so you can redirect it
easily. For example, in Bourne-compatible shells:
dvips -d -1 ... 2>/tmp/debug
It is sometimes helpful to run the standalone Kpsewhich utility
(see section kpsewhich
: Standalone path searching), instead of the original program.
In any case, you can not use the names below; you must
always use somebody's numbers. (Sorry.) To set more than one
option, just sum the corresponding numbers.
KPSE_DEBUG_STAT (1)
ls-R
)), this should produce no output unless a
nonexistent file that must exist is searched for.
KPSE_DEBUG_HASH (2)
ls-R
)); font aliases (see section Fontmap); and config
file values (see section Config files). Useful when expected values are not
being found, e.g.., file searches are looking at the disk instead of
using `ls-R'.
KPSE_DEBUG_FOPEN (4)
KPSE_DEBUG_PATHS (8)
kpse_format_info_type
structure defined in
`tex-file.h'.
KPSE_DEBUG_EXPAND (16)
KPSE_DEBUG_SEARCH (32)
GSFTOPK_DEBUG (64)
gsftopk
program.
MAKETEX_DEBUG (128)
MakeTeX
programs instead of the
traditional shell scripts, this will report the name of the site file
(`MakeTeX.site' by default) which is read, directories created by
MakeTeX-mkdir
, the full path of the `ls-R' database built by
MakeTeXls-R
, font map searches, MT_FEATURES
in effect,
parameters from MakeTeXnames
, filenames added by
MakeTeXupdate
, and some subsidiary commands run by the programs.
MAKETEX_FINE_DEBUG (256)
MakeTeX
programs are used, this will print
additional debugging info from functions internal to these programs.
Debugging output from Kpathsea is always written to standard error, and
begins with the string `kdebug:'. (Except for hash table buckets,
which just start with the number, but you can only get that output
running under a debugger. See comments at the hash_summary_only
variable in `kpathsea/db.c'.)
Kpathsea can record the time and filename found for each successful
search. This may be useful in finding good candidates for deletion when
your filesystem is full, or in discovering usage patterns
at your site.
To do this, define the environment or config file variable
TEXMFLOG
. The value is the name of the file to append the
information to. The file is created if it doesn't exist, and appended
to if it does.
Each successful search turns into one line in the log file: two words
separated by a space. The first word is the time of the search, as the
integer number of seconds since "the epoch", i.e., UTC midnight 1
January 1970 (more precisely, the result of the time
system
call). The second word is the filename.
For example, after setenv TEXMFLOG /tmp/log
, running Dvips on
`story.dvi' appends the following lines:
774455887 /usr/local/share/texmf/dvips/config.ps 774455887 /usr/local/share/texmf/dvips/psfonts.map 774455888 /usr/local/share/texmf/dvips/texc.pro 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk 774455889 /usr/local/share/texmf/dvips/texc.pro
Only filenames that are absolute are recorded, to preserve some semblance of privacy.
Here are some common problems with configuration, compilation, linking, execution, ...
If a program complains it cannot find fonts (or other input files), any of several things might be wrong. In any case, you may find the debugging options helpful. See section Debugging.
MakeTeXPK
(or
MakeTeXMF
or MakeTeXTFM
) will try to create them. If
these rather complicated shell scripts fail, you'll eventually get an
error message saying something like `Can't find font
fontname'. The best solution is to fix (or at least report) the
bug in MakeTeXPK
; the workaround is to generate the necessary
fonts by hand with Metafont, or to grab them from a CTAN site
(see section `unixtex.ftp': Obtaining TeX).
If your program takes an excessively long time to find fonts or other input files, but does eventually succeed, here are some possible culprits:
ls-R
). Kpathsea always uses `ls-R'
if it's present; there's no need to recompile or reconfigure any of the
programs.
In any case, you may find the debugging options helpful in determining precisely when the disk or network is being pounded. See section Debugging.
This can happen if either MakeTeXPK
hasn't been installed
properly, or if the local installation of Metafont isn't correct.
If mf
is a command not found by MakeTeXPK
, then you need
to install Metafont (see section `unixtex.ftp': Obtaining TeX).
If Metafont runs, but generates fonts at the wrong resolution, you need
to be sure the `M' and `D' lines in your Dvips configuration
file match (see section `Config files' in Dvips). For example, if
MakeTeXPK
is generating 300dpi fonts, but you need
600dpi fonts, you should have:
M ljfour D 600
If Metafont runs but generates fonts at a resolution of 2602dpi
(and prints out the name of each character as well as just a character
number, and maybe tries to display the characters), then your Metafont
base file probably hasn't been made properly. (It's using the default
proof
mode, instead of an actual device mode.) To make a proper
`plain.base', assuming the local mode definitions are contained in
a file `modes.mf', run the following command (assuming Unix):
inimf "plain; input modes; dump"
Then copy the `plain.base' file from the current directory to where the base files are stored on your system (`/usr/local/share/texmf/web2c' by default), and make a link (either hard or soft) from `plain.base' to `mf.base' in that directory. See section `inimf invocation' in Web2c.
If TeX or Metafont get a segmentation fault or otherwise fail while running a normal input file, the problem is usually a compiler bug (unlikely as that may sound). Even if the trip and trap tests are passed, problems may lurk. Optimization occasionally causes trouble in programs other than TeX and Metafont themselves, too. Insufficient swap space may also cause core dumps or other erratic behavior. For a workaround, if you enabled any optimization flags, it's best to omit optimization entirely. In any case, the way to find the facts is to run the program under the debugger and see where it's failing. Also, if you have trouble with a system C compiler, I advise trying the GNU C compiler. And vice versa, unfortunately; but in that case I also recommend reporting a bug to the GCC mailing list; see section `Bugs' in Using and Porting GNU CC. To report compiler bugs effectively requires perseverance and perspicacity: you must find the miscompiled line, and that usually involves delving backwards in time from the point of error, checking through TeX's (or whatever program's) data structures. Things are not helped by all-too-common bugs in the debugger itself. Good luck.
XtStrings
You may find that linking X programs results in an error from the linker that `XtStrings' is undefined, something like this:
gcc -o virmf ... .../x11.c:130: undefined reference to `XtStrings'
This generally happens because of a mismatch between the X include files
with which you compiled and the X libraries with which you linked;
often, the include files are from MIT and the libraries from Sun.
The solution is to use the same X distribution for compilation and
linking. Probably `configure' was unable to guess the proper
directories from your installation. You can use the configure
options `--x-includes=path' and
`--x-libraries=path' to explicitly specify them.
dlopen
(This section adapted from the file `dlsym.c' in the X distribution.)
The Xlib
library uses the standard C function wcstombs
.
Under SunOS 4.1, wcstombs
uses the `dlsym' interface defined
in `libdl.so'. Unfortunately, the SunOS 4.1 distribution does not
include a static `libdl.a' library.
As a result, if you try to link an X program statically under SunOS, you
may get undefined references to dlopen
, dlsym
, and
dlclose
. One workaround is to include these definitions
when you link:
void *dlopen() { return 0; } void *dlsym() { return 0; } int dlclose() { return -1; }
These are contained in the `dlsym.c' file in the MIT X distribution.
ShellWidgetClass
(This section adapted from the comp.sys.sun.admin FAQ.)
If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x, you
may get undefined symbols _get_wmShellWidgetClass
and
_get_applicationShellWidgetClass
when linking. This problem does
not arise using the standard MIT X libraries under SunOS.
The cause is bugs in the Xmu
shared library as shipped from Sun.
There are several fixes:
Xmu
library into the executable.
Xmu
at all. If you are compiling
Metafont, see section `Online Metafont graphics' in Web2c. If you are
compiling Xdvi, see the -DNOTOOL
option in `xdvik/INSTALL'.
Here is the information for getting the two patches:
Patch ID: 100512-02 Bug ID's: 1086793, 1086912, 1074766 Description: 4.1.x OpenWindows 3.0libXt
jumbo patch Patch ID: 100573-03 Bug ID: 1087332 Description: 4.1.x OpenWindows 3.0 undefined symbols when using sharedlibXmu
.
The way to statically link with libXmu
depends on whether you are
using a Sun compiler (e.g., cc
) or gcc
. If the latter,
alter the x_libs
Make variable to include
-static -lXmu -dynamic
If you are using the Sun compiler, use `-Bstatic' and `-Bdynamic'.
When compiling with old C compilers, you may get some warnings about "illegal pointer combinations". These are spurious; just ignore them. I decline to clutter up the source with casts to get rid of them.
Go to the first, previous, next, last section, table of contents.