tex
invocation
TeX (usually invoked as tex
) formats the given text and
commands, and outputs a corresponding device-independent representation
of the typeset document. This section merely describes the options
available in the Web2c implementation. For a complete description of
the TeX typesetting language, see The TeXbook
(see section References).
TeX, Metafont, and MetaPost process the command line (described here) and determine their memory dump (fmt) file in the same way (see section Memory dumps). Synopses:
tex [option]... [texname[.tex]] [tex-commands] tex [option]... \first-line tex [option]... &fmt args
TeX searches the usual places for the main input file texname
(see section `Supported file formats' in Kpathsea), extending
texname with `.tex' if necessary. To see all the
relevant paths, set the environment variable KPATHSEA_DEBUG
to
`-1' before running the program.
After texname is read, TeX processes any remaining tex-commands on the command line as regular TeX input. Also, if the first non-option argument begins with a TeX escape character (usually \), TeX processes all non-option command-line arguments as a line of regular TeX input.
If no arguments or options are specified, TeX prompts for an input file name with `**'.
TeX writes the main DVI output to the file `basetexname.dvi', where basetexname is the basename of texname, or `texput' if no input file was specified. A DVI file is a device-independent binary representation of your TeX document. The idea is that after running TeX, you translate the DVI file using a separate program to the commands for a particular output device, such as a PostScript printer (see section `Introduction' in Dvips) or an X Window System display (see xdvi(1)).
TeX also reads TFM files for any fonts you load in your document with
the \font
primitive. By default, it runs an external program
named `MakeTeXTFM' to create any nonexistent TFM files. You can
disable this at configure-time or runtime (see section `MakeTeX configuration' in Kpathsea). This is enabled mostly for the
sake of the DC fonts, which can be generated at any size.
TeX can write output files, via the \openout
primitive; this
opens a security hole vulnerable to Trojan horse attack: an unwitting
user could run a TeX program that overwrites, say, `~/.rhosts'.
(MetaPost has a write
primitive with similar implication). To
alleviate this, there is a configuration variable `openout_any'; by
default, this is set to `0', which disallows writing to any
filename beginning with `.' except `.tex' (for the sake of the
LaTeX distribution). If set to `1', any file can be written.
In any case, all \openout
filenames are recorded in the log file,
except those opened on the first line of input, which is processed when
the log file has not yet been opened. (If you as a TeX administrator
wish to implement more stringent rules on \openout
, modifying the
function openoutnameok
in `web2c/lib/texmfmp.c' is intended
to suffice.)
The program accepts the following options, as well as the standard `-help' and `-version' (see section Common options):
.drv .dtx .ins .ltx .tex .texi .texinfo .txithen TeX strips the extension; thus, `foo.tex' produces `foo.dvi', but `foo.bar.tex' produces `foo.bar.dvi'.
configure
during installation of Web2c.
INITEX
(see section Initial and virgin), enable MLTeX
extensions such as \charsubdef
. Implicitly set if the program
name is mltex
. See section MLTeX: Multi-lingual TeX.
\write
. (If you as
a TeX administrator wish to implement more stringent rules on what
can be executed, you will need to modify `tex.ch'.)
Go to the first, previous, next, last section, table of contents.