detex (1) Linux Manual Page
NAME
detex – a filter to strip TeX commands from a .tex file.
SYNOPSIS
detex [ -clnstw ] [ -e environment-list ] [ filename[.tex] … ]
DESCRIPTION
Detex reads each file in sequence, removes all comments and TeX control sequences and writes the remainder on the standard output. All text in math mode and display mode is removed. By default, detex follows \input commands. If a file cannot be opened, a warning message is printed and the command is ignored. If the -n option is used, no \input or \include commands will be processed. This allows single file processing. If no input file is given on the command line, detex reads from standard input.
If the magic sequence “egin{document}” appears in the text, detex assumes it is dealing with LaTeX source and detex recognizes additional constructs used in LaTeX. These include the \include and \includeonly commands. The -l option can be used to force LaTeX mode and the -t option can be used to force TeX mode regardless of input content.
Text in various environment modes of LaTeX is ignored. The default modes are array, eqnarray, equation, longtable, picture, tabular and verbatim. The -e option can be used to specify a comma separated environment-list of environments to ignore. The list replaces the defaults so specifying an empty list effectively causes no environments to be ignored.
The -c option can be used in LaTeX mode to have detex echo the arguments to
