]> Kpathsea: A library for path searching This file documents the Kpathsea library for path searching.Copyright (C) 1993-2004 Karl Berry & Olaf Weber.Permission is granted to make and distribute verbatim copies of thismanual provided the copyright notice and this permission notice arepreserved on all copies.Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that theentire resulting derived work is distributed under the terms of apermission notice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translationapproved by the Free Software Foundation. Kpathsea library This manual documents how to install and use the Kpathsea library for filename lookup. It corresponds to version 3.5.4, released in February 2005. Introduction introduction fundamental purpose of Kpathsea This manual corresponds to version 3.5.4 of the Kpathsea library, released in February 2005. The library's fundamental purpose is to return a filename from a list of directories specified by the user, similar to what shells do when looking up program names to execute. programs using the library The following software, all of which we maintain, uses this library: Dviljk (see the ‘dvilj’ man page) Dvipsk (see See section ``Introduction'' in Dvips: A DVI driver) GNU font utilities (see See section ``Introduction'' in GNU font utilities) Web2c (see See section ``Introduction'' in Web2c: A @TeX{}implementation) Xdvik (see the ‘xdvi’ man page) Other software that we do not maintain also uses it. interface, not frozen comments, making suggestions, making We are still actively maintaining the library (and probably always will be, despite our hopes). If you have comments or suggestions, please send them to us (see ). conditions for use license for using the library GNU General Public License We distribute the library under the GNU Library General Public License (LGPL). In short, this means if you write a program using the library, you must (offer to) distribute the source to the library, along with any changes you have made, and allow anyone to modify the library source and distribute their modifications. It does not mean you have to distribute the source to your program, although we hope you will. See the files COPYING and COPYING.LIB for the text of the GNU licenses. &tex; Users Group If you know enough about &tex; to be reading this manual, then you (or your institution) should consider joining the &tex; Users Group (if you're already a member, great!). TUG produces the periodical TUGboat, sponsors an annual meeting and publishes the proceedings, and arranges courses on &tex; for all levels of users throughout the world. Anyway, here is the address: tug@tug.org &tex; Users Group P.O. Box 2311 Portland OR 97208-2311 USA phone: +1 503 223-9994 fax: +1 503 223-3960 email: History history of Kpathsea Knuth, Donald E. (This section is for those people who are curious about how the library came about.) (If you like to read historical accounts of software, we urge you to seek out the GNU Autoconf manual and the “Errors of &tex;” paper by Don Knuth, published in Software—Practice and Experience 19(7), July 1989.) Morgan, Tim Rokicki, Tom Berry, Karl VAX 11/750 Sun 2 pxp Pascal preprocessor pc Pascal compiler [Karl writes.] My first ChangeLog entry for Web2c seems to be February 1990, but I may have done some work before then. In any case, Tim Morgan and I were jointly maintaining it for a time. (I should mention here that Tim had made Web2c into a real distribution long before I had ever used it or even heard of it, and Tom Rokicki did the original implementation. I was using pxp and pc on VAX 11/750's and the hot new Sun 2 machines.) It must have been later in 1990 and 1991 that I started working on &tex; for the Impatient. Dvips, Xdvi, Web2c, and the GNU fontutils (which I was also writing at the time) all used different environment variables, and, more importantly, had different bugs in their path searching. This became extremely painful, as I was stressing everything to the limit working on the book. I also desperately wanted to implement subdirectory searching, since I couldn't stand putting everything in one big directory, and also couldn't stand having to explicitly specify cm, pandora, … in a path. Vojta, Paul In the first incarnation, I just hacked separately on each program—that was the original subdirectory searching code in both Xdvi and Dvips, though I think Paul Vojta has completely rewritten Xdvi's support by now. That is, I tried to go with the flow in each program, rather than changing the program's calling sequences to conform to common routines. Then, as bugs inevitably appeared, I found I was fixing the same thing three times (Web2c and fontutils were always sharing code, since I maintained those—there was no Dvipsk or Xdvik or Dviljk at this point). After a while, I finally started sharing source files. They weren't yet a library, though. I just kept things up to date with shell scripts. (I was developing on a 386 running ISC 2.2 at the time, and so didn't have symbolic links. An awful experience.) MacKenzie, David The ChangeLogs for Xdvik and Dvipsk record initial releases of those distributions in May and June 1992. I think it was because I was tired of the different configuration strategies of each program, not so much because of the path searching. (Autoconf was being developed by David MacKenzie and others, and I was adapting it to &tex; and friends.) zuhn, david I started to make a separate library that other programs could link with on my birthday in April 1993, according to the ChangeLog. I don't remember exactly why I finally took the time to make it a separate library; a conversation with david zuhn that initiated it. Just seemed like it was time. Walsh, Norman Neumann, Gustaf Dviljk got started in March 1994 after I bought a Laserjet 4. (Kpathsea work got suspended while Norm Walsh and I, with Gustaf Neumann's help, implemented a way for &tex; to get at all those neat builtin LJ4 fonts … such a treat to have something to typeset in besides Palatino!) By spring of 1995, I had implemented just about all the path-searching features in Kpathsea that I plan to, driven beyond my initial goals by Thomas Esser and others. I then started to integrate Web2c with Kpathsea. After the release of a stable Web2c, I hope to be able to stop development, and turn most of my attention back to making fonts for GNU. (Always assuming Micros**t hasn't completely obliterated Unix by then, or that software patents haven't stopped software development by anybody smaller than a company with a million-dollar-a-year legal budget. Which is actually what I think is likely to happen, but that's another story…) Weber, Olaf [Olaf writes.] At the end of 1997, UNIX is still alive and kicking, individuals still develop software, and Web2c development still continues. Karl had been looking for some time for someone to take up part of the burden, and I volunteered. Installation installation configuration compilation (A copy of this chapter is in the distribution file kpathsea/INSTALL.) The procedure for Kpathsea (and Web2c, etc.) configuration and installation follows. If you encounter trouble, see , a copy of which is in the file kpathsea/BUGS. Simple installation simple installation installation, simple precompiled executables, instead of installation installation, getting executables instead of 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 . This section explains what to do if you wish to take the defaults for everything, 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. By default everything will be installed under /usr/local and the following discussion assumes this. However, if you already have &tex; installed, its location is used to derive the directory under which everything is to be installed. Be sure you have enough disk space: approximately 8 megabytes for thecompressed archives, 15MB for sources, 50MB for compilation, 40MB forthe (initial) installed system (including library files). See . Retrieve these distribution archives: ftp://ftp.tug.org/tex/texk.tar.gz These are the sources, which you will be compiling. ftp://ftp.tug.org/tex/texklib.tar.gz This is a basic set of input files. You should unpack it in thedirectory /usr/local/share; doing so will create a texmfsubdirectory there. These archives are mirrored on the CTAN hosts, in thesystems/web2c directory.See . When using the default search paths, there is no need to edit anydistribution files. See . At the top level of the distribution, run ‘sh configure’. (If youhave the GNU Bash shell installed, run ‘bash configure’.)See . make’. See . If you are using a BSD 4.4 systemsuch as FreeBSD or NetBSD, you may have to use GNU make (often installedin /usr/local/bin), not the BSD make. make install’. See . make distclean’. See . Set up a cron job to rebuild the filename database that makes searchingfaster. This line will rebuild it every midnight: 0 0 * * * cd /usr/local/share/texmf && /bindir/mktexlsr See , and . printer configuration files PostScript fonts, additional color printers, configuringIf you're installing Dvips, you also need to set up configuration filesfor your printers and make any additional PostScript fonts available.See See section ``Installation'' in Dvips. If you have any color printers,see See section ``Color device configuration'' in Dvips. The first time you run a DVI driver, a bunch of PK fonts will be builtby Metafont via mktexpk (and added to the filename database).This will take some time. Don't be alarmed; they will created only thisfirst time (unless something is wrong with your path definitions).By default, mktexpk will create these fonts in a hierarchyunder /var/tmp/texfonts; it simply assumes that /var/tmpexists and is globally writable. If you need a different arrangement,see .See . fonts, being created mktexpk , initial runs tests, simpleFor some simple tests, try ‘tex story \\bye’ and ‘latexsample2e’. Then run xdvi story or dvips sample2e on theresulting DVI files to preview/print the documents. See . Custom installation custom installation installation, customized 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: dviljk/INSTALL. See See section ``Installation'' in Dvips. See See section ``Installation'' in Web2c. xdvik/INSTALL. non-Unix operating systems Amiga support DOS support OS/2 support VMS support 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. Disk space disk space, needed total disk space size of distribution archives 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 ‘texklib’; the individual distributions don't enter into it. Sizes are in megabytes. All numbers are approximate. Distribution .tar.gz Unpacked Compiled Installed dviljk .9 3.8 dvipsk .9 3.2 xdvik .7 2.5 web2c 1.3 5.0 web 1.9 6.5 - - texk 7.5 32.1 95.3 33.5 texklib 6.3 15.0 - 15.0 (totals) 14.6 47.1 95.3 48.5 Kpathsea application distributions distributions, compiling simultaneously version number, of Kpathsea Kpathsea version number distributions, not compiling NeXT, lacking X11 X11, lacking on NeXT The archive 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: DVI drivers dviljk.tar.gz PCL driver LaserJet driveDVI to PCL, for LaserJet printers. dvipsk.tar.gz PDF generation PostScript driverDVI to PostScript, for previewers, printers, or PDF generation. web2c.tar.gz The software needed to compile &tex; and friends. web.tar.gz The original WEB source files, also used in compilation. xdvik.tar.gz X11 previewerDVI previewing under the X window system. Babel non-English typesetting If you want to use the Babel La&tex; package for support of non-English typesetting, you may need to retrieve additional files. See the file install.txt in the Babel distribution. Changing search paths search paths, changing default paths, changing default texmf.in, editing If the search paths for your installation differ from the standard &tex; directory structure (see See section ``Introduction'' in A Directory Structure for @TeX{} files), edit the file kpathsea/texmf.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 mktex.cnf, either before or after installation, to control various aspects of mktexpk and friends. See . You do not need to edit texmf.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.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. Default path features default path features features, of default paths 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.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.) MAKETEX_MODE paths, device name included in 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. kpse_init_prog, and MAKETEX_MODE proginit.c 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.in before installation, or the installed texmf.cnf, and remove the ‘$MAKETEX_MODE’. See , for how this interacts with mktexpk. HIER kpathsea/HIER See &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. Default path generation default paths, changing paths, changing default installation, changing default directories directories, changing default installation 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. default paths, how they're made To summarize the chain of events that go into defining the default paths: configure’ creates a Makefile from each Makefile.in. texmf.sedWhen Make runs in the kpathsea directory, it creates a filetexmf.sed that substitutes the Make value of $(var) for astring @var@. The variables in question are the one thatdefine the installation directories. texmf.in texmf.cnf, generatedtexmf.sed (together with a little extra magic—seekpathsea/Makefile) is applied to texmf.in to generatetexmf.cnf. This is the file that will eventually be installedand used. paths.hThe definitions in texmf.cnf are recast as C #define's inpaths.h. These values will be the compile-time defaults; theyare 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 intexmf.cnf expand into; but the paths as distributed have no extra:'s, and there's no particular reason for them to.) Running configure configure, running c-auto.in Makefile.in ac_include, Autoconf extension @var@ substitutions system dependencies Run sh configure options (in the top-level directory, the one containing kpathsea/), possibly using a shell other than sh (see ). configure adapts the source distribution to the present system via #define's in */c-auto.h, which are created from the corresponding c-auto.in. It also creates a Makefile from the corresponding Makefile.in, doing ‘@var@’ and ‘ac_include’ substitutions). README.CONFIGURE kpathsea/README.CONFIGURE 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 mktexpk by default with the option ‘--disable-mktexpk’. See . configure shells shells and configure bash, recommended for running configure Considerable effort has gone into trying to ensure that the configure scripts can be run by most Bourne shell variants. If sh runs into trouble, your best bet is to use Bash, the GNU Bourne-again shell (see See section ``Top'' in Bash Reference Manual). Bourne shell variants for which problems have been reported in the past are: ksh ksh, losing with configure bsh, ok with configure Korn shell, losing with configure AIX shells and configureOld versions of the Korn shell may fail to handle the scripts. The Kornshell may be installed as /bin/sh on AIX, in which case/bin/bsh may serve instead. ash ash, losing with configure NetBSD shells and configure FreeBSD shells and configure Linux shells and configureOld versions of ash are unable to handle the scripts. Ash is sometimesinstalled as /bin/sh on NetBSD, FreeBSD, and Linux systems./bin/bash should be available for those systems, but might not bepart of a default installation. Ultrix /bin/sh DEC shells and configure Ultrix shells and configure sh5, ok with configure/bin/sh under Ultrix is a DEC-grown shell that is notablydeficient in many ways. /bin/sh5 may be necessary. configure options configure options For a complete list of all configure options, run ‘configure --help’ or see See section ``Running @code{configure} scripts'' in Autoconf, (a copy is in the file kpathsea/README.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 . –with options –enable options configuration of optional features options to configure This section gives pointers to descriptions of the ‘--with’ and ‘--enable’ options to configure that Kpathsea-using programs accept. --without-mktexmf-default’‘--without-mktexpk-default’‘--without-mktextfm-default’‘--with-mktextex-defaultEnable or disable the dynamic generation programs. See . --enable-shared –enable-sharedBuild Kpathsea as a shared library, and link against it. Also build theusual static library. See . --disable-static –disable-staticBuild only the shared library. Implies ‘--enable-shared’. --enable-maintainer-mode –enable-maintainer-modeEnables make targets that are useful for the maintainer and likely to bea pain for anyone else; the makefiles created when this option isenabled may not work at all for you. You have been warned. configure environment configure uses the value of the following environment variables in determining your system's characteristics, and substitutes for them in Makefile's: CC gcc, compiling with cc, compiling withThe compiler to use: default is gcc if it's installed, otherwisecc. CFLAGS compiler options, specifyingOptions to give the compiler: default is ‘-g -O2’ for gcc,‘-g’ otherwise. CFLAGS comes after any other options. Youmay need to include -w here if your compilations commonly haveuseless warnings (e.g., NULL redefined), or configure mayfail to detect the presence of header files (it takes the messages onstandard error to mean the header file doesn't exist). CPPFLAGS configuration compiler optionsOptions to pass to the compiler preprocessor; this matters most forconfiguration, not the actual source compilation. The configurescript often does only preprocessing (e.g., to check for the existenceof #include files), and CFLAGS is not used for this. You mayneed to set this to something like‘-I/usr/local/include/wwwhatever’ if you have the libwww libraryinstalled for hyper-xdvik (see xdvik/INSTALL). DEFS preprocessor optionsAdditional preprocessor options, but not used by configure.Provided for enabling or disabling program features, as documented inthe various program-specific installation instructions. DEFScomes before any compiler options included by the distributionMakefiles or by configure. LDFLAGS loader optionsAdditional options to give to the loader. LDFLAGS comes beforeany other linker options. LIBS libraries, specifying additionalAdditional libraries to link with. configure scenarios Here are some common installation scenarios: Including X support in Metafont. This is disabled by default, sincemany sites have no use for it, and it's a leading cause of configurationproblems. configure --with-x &tex; hierarchy, onePutting the binaries, &tex; files, GNU info files, etc. into a single&tex; hierarchy, say /here/texmf, requires overriding defaults inconfigure: configure --prefix=/here/texmf --datadir=/here multiple architectures, compiling on architectures, compiling multiple symbolic link trees, for multiple architectures –srcdir, for building multiple architectures lndir for building symlink treesYou can compile on multiple architectures simultaneously either bybuilding symbolic link trees with the lndir script from the X11distribution, or with the ‘--srcdir’ option: configure --srcdir=srcdir multiple architectures, directories forIf you are installing binaries for multiple architectures into a singlehierarchy, you will probably want to override the default bin andlib directories, something like this: configure --prefix=texmf --datadir=texmf \ --bindir=texmf/arch/bin --libdir=texmf/arch/lib make texmf=texmf depot automounter, and configuration(Unless you make provisions for architecture-specific files inother ways, e.g., with Depot or an automounter.) -O, compiling with -g, compiling without optimization, enabling debugging with ‘-g’, disablingTo compile with optimization (to compile without debugging, remove the‘-g’): env CFLAGS="-g -O" sh configure … For a potential problem if you optimize, see &tex; or Metafont failing. Shared library shared library, making –enable-shared You can compile Kpathsea as a shared library on a few systems, by specifying the option ‘--enable-shared’ when you run ‘configure’. code sharing 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’, on IRIX or Linux, use ‘-rpath${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 Linux, SunOS 4 (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. 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. Running make make, running texmf.cnf, creating paths.h, creating 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. fallback resolutions, overriding 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 ). The Make variables have the same names. Finally, you can supply additional options via the following variables. (configure does not use these.) XCPPFLAGS’‘XDEFS preprocessor options, additionalPreprocessor options. XCFLAGS compiler options, additionalCompiler options. XLDFLAGS loader options, initialLoader options (included at beginning of link commands). XLOADLIBES loader options, finalMore loader options (included at end of link commands). XMAKEARGS Make arguments, additionalAdditional Make arguments passed to all sub-make's. You may needto include assignments to the other variables here via XMAKEARGS;for example: ‘make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"’. compiler, changing libraries, changing 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. universe, BSD vs. system V BSD universe system V universe Solaris BSD compatibility, not libucb, avoiding ucbinclude, avoiding 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). Babel If you want to use the Babel La&tex; package for support of non-English typesetting, you need to modify some files before making the La&tex; format. See the file install.txt in the Babel distribution. Installing files installing files The basic command is the usual make install. For security issues, see . 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 (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. multiple architectures, installing on architecture-(in)dependent files, installing only installation, architecture-(in)dependent files only You may wish to use one of the following targets, especially if you are installing on multiple architectures: install-exec Make targetmake install-exec to install in architecture-dependentdirectories, i.e., ones that depend on the $(exec_prefix) Makevariable. This includes links to binaries, libraries, etc., not just“executables”. install-data Make targetmake install-data to install in architecture-independentdirectories, such as documentation, configuration files, pool files, etc. AFS Andrew File System, installing with /afs/… , installing into 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 ls-R and AFS relative filenames in ls-R With AFS, you will definitely want to use relative filenames in ls-R (see ), not absolute filenames. This is done by default, but check anyway. Cleaning up distclean Make target The basic command is make distclean. This removes all files created by the build. Alternatively, mostlyclean Make targetmake mostlyclean if you intend to compile on anotherarchitecture. For Web2C, since the generated C files are portable,they are not removed. If the lex vs. flex situationis going to be different on the next machine, rmweb2c/lex.yy.c. clean Make targetmake clean to remove files created by compiling, but leaveconfiguration files and Makefiles. maintainer-clean Make targetmake maintainer-clean to remove everything that the Makefiles canrebuild. This is more than ‘distclean’ removes, and you shouldonly use it if you are thoroughly conversant with (and have the necessaryversions of) Autoconf. extraclean Make targetmake extraclean to remove other junk, e.g., core files, logfiles, patch rejects. This is independent of the other ‘clean’targets. Filename database generation filename database generation generation of filename database 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/mktexlsr See . Although the mktex… 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. mktex scripts mktex scripts scripts for file creation font set, infinite dynamic creation of files Sauter fonts, and dynamic source creation EC fonts, and dynamic source creation 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 ). This is most useful for fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as the Sauter and EC 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. mktex configuration mktex script configuration configuration of mktex scripts enabling mktex scripts disabling mktex scripts The following file types can run an external program to create missing files: pk, tfm, mf, tex; the scripts are named mktexpk, mktextfm, mktexmf, and mktextex. In the absence of configure options specifying otherwise, everything but mktextex will be enabled by default. The configure options to change the defaults are: configure options for mktex scripts –without-mktexmf-default –without-mktexpk-default –without-mktextfm-default –with-mktextex-default --without-mktexmf-default --without-mktexpk-default --without-mktextfm-default --with-mktextex-default The configure setting is overridden if the environment variable or configuration file value named for the script is set; e.g., MKTEXPK (see ). mktex.cnf site overrides for mktex… As distributed, all the scripts source a file texmf/web2c/mktex.cnf if it exists, so you can override various defaults. See mktex.opt, for instance, which defines the default mode, resolution, some special directory names, etc. If you prefer not to change the distributed scripts, you can simply create mktex.cnf with the appropriate definitions (you do not need to create it if you have nothing to put in it). mktex.cnf has no special syntax; it's an arbitrary Bourne shell script. The distribution contains a sample mktex.cnf for you to copy and modify as you please (it is not installed anywhere). mktex.opt MT_FEATURES In addition, you can configure a number of features with the MT_FEATURES variable, which you can define: in mktex.opt, as just mentioned; by editing the file mktex.opt, either before ‘makeinstall’ (in the source hierarchy) or after (in the installedhierarchy); or in the environment. If none of the options below are enabled, mktexpk, mktextfm, and mktexmf follow the following procedure to decide where fonts should be installed. Find the tree where the font's sources are, and test the permissions of the ‘fonts’ directory of that tree to determine whether it is writable. If it is, put the files in the tree in appropriate locations. If it isn't writable, see whether the tree is a system tree (named in SYSTEXMF). If so, the VARTEXFONTS tree is used. In all other cases the working directory is used. The ‘appendonlydir’ option is enabled by default. appendonlydir directories, making append-only mktexdirTell mktexdir to create directories append-only, i.e., settheir sticky bit (see See section ``Mode Structure'' in GNU Core Utilities). This feature is silently ignored on non-Unix platforms(e.g. Windows/NT and MS-DOS) which don't support similar functionality.This feature is enabled by default. dosnames 8.3 filenames, using DOS compatible names dpinnn directoriesUse 8.3 names; e.g., dpi600/cmr10.pk instead ofcmr10.600pk. Note that this feature only affects filenames thatwould otherwise clash with other TeX-related filenames; mktexscripts do nothing about filenames which exceed the 8+3 MS-DOS limitsbut remain unique when truncated (by the OS) to these limits, and netherdo the scripts care about possible clashes with files which aren'trelated with TeX. For example, cmr10.600pk would clash withcmr10.600gf and is therefore changed when ‘dosnames’ is ineffect, but mf.pool and mp.base don't clash with anyTeX-related files and are therefore unchanged.This feature is turned on by default on MS-DOS. If you do not wish‘dosnames’ to be set on an MS-DOS platform, you need to set theMT_FEATURES environment variable to a value that doesn't include‘dosnames’. You can also change the default setting by editingmktex.opt, but only if you use the mktex shell scripts;the emulation programs don't consult mktex.opt. fontmaps fontmaps fontnameInstead of deriving the location of a font in the destination tree fromthe location of the sources, the aliases and directory names from theFontname distribution are used. (see See section ``Introduction'' in Fontname). nomfdrivers metafont driver filesLet mktexpk and mktextfm create metafont driver files in a temporarydirectory. These will be used for just one metafont run and notinstalled permanently. nomode mode directory, omittingOmit the directory level for the mode name; this is fine as long asyou generate fonts for only one mode. stripsupplier supplier directory, omittingOmit the font supplier name directory level. striptypeface typeface directory, omittingOmit the font typeface name directory level. strip supplier directory, omitting typeface directory, omittingOmit the font supplier and typeface name directory levels. This featureis deprecated in favour of ‘stripsupplier’ and ‘striptypeface’. varfonts /var/tmp/texfonts VARTEXFONTS Linux File System StandardWhen this option is enabled, fonts that would otherwise be written insystem texmf tree go to the VARTEXFONTS tree instead. Thedefault value in kpathsea/Makefile.in is/var/tmp/texfonts. The Linux File System Standardrecommends /var/tex/fonts. USE_VARTEXFONTSThe ‘varfonts’ setting in MT_FEATURES is overridden by theUSE_VARTEXFONTS environment variable: if set to ‘1’, thefeature is enabled, and if set to ‘0’, the feature is disabled. texmfvar TEXMFVARForce generated files that would go into a system tree (as defined bySYSTEXMF) into TEXMFVAR. Starting with te&tex;-3.0, thevariable TEXMFVAR is always set. The ‘varfonts’ feature takesprecedence if also set. USE_TEXMFVARThe ‘texmfvar’ setting in MT_FEATURES is overridden by theUSE_TEXMFVAR environment variable: if set to ‘1’, thefeature is enabled, and if set to ‘0’, the feature is disabled. mktex script names mktex script names names for mktex scripts tex-make.c kpse_make_specs 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.) mktexpk mktexpkGlyph fonts. mktextex mktextex&tex; input files. mktexmf mktexmfMetafont input files. mktextfm mktextfmTFM files. DVIPSMAKEPK XDVIMAKEPK DVILJMAKEPK These names are overridden by an environment variable specific to the program—for example, DVIPSMAKEPK for Dvipsk. missfont.log failed mktex… script invocation If a mktex… 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. TEXMFOUTPUT MISSFONT_LOG 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. mktex script arguments arguments to mktex The first argument to a mktex script is always the name of the file to be created. In the default mktexpk implementation, additional arguments may also be passed: --dpi numSets the resolution of the generated font to num. --mfmode nameSets the Metafont mode to name. --bdpi numSets the the “base dpi” for the font. This must match the mode beingused. --mag stringA “magstep” string suitable for the Metafont mag variable.This must match the combination of bdpi and dpi being used. --destdir stringA directory name. If the directory is absolute, it is used as-is.Otherwise, it is appended to the root destination directory set in thescript. Installation testing testing, post-installation installation testing Besides the tests listed in , you can try running ‘make check’. This includes the torture tests (trip, trap, and mptrap) that come with Web2c (see See section ``Triptrap'' in Web2c). Security security considerations 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. trojan horse attack .rhosts, writable by &tex; 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 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 See section ``Option details'' in Dvips, the xdvi man page, and See section ``tex invocation'' in Web2c, respectively. local cache of fonts cache of fonts, local Another security issue arises because it's very useful—almost necessary—to make arbitrary fonts on user demand with mktexpk and friends. Where do these files get installed? By default, the mktexpk distributed with Kpathsea assumes a world-writable /var/tmp directory; this is a simple and convenient approach, but it may not suit your situation because it means that a local cache of fonts is created on every machine. globally writable directories To avoid this duplication, many people consider a shared, globally writable font tree desirable, in spite of the potential security problems. To do this you should change the value of VARTEXFONTS in texmf.cnf to refer to some globally known directory. See . append-only directories and mktexpk The first restriction you can apply is to make newly-created directories under texmf be append-only with an option in mktex.cnf. See . group-writable directories setgid scripts 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 mktexpk 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.) file permissions permissions, file The mktex… scripts install files with the same read and write permissions as the directory they are installed in. The executable, sgid, suid, and sticky bits are always cleared. directory permissions permissions, directory Any directories created by the mktex… scripts have the same permissions as their parent directory, unless the appendonlydir feature is used, in which case the sticky bit is always set. &tex; directory structure TEXMF &tex; directory structure directory structure, for &tex; files skeleton &tex; directory TDS 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 ftp://prep.ai.mit.edu/pub/gnu/standards/standards.texi and mirrors. The TDS document is available from CTAN:/tex-archive/tds (see ). You can change the default paths in many ways (see ). 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 . 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/ Bib&tex; input files bib/ Bib&tex; databases base/ base distribution (e.g., xampl.bib’) misc/ single-file databases pkg/ name of a package bst/ Bib&tex; 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 unixtex.ftp: Obtaining &tex; obtaining &tex; retrieving &tex; unixtex.ftp tug.org www.tug.org ftp.tug.org This is ftp://ftp.tug.org/tex/unixtex.ftp, last updated 26 December 2003. Also available as http://www.tug.org/unixtex.ftp. The IP address is currently [130.225.2.178]. It is also in Kpathsea source distributions as etc/unixtex.ftp (although the network version is usually newer). Mail with comments or questions. Following are general instructions for Unix or other sites who wish to acquire the Web2c distribution, (plain) &tex;, La&tex; (2e), Bib&tex;, 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 http://www.tug.org/web2c/, the Web2c and Kpathsea home page. Please note that the Web2c distribution is a bare-bones distribution in source form, and building a complete installation from it is a non-trivial matter. For most uses, it is a better idea to install a distribution with pre-packaged binaries for your platform. The principal example of such a distribution is &tex; Live (http://www.tug.org/texlive/), which is based on the Web2c sources. Please consider joining the &tex; Users Group (TUG) or another user group of your choice to help support the maintenance and development of the programs you retrieve. See http://www.tug.org/join.html for information and the membership registration form, and http://www.tug.org/usergroups.html for a listing of all user groups. For actual installation instructions after obtaining the necessary sources, see . A copy is in the distribution file kpathsea/INSTALL. Electronic distribution ftp retrieval obtaining Web2c by ftp distributions, via ftp CTAN, defined backbone of CTAN In many places we refer to CTAN:. This is both a host name and a directory name. Here are the primary locations: ftp://ctan.tug.org/tex-archive/ (Vermont, USA) ftp://ftp.dante.de/tex-archive/ (Germany) ftp://ftp.tex.ac.uk/tex-archive/ (England) README.mirrors CTAN.sites mirrors, FTP CTAN has many mirrors worldwide; see the top-level file README.mirrors from one of the sites above or see http://www.tug.org/CTAN.sites. World Wide Web CTAN access email CTAN access NFS CTAN access You can also access CTAN via the World Wide Web, electronic mail, or NFS. The same README.mirrors file explains how. binary mode, for file transfers 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): CTAN:/systems/web2c/web.tar.gz Knuth, Donald E., original authorThe original WEB source files, written primarily by Don Knuth. Requiredunless you already have this web version. (The WEB sourceschange irregularly with respect to Web2c itself.) Unpacks intoweb2c-version. CTAN:/systems/web2c/web2c.tar.gz The Web2c system. Required. Also unpacks intoweb2c-version. CTAN:/systems/web2c/web2c-etex.tar.gz Additions to the Web2c system for building e-&tex;. Optional. Unpacksinto web2c-version. CTAN:/systems/web2c/etexlib.tar.gz Additions to the texmf tree needed to build e-&tex;. Optional.Unpacks into texmf/. CTAN:/systems/web2c/etexdoc.tar.gz Documentation for e-&tex; as an addition to the texmf tree. Optional.Unpacks into texmf/. CTAN:/systems/web2c/web2c-omega.tar.gz Additions to the Web2c system for building Omega. Optional. Unpacksinto web2c-version. CTAN:/systems/web2c/omegalib.tar.gz Additions to the texmf tree needed to build Omega. Optional. Unpacksinto texmf/. CTAN:/systems/web2c/omegadoc.tar.gz Documentation for Omega as an addition to the texmf tree. Optional.Unpacks into texmf/. CTAN:/systems/web2c/web2c-pdftex.tar.gz Additions to the Web2c system for building pdf&tex;. Optional.Unpacks into web2c-version. CTAN:/systems/web2c/pdftexlib.tar.gz Additions to the texmf tree needed to build pdf&tex;. Optional.Unpacks into texmf/. CTAN:/dviware/xdvik/xdvik.tar.gz X window system DVI previewer. Unpacks into xdvik-version.Optional. Additional drivers, macro files, and other support are needed to build a working system. These are available in te&tex;. 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. CD-ROM distribution CD-ROM distributions obtaining Web2c on CD-ROM distributions, on CD-ROM Numerous organizations distribute various &tex; CD-ROM's (and DVD's): &tex; Live CD-ROMVirtually all the &tex; user groups collaborate to produce the&tex; Live distribution once a year; seehttp://www.tug.org/texlive/ for more information. Free Software Foundation FSF Source Code CD-ROMThe Free Software Foundation's Source Code CD-ROM contains theminimal &tex; source distribution described in the previous section(i.e., enough to print GNU documentation); email. Linux, using Web2cMost Linux distributions include some &tex; package based onWeb2c; see the Linux documentation file ‘Distribution-HOWTO’ for acomparison of Linux distributions, available (for example) viahttp://www.linux.org. If you know of additional &tex; distributions to add to this list, please inform . Other &tex; packages other &tex; distributions &tex; distributions besides Web2c Amiga &tex; implementations Acorn &tex; implementations VMS &tex; implementations Macintosh &tex; implementations DOS &tex; implementations Windows &tex; implementations 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!) te&tex; precompiled Unix binaries The principal user-oriented Unix distribution based on Web2c is the te&tex; distribution. It includes complete sources, and runs on all modern Unix variants, including Linux. It contains many &tex;-related programs besides those in the core Web2c. labrea.stanford.edu Knuth, Donald E., archive of programs by 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. Reporting bugs reporting bugs bugs, reporting (A copy of this chapter is in the file kpathsea/BUGS.) tex-k@mail.tug.org (bug address) bug address If you have problems or suggestions, please report them to 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, … Bug checklist checklist for bug reports bug checklist Before reporting a bug, please check below to be sure it isn't already known (see ). Bug reports should be sent via electronic mail to , 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: version numbers, determiningThe version number(s) of the program(s) involved, and of Kpathseaitself. You can get the former by giving a sole option ‘--version’to the program, and the latter by running ‘kpsewhich --version’.The NEWS and ChangeLog files also contain the versionnumber. unameThe hardware, operating system (including version number), compiler, andmake program you are using (the output of uname -a is astart on the first two, though often incomplete). If the bug involvesthe X window system, include X version and supplier information as well(examples: X11R6 from MIT; X11R4 from HP; OpenWindows 3.3 bundled withSunOS 4.1.4). config.logAny options you gave to configure. This is recorded in theconfig.status files. configuration bugs config.statusIf you are reporting a bug in ‘configure’ itself, it's probablysystem-dependent, and it will be unlikely the maintainers can doanything useful if you merely report that thus-and-such is broken.Therefore, you need to do some additional work: for some bugs, you canlook in the file config.log where the test that failed shouldappear, along with the compiler invocation and source program inquestion. You can then compile it yourself by hand, and discover whythe test failed. Other ‘configure’ bugs do not involve thecompiler; in that case, the only recourse is to inspect theconfigure shell script itself, or the Autoconf macros thatgenerated configure. The log of all debugging output, if the bug is in path searching. Youcan get this by setting the environment variable KPATHSEA_DEBUGto ‘-1’ before running the program. Please look at the logyourself to make sure the behavior is really a bug before reporting it;perhaps “old” environment variable settings are causing files not tobe found, for example. The contents of any input files necessary to reproduce the bug. Forbugs in DVI-reading programs, for example, this generally means a DVIfile (and any EPS or other files it uses)—&tex; source files arehelpful, but the DVI file is necessary, because that's the actualprogram input. shar, recommendedGNU shar, available from ftp://prep.ai.mit.edu/pub/gnu isa convenient way of packaging multiple (possibly binary) files forelectronic mail. If you feel your input files are too big to send byemail, you can ftp them to ftp://ftp.tug.org/incoming (thatdirectory is writable, but not readable). context diff sending patches ChangeLog entryIf you are sending a patch (do so if you can!), please do so in the formof a context diff (‘diff -c’) against the original distributionsource. Any other form of diff is either not as complete or harder forme to understand. Please also include a ChangeLog entry. stack trace debugger crashes, reporting core dumps, reporting null pointers, dereferencing gdb, recommendedIf the bug involved is an actual crash (i.e., core dump), it is easy anduseful to include a stack trace from a debugger (I recommend the GNUdebugger GDB, available from ftp://prep.ai.mit.edu/pub/gnu). Ifthe cause is apparent (a NULL value being dereferenced, forexample), 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 programor the library (see &tex; or Metafontfailing). Any additional information that will be helpful in reproducing,diagnosing, or fixing the bug. Mailing lists mailing lists bug mailing list announcement mailing list Web2c and Kpathsea in general are discussed on the mailing list . tex-k-request@mail.tug.org To join, email 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 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. tex-archive@math.utah.edu announcement mailing list If you only want announcements of new releases, not bug reports and discussion, join (via mail to ). &tex; help mailing list La&tex; help mailing list Usenet &tex; newsgroup newsgroup for &tex; help, mailing list for general &tex; info-tex@shsu.edu comp.text.tex If you are looking for general &tex; help, such as how to use La&tex;, please use the mailing list mailing list, which is gatewayed to the ‘comp.text.tex’ Usenet newsgroup (or post to the newsgroup; the gateway is bidirectional). Debugging debugging runtime debugging options for debugging kpathsea_debug debug.h 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. KPATHSEA_DEBUG kpathsea_debug 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. -1 debugging value 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 standard error and debugging output 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 Kpsewhich, and debugging It is sometimes helpful to run the standalone Kpsewhich utility (see ), instead of the original program. numeric debugging values 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) Report ‘stat’(2) calls. This is useful for verifying that yourdirectory structure is not forcing Kpathsea to do many additional filetests (see , and see ). If you are using an up-to-date ls-R database(see ), this should produce no output unless anonexistent file that must exist is searched for. KPSE_DEBUG_HASH (2) Report lookups in all hash tables: ls-R and aliases(see ); font aliases (see ); and configfile values (see ). Useful when expected values are notbeing found, e.g.., file searches are looking at the disk instead ofusing ls-R. KPSE_DEBUG_FOPEN (4) fopen, redefinedReport file openings and closings. Especially useful when your system'sfile table is full, for seeing which files have been opened but neverclosed. In case you want to set breakpoints in a debugger: this works byredefining ‘fopen’ (‘fclose’) to be ‘kpse_fopen_trace’(‘kpse_fclose_trace’). KPSE_DEBUG_PATHS (8) kpse_format_info_typeReport general path information for each file type Kpathsea is asked tosearch. This is useful when you are trying to track down how aparticular path got defined—from texmf.cnf, config.ps,an environment variable, the compile-time default, etc. This is thecontents of the kpse_format_info_type structure defined intex-file.h. KPSE_DEBUG_EXPAND (16) Report the directory list corresponding to each path element Kpathseasearches. This is only relevant when Kpathsea searches the disk, sincels-R searches don't look through directory lists in this way. KPSE_DEBUG_SEARCH (32) Report on each file search: the name of the file searched for, the pathsearched in, whether or not the file must exist (when drivers search forcmr10.vf, it need not exist), and whether or not we arecollecting all occurrences of the file in the path (as with, e.g.,texmf.cnf and texfonts.map), or just the first (as withmost lookups). This can help you correlate what Kpathsea is doing withwhat is in your input file. KPSE_DEBUG_VARS (64) Report the value of each variable Kpathsea looks up. This is useful forverifying that variables do indeed obtain their correct values. GSFTOPK_DEBUG (128) Activates debugging printout specific to gsftopk program. MAKETEX_DEBUG (512) If you use the optional mktex programs instead of thetraditional shell scripts, this will report the name of the site file(mktex.cnf by default) which is read, directories created bymktexdir, the full path of the ls-R database built bymktexlsr, font map searches, MT_FEATURES in effect,parameters from mktexnam, filenames added bymktexupd, and some subsidiary commands run by the programs. MAKETEX_FINE_DEBUG (1024) When the optional mktex programs are used, this will printadditional debugging info from functions internal to these programs. kdebug: hash_summary_only variable for debugging hash table buckets, printing 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.) Logging log file logging successful searches recording successful searches usage patterns, finding disk usage, reducing 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. TEXMFLOG 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. epoch, seconds since time system call 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 privacy, semblance of Only filenames that are absolute are recorded, to preserve some semblance of privacy. Common problems common problems problems, common FAQ, Kpathsea Here are some common problems with configuration, compilation, linking, execution, … Unable to find files unable to find files files, unable to find 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 . Perhaps you simply haven't installed all the necessary files; the basicfonts and input files are distributed separately from the programs.See . /etc/profile environment variables, oldYou have (perhaps unknowingly) told Kpathsea to use search paths thatdon't reflect where the files actually are. One common cause is havingenvironment variables set from a previous installation, thus overridingwhat you carefully set in texmf.cnf (see ). System /etc/profile or other files such may be theculprit. symbolic links not found leaf directories wrongly guessedYour files reside in a directory that is only pointed to via a symboliclink, in a leaf directory and is not listed in ls-R.Unfortunately, Kpathsea's subdirectory searching has an irremediabledeficiency: If a directory d being searched for subdirectoriescontains plain files and symbolic links to other directories, but notrue subdirectories, d will be considered a leaf directory, i.e.,the symbolic links will not be followed. See .You can work around this problem by creating an empty dummy subdirectoryin d. Then d will no longer be a leaf, and the symlinks willbe followed.The directory immediately followed by the ‘//’ in the pathspecification, however, is always searched for subdirectories, even ifit is a leaf. Presumably you would not have asked for the directory tobe searched for subdirectories if you didn't want it to be. If the fonts (or whatever) don't already exist, mktexpk (ormktexmf or mktextfm) will try to create them. Ifthese rather complicated shell scripts fail, you'll eventually get anerror message saying something like ‘Can't find fontfontname’. The best solution is to fix (or at least report) thebug in mktexpk; the workaround is to generate the necessaryfonts by hand with Metafont, or to grab them from a CTAN site(see ). There is a bug in the library. See . Slow path searching excessive startup time slow startup time startup time, excessive If your program takes an excessively long time to find fonts or other input files, but does eventually succeed, here are some possible culprits: Most likely, you just have a lot of directories to search, and thattakes a noticeable time. The solution is to create and maintain aseparate ls-R file that lists all the files in your main &tex;hierarchy. See . Kpathsea always uses ls-Rif it's present; there's no need to recompile or reconfigure any of theprograms. Your recursively-searched directories (e.g.,/usr/local/share/texmf/fonts//), contain a mixture of files anddirectories. This prevents Kpathsea from using a useful optimization(see ).It is best to have only directories (and perhaps a README) in theupper levels of the directory structure, and it's very important to haveonly files, and no subdirectories, in the leaf directories wherethe dozens of TFM, PK, or whatever files reside. In any case, you may find the debugging options helpful in determining precisely when the disk or network is being pounded. See . Unable to generate fonts unable to generate fonts font generation failures This can happen if either mktexpk hasn't been installed properly, or if the local installation of Metafont isn't correct. Metafont installation If mf is a command not found by mktexpk, then you need to install Metafont (see ). Metafont using the wrong resolution resolution, wrong 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 See section ``Config files'' in Dvips). For example, if mktexpk is generating 300dpi fonts, but you need 600dpi fonts, you should have: M ljfour D 600 .2602gf 2602gf Metafont making too-large fonts proof mode online Metafont display, spurious 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" plain.base 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 See section ``inimf invocation'' in Web2c. &tex; or Metafont failing &tex; failures Metafont failures compiler bugs 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. optimization caveat 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. GNU C compiler bugs system C compiler bugs 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 See section ``Bugs'' in Using and Porting GNU CC. compiler bugs, finding 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. ANSI C HP-UX, compiling on compiling on HP-UX One known cause of trouble is the way arrays are handled. Some of the Pascal arrays have a lower index other than 0, and the C code will take the pointer to the allocated memory, subtract the lower index, and use the resulting pointer for the array. While this trick often works, ANSI C doesn't guarantee that it will. It it known to fail on HP-UX 10 mchines when the native compiler is used, unless the ‘+u’ compiler switch was specified. Using GCC will work on this platform as well. Empty Makefiles Makefiles, empty sed error from configure configure error from sed NetBSD configure error FreeBSD configure error Mach10 configure error AIX 4.1 configure error NeXT sed error On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), configure may fail to properly create the Makefiles. Instead, you get an error which looks something like this: prompt$ ./configure … creating Makefile sed: 1: "\\@^ac_include make/pat ...": \ can not be used as a string delimiter So far as I know, the bug here is in /bin/sh on these systems. I don't have access to a machine running any of them, so if someone can find a workaround that avoids the quoting bug, I'd be most grateful. (Search for ac_include in the configure script to get to the problematic code.) It should work to run bash configure, instead of using /bin/sh. You can get Bash from ftp://prep.ai.mit.edu/pub/gnu and mirrors. Another possible cause (reported for NeXT) is a bug in the sed command. In that case the error may look like this: Unrecognized command: \@^ac_include make/paths.make@r make/paths.make In this case, installing GNU sed should solve the problem. You can get GNU sed from the same places as Bash. XtStrings 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 static linking and dlsym dlopen dlsym dlclose wcstombs libdl.a (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; } dlsym.c These are contained in the dlsym.c file in the MIT X distribution. ShellWidgetClass dynamic linking problems with OpenWin libraries OpenWin libraries, dynamic linking problems get_wmShellWidgetClass get_applicationShellWidgetClass comp.sys.sun.admin FAQ FAQ, comp.sys.sun.admin (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. Xmu library problems The cause is bugs in the Xmu shared library as shipped from Sun. There are several fixes: Install the free MIT distribution from ‘ftp.x.org’ and mirrors. Get the OpenWindows patches listed below. Statically link the Xmu library into the executable. Avoid using Xmu at all. If you are compilingMetafont, see See section ``Online Metafont graphics'' in Web2c. If you arecompiling Xdvi, see the -DNOTOOL option in xdvik/INSTALL. Ignore the errors. The binary runs fine regardless. Sun OpenWin patches patches, Sun OpenWin 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.0 libXt jumbo patch Patch ID: 100573-03 Bug ID: 1087332 Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared libXmu. static linking 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 -dynamic -static -lXmu -dynamic -Bstatic -Bdynamic If you are using the Sun compiler, use ‘-Bstatic’ and ‘-Bdynamic’. Pointer combination warnings warnings, pointer combinations pointer combination warnings illegal pointer combination warnings cc warnings 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. Path searching path searching This chapter describes the generic path searching mechanism Kpathsea provides. For information about searching for particular file types (e.g., &tex; fonts), see the next chapter. Searching overview searching overview path searching, overview overview of path searching search path, defined A search path is a colon-separated list of path elements, which are directory names with a few extra frills. A search path can come from (a combination of) many sources; see below. To look up a file ‘foo’ along a path ‘.:/dir’, Kpathsea checks each element of the path in turn: first ./foo, then /dir/foo, returning the first match (or possibly all matches). magic characters : may not be : / may not be / The “colon” and “slash” mentioned here aren't necessarily ‘:’ and ‘/’ on non-Unix systems. Kpathsea tries to adapt to other operating systems' conventions. database search searching the database To check a particular path element e, Kpathsea first sees if a prebuilt database (see ) applies to e, i.e., if the database is in a directory that is a prefix of e. If so, the path specification is matched against the contents of the database. floating directories filesystem search disk search searching the disk If the database does not exist, or does not apply to this path element, or contains no matches, the filesystem is searched (if this was not forbidden by the specification with ‘!!’ and if the file being searched for must exist). Kpathsea constructs the list of directories that correspond to this path element, and then checks in each for the file being searched for. (To help speed future lookups of files in the same directory, the directory in which a file is found is floated to the top of the directory list.) must exist VF files, not found cmr10.vf \openin The “file must exist” condition comes into play with VF files and input files read by the &tex; ‘\openin’ command. These files may not exist (consider cmr10.vf), and so it would be wrong to search the disk for them. Therefore, if you fail to update ls-R when you install a new VF file, it will never be found. Each path element is checked in turn: first the database, then the disk. If a match is found, the search stops and the result is returned. This avoids possibly-expensive processing of path specifications that are never needed on a particular run. (Unless the search explicitly requested all matches.) expansion, path element Although the simplest and most common path element is a directory name, Kpathsea supports additional features in search paths: layered default values, environment variable names, config file values, users' home directories, and recursive subdirectory searching. Thus, we say that Kpathsea expands a path element, meaning transforming all the magic specifications into the basic directory name or names. This process is described in the sections below. It happens in the same order as the sections. absolute filenames relative filenames explicitly relative filenames filenames, absolute or explicitly relative Exception to all of the above: If the filename being searched for is absolute or explicitly relative, i.e., starts with ‘/’ or ‘./’ or ‘../’, Kpathsea simply checks if that file exists. permission denied unreadable files access warnings warnings, file access lost+found directory TEX_HUSH Ordinarily, if Kpathsea tries to access a file or directory that cannot be read, it gives a warning. This is so you will be alerted to directories or files that accidentally lack read permission (for example, a lost+found). If you prefer not to see these warnings, include the value ‘readable’ in the TEX_HUSH environment variable or config file value. This generic path searching algorithm is implemented in kpathsea/pathsearch.c. It is employed by a higher-level algorithm when searching for a file of a particular type (see , and ). Path sources path sources sources for search paths A search path can come from many sources. In the order in which Kpathsea uses them: environment variable, source for pathA user-set environment variable, e.g., TEXINPUTS.Environment variables with an underscore and the program name appendedoverride; for example, TEXINPUTS_latex overrides TEXINPUTSif the program being run is named ‘latex’. A program-specific configuration file, e.g., an ‘S /a:/b’ line inDvips' config.ps (see See section ``Config files'' in Dvips). configuration file, source for path Kpathsea config file, source for path texmf.cnf, source for pathA line in a Kpathsea configuration file texmf.cnf, e.g.,‘TEXINPUTS=/c:/d’ (see below). compilation value, source for pathThe compile-time default (specified in kpathsea/paths.h). You can see each of these values for a given search path by using the debugging options (see ). These sources may be combined via default expansion (see ). Config files config files texmf.cnf, definition for runtime configuration files TEXMFCNF As mentioned above, Kpathsea reads runtime configuration files named texmf.cnf for search path and other definitions. The search path used to look for these configuration files is named TEXMFCNF, and is constructed in the usual way, as described above, except that configuration files cannot be used to define the path, naturally; also, an ls-R database is not used to search for them. Kpathsea reads all texmf.cnf files in the search path, not just the first one found; definitions in earlier files override those in later files. Thus, if the search path is ‘.:$TEXMF’, values from ./texmf.cnf override those from $TEXMF/texmf.cnf. While (or instead of) reading this description, you may find it helpful to look at the distributed texmf.cnf, which uses or at least mentions most features. The format of texmf.cnf files follows: comments, in texmf.cnfComments start with ‘%’ and continue to the end of the line. blank lines, in texmf.cnfBlank lines are ignored. backslash-newline continuation character whitespace, not ignored on continuation lines \, line continuation in texmf.cnfA ‘\’ at the end of a line acts as a continuation character, i.e.,the next line is appended. Whitespace at the beginning of continuationlines is not ignored. Each remaining line must look like variable [ . progname ] [ = ] value where the ‘=’ and surrounding whitespace is optional. identifiers, characters valid inThe variable name may contain any character other than whitespace,‘=’, or ‘.’, but sticking to ‘A-Za-z_’ is safest. If ‘.progname’ is present, the definition onlyapplies if the program that is running is named (i.e., the lastcomponent of argv[0] is) progname orprogname.exe. This allows different flavors of &tex; tohave different search paths, for example. right-hand side of variable assignmentsvalue may contain any characters except ‘%’ and ‘@’.(These restrictions are only necessary because of the processing done ontexmf.cnf at build time, so you can stick those characters inafter installation if you have to.) The ‘$var.prog’feature is not available on the right-hand side; instead, you must usean additional variable (see below for example). A ‘;’ invalue is translated to ‘:’ if running under Unix; this isuseful to write a single texmf.cnf which can be used under bothUnix and NT. (If you really want ‘;’'s in your filenames, add‘-DALLOW_SEMICOLON_IN_FILENAMES’ to CFLAGS.) All definitions are read before anything is expanded, so you canuse variables before they are defined (like Make, unlike most otherprograms). Here is a configuration file fragment illustrating most of these points: % TeX input files -- i.e., anything to be found by \input or \openin ... latex209_inputs = .:$TEXMF/tex/latex209//:$TEXMF/tex// latex2e_inputs = .:$TEXMF/tex/latex//:$TEXMF/tex// TEXINPUTS = .:$TEXMF/tex// TEXINPUTS.latex209 = $latex209_inputs TEXINPUTS.latex2e = $latex2e_inputs TEXINPUTS.latex = $latex2e_inputs shell scripts as configuration files configuration files as shell scripts. Although this format has obvious similarities to Bourne shell scripts—change the comment character to #, disallow spaces around the =, and get rid of the .name convention, and it could be run through the shell. But there seemed little advantage to doing this, since all the information would have to passed back to Kpathsea and parsed there anyway, since the sh process couldn't affect its parent's environment. cnf.c The implementation of all this is in kpathsea/cnf.c. Path expansion path expansion expansion, search path Kpathsea recognizes certain special characters and constructions in search paths, similar to that in shells. As a general example: ‘~$USER/{foo,bar}//baz’ expands to all subdirectories under directories foo and bar in $USER's home directory that contain a directory or file baz. These expansions are explained in the sections below. Default expansion :: expansion doubled colons leading colons trailing colons extra colons default expansion expansion, default If the highest-priority search path (see ) contains an extra colon (i.e., leading, trailing, or doubled), Kpathsea inserts at that point the next-highest-priority search path that is defined. If that inserted path has an extra colon, the same happens with the next-highest. (An extra colon in the compile-time default value has unpredictable results, so installers beware.) For example, given an environment variable setting setenv TEXINPUTS /home/karl: and a TEXINPUTS value from texmf.cnf of .:$TEXMF//tex then the final value used for searching will be: /home/karl:.:$TEXMF//tex Since Kpathsea looks for multiple configuration files, it would be natural to expect that (for example) an extra colon in ./texmf.cnf would expand to the path in $TEXMF/texmf.cnf. Or, with Dvips' configuration files, that an extra colon in config.$PRINTER would expand to the path in config.ps. This doesn't happen. It's not clear this would be desirable in all cases, and trying to devise a way to specify the path to which the extra colon should expand seemed truly baroque. Bach, Johann Sebastian Technicality: Since it would be useless to insert the default value in more than one place, Kpathsea changes only one extra ‘:’ and leaves any others in place (they will eventually be ignored). Kpathsea checks first for a leading ‘:’, then a trailing ‘:’, then a doubled ‘:’. kdefault.c You can trace this by debugging “paths” (see ). Default expansion is implemented in the source file kpathsea/kdefault.c. Variable expansion $ expansion environment variables in paths variable expansion expansion, variable texmf.cnf, and variable expansion $foo’ or ‘${foo}’ in a path element is replaced by (1) the value of an environment variable ‘foo’ (if defined); (2) the value of ‘foo’ from texmf.cnf (if defined); (3) the empty string. If the character after the ‘$’ is alphanumeric or ‘_’, the variable name consists of all consecutive such characters. If the character after the ‘$’ is a ‘{’, the variable name consists of everything up to the next ‘}’ (braces may not be nested around variable names). Otherwise, Kpathsea gives a warning and ignores the ‘$’ and its following character. quoting variable values shell variables You must quote the $'s and braces as necessary for your shell. Shell variable values cannot be seen by Kpathsea, i.e., ones defined by set in C shells and without export in Bourne shells. For example, given setenv tex /home/texmf setenv TEXINPUTS .:$tex:${tex}prev the final TEXINPUTS path is the three directories: .:/home/texmf:/home/texmfprev The ‘.progname’ suffix on variables and ‘_progname’ on environment variable names are not implemented for general variable expansions. These are only recognized when search paths are initialized (see ). variable.c Variable expansion is implemented in the source file kpathsea/variable.c. Tilde expansion ~ expansion home directories in paths tilde expansion expansion, tilde HOME, as ~ expansion A leading ‘~’ in a path element is replaced by the value of the environment variable HOME, or . if HOME is not set. A leading ‘~user’ in a path element is replaced by user's home directory from the system passwd database. For example, setenv TEXINPUTS ~/mymacros: will prepend a directory mymacros in your home directory to the default path. root user trailing ‘/’ in home directory /, trailing in home directory As a special case, if a home directory ends in ‘/’, the trailing slash is dropped, to avoid inadvertently creating a ‘//’ construct in the path. For example, if the home directory of the user ‘root’ is ‘/’, the path element ‘~root/mymacros’ expands to just ‘/mymacros’, not ‘//mymacros’. tilde.c Tilde expansion is implemented in the source file kpathsea/tilde.c. Brace expansion { expansion brace expansion x{a,b}y’ expands to ‘xay:xby’. For example: foo/{1,2}/baz expands to ‘foo/1/baz:foo/2/baz’. ‘:’ is the path separator on the current system; e.g., on a DOS system, it's ‘;’. Braces can be nested; for example, ‘x{A,B{1,2}}y’ expands to ‘xAy:xB1y:xB2y’. Multiple non-nested braces are expanded from right to left; for example, ‘x{A,B}{1,2}y’ expands to ‘x{A,B}1y:x{A,B}2y’, which expands to ‘xA1y:xB1y:xA2y:xB2y’. multiple &tex; hierarchies This feature can be used to implement multiple &tex; hierarchies, by assigning a brace list to $TEXMF, as mentioned in texmf.in. You can also use the path separator in stead of the comma. The last example could have been written ‘x{A:B}{1:2}y’. expand.c Brace expansion is implemented in the source file kpathsea/expand.c. It is a modification of the Bash sources, and is thus covered by the GNU General Public License, rather than the Library General Public License that covers the rest of Kpathsea. KPSE_DOT expansion KPSE_DOT expansion When KPSE_DOT is defined in the environment, it names a directory that should be considered the current directory for the purpose of looking up files in the search paths. This feature is needed by the ‘mktex…’ scripts , because these change the working directory. You should not ever define it yourself. Subdirectory expansion // subdirectory searching expansion, subdirectory alphabetical order, not Two or more consecutive slashes in a path element following a directory d is replaced by all subdirectories of d: first those subdirectories directly under d, then the subsubdirectories under those, and so on. At each level, the order in which the directories are searched is unspecified. (It's “directory order”, and definitely not alphabetical.) If you specify any filename components after the ‘//’, only subdirectories which match those components are included. For example, ‘/a//b’ would expand into directories /a/1/b, /a/2/b, /a/1/1/b, and so on, but not /a/b/c or /a/1. You can include multiple ‘//’ constructs in the path. //’ at the beginning of a path is ignored; you didn't really want to search every directory on the system, did you? trick for detecting leaf directories leaf directory trick Farwell, Matthew MacKenzie, David I should mention one related implementation trick, which I took from GNU find. Matthew Farwell suggested it, and David MacKenzie implemented it. st_nlink The trick is that in every real Unix implementation (as opposed to the POSIX specification), a directory which contains no subdirectories will have exactly two links (namely, one for . and one for ..). That is to say, the st_nlink field in the ‘stat’ structure will be two. Thus, we don't have to stat everything in the bottom-level (leaf) directories—we can just check st_nlink, notice it's two, and do no more work. But if you have a directory that contains a single subdirectory and 500 regular files, st_nlink will be 3, and Kpathsea has to stat every one of those 501 entries. Therein lies slowness. UNIX_ST_LINK You can disable the trick by undefining UNIX_ST_LINK in kpathsea/config.h. (It is undefined by default except under Unix.) elt-dirs.c Unfortunately, in some cases files in leaf directories are stat'd: if the path specification is, say, ‘$TEXMF/fonts//pk//’, then files in a subdirectory ‘…/pk’, even if it is a leaf, are checked. The reason cannot be explained without reference to the implementation, so read kpathsea/elt-dirs.c (search for ‘may descend’) if you are curious. And if you can find a way to solve the problem, please let me know. elt-dirs.c Subdirectory expansion is implemented in the source file kpathsea/elt-dirs.c. Filename database (ls-R) filename database database, for filenames externally-built filename database Kpathsea goes to some lengths to minimize disk accesses for searches (see ). Nevertheless, at installations with enough directories, searching each possible directory for a given file can take an excessively long time (depending on the speed of the disk, whether it's NFS-mounted, how patient you are, etc.). In practice, a font tree containing the standard PostScript and PCL fonts is large enough for searching to be noticeably slow on typical systems these days. Therefore, Kpathsea can use an externally-built “database” file named ls-R that maps files to directories, thus avoiding the need to exhaustively search the disk. A second database file aliases allows you to give additional names to the files listed in ls-R. This can be helpful to adapt to “8.3” filename conventions in source files. The ls-R and aliases features are implemented in the source file kpathsea/db.c. ls-R ls-R database file TEXMFDBS As mentioned above, you must name the main filename database ls-R. You can put one at the root of each &tex; installation hierarchy you wish to search ($TEXMF by default); most sites have only one hierarchy. Kpathsea looks for ls-R files along the TEXMFDBS path, so that should presumably match the list of hierarchies. The recommended way to create and maintain ‘ls-R’ is to run the mktexlsr script, which is installed in ‘$(bindir)’ (/usr/local/bin by default). That script goes to some trouble to follow symbolic links as necessary, etc. It's also invoked by the distributed ‘mktex…’ scripts. ls-R, simplest build At its simplest, though, you can build ls-R with the command cd /your/texmf/root && ls -LAR ./ >ls-R –color=tty /etc/profile and aliases presuming your ls produces the right output format (see the section below). GNU ls, for example, outputs in this format. Also presuming your ls hasn't been aliased in a system file (e.g., /etc/profile) to something problematic, e.g., ‘ls --color=tty’. In that case, you will have to disable the alias before generating ls-R. For the precise definition of the file format, see . Regardless of whether you use the supplied script or your own, you will almost certainly want to invoke it via cron, so when you make changes in the installed files (say if you install a new La&tex; package), ls-R will be automatically updated. -A option to ls dot files . files . directories, ignored .tex file, included in ls-R The ‘-A’ option to ls includes files beginning with ‘.’ (except for . and ..), such as the file .tex included with the La&tex; tools package. (On the other hand, directories whose names begin with ‘.’ are always ignored.) symbolic links, and ls-R -L option to ls If your system does not support symbolic links, omit the ‘-L’. automounter, and ls-R NFS and ls-R ls -LAR /your/texmf/root will also work. But using ‘./’ avoids embedding absolute pathnames, so the hierarchy can be easily transported. It also avoids possible trouble with automounters or other network filesystem conventions. warning about unusable ls-R unusable ls-R warning Kpathsea warns you if it finds an ls-R file, but the file does not contain any usable entries. The usual culprit is running plain ‘ls -R’ instead of ‘ls -LR ./’ or ‘ls -R /your/texmf/root’. Another possibility is some system directory name starting with a ‘.’ (perhaps if you are using AFS); Kpathsea ignores everything under such directories. !! in path specifications disk searching, avoiding Because the database may be out-of-date for a particular run, if a file is not found in the database, by default Kpathsea goes ahead and searches the disk. If a particular path element begins with ‘!!’, however, only the database will be searched for that element, never the disk. If the database does not exist, nothing will be searched. Because this can surprise users (“I see the font foo.tfm when I do an ls; why can't Dvips find it?”), it is not in any of the default search paths. Filename aliases filename aliases aliases, for filenames In some circumstances, you may wish to find a file under several names. For example, suppose a &tex; document was created using a DOS system and tries to read longtabl.sty. But now it's being run on a Unix system, and the file has its original name, longtable.sty. The file won't be found. You need to give the actual file longtable.sty an alias ‘longtabl.sty’. You can handle this by creating a file aliases as a companion to the ls-R for the hierarchy containing the file in question. (You must have an ls-R for the alias feature to work.) The format of aliases is simple: two whitespace-separated words per line; the first is the real name longtable.sty, and second is the alias (longtabl.sty). These must be base filenames, with no directory components. longtable.sty must be in the sibling ls-R. Also, blank lines and lines starting with ‘%’ or ‘#’ are ignored in aliases, to allow for comments. If a real file longtabl.sty exists, it is used regardless of any aliases. Database format format of external database database, format of The “database” read by Kpathsea is a line-oriented file of plain text. The format is that generated by GNU (and most other) ls programs given the ‘-R’ option, as follows. Blank lines are ignored. If a line begins with ‘/’ or ‘./’ or ‘../’ and ends witha colon, it's the name of a directory. (‘../’ lines aren't useful,however, and should not be generated.) All other lines define entries in the most recently seen directory./'s in such lines will produce possibly-strange results. Files with no preceding directory line are ignored. For example, here's the first few lines of ls-R (which totals about 30K bytes) on my system: bibtex dvips fonts ls-R metafont metapost tex web2c ./bibtex: bib bst doc ./bibtex/bib: asi.bib btxdoc.bib … kpsewhich: Standalone path searching kpsewhich path searching, standalone standalone path searching The Kpsewhich program exercises the path searching functionality independent of any particular application. This can also be useful as a sort of find program to locate files in your &tex; hierarchies, perhaps in administrative scripts. It is used heavily in the distributed ‘mktex…’ scripts. Synopsis: kpsewhich optionfilename The options and filename(s) to look up can be intermixed. Options can start with either ‘-’ or ‘--’, and any unambiguous abbreviation is accepted. Path searching options path searching options Kpsewhich looks up each non-option argument on the command line as a filename, and returns the first file found. There is no option to return all the files with a particular name (you can run the Unix ‘find’ utility for that, see See section ``Invoking find'' in GNU find utilities). Various options alter the path searching behavior: --dpi=num –dpi=num -D num resolution, settingSet the resolution to num; this only affects ‘gf’ and‘pk’ lookups. ‘-D’ is a synonym, for compatibility withDvips. Default is 600. --engine=name –engine=name engine nameSet the engine name to name. By default it is not set. Theengine name is used in some search paths to allow files with the samename but used by different engines to coexist. --format=name –format=nameSet the format for lookup to name. By default, the format isguessed from the filename, with ‘tex’ being used if nothing elsefits. The recognized filename extensions (including any leading‘.’) are also allowable names.All formats also have a name, which is the only way to specify formatswith no associated suffix. For example, for Dvips configuration filesyou can use ‘--format="dvips config"’. (The quotes are for thesake of the shell.)Here's the current list of recognized names and the associated suffixes.See , for more information on each of these. gf: gf pk: pk bitmap font afm: .afm base: .base bib: .bib bst: .bst cnf: .cnf ls-R: ls-R fmt: .fmt map: .map mem: .mem mf: .mf mfpool: .pool mft: .mft mp: .mp mppool: .pool MetaPost support ocp: .ocp ofm: .ofm .tfm opl: .opl otp: .otp ovf: .ovf ovp: .ovp graphic/figure: .eps .epsi tex: .tex TeX system documentation texpool: .pool TeX system sources PostScript header/font: .pro Troff fonts tfm: .tfm type1 fonts: .pfa .pfb vf: .vf dvips config ist: .ist truetype fonts: .ttf .ttc type42 fonts web2c files other text files other binary files misc fonts web: .web cweb: .w .web enc: .enc cmap: .cmap sfd: .sfd opentype fonts pdftex config lig files: .lig texmfscripts This option and ‘--path’ are mutually exclusive. --interactive –interactive interactive queryAfter processing the command line, read additional filenames to look upfrom standard input. -mktex=filetype’‘-no-mktex=filetype -mktex=filetype -no-mktex=filetypeTurn on or off the ‘mktex’ script associated with filetype.The only values that make sense for filetype are ‘pk’,‘mf’, ‘tex’, and ‘tfm’. By default, all are off inKpsewhich. See . --mode=string –mode=stringSet the mode name to string; this also only affects ‘gf’ and‘pk’ lookups. No default: any mode will be found. See . --must-exist –must-existDo everything possible to find the files, notably including searchingthe disk. By default, only the ls-R database is checked, in theinterest of efficiency. --path=string –path=stringSearch along the path string (colon-separated as usual), insteadof guessing the search path from the filename. ‘//’ and all theusual expansions are supported (see ). This optionand ‘--format’ are mutually exclusive. To output the completedirectory expansion of a path, instead of doing a one-shot lookup, see‘--expand-path’ in the following section. --progname=name –progname=nameSet the program name to name; default is ‘kpsewhich’. Thiscan affect the search paths via the ‘.prognam’ feature inconfiguration files (see ). Auxiliary tasks auxiliary tasks Kpsewhich provides some additional features not strictly related to path lookup: –debug=num--debug=num’ sets the debugging options to num.See . –var-value=variable--var-value=variable’ output the value of variable. –expand-braces=string--expand-braces=string’ outputs the variable and braceexpansion of string. See . –expand-var=string--expand-var=string’ outputs the variable expansion ofstring. For example, the ‘mktex…’ scripts run‘kpsewhich --expand-var='$TEXMF'’ to find the root of the &tex; systemhierarchy. See . –expand-path=string--expand-path=string’ outputs the complete expansion ofstring as a colon-separated path. This is useful to construct asearch path for a program that doesn't accept recursive subdirectoryspecifications.For one-shot uses of an arbitrary (not built in to Kpathsea) path, see‘--path’ in the previous section. –show-path=name--show-path=name’ shows the path that would be used for filelookups of file type name. Either a filename extension(‘pk’, ‘.vf’, etc.) or an integer can be used, just as with‘--format’, described in the previous section. Standard options standard options Kpsewhich accepts the standard GNU options: –help--help’ prints a help message on standard output and exits. –version--version’ prints the Kpathsea version number and exits. &tex; support &tex; support Although the basic features in Kpathsea can be used for any type of path searching, it came about (like all libraries) with a specific application in mind: I wrote Kpathsea specifically for &tex; system programs. I had been struggling with the programs I was using (Dvips, Xdvi, and &tex; itself) having slightly different notions of how to specify paths; and debugging was painful, since no code was shared. Therefore, Kpathsea provides some &tex;-specific formats and features. Indeed, many of the supposedly generic path searching features were provided because they seemed useful in that con&tex;t (font lookup, particularly). Kpathsea provides a standard way to search for files of any of the supported file types; glyph fonts are a bit different than all the rest. Searches are based solely on filenames, not file contents—if a GF file is named cmr10.600pk, it will be found as a PK file. Supported file formats supported file formats file formats, supported environment variables for &tex; &tex; environment variables Kpathsea has support for a number of file types. Each file type has a list of environment and config file variables that are checked to define the search path, and most have a default suffix that plays a role in finding files (see the next section). Some also define additional suffixes, and/or a program to be run to create missing files on the fly. program-varying paths Since environment variables containing periods, such as ‘TEXINPUTS.latex’, are not allowed on some systems, Kpathsea looks for environment variables with an underscore, e.g., ‘TEXINPUTS_latex’ (see ). The following table lists the above information. afm .afm AFMFONTS(Adobe font metrics, see See section ``Metric files'' in Dvips)AFMFONTS;suffix ‘.afm’. base .base MFBASES TEXMFINI(Metafont memory dump, see See section ``Memory dumps'' in Web2c)MFBASES, TEXMFINI;suffix ‘.base’. bib .bib BIBINPUTS TEXBIB(Bib&tex; bibliography source, see See section ``bibtex invocation'' in Web2c)BIBINPUTS, TEXBIB;suffix ‘.bib’. bst .bst BSTINPUTS(Bib&tex; style file, see See section ``Basic Bib@TeX{}style files'' in Web2c)BSTINPUTS;suffix ‘.bst’. cmap .cmap CMAPFONTS(character map files)CMAPFONTS;suffix ‘.cmap’. cnf .cnf TEXMFCNF(Runtime configuration files, see )TEXMFCNF;suffix ‘.cnf’. cweb .w .web CWEBINPUTS(CWEB input files)CWEBINPUTS;suffixes ‘.w’, ‘.web’;additional suffix ‘.ch’. dvips config TEXCONFIG config.ps, search path for(Dvips ‘config.*’ files, such as config.ps, see See section ``Config files'' in Dvips)TEXCONFIG. enc files .enc ENCFONTS(encoding vectors)ENCFONTS;suffix ‘.enc’. fmt .fmt TEXFORMATS TEXMFINI(&tex; memory dump, see See section ``Memory dumps'' in Web2c)TEXFORMATS, TEXMFINI;suffix ‘.fmt’. gf gf GFFONTS GLYPHFONTS TEXFONTS(generic font bitmap, see See section ``Glyph files'' in Dvips)programFONTS, GFFONTS, GLYPHFONTS, TEXFONTS;suffix ‘gf’. graphic/figure .eps .epsi TEXPICTS TEXINPUTS(Encapsulated PostScript figures, see See section ``PostScript figures'' in Dvips)TEXPICTS, TEXINPUTS;additional suffixes: ‘.eps’, ‘.epsi’. ist .ist TEXINDEXSTYLE INDEXSTYLE(makeindex style files)TEXINDEXSTYLE, INDEXSTYLE;suffix ‘.ist’. lig files .lig LIGFONTS(ligature definition files)LIGFONTS;suffix ‘.lig’. ls-R ls-R TEXMFDBS(Filename databases, see )TEXMFDBS. map .map TEXFONTMAPS(Fontmaps, see )TEXFONTMAPS;suffix ‘.map’. mem .mem MPMEMS TEXMFINI(MetaPost memory dump, see See section ``Memory dumps'' in Web2c)MPMEMS, TEXMFINI;suffix ‘.mem’. MetaPost support MPSUPPORT(MetaPost support files, used by DMP; see See section ``dmp invocation'' in Web2c)MPSUPPORT. mf .mf MFINPUTS(Metafont source, see See section ``mf invocation'' in Web2c)MFINPUTS;suffix ‘.mf’;dynamic creation program: mktexmf. mfpool .pool MFPOOL(Metafont program strings, see See section ``pooltype invocation'' in Web2c)MFPOOL, TEXMFINI;suffix ‘.pool’. mft .mft MFTINPUTS(MFT style file, see See section ``mft invocation'' in Web2c)MFTINPUTS;suffix ‘.mft’. misc fonts MISCFONTS(font-related files that don't fit the other categories)MISCFONTS mp .mp MPINPUTS(MetaPost source, see See section ``mpost invocation'' in Web2c)MPINPUTS;suffix ‘.mp’. mppool .pool MPPOOL(MetaPost program strings, see See section ``pooltype invocation'' in Web2c)MPPOOL, TEXMFINI;suffix ‘.pool’. ocp .ocp OCPINPUTS(Omega compiled process files)OCPINPUTS; suffix ‘.ocp’;dynamic creation program: MakeOmegaOCP. ofm .ofm OFMFONTS(Omega font metrics)OFMFONTS, TEXFONTS; suffixes ‘.ofm’, ‘.tfm’;dynamic creation program: MakeOmegaOFM. opentype fonts OPENTYPEFONTS(OpenType fonts)OPENTYPEFONTS. opl .opl(Omega property lists)OPLFONTS, TEXFONTS;suffix ‘.opl’. otp .otp OTPINPUTS(Omega translation process files)OTPINPUTS;suffix ‘.otp’. ovf .ovf OVFFONTS(Omega virtual fonts)OVFFONTS, TEXFONTS;suffix ‘.ovf’. ovp .ovp OVPFONTS(Omega virtual property lists)OVPFONTS, TEXFONTS;suffix ‘.ovp’. pdftex config PDFTEXCONFIG(PDF&tex;-specific configuration files)PDFTEXCONFIG. pk .pk PKFONTS TEXPKS GLYPHFONTS TEXFONTS(packed bitmap fonts, see See section ``Glyph files'' in Dvips)PROGRAMFONTS (program being ‘XDVI’, etc.),PKFONTS, TEXPKS, GLYPHFONTS, TEXFONTS;suffix ‘pk’;dynamic creation program: mktexpk. PostScript header .pro TEXPSHEADERS PSHEADERS(downloadable PostScript, see See section ``Header files'' in Dvips)TEXPSHEADERS, PSHEADERS;additional suffix ‘.pro’. subfont definition files .sfd SFDFONTS(subfont definition files)SFDFONTSsuffix ‘.sfd’. tex .tex TEXINPUTS(&tex; source, see See section ``tex invocation'' in Web2c)TEXINPUTS;suffix ‘.tex’;additional suffixes: none, because such a list cannot be complete;dynamic creation program: mktextex. TeX system documentation doc files TEXDOCS(Documentation files for the &tex; system)TEXDOCS. TeX system sources source files TEXSOURCES(Source files for the &tex; system)TEXSOURCES. texmfscripts TEXMFSCRIPTS(Architecture-independent executables distributed in the texmf tree)TEXMFSCRIPTS. texpool .pool TEXPOOL(&tex; program strings, see See section ``pooltype invocation'' in Web2c)TEXPOOL, TEXMFINI;suffix ‘.pool’. tfm .tfm TFMFONTS TEXFONTS(&tex; font metrics, see See section ``Metric files'' in Dvips)TFMFONTS, TEXFONTS;suffix ‘.tfm’;dynamic creation program: mktextfm. Troff fonts TRFONTS(Troff fonts, used by DMP; see See section ``DMP invocation'' in Web2c)TRFONTS. truetype fonts .ttf .ttc TTFONTS(TrueType outline fonts) TTFONTS; suffixes ‘.ttf’,‘.ttc’. type1 fonts .pfa .pfb T1FONTS T1INPUTS TEXPSHEADERS DVIPSHEADERS(Type 1 PostScript outline fonts, see See section ``Glyph files'' in Dvips)T1FONTS, T1INPUTS, TEXPSHEADERS, DVIPSHEADERS;suffixes ‘.pfa’, ‘.pfb’. type42 fonts T42FONTS(Type 42 PostScript outline fonts) T42FONTS. vf .vf VFFONTS TEXFONTS(virtual fonts, see See section ``Virtual fonts'' in Dvips)VFFONTS, TEXFONTS;suffix ‘.vf’. web .web WEBINPUTS(WEB input files)WEBINPUTS;suffix ‘.web’;additional suffix ‘.ch’. web2c files WEB2C(files specific to the web2c implementation)WEB2C. There are two special cases, because the paths and environment variables always depend on the name of the program: the variable name is constructed by converting the program name to upper case, and then appending ‘INPUTS’. Assuming the program is called ‘foo’, this gives us the following table. other text files FOOINPUTS(text files used by ‘foo’)FOOINPUTS. other binary files FOOINPUTS(binary files used by ‘foo’)FOOINPUTS. If an environment variable by these names are set, the corresponding texmf.cnf definition won't be looked at (unless, as usual, the environment variable value has an extra ‘:’). See . For the font variables, the intent is that: TEXFONTS is the default for everything. GLYPHFONTS is the default for bitmap (or, more precisely,non-metric) files. Each font format has a variable of its own. XDVIFONTS DVIPSFONTSEach program has its own font override path as well; e.g.,DVIPSFONTS for Dvipsk. Again, this is for bitmaps, not metrics. File lookup file lookup searching for files &tex; file lookup This section describes how Kpathsea searches for most files (bitmap font searches are the exception, as described in the next section). Here is the search strategy for a file name: If the file format defines default suffixes, and the suffix ofname name is not already a known suffix for that format, try thename with each default appended, and use alternative names found in thefontmaps if necessary. We postpone searching the disk as long aspossible. Example: given ‘foo.sty’, look for ‘foo.sty.tex’before ‘foo.sty’. This is unfortunate, but allows us to find‘foo.bar.tex’ before ‘foo.bar’ if both exist and we were given‘foo.bar’. Search for name, and if necessary for alternative names found inthe fontmaps. Again we avoid searching the disk if possible. Example:given ‘foo’, we look for ‘foo’. If the file format defines a program to invoke to create missing files,run it (see ). tex-file.c kpse_find_file This is implemented in the routine kpse_find_file in kpathsea/tex-file.c. You can watch it in action with the debugging options (see ). Glyph lookup glyph lookup searching for glyphs &tex; glyph lookup This section describes how Kpathsea searches for a bitmap font in GF or PK format (or either) given a font name (e.g., ‘cmr10’) and a resolution (e.g., 600). Here is an outline of the search strategy (details in the sections below) for a file name at resolution dpi. The search stops at the first successful lookup. Look for an existing file name.dpiformat in thespecified format(s). If name is an alias for a file f in the fontmapfile texfonts.map, look for f.dpi. Run an external program (typically named ‘mktexpk’) togenerate the font (see ) Look for fallback.dpi, where fallback is somelast-resort font (typically ‘cmr10’). tex-glyph.c kpse_find_glyph_format This is implemented in kpse_find_glyph_format in kpathsea/tex-glyph.c. Basic glyph lookup basic glyph lookup common features in glyph lookup When Kpathsea looks for a bitmap font name at resolution dpi in a format format, it first checks each directory in the search path for a file ‘name.dpiformat’; for example, ‘cmr10.600pk’. Kpathsea looks for a PK file first, then a GF file. If that fails, Kpathsea looks for ‘dpidpi/name.format’; for example, ‘dpi600/cmr10.pk’. This is how fonts are typically stored on filesystems (such as DOS) that permit only three-character extensions. tolerance for glyph lookup glyph lookup bitmap tolerance KPSE_BITMAP_TOLERANCE If that fails, Kpathsea looks for a font with a close-enough dpi. “Close enough” is defined by the macro KPSE_BITMAP_TOLERANCE in kpathsea/tex-glyph.h to be dpi / 500 + 1. This is slightly more than the 0.2% minimum allowed by the DVI standard (CTAN:/dviware/driv-standard/level-0). Fontmap fontmap files font alias files aliases for fonts texfonts.map If a bitmap font or metric file is not found with the original name (see the previous section), Kpathsea looks through any fontmap files for an alias for the original font name. These files are named texfonts.map and searched for along the TEXFONTMAPS environment/config file variable. All texfonts.map files that are found are read; earlier definitions override later ones. This feature is intended to help in two respects: fontnames, arbitrary lengthAn alias name is limited in length only by available memory, not by yourfilesystem. Therefore, if you want to ask for ‘Times-Roman’instead of ptmr, you can (you get ‘ptmr8r’). circle fonts lcircle10A few fonts have historically had multiple names: specifically,La&tex;'s “circle font” has variously been known as circle10,lcircle10, and lcirc10. Aliases can make all the namesequivalent, so that it no longer matters what the name of the installedfile is; &tex; documents will find their favorite name. The format of fontmap files is straightforward: comments, in fontmap files Comments start with ‘%’ and continue to the end of the line. whitespace, in fontmap files Blank lines are ignored. Each nonblank line is broken up into a series of words: a sequence of non-whitespace characters. include fontmap directive If the first word is ‘include’, the second word is used as a filename, and it is searched for and read. Otherwise, the first word on each line is the true filename; the second word is the alias; subsequent words are ignored. If an alias has an extension, it matches only those files with that extension; otherwise, it matches anything with the same root, regardless of extension. For example, an alias ‘foo.tfm’ matches only when foo.tfm is being searched for; but an alias ‘foo’ matches foo.vf, foo.600pk, etc. As an example, here is an excerpt from the texfonts.map in the Web2c distribution. It makes the circle fonts equivalent and includes automatically generated maps for most PostScript fonts available from various font suppliers. circle10 lcircle10 circle10 lcirc10 lcircle10 circle10 lcircle10 lcirc10 lcirc10 circle10 lcirc10 lcircle10 … include adobe.map include apple.map include bitstrea.map … Fontmaps are implemented in the file kpathsea/fontmap.c. The Fontname distribution has much more information on font naming (see See section ``Introduction'' in Filenames for @TeX{} fonts). Fallback font fallback font fallback resolutions font of last resort resolutions, last-resort last-resort font DVIPSSIZES XDVISIZES DVILJSIZES TEXSIZES default_texsizes If a bitmap font cannot be found or created at the requested size, Kpathsea looks for the font at a set of fallback resolutions. You specify these resolutions as a colon-separated list (like search paths). Kpathsea looks first for a program-specific environment variable (e.g., DVIPSSIZES for Dvipsk), then the environment variable TEXSIZES, then a default specified at compilation time (the Make variable default_texsizes). You can set this list to be empty if you prefer to find fonts at their stated size or not at all. cmr10, as fallback font kpse_fallback_font Finally, if the font cannot be found even at the fallback resolutions, Kpathsea looks for a fallback font, typically cmr10. Programs must enable this feature by assigning to the global variable kpse_fallback_font or calling kpse_init_prog (see ); the default is no fallback font. Suppressing warnings warnings, suppressing suppressing warnings TEX_HUSH Kpathsea provides a way to suppress selected usually-harmless warnings; this is useful at large sites where most users are not administrators, and thus the warnings are merely a source of confusion, not a help. To do this, you set the environment variable or configuration file value TEX_HUSH to a colon-separated list of values. Here are the possibilities: allSuppress everything possible. checksum mismatched checksum warningsSuppress mismatched font checksum warnings. lostchar missing character warningsSuppress warnings when a character is missing from a font that a DVI orVF file tries to typeset. noneDon't suppress any warnings. readable unreadable file warningsSuppress warnings about attempts to access a file whose permissionsrender it unreadable. special unknown special warnings \special, suppressing warnings aboutSuppresses warnings about an unimplemented or unparsable‘\special’ command. tex-hush.c defines the function that checks the variable value. Each driver implements its own checks where appropriate. Programming This chapter is for programmers who wish to use Kpathsea. See , for the conditions under which you may do so. Programming overview programming overview overview of programming with Kpathsea Aside from this manual, your best source of information is the source to the programs I've modified to use Kpathsea (see ). Of those, Dviljk is probably the simplest, and hence a good place to start. Xdvik adds VF support and the complication of X resources. Dvipsk adds the complication of its own config files. Web2c is source code I also maintain, so it uses Kpathsea rather straightforwardly, but is of course complicated by the Web to C translation. Finally, Kpsewhich is a small utility program whose sole purpose is to exercise the main path-searching functionality. pathsearch.h tex-file.h tex-glyph.h kpathsea.h Beyond these examples, the .h files in the Kpathsea source describe the interfaces and functionality (and of course the .c files define the actual routines, which are the ultimate documentation). pathsearch.h declares the basic searching routine. tex-file.h and tex-glyph.h define the interfaces for looking up particular kinds of files. In view of the way the headers depend on each other, it is recommended to use #include <kpathsea/kpathsea.h>, which includes every Kpathsea header. config.h c-auto.h If you want to include only specific headers, you should still consider including kpathsea/config.h before including any other Kpathsea header, as it provides symbols used in the other headers. Note that kpathsea/config.h includes kpathsea/c-auto.h, which is generated by Autoconf. file types, registering new The library provides no way for an external program to register new file types: tex-file.[ch] must be modified to do this. For example, Kpathsea has support for looking up Dvips config files, even though no program other than Dvips will likely ever want to do so. I felt this was acceptable, since along with new file types should also come new defaults in texmf.cnf (and its descendant paths.h), since it's simplest for users if they can modify one configuration file for all kinds of paths. Kpathsea does not parse any formats itself; it barely opens any files. Its primary purpose is to return filenames. The GNU font utilities does contain libraries to read TFM, GF, and PK files, as do the programs above, of course. Calling sequence programming with Kpathsea calling sequence The typical way to use Kpathsea in your program goes something like this: kpse_set_program_name argv[0]Call kpse_set_program_name with argv[0] as the firstargument; the second argument is a string or NULL. The secondargument is used by Kpathsea as the program name for the.program feature of config files (see ).If the second argument is NULL, the value of the first argumentis used. This function must be called before any other use of theKpathsea library. program_invocation_name program_invocation_short_name kpse_program_name KPATHSEA_DEBUG SELFAUTOLOC SELFAUTODIR SELFAUTOPARENT error message macros symlinks, resolving expanding symlinksIf necessary, kpse_set_program_name sets the global variablesprogram_invocation_name and program_invocation_short_name.These variables are used in the error message macros defined inkpathsea/lib.h. It sets the global variablekpse_program_name to the program name it uses. It alsoinitializes debugging options based on the environment variableKPATHSEA_DEBUG (if that is set). Finally, it sets the variablesSELFAUTOLOC, SELFAUTODIR and SELFAUTOPARENT to thelocation, parent and grandparent directory of the executable, removing. and .. path elements and resolving symbolic links.These are used in the default configuration file to allow people toinvoke TeX from anywhere, specifically from a mounted CD-ROM. (You canuse ‘--expand-var=\$SELFAUTOLOC’, etc., to see the values finds.) kpse_set_progname argv[0]The kpse_set_progname is deprecated. A call tokpse_set_progname with argv[0] is equivalent to a call ofkpse_set_program_name with first argument argv[0] andsecond argument NULL. The function is deprecated because itcannot ensure that the .program feature of config fileswill always work (see ). kpathsea_debug variable debugging options, in Kpathsea-using programSet debugging options. See . If your program doesn't have adebugging option already, you can define one and setkpathsea_debug to the number that the user supplies (as in Dviljkand Web2c), or you can just omit this altogether (people can always setKPATHSEA_DEBUG). If you do have runtime debugging already, youneed to merge Kpathsea's options with yours (as in Dvipsk and Xdvik). client_path in kpse_format_info kpse_format_info resident.c config files, for Kpathsea-using programsIf your program has its own configuration files that can define searchpaths, you should assign those paths to the client_path member inthe appropriate element of the kpse_format_info array. (Thisarray is indexed by file type; see tex-file.h.) Seeresident.c in Dvipsk for an example. kpse_init_prog proginit.hCall kpse_init_prog (see proginit.c). It's useful for theDVI drivers, at least, but for other programs it may be simpler toextract the parts of it that actually apply. This does not initializeany paths, it just looks for (and sets) certain environment variablesand other random information. (A search path is always initialized atthe first call to find a file of that type; this eliminates much uselesswork, e.g., initializing the Bib&tex; search paths in a DVI driver.) kpse_find_* kpse_find_fileThe routine to actually find a file of type format iskpse_find_format, defined in tex-file.h. These aremacros that expand to a call to kpse_find_file. You can call,say, kpse_find_tfm after doing only the first of theinitialization steps above—Kpathsea automatically reads thetexmf.cnf generic config files, looks for environment variables,and does expansions at the first lookup. To find PK and/or GF bitmap fonts, the routines are kpse_find_pk,kpse_find_gf and kpse_find_glyph, defined intex-glyph.h. These return a structure in addition to theresultant filename, because fonts can be found in so many ways. See thedocumentation in the source. kpse_open_fileTo actually open a file, not just return a filename, callkpse_open_file. This function takes the name to look up and aKpathsea file format as arguments, and returns the usual FILE *.It always assumes the file must exist, and thus will search the disk ifnecessary (unless the search path specified ‘!!’, etc.). In otherwords, if you are looking up a VF or some other file that need notexist, don't use this. hash table routines memory allocation routines string routines reading arbitrary-length lines input lines, reading lines, reading arbitrary-length Kpathsea also provides many utility routines. Some are generic: hash tables, memory allocation, string concatenation and copying, string lists, reading input lines of arbitrary length, etc. Others are filename-related: default path, tilde, and variable expansion, stat calls, etc. (Perhaps someday I'll move the former to a separate library.) c-*.h autoconf, recommended The c-*.h header files can also help your program adapt to many different systems. You will almost certainly want to use Autoconf for configuring your software if you use Kpathsea; I strongly recommend using Autoconf regardless. It is available from ftp://prep.ai.mit.edu/pub/gnu/. Program-specific files Many programs will need to find some configuration files. Kpathsea contains some support to make it easy to place them in their own directories. The Standard &tex; directory structure (see See section ``Introduction'' in A Directory Structure for @TeX{} files), specifies that such files should go into a subdirectory named after the program, like ‘texmf/ttf2pk’. Two special formats, ‘kpse_program_text_format’ and ‘kpse_program_binary_format’ exist, which use .:$TEXMF/program// as their compiled-in search path. To override this default, you can use the variable PROGRAMINPUTS in the environment and/or ‘texmf.cnf’. That is to say, the name of the variable is constructed by converting the name of the program to upper case, and appending INPUTS. The only difference between these two formats is whether kpse_open_file will open the files it finds in text or binary mode. Programming with config files programming with config files config files, programming with You can (and probably should) use the same texmf.cnf configuration file that Kpathsea uses for your program. This helps installers by keeping all configuration in one place. kpse_var_value variable.h shell_escape, example for code To retrieve a value var from config files, the best way is to call kpse_var_value on the string var. This will look first for an environment variable var, then a config file value. The result will be the value found or ‘NULL’. This function is declared in kpathsea/variable.h. For an example, see the shell_escape code in web2c/lib/texmfmp.c. The routine to do variable expansion in the context of a search path (as opposed to simply retrieving a value) is kpse_var_expand, also declared in kpathsea/variable.h. It's generally only necessary to set the search path structure components as explained in the previous section, rather than using this yourself. kpse_cnf_get cnf.h If for some reason you want to retrieve a value only from a config file, not automatically looking for a corresponding environment variable, call kpse_cnf_get (declared in kpathsea/cnf.h) with the string var. No initialization calls are needed. xreflabel="Index" id="Index"> Index !! in path specifications, see $ expansion, see kdebug:’, see &tex; directory structure, see &tex; distributions besides Web2c, see &tex; environment variables, see &tex; failures, see &tex; file lookup, see &tex; glyph lookup, see &tex; help mailing list, see &tex; hierarchy, one, see &tex; Live CD-ROM, see &tex; support, see &tex; Users Group, see –color=tty, see –debug=num, see –disable-static, see –dpi=num, see –enable options, see –enable-maintainer-mode, see –enable-shared, see –enable-shared, see –engine=name, see –expand-braces=string, see –expand-path=string, see –expand-var=string, see –format=name, see –help, see –interactive, see –mode=string, see –must-exist, see –path=string, see –progname=name, see –show-path=name, see –srcdir, for building multiple architectures, see –var-value=variable, see –version, see –with options, see –with-mktextex-default, see –without-mktexmf-default, see –without-mktexpk-default, see –without-mktextfm-default, see -1 debugging value, see -A option to ls, see -Bdynamic, see -Bstatic, see -D num, see -dynamic, see -g, compiling without, see -L option to ls, see -mktex=filetype, see -no-mktex=filetype, see -O, compiling with, see -static, see . directories, ignored, see . files, see .2602gf, see .afm, see .base, see .bib, see .bst, see .cmap, see .cnf, see .enc, see .eps, see .epsi, see .fmt, see .ist, see .lig, see .map, see .mem, see .mf, see .mft, see .mp, see .ocp, see .ofm, see .opl, see .otp, see .ovf, see .ovp, see .pfa, see .pfb, see .pk, see .pool, see .pro, see .rhosts, writable by &tex;, see .sfd, see .tex, see .tex file, included in ls-R, see .tfm, see .ttc, see .ttf, see .vf, see .w, see .web, see / may not be /, see /, trailing in home directory, see //, see /afs/… , installing into, see /etc/profile, see /etc/profile and aliases, see /var/tmp/texfonts, see 2602gf, see 8.3 filenames, using, see : may not be :, see :: expansion, see @var@ substitutions, see \, line continuation in texmf.cnf, see \openin, see \special, suppressing warnings about, see A absolute filenames, see ac_include, Autoconf extension, see access warnings, see Acorn &tex; implementations, see AFMFONTS, see AFS, see AIX 4.1 configure error, see AIX shells and configure, see aliases for fonts, see aliases, for filenames, see alphabetical order, not, see Amiga &tex; implementations, see Amiga support, see Andrew File System, installing with, see announcement mailing list, see ANSI C, see append-only directories and mktexpk, see architecture-(in)dependent files, installing only, see architectures, compiling multiple, see arguments to mktex, see argv[0], see ash, losing with configure, see autoconf, recommended, see automounter, and configuration, see automounter, and ls-R, see auxiliary tasks, see B Babel, see Babel, see Bach, Johann Sebastian, see backbone of CTAN, see backslash-newline, see bash, recommended for running configure, see basic glyph lookup, see Berry, Karl, see BIBINPUTS, see binary mode, for file transfers, see blank lines, in texmf.cnf, see brace expansion, see BSD universe, see bsh, ok with configure, see BSTINPUTS, see bug address, see bug checklist, see bug mailing list, see bugs, reporting, see C c-*.h, see c-auto.h, see c-auto.in, see cache of fonts, local, see calling sequence, see cc warnings, see cc, compiling with, see CD-ROM distributions, see ChangeLog entry, see checklist for bug reports, see circle fonts, see clean Make target, see client_path in kpse_format_info, see CMAPFONTS, see cmr10, as fallback font, see cmr10.vf, see cnf.c, see cnf.h, see code sharing, see color printers, configuring, see comments, in fontmap files, see comments, in texmf.cnf, see comments, making, see common features in glyph lookup, see common problems, see comp.sys.sun.admin FAQ, see comp.text.tex, see compilation, see compilation value, source for path, see compiler bugs, see compiler bugs, finding, see compiler options, additional, see compiler options, specifying, see compiler, changing, see compiling on HP-UX, see conditions for use, see config files, see config files, for Kpathsea-using programs, see config files, programming with, see config.h, see config.log, see config.ps, search path for, see config.status, see configuration, see configuration bugs, see configuration compiler options, see configuration file, source for path, see configuration files as shell scripts., see configuration of mktex scripts, see configuration of optional features, see configure error from sed, see configure options, see configure options for mktex scripts, see configure, running, see context diff, see continuation character, see core dumps, reporting, see crashes, reporting, see CTAN, defined, see CTAN.sites, see custom installation, see CWEBINPUTS, see D database search, see database, for filenames, see database, format of, see debug.h, see debugger, see debugging, see debugging options, in Kpathsea-using program, see debugging output, see debugging with ‘-g’, disabling, see DEC shells and configure, see default expansion, see default path features, see default paths, changing, see default paths, how they're made, see default_texsizes, see depot, see directories, changing default installation, see directories, making append-only, see directory permissions, see directory structure, for &tex; files, see disabling mktex scripts, see disk search, see disk searching, avoiding, see disk space, needed, see disk usage, reducing, see distclean Make target, see distributions, compiling simultaneously, see distributions, not compiling, see distributions, on CD-ROM, see distributions, via ftp, see dlclose, see dlopen, see dlsym, see dlsym.c, see doc files, see DOS &tex; implementations, see DOS compatible names, see DOS support, see dot files, see doubled colons, see dpinnn directories, see DVI drivers, see DVILJMAKEPK, see DVILJSIZES, see DVIPSFONTS, see DVIPSHEADERS, see DVIPSMAKEPK, see DVIPSSIZES, see dynamic creation of files, see dynamic linking problems with OpenWin libraries, see E EC fonts, and dynamic source creation, see elt-dirs.c, see email CTAN access, see enabling mktex scripts, see ENCFONTS, see engine name, see environment variable, source for path, see environment variables for &tex;, see environment variables in paths, see environment variables, old, see epoch, seconds since, see error message macros, see excessive startup time, see expand.c, see expanding symlinks, see expansion, default, see expansion, path element, see expansion, search path, see expansion, subdirectory, see expansion, tilde, see expansion, variable, see explicitly relative filenames, see externally-built filename database, see extra colons, see extraclean Make target, see F failed mktex… script invocation, see fallback font, see fallback resolutions, see fallback resolutions, overriding, see FAQ, comp.sys.sun.admin, see FAQ, Kpathsea, see Farwell, Matthew, see features, of default paths, see file formats, supported, see file lookup, see file permissions, see file types, registering new, see filename aliases, see filename database, see filename database generation, see filenames, absolute or explicitly relative, see files, unable to find, see filesystem search, see floating directories, see font alias files, see font generation failures, see font of last resort, see font set, infinite, see fontmap files, see fontmaps, see fontname, see fontnames, arbitrary length, see fonts, being created, see FOOINPUTS, see fopen, redefined, see format of external database, see Free Software Foundation, see FreeBSD configure error, see FreeBSD shells and configure, see FSF Source Code CD-ROM, see ftp retrieval, see ftp.tug.org, see fundamental purpose of Kpathsea, see G gcc, compiling with, see gdb, recommended, see generation of filename database, see get_applicationShellWidgetClass, see get_wmShellWidgetClass, see gf, see GFFONTS, see globally writable directories, see glyph lookup, see glyph lookup bitmap tolerance, see GLYPHFONTS, see GNU C compiler bugs, see GNU General Public License, see group-writable directories, see H hash table buckets, printing, see hash table routines, see hash_summary_only variable for debugging, see help, mailing list for general &tex;, see HIER, see history of Kpathsea, see home directories in paths, see HOME, as ~ expansion, see HP-UX, compiling on, see I identifiers, characters valid in, see illegal pointer combination warnings, see include fontmap directive, see INDEXSTYLE, see info-tex@shsu.edu, see input lines, reading, see install-data Make target, see install-exec Make target, see installation, see installation testing, see installation, architecture-(in)dependent files only, see installation, changing default directories, see installation, customized, see installation, getting executables instead of, see installation, simple, see installing files, see interactive query, see interface, not frozen, see introduction, see K kdefault.c, see Knuth, Donald E., see Knuth, Donald E., archive of programs by, see Knuth, Donald E., original author, see Korn shell, losing with configure, see Kpathsea config file, source for path, see Kpathsea version number, see kpathsea.h, see kpathsea/HIER, see kpathsea/README.CONFIGURE, see KPATHSEA_DEBUG, see kpathsea_debug, see KPATHSEA_DEBUG, see kpathsea_debug, see kpathsea_debug variable, see KPSE_BITMAP_TOLERANCE, see kpse_cnf_get, see KPSE_DOT expansion, see kpse_fallback_font, see kpse_find_*, see kpse_find_file, see kpse_find_file, see kpse_find_glyph_format, see kpse_format_info, see kpse_format_info_type, see kpse_init_prog, see kpse_init_prog, and MAKETEX_MODE, see kpse_make_specs, see kpse_open_file, see kpse_program_name, see kpse_set_progname, see kpse_set_program_name, see kpse_var_value, see kpsewhich, see Kpsewhich, and debugging, see ksh, losing with configure, see L La&tex; help mailing list, see labrea.stanford.edu, see LaserJet drive, see last-resort font, see lcircle10, see leading colons, see leaf directories wrongly guessed, see leaf directory trick, see libdl.a, see libraries, changing, see libraries, specifying additional, see libucb, avoiding, see license for using the library, see LIGFONTS, see lines, reading arbitrary-length, see Linux File System Standard, see Linux shells and configure, see Linux, using Web2c, see lndir for building symlink trees, see loader options, see loader options, final, see loader options, initial, see local cache of fonts, see log file, see logging successful searches, see lost+found directory, see ls-R, see ls-R and AFS, see ls-R database file, see ls-R, simplest build, see M Mach10 configure error, see Macintosh &tex; implementations, see MacKenzie, David, see MacKenzie, David, see magic characters, see mailing lists, see maintainer-clean Make target, see Make arguments, additional, see make, running, see Makefile.in, see Makefiles, empty, see MAKETEX_MODE, see memory allocation routines, see metafont driver files, see Metafont failures, see Metafont installation, see Metafont making too-large fonts, see Metafont using the wrong resolution, see MFBASES, see MFINPUTS, see MFPOOL, see MFTINPUTS, see mirrors, FTP, see MISCFONTS, see mismatched checksum warnings, see missfont.log, see MISSFONT_LOG, see missing character warnings, see mktex script configuration, see mktex script names, see mktex scripts, see mktex.cnf, see mktex.opt, see mktexdir, see mktexmf, see mktexpk, see mktexpk , initial runs, see mktextex, see mktextfm, see mode directory, omitting, see Morgan, Tim, see mostlyclean Make target, see MPINPUTS, see MPMEMS, see MPPOOL, see MPSUPPORT, see MT_FEATURES, see multiple &tex; hierarchies, see multiple architectures, compiling on, see multiple architectures, directories for, see multiple architectures, installing on, see must exist, see N names for mktex scripts, see NetBSD configure error, see NetBSD shells and configure, see Neumann, Gustaf, see newsgroup for &tex;, see NeXT sed error, see NeXT, lacking X11, see NFS and ls-R, see NFS CTAN access, see non-English typesetting, see non-Unix operating systems, see null pointers, dereferencing, see numeric debugging values, see O obtaining &tex;, see obtaining Web2c by ftp, see obtaining Web2c on CD-ROM, see OCPINPUTS, see OFMFONTS, see online Metafont display, spurious, see OPENTYPEFONTS, see OpenWin libraries, dynamic linking problems, see optimization caveat, see optimization, enabling, see options for debugging, see options to configure, see OS/2 support, see other &tex; distributions, see OTPINPUTS, see overview of path searching, see overview of programming with Kpathsea, see OVFFONTS, see OVPFONTS, see P patches, Sun OpenWin, see path expansion, see path searching, see path searching options, see path searching, overview, see path searching, standalone, see path sources, see paths, changing default, see paths, changing default, see paths, device name included in, see paths.h, see paths.h, creating, see pathsearch.h, see pc Pascal compiler, see PCL driver, see PDF generation, see PDFTEXCONFIG, see permission denied, see permissions, directory, see permissions, file, see PKFONTS, see plain.base, see pointer combination warnings, see PostScript driver, see PostScript fonts, additional, see precompiled executables, instead of installation, see precompiled Unix binaries, see preprocessor options, see preprocessor options, additional, see printer configuration files, see privacy, semblance of, see problems, common, see proginit.c, see proginit.h, see program-varying paths, see program_invocation_name, see program_invocation_short_name, see programming overview, see programming with config files, see programming with Kpathsea, see programs using the library, see proof mode, see PSHEADERS, see pxp Pascal preprocessor, see Q quoting variable values, see R reading arbitrary-length lines, see README.CONFIGURE, see README.mirrors, see recording successful searches, see relative filenames, see relative filenames in ls-R, see reporting bugs, see resident.c, see resolution, setting, see resolution, wrong, see resolutions, last-resort, see retrieving &tex;, see right-hand side of variable assignments, see Rokicki, Tom, see root user, see runtime configuration files, see runtime debugging, see S Sauter fonts, and dynamic source creation, see scripts for file creation, see search path, defined, see search paths, changing default, see searching for files, see searching for glyphs, see searching overview, see searching the database, see searching the disk, see security considerations, see sed error from configure, see SELFAUTODIR, see SELFAUTOLOC, see SELFAUTOPARENT, see sending patches, see setgid scripts, see SFDFONTS, see sh5, ok with configure, see shar, recommended, see shared library, making, see shell scripts as configuration files, see shell variables, see shell_escape, example for code, see shells and configure, see simple installation, see site overrides for mktex…, see size of distribution archives, see skeleton &tex; directory, see slow startup time, see Solaris BSD compatibility, not, see source files, see sources for search paths, see st_nlink, see stack trace, see standalone path searching, see standard error and debugging output, see standard options, see startup time, excessive, see static linking, see static linking and dlsym, see string routines, see subdirectory searching, see suggestions, making, see Sun 2, see Sun OpenWin patches, see supplier directory, omitting, see supported file formats, see suppressing warnings, see symbolic link trees, for multiple architectures, see symbolic links not found, see symbolic links, and ls-R, see symlinks, resolving, see system C compiler bugs, see system dependencies, see system V universe, see T T1FONTS, see T1INPUTS, see T42FONTS, see TDS, see te&tex;, see testing, post-installation, see tests, simple, see tex-archive@math.utah.edu, see tex-file.c, see tex-file.h, see tex-glyph.c, see tex-glyph.h, see tex-k-request@mail.tug.org, see tex-k@mail.tug.org (bug address), see tex-make.c, see TEX_HUSH, see TEX_HUSH, see TEXBIB, see TEXCONFIG, see TEXDOCS, see TEXFONTMAPS, see TEXFONTS, see texfonts.map, see TEXFORMATS, see TEXINDEXSTYLE, see TEXINPUTS, see TEXMF, see texmf.cnf, and variable expansion, see texmf.cnf, creating, see texmf.cnf, definition for, see texmf.cnf, generated, see texmf.cnf, source for path, see texmf.in, see texmf.in, editing, see texmf.sed, see TEXMFCNF, see TEXMFCNF, see TEXMFDBS, see TEXMFDBS, see TEXMFINI, see TEXMFLOG, see TEXMFOUTPUT, see TEXMFSCRIPTS, see TEXMFVAR, see TEXPICTS, see TEXPKS, see TEXPOOL, see TEXPSHEADERS, see TEXSIZES, see TEXSOURCES, see TFMFONTS, see tilde expansion, see tilde.c, see time system call, see tolerance for glyph lookup, see total disk space, see trailing ‘/’ in home directory, see trailing colons, see TRFONTS, see trick for detecting leaf directories, see trojan horse attack, see TTFONTS, see tug.org, see tug@tug.org, see typeface directory, omitting, see U ucbinclude, avoiding, see Ultrix shells and configure, see unable to find files, see unable to generate fonts, see uname, see universe, BSD vs. system V, see UNIX_ST_LINK, see unixtex.ftp, see unknown special warnings, see unreadable file warnings, see unreadable files, see unusable ls-R warning, see usage patterns, finding, see USE_TEXMFVAR, see USE_VARTEXFONTS, see Usenet &tex; newsgroup, see V variable expansion, see variable.c, see variable.h, see VARTEXFONTS, see VAX 11/750, see version number, of Kpathsea, see version numbers, determining, see VF files, not found, see VFFONTS, see VMS &tex; implementations, see VMS support, see Vojta, Paul, see W Walsh, Norman, see warning about unusable ls-R, see warnings, file access, see warnings, pointer combinations, see warnings, suppressing, see wcstombs, see WEB2C, see Weber, Olaf, see WEBINPUTS, see whitespace, in fontmap files, see whitespace, not ignored on continuation lines, see Windows &tex; implementations, see World Wide Web CTAN access, see www.tug.org, see X X11 previewer, see X11, lacking on NeXT, see XDVIFONTS, see XDVIMAKEPK, see XDVISIZES, see Xmu library problems, see XtStrings, see Z zuhn, david, see { expansion, see ~ expansion, see