ChkTeX - LaTeX semantic checker

I, Ivan Andrus, am the newest maintainer of ChkTeX and released version 1.6.6 on April 7, 2012. Many thanks to Baruch Even who has been maintaining ChkTeX by himself for quite some time.

Development happens in a Subversion repository on Savannah. ChkTeX has been stable for a long time, and bug fixes will continue to be done on the 1.6 version branch. I plan to do any development of new features on the trunk and start numbering new versions at 1.7.

The latest version is:

|             #####  ###       ###    ########     ###     ##
|           ###   ##  ##        ##       ##          ##   #
|          @@         @@ @@@    @@  @@   @@  #######  @@ @
|          @@         @@@  @@   @@ @@    @@   ##   #   @@
|          &&         &&   &&   &&&&     &&   @@      & &&
|           &&&   &&  &&   &&   && &&    &&   @@@@   &   &&
|             %%%%%  %%%   %%% %%%  %%%  %%   &&   %%%    %%% v1.6.6
|                                             &&   &
|                                            %%%%%%%

Introduction

This program has been written in frustration because some constructs in LaTeX are sometimes non-intuitive, and easy to forget. It is _not_ a replacement for the built-in checker in LaTeX; however it catches some typographic errors LaTeX oversees. In other words, it is Lint for LaTeX. Filters are also provided for checking the LaTeX parts of CWEB documents. Features are summarized below or you can read the manual (pdf).

The program also supports output formats suitable for further processing by editors or other programs, making errors easy to cycle through. Software is provided for beautifully interfacing against the AUCTeX Emacs mode. It is known to interface with LyX.

Features

ChkTeX begins to get quite a few bells and whistles now. However, you should be aware of that in most cases, all this is transparent to the user. As you will see, ChkTeX offers the ability to adapt to many environments and configurations.

New features

  Modifications and additions since v1.5:

    * Fix crash when running from within emacs
    * Fix crash for some documents
    * Support \verb* command

  Modifications and additions since v1.4:

  Program

   Modifications to the executable itself:
     * As usual, a few more warnings:
          + No space or similar in front/after parenthesis.
          + Demands a consistent quote style.
          + Double spaces in input which will not be rendered as one.
          + Punctuation malplaced regarding to math mode.
          + Warns about TeX primitives.
          + Space in front of footnotes.
          + Bogus \left and \right commands.
     * The abbreviation recognizer has (for the last time?) been
       redesigned. We now produce far less false warnings, catch more
       cases and do all this faster than before. Seems like a win.
       Done much of the same with the italic correction detection part,
       too...
     * Some bugs have been silently fixed. Hot spots in the program have
       been optimized; in certain cases this in fact doubles the speed!
       Along with this goes more code elegance and utilization of macro
       processing and the C language. Take a look at ``Resource.[ch]''.
     * It's possible to specify separate output-formats depending on
       whether you are sending the output to a file/pipe or to a
       terminal.
     * Column positions are finally correct; we now expand tabs
       correctly.
     * ChkTeX will now recursively search for \input'ed files, both in
       the document and on the commandline. See the ``chktexrc'' file for
       more info.
     * The debug switch is now more intelligent; if you wish to hack a
       bit on ChkTeX for yourself, it is possible to produce selective
       debugging output. The feature can also be disabled altogether.
     * MS-DOS and OS/2 version of the program is now more flexible and
       well-behaved, thanks to Gerd Böhm.
     * You may now say ``-wall'' to make all messages warnings, and turn
       them on.
     * Uses termcap on UNIX boxes; this should ensure that ``-v2'' (or
       more precisely: ``%i'' and ``%I'') works regardless to what
       terminal you are using.

  Resource file

   New concepts introduced in the setup file:
     * You may now specify both case-sensitive and case-insensitive user
       patterns in the ``chktexrc'' file. In addition; it is now possible
       to reset/clear lists.
     * It is possible to specify how many arguments (optional/required)
       ``WIPEARG'' should wipe; it behaves also somewhat more intelligent
       when the arguments stretch over multiple lines.
     * Global files will be read _in addition_ to local ones. The
       searching order has also been reversed in order to make this more
       intelligent.

  Other

   Various other stuff I've done to the product:

     * The documentation has been polished and should now be easier to
       use in practical situations.
     * ``check'' target in ``Makefile'', so you can check that the
       installation succeeded. In fact, the ``Makefile'' has been
       enhanced in several other ways too, amongst other it is now GNU
       conforming.
     * ``deweb'' is now documented; you may say ``man deweb'' to get a
       few words of advice. The support script (chkweb) does now behave
       as the remaining package (accepting stdin input and flags).
     * I've written an Emacs hack which magically adds ChkTeX to the list
       of AUCTeX commands; thus making the use of the program even more
       trivial.
       For those of you who don't wish to mess with Emacs, I've included
       a trivial lacheck <-> ChkTeX interface.
       This means that you now can use ChkTeX just as easily as lacheck
       when you're running AUCTeX.
     * Added an ARexx script which lets ChkTeX talk to VBrowse, the
       message browser of Volker Barthelmann's freely distributable ANSI
       C compiler. The browser itself is available on Aminet as
       ``dev/c/vbcc.lha''.

