Check LaTeX Begin-End Pairs

See the download page to obtain this program

Description

This script checks that begin-end pairs of LaTeX commands do in fact match. Source files without a .tex extension are automatically given one. If no parameters are given, the script reads from the standard input. If multiple parameters are given, the script prefixes each report with the file name.

The pairs which are checked are:


\begin{thing} ... \end{thing}
( ... )
[ ... ] (but not when escaped with backslash)
{ ... } (but not when escaped with backslash)
\( ... \)
\[ ... \]
$ ... $

Pairs which are not checked are:


` ... '
" ... "
\verb@ ... @ (for arbitrary delimter @, and \verb followed by *)

Verbatim text is ignored, specifically \begin{verbatim} ... \end{verbatim} (or the verbatim* variant).

Usage

Run on a (La)TeX file with or without an extension:

checktex file[.tex]

The resulting report of problems is sent to the standard output.

History

First public version Ken Turner, 28/07/92


Up one level to LaTeX Utilities

Web Ken Turner Home   Email    Search Search Web Pages

Last Update: 15th July 2006
URL: https://www.cs.stir.ac.uk/~kjt/software/latex/chktex.html