% -*-LaTeX-*-
% Converted automatically from troff to LaTeX by tr2tex on Thu Apr 23 19:48:49 1992
% tr2tex was written by Kamal Al-Yahya at Stanford University
% (Kamal%Hanauma@SU-SCORE.ARPA)


\documentstyle[troffman]{article}
\begin{document}
%
% input file: detex.1l
%
\phead{DETEX}{1L}{12\ Decemeber\ 1990}
 "Purdue University"
\shead{NAME}
detex -- a filter to strip TeX commands from a .tex file.
\shead{SYNOPSIS}
{\bf detex}
[ %
\bf --clnsw %
\rm  ] [ %
\bf --e %
\it  environment-list %
\rm  ] [ %
\it filename%
\rm [.tex] ... ]
\shead{DESCRIPTION}
{\it Detex}
(Version 2.3)
reads each file in sequence, removes all comments and
{\it TeX}
control sequences
and writes the remainder on the standard output.
All text in math mode and display mode is removed.
By default,
{\it detex}
follows \bs input commands.
If a file cannot be opened, a warning message is
printed and the command is ignored.
If the
{\bf --n}
option is used, no \bs input or \bs include commands will be processed.
This allows single file processing.
If no input file is given on the command line,
{\it detex}
reads from standard input.
\par
If the magic sequence ``\bs begin\{document\}'' appears in the text,
{\it detex}
assumes it is dealing with LaTeX source and
{\it detex}
recognizes additional constructs used in
{\it LaTeX}{\rm .}
These include the \bs include and \bs includeonly commands.
The
{\bf --l}
option can be used to force LaTeX mode.
\par
Text in various environment modes of
{\it LaTeX}
is ignored.  The default modes are array, eqnarray, equation, figure,
picture, table and verbatim.  The
{\bf --e}
option can be used to specify a comma separated
{\it environment-list}
of environments to ignore.  The list replaces the defaults so specifying an
empty list effectively causes no environments to be ignored.
\par
The
{\bf --c}
option can be used in LaTeX mode to have detex echo the arguments to \bs cite,
\bs ref, and \bs pageref macros.  This can be useful when sending the output to
a style checker.
\par
{\it Detex}
assumes the standard character classes are being used for
{\it TeX}{\rm .}
{\it Detex}
allows white space between control sequences
and magic characters like `\{' when recognizing things like
{\it LaTeX}
environments.
\par
If the
{\bf --w}
flag is given, the output is a word list, one `word' (string of two or more
letters and apostrophes beginning with a letter)
per line, and all other characters ignored.
Without %
\bf --w %
\rm  the output follows the original,
with the deletions mentioned above.  Newline characters are
preserved where possible
so that the lines of output match the input as closely as possible.
\par
The TEXINPUTS environment variable is used to find \bs input and \bs include
files.
\par
Note that previous versions of
{\it detex}
would replace control sequences with a space character to prevent words
from running together.
However, this caused accents in the middle of words to break words, generating
"spelling errors" that were not desirable.
The old functionality can be essentially duplicated by using the
{\bf --s}
option.
\shead{SEE ALSO}
tex(1L)
\shead{DIAGNOSTICS}
Nesting of \bs input is allowed but the number of opened files must not
exceed the system's limit on the number of simultaneously opened files.
{\it Detex}
ignores unrecognized option characters after printing a warning message.
\shead{AUTHOR}
Daniel Trinkle, Computer Science Department, Purdue University
\shead{BUGS}
{\it Detex}
is not a complete
{\it TeX}
interpreter, so it can be confused by some constructs.
Most errors result in too much rather than too little output.
\par
Running %
\it LaTeX %
\rm 
source without a ``\bs begin\{document\}''
through %
\it detex %
\rm  may produce
errors.
\par
Suggestions for improvements are encouraged.
\end{document}