Feature list

     * Supports over 40 warnings. Warnings include:
          + Commands terminated with space. Ignores ``\tt'', etc.
          + Space in front of references instead of ``~''.
          + Forgetting to group parenthesis characters when
            sub-/superscripting.
          + Italic correction (``\/'') mistakes (double, missing,
            unnecessary).
          + Parenthesis and environment matching.
          + Ellipsis detection; also checks whether to use ``\dots'',
            ``\cdots'' or ``\ldots''.
          + Enforcement of normal space after abbreviation. Detects most
            abbreviations automagically.
          + Enforcement of end-of-sentence space when the last sentence
            ended with capital letter.
          + Math-mode on/off detection.
          + Quote checking, both wrong types (``"'') and wrong direction.
          + Recommends splitting three quotes in a row.
          + Searching for user patterns.
          + Displays comments.
          + Space in front of ``\label'' and similar commands.
          + Use of ``x'' instead of ``$\times$'' between numbers.
          + Multiple spaces in input which will be rendered as one space
            (or multiple spaces, where that is undesirable).
          + Warns about text which may be ignored.
          + Mathematical operators typeset as variables.
          + No space in front of/after parenthesis.
          + Demands a consistent quote style.
          + Punctuation inside inner math mode/outside display math mode.
          + Use of TeX primitives where LaTeX equivalents are available.
          + Space in front of footnotes.
          + Bogus characters following commands.
     * Fully customizable. Intelligent resource format makes it possible
       to make ChkTeX respect your LaTeX setup. Even command-line options
       may be specified globally in the ``chktexrc'' file.
     * Supports ``\input'' command; both TeX and LaTeX version. Actually
       includes the files. ``TEXINPUTS''-equivalent search path.
     * Intelligent warning/error handling. The user may promote/mute
       warnings to suit his preferences. You may also mute warnings in
       the header of a file; thus killing much unwanted garbage.
     * Scripts included for checking CWEB files written in LaTeX.
       (Requires perl v5).
     * Supports both LaTeX 2.09 and LaTeX2e.
     * Flexible output handling. Has some predefined formats and lets the
       user specify his own format. Uses a ``printf()'' similar syntax.
       ``lacheck'' compatible mode included for interfacing with the
       AUCTeX Emacs mode.
     * ARexx scripts for interfacing with ScMsg and VBrowse are included.
       Special scripts included for CygnusED/GoldED, for binding to
       hotkey.
     * Amiga Workbench support. Parameters may be passed by
       shift-clicking the LaTeX files and setting the remaining options
       in the tooltypes.
     * Wildcard matching (Amiga only). Matches file patterns internally,
       thus saving a lot of work. This is, however, platform-specific
       code -- on UNIX boxes this is done by the shell.
     * Written in ANSI C. ``configure'' script included for easy setup
       and installation on UNIX systems.

Still, it is important to realize that the output from ChkTeX is only intended as a _guide_ to fixing faults. However, it is by no means always correct. This means that correct LaTeX code may produce errors in ChkTeX, and vice versa: Incorrect LaTeX code may pass silently through.

Legal stuff

   ChkTeX, documentation, installations scripts, CWEB filters and other
   materials provided are copyright © 1995-96 Jens T. Berger Thielemann,
   unless explicitly stated otherwise.

   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

Last modified by Ivan Andrus on 2012-04-07.