\documentstyle[fix, a4, titlepage]{article}

\def\eone{\medskip\hrule\smallskip\begin{center}}
\def\etwo{\nopagebreak\end{center}\nopagebreak}
\def\ethr{\nopagebreak\begin{center}\nopagebreak}
\def\efou{\end{center}}

\newcommand{\chktex}{Chk\TeX}

\title{\chktex}
\author{Jens T. Berger Thielemann}
\date{1995}

\begin{document}
\maketitle

\section{Introduction}

This program was written in frustration of that some constructs in
\LaTeX\ are sometimes non-intuitive, and easy to forget.  It was
written in ANSI C, so you could use this at your UNIX/MSDOS/whatever
site also.  Full source included.

In the Amiga version, however, the program is localized.  The
localization was created by using C2LOCAL, the automatically generated
source code is not included.  A catalog for Norwegian is included,
plus a skeleton for further translation.

The program itself does not have any machine requirements, an Amiga
compiled version is included which should work on all Amigas.  You'll
get translations only on 2.1+, though.


\section{Legal stuff}

This  program  is free software; you can redistribute it and/or modify
it  under  the terms of the GNU General Public License as published by
the  Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This  program  is  distributed in the hope that it will be useful, but
WITHOUT   ANY   WARRANTY;   without   even  the  implied  warranty  of
MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR PURPOSE\@.  See the GNU
General Public License for more details.

You  should  have  received  a  copy of the GNU General Public License
along   with  this  program;  if  not,  write  to  the  Free  Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


\section{Errors searched for}



Currently,  it  will  catch  the  following  errors,  the  error being
underlined:

\eone
\verb@\LaTeX@\underline{\verb@ @}\verb@is a typesetting package.@
\etwo
Most probably, you would like this to look like this:
\ethr
\verb@\LaTeX\ is a typesetting package.@
\efou

An environment file tells \chktex\ which commands that may end with a
normal space, like `\verb@\bf@' or similar, which don't produce any text
output.  In math mode, this checking is of course turned off.

\eone
\verb@Please refer to figure@\underline{\verb@ @}\verb@\ref{foo}.@
\etwo
This should rather look like this:
\ethr
\verb@Please refer to figure~\ref{foo}.@
\efou

An environment file tells \chktex\ which commands that should be
prefaced with a non-breaking space.

\eone
\verb@This is an example of use of accents: \'{@\underline{\verb@i@}\verb@}.@
\etwo
This will not look pretty.  It should rather be:
\ethr
\verb@This is an example of use of accents: \'{\i}.@
\efou

It  does also try to differ between whether we're in math mode or not.
It  is possible to customize which functions which needs the use of
\verb@\i@ or \verb@\j@.

\eone
\verb@This is an example, i.e.@\underline{\verb@ @}\verb@an demonstration.@
\etwo
This will cause incorrect spacing, and should be written as:
\ethr
\verb@This is an example, i.e.\ an demonstration.@
\efou

The  abbrevs  which  you wish to search for, are of course kept in the
very same env-file.

\eone
\verb@I've seen an UFO!@\underline{\verb@ @}\verb@Right over there!@
\etwo
Will once more cause incorrect spacing, it should read:
\ethr
\verb+I've seen an UFO\@! Right over there!+
\efou

\eone
\verb@I don't know quite@\underline{\verb@...@}\verb@I think it's wrong.@
\etwo
This ellipsis will not look good. You should rather write:
\ethr
\verb@I don't know quite\ldots I think it's wrong.@
\efou

\eone
\verb@It wasn't anything @\underline{\verb@-@}\verb@ just a 2@\underline
{\verb@---@}\verb@3 star@\underline{\verb@--@}\verb@shots, or something else.@
\etwo
In  all  cases,  an  incorrect dash-length was used, it should be like this:
\ethr
\verb@It wasn't anything --- just a 2--3 star-shots, or something else.@
\efou

This  check  is  rather  vague, as it will only check the character in
front of the dashes.  It uses the following table:

\begin{itemize}
    \item If the dashes are leaded by a space, there should be three `-'s.
    \item If the dashes are leaded by a digit, there should be two `-'s.
    \item If the dashes are leaded by a character, there should be one `-'.
\end{itemize}

This  is  more or less correct, according to my references.  Hopefully
this check can be improved (suggestions?).

\medskip
\hrule
\medskip

Wherever `a space' is mentioned, we'll of course also detect tabs and
other spacing characters recognized by isspace().

In addition, it will keep track of brackets characters
(`\verb"{}[]()"'), and make sure that they match.  Everything found is
of course pumped nicely to {\tt stdout}, with line number and error
position.

To get a quick demonstration of \chktex' features, run it on the file
`{\tt Test.tex}'.  Although most of the file is nonsense in a \TeX nical
manner (lots of pseudo-commands), it will show what \chktex\ has to
offer.

\section{Porting and translation}

Porting  should  be  rather easy.  However, to ensure that the porting
proceeds  painless,  read the first lines of the `{\tt ChkTeX.h}' file.
Not very much to do, and it will make life easier later.

If you wish to translate the strings used in the programs (should only
need  5  minutes of work), look in the Catalogs directory.  Write your
translations  in  the  file \verb@ChkTeX_locale.ct@, and mail it to me.  I'll
include it in the next release.  In advance, thanks for your support.

\section{Usage}

Easy-peasy: \\
ChkTeX <\TeX-file> \\
No options --- currently.  You should, however, take a look at the
`{\tt .chktexrc}' file.  It is located in `{\tt ENV:}' and `{\tt ENVARC:}'
on 2.04+ Amiga's, in `{\tt S:}' on 1.3 Amiga's, in your \verb@$HOME@
directory on UNIX boxes.  This depends also upon what you did to the
`{\tt ChkTeX.h}' file.  It should be rather self-explanatory, and should
help you customize the program to your own needs.


\section{Bugs}

No  fatal  ones,  I think, but the program currently has some problems
when  a command/parameter stretch over a two lines.  Also, the killing
of comments is still at bit brutal (but correct (:-) ).

The detection of whether we're in math mode is also not perfect.  The
only codes which are recognized for getting in/out of math mode are:
`\verb"$"', `\verb"$$"', `\verb"\("', `\verb"\)"', `\verb"\["' and
`\verb"\]"'.  Environments like \verb@\begin{displaymath}@, user-defined
commands, etc., do thus not work.  This is usually no problem, as it
just creates a bit more warnings than needed.

\section{Contacting the author}

If  you  wish  to  contact  me  for whatever (more tests, bug reports,
suggestions, hellos, smiley's, etc.), write to:\\
  Jens Berger           \\
  Spektrumvn. 4         \\
  N-0666 Oslo           \\
  Norway                \\
  E-mail: {\tt <jensthi@ifi.uio.no>}

Any signs of intelligent life is welcomed; that should exclude piracy.

Have fun.

\end{document}


