LinuxCommandLibrary

tex

Typeset documents using the TeX engine

TLDR

Compile a DVI document

$ tex [source.tex]
copy

Compile a DVI document, specifying an output directory
$ tex -output-directory=[path/to/directory] [source.tex]
copy

Compile a DVI document, exiting on each error
$ tex -halt-on-error [source.tex]
copy

SYNOPSIS

tex [options] [file...]

PARAMETERS

-help
    Display help information and exit.

-version
    Display version information and exit.

-ini
    Run TeX in initialization mode.

-enc
    Specifies input encoding. (Not standardized across implementations)

file
    The TeX source file to process. If no file is specified, TeX reads from standard input.

DESCRIPTION

The tex command is a front-end to the TeX typesetting system. It reads the specified TeX source file(s) and produces formatted output, typically in the form of a DVI (Device Independent) file. TeX is a powerful typesetting language that allows for precise control over the appearance of documents, including fonts, layout, and mathematical formulas. It uses a markup language to describe the structure and formatting of the document, which is then processed by the TeX engine to create the final output.

The DVI file can then be processed by a DVI driver to produce output suitable for a specific printer or display. Common DVI drivers include dvips for PostScript output and dvipdfm or dvipdfmx for PDF output. TeX is widely used in academia and scientific publishing for producing high-quality documents with complex mathematical content. The tex command is often used indirectly through higher-level interfaces like LaTeX.

USAGE NOTES

The tex command directly executes the TeX engine. In practice, users often prefer to use LaTeX (accessed through the latex command), which provides a higher-level markup language and a more convenient environment for document preparation. LaTeX simplifies many aspects of document formatting and provides a wide range of pre-defined styles and packages.

ENVIRONMENT VARIABLES

TeX's behavior can be customized using environment variables. For example, the TEXINPUTS variable specifies the search path for TeX input files, such as style files and fonts.

HISTORY

TeX was created by Donald Knuth and initially released in 1978. It was designed to provide a consistent and high-quality typesetting system that would remain stable over time. The core TeX engine has been remarkably stable, with relatively few changes made to the original code. This stability is a key feature of TeX, ensuring that documents created many years ago can still be processed correctly today. LaTeX, a macro package built on top of TeX, is now more commonly used for document preparation.

SEE ALSO

latex(1), dvips(1), dvipdfm(1)

Copied to clipboard