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


\documentstyle[troffman]{article}
\begin{document}
%
% input file: texchk.1
%
% texchk(1) original date 3/13/85
%
\phead{TEXCHK}{1}{9/16/90}

\shead{NAME}
TEXCHK - syntax checker for LaTeX.
\shead{SYNOPSIS}
{\bf texchk}
[ -vcr2al ] [ file1 file2 ... ]
\shead{DESCRIPTION}
By default
{\it texchk}
reads from standard input and outputs error messages and what not to
standard error.  If filenames are given as arguments, each file is read
and parsed in turn.
\par
{\it texchk}
checks for the proper nesting of matching '\{' '\}' and '[' ']' pairs,
matching '\bs begin\{$<$environment$>$\}' '\bs end\{$<$environment$>$\} pairs, and Math Mode
and Display Math Mode constructs.  If improper nesting is detected, an error
message consisting of a reason, a line number, and the actual line of text
on which the error occurred is displayed.
\par
In general, the program will halt after finding and printing the first
error, because attempts at further diagnosis would likely result in a
stream of spurious error messages.
\par
Unlike LaTeX
{\it texchk}
is fast.  It can grovel over a large file in a matter of a few seconds,
and can be run repeatedly without causing the CPU to beg for mercy.
\par
The command line options are:
\begin{TPlist}{{\bf --v}}
\item[{{\bf --v}}]
Verbose option.  Produces on the standard output a trace of each environment
{\it texchk}
enters and leaves, along with the number of the line it is currently
processing.  This is used basically to assure yourself that
{\it texchk}
is actually doing something, if you give it a huge file to process.
(And is mildly interesting).
\item[{{\bf --c}}]
Check mode.  Tells
{\it texchk}
to check each keyword (e.g., \bs hspace, \bs mbox) in the file against a list of
known keywords, and issue a warning if the keyword is not in the list.
Also, each keyword is checked as to whether it is only legal if given
inside of math mode, and if so and if math mode is not enabled, an error
message is given (but processing continues).
\item[{{\bf --a}}]
Only useful with option --c.  As default the unknown keyword is warned at
the first occurence, with this option it is warned at all occurences.
\item[{{\bf --l}}]
Only useful with option --c.  Prints a list of all unknown keywords found
in the files to stdout at the end of the job.
\item[{{\bf --r}}]
Allows input of control characters below ASCII space.  As default only
TAB (\^{}I) and RETURN (\^{}M) is allowed.
\item[{{\bf --2}}]
Disallows input of 8-bit characters above ASCII 127.
With TeX 3.0 you are free to use any character in the range 0...256.
\item[{{\bf --d}}]
Debug option.  Checks some internal states of
{\it texchk}
Not useful for normal users.
\end{TPlist}
\shead{FILES}
\nofill
/usr/local/bin/texchk            executable
\fill
\shead{AUTHOR}
JP Massar, Thinking Machines Corporation
\shead{HISTORY}
\nofill
Originally written by JP Massar in 1985 and released into the PD.
Slightly changes by B.Raichle in 1990.
\fill
\shead{BUGS}
{\it texchk}
makes no claims to being perfect.  It is quite possible that an 'error'
flagged by
{\it texchk}
is not really an error at all if run through LaTeX.
\par
It does not check for number of arguments, presence of optional arguments,
etc.
\par
It does not know that certain keywords can only be used in certain modes.
\par
It does not understand that '[' and ']' can be used in regular text
without necessarily being paired. Also, \bs left], for example,
will confuse it totally.
\par
Although not officially part of LaTeX,
{\it texchk}
understands the '\$\$' construct of TeX.
\end{document}
