# DESCRIPTION

tex-pretty filters its TeX input from stdin, or from one or more files named on the command line, and prettyprints it to stdout. Most formatting systems based on TeX, including AmSTeX, AmSLaTeX, ETeX (K. Berry's Extended plain TeX), LAmSTeX, LaTeX, and SliTeX, are handled reasonably well. tex-pretty also includes support for the Free Software Foundation's GNU Project TeXinfo, whose markup syntax resembles that of scribe(1) rather than that of TeX.

LaTeXinfo is similar enough to LaTeX that it can be handled by tex-pretty, provided a suitable supplementary style file is supplied; an example is given in the STYLE FILES section below.

Although prettyprinters of necessity impose a certain style that may not be universally agreed upon, they have nevertheless proven useful for many programming languages for heuristic syntax checking, and for generating a consistent appearance in files that may have been prepared by many authors (human, or computer programs), or even by a single author with lax file preparation discipline.

Because of their low-level markup, plain TeX and AmSTeX files offer fewer opportunities for useful prettyprinting than do LaTeX, LAmSTeX, and SliTeX. Nevertheless, the heuristic error checking provided by tex-pretty may still be useful for catching brace, dollar, and environment balance errors.

LaTeX users are advised to make regular use of lacheck(1), which warns about many other kinds of likely errors that LaTeX itself cannot detect. tex-pretty will automatically repair some of these types of errors.

tex-pretty may be less useful for files consisting only of macro definitions (e.g. plain.tex, or LaTeX style files), because

• they may already have stylized formatting,
• macro definitions might include unclosed environments, and
• there is usually little structure in such files to be exposed by prettyprinting.

Because TeX commands can be arcane, and do unexpected things, users of tex-pretty are urged to check the output carefully, and not replace input files with prettyprinted output files until the latter have been typeset and verified.

tex-pretty does not examine included files that would be read by TeX during processing of commands like \bibliography, \include, \input, \listoffigures, \listoftables, \printindex, \tableofcontents, ... You must provide these files to tex-pretty explicitly if you want them to be prettyprinted.