Warning messages are printed to stdout whenever unbalanced delimiters are found, giving the delimiter and its line, column, and file positions. The output format is recognizable by the GNU emacs M-x compile command, making it easy to parse the error messages and jump to the error locations with the keystrokes C-x `(next-error).
Dollar signs are checked only when the -TeX option has been specified. Single dollar signs are expected to occur in pairs on the same line for in-line math mode. Doubled adjacent dollar signs may be separated by several lines for display-math mode. However, if more than 10 lines, or a blank line, separate doubled dollar signs, a warning is issued.
A backslash preceding a delimiter prevents it from being recognized as a delimiter; this is a suitable choice for TeX documents, as well as for C-like programming languages and UNIX shells.
A backslash-asterisk pair preceding an open parenthesis also prevents recognition of the parenthesis. This is suitable for nroff and troff two-letter user-defined macros, such as \*(Te. Such a character sequence is highly unlikely in other files.
Checking of forward quotes (apostrophes) may be less useful, because they are used both as string delimiter characters in computer programming languages, and in typewritten text, and also singly, marking possessives or elided characters in English-language text. The -TeX option described below implements a partial workaround for this ambiguity.
If unbalanced delimiters are needed, it is often possible to insert a matching delimiter in a nearby comment so that the delimiter appears to chkdelim to be properly balanced. This will reduce the number of messages issued, so that the real errors will be more evident.
chkdelim is a handy tool for detecting common errors in electronic documents and computer programs. Its other purpose is to demonstrate a modest lex(1) program.
Since most delimiter characters have special significance to command shells, it will usually be necessary to protect them suitably from shell interpretation, such as with backslashes, or inside quoted strings.
Angle brackets are more commonly used for less-than and greater-than symbols, rather than <paired>, so -ignore \<\> will be a likely chkdelim option on UNIX systems.
Also, check that forward and backward quotes appear in open/close pairs: `...' and ``...'', instead of in the forms `...` and '...' used in computer programming languages.
Forward quotes between letters or digits are ignored, so that possessives and elisions do not raise bogus warnings.
In TeX documents, quotation marks "..." should be used only inside verbatim environments, but chkdelim cannot recognize such environments, so it will only warn if quotation marks are unbalanced. LaTeX users are advised to employ the lacheck(1) utility to detect incorrect use of quotation marks.
Nelson H. F. Beebe, Ph.D. Center for Scientific Computing Department of Mathematics University of Utah Salt Lake City, UT 84112 USA Tel: +1 801 581 5254 FAX: +1 801 581 4148 Email: beebe@math.utah.edu WWW URL: http://www.math.utah.edu/~beebe