Environment Variables for emTEX and web2c

Environment variables often cause confusion, as they vary unpredictably — sometimes subtly, sometimes widely — between systems.

EmTEX for MS-DOS and web2c for UNIX are two popular distributions of TEX, , and associated programs. It's worthwhile therefore to compare their environment variables.

Firstly, the variables used leading up to the production of the DVI file:

TEX, BIEM BTEX, and MFjob
Seeking emTEX web2c
TEX Pool file TEXFMT, BTEXFMT TEXPOOL
TEX Formats TEXFMT, BTEXFMT TEXFORMATS
TEX Inputs TEXINPUT TEXINPUTS
TEX Font Metrics TEXTFM TFMFONTS, TEXFONTS
BIEM BTEX bst TEXINPUT BSTINPUTS, TEXINPUTS
BIEM BTEX bib BIBINPUT BIBINPUTS
Pool MFBAS, BMFBAS MFPOOL
Bases MFBAS, BMFBAS MFBASES
Inputs MFINPUT MFINPUTS
MFjob Inputs MFJOB

The second table compares the environment variables used by emTEX's DVI drivers with those for Tomas ROKICKI's portable PostScript driver, dvips.

DVI Drivers
Seeking emTEX Drivers dvips
DVI files DVIDRVINPUT current directory
PK Fonts DVIDRVFONTS TEXPKS, PKFONTS
Bitmap Graphics DVIDRVGRAPH
Virtual Fonts set by /pv option VFFONTS, TEXFONTS
MakeTeXPK MAKETEXPK
config.ps TEXCONFIG
PS files TEXINPUTS

Where two or more variables are listed together, they are searched from left to right. For example, dvips seeks PK fonts first in TEXPKS, then in PKFONTS. By the way, if no PK fonts can be found, then dvips uses the TFM files to determine spacing, and leaves the characters blank.

BERRY's dvipsk seeks PK fonts in whichever one of PKFONTS, TEXPKS, GLYPHFONTS and TEXFONTS — in that order — is set and of the highest priority. If a font cannot be found via environment variables, then the compile-time system default paths are searched; any lower priority font path environment variables are ignored — which may also be the behavior of Rokicki's dvips, but readers are encouraged to discover the truth for themselves. In addition, dvipsk seeks GF fonts using the successive environment variables GFFONTS, GLYPHFONTS and TEXFONTS.

MFjob and MakeTeXPK have a similar function: to create PK fonts from files. When PK fonts are missing, but the font sources are available, MFjob can be called by recent versions (1.4r and above) of the emTEX drivers to create the missing fonts. MakeTeXPK is called by dvips for the same purpose.

In BERRY's web2c 5.851d6, TEX can be configured to call MakeTeXTFM and MakeTeXTeX, and to call MakeTeXMF, to make missing TFM, TEX, and files, respectively. MakeTeXTFM, like MakeTeXPK, can call . Design of MakeTeXTeX and MakeTeXMF are up to the user's imagination — Karl says that one possibility is to employ ftp.