CheckStyle

Version 0.72

Download

You can dowload the Source Code: CheckStyleV0.72-src.tgz

Programs in this Package

  1. checkstyle

  2. checkmath

  3. doubleword
    check a text file for words occurring twice. This is used by checkstyle.

  4. delatex
    strips a LaTeX file of comments and everything before \begin{document} and after either \begin{bibliography} or \end{document}

Description of CheckStyle

Checks a text file written in English for word usage and displays suggestions for improvements. Detect words occurring twice. The program does not change the input file.

This package was written to help scientific writing in general, specially mathematical writing. One fundamental in technical writing is to keep your prose simple and direct (Higham). We need to avoid long-winded or imprecise text and aim for economy of words. So checkstyle tries to detect wordiness and verbiage. It also detects words occurring twice in a text file.

After detecting a word or phrase it will display suggestions in the form:

Line Number: action (word) ... [comment]

where action can be : Avoid, Replace, Omit, Rewrite or Doubled word. The suggestions range from Avoid to Omit.

Doubled word means that the word in parenthesis is occurring twice in the file.

The program ignores LaTeX comments, i.e., everything in a line after the character "%".

There are four levels of checking, from 1 (longer expressions) to 4 (passive voice). The default is levels 1 and 2 enabled. In the OPTIONS section we give details on each level.

Like every Unix program, if it does not find anything wrong it will not display anything.

Description of CheckMath

Check a LaTeX file for for mathematical formulas and spacing. We suggest usage for soft space (~), \ldots and \cdots, correct spacing in abbreviations, spacing in integrals, etc.

The program does not change the input file, it will only display suggestions in the form below:

7: Replace << \int\int >> by << \int\!\!\int >>.

Things that are checked now are:

  • nth Usage: Replacing i-th, n'th by ith or nth because "nth is a valid word" (Higham).

  • Fractions: Replace 2^\frac{a}{b} by a/b.

  • Correct Spacing: Check for correct spacing after common abbreviations e.g. i.e. cf. et al.

  • Preventing line breaks with unbreakable spaces. Examples are Figure \ref{} which should be replaced by Fig­ ure~\ref{}. Other examples are for Table(s), Subsection, Chapter, Section, Part, equation, page. Other are see John \cite{}.

  • Correct Capitalization after Section~\ref{}. It is wrong section~\ref{}.

  • Innerproduct. Replace "(( ... ))" by "(\!( ... )\!)".

  • Duality product. Replace < ... > by \langle ... \rangle.

  • Norm symbol. Replace "||" by "\|".

  • Spacing in double integrals. Replace "\int\int" by "\int\!\!\int".

  • Spacing in integrals. Replace "\int ... dx" by "\int ... \,dx".

  • Transpose symbol. Replace "^t" by "^T".

  • Dots usage: "+ \ldots +" is wrong, should be "+ \cdots +". The same for minus. The opposite for ", \cdots ,".

  • Replace \tilde and \hat by \widehat and \widetilde.

  • Replace \epsilon by \varepsilon.

  • Correct dash: replace "num-num" by "num--num". The same for page references.

  • Avoid vertical lines in tables.

  • Avoid symbols \forall and \exist. Better to write "for all" or "there exist".

  • Avoid symbols \Longleftrightarrow, \leftrightarrow. Better to write "if and only if".

  • Avoid symbols \Longrightarrow, \rightarrow. Better to write "implies".

  • Avoid symbols \Longrightarrow, \rightarrow. Better to write "implies".

  • Avoid symbols \not=0, \neq 0. Better to write "nonzero".

References

The main reference, which served as the inspiration of this package, is

  • Nicholas J. Higham (1993); Handbook of Writing for Mathematical Sciences; SIAM.

For mathematical formatting we used

  • Lamport, Leslie; (1994) Latex, a Document Preparation System; Addison-Wesley.

  • Halmos, Paul; How to Write Mathematics; pp. 123 - 152.

  • Flanders, Harley; Manual for Monthly Authors; American Mathematical Monthly, January 1971, pp. 1 - 10.

A classical book for writers in general is

  • William Strunk & E.B. White (1979); The Elements of Style. Macmillian. According to Zinsser, a book that every writer should read at least once a year.

Other references that we use for phrases and expressions to avoid and suggestions for improving the language are:

  • Maeve O'Connor & F. P. Woodford (1976); Writing Scientific Papers in English. Pitman Medical.

  • Martins Cutts (1995); Plain English Guide.

  • Ernest Gowers (1988); The Complete Plain Words. Penguim.

  • Marva T. Barnett; Writing for Technicians.

  • Richard Marius; A Writer's Companion.

  • Michael Alley (1996); The Craft of Scientific Writing; Springer-Verlag.

  • Mike Markel (1994); Writing in the technical fields; IEEE Press.

  • Justin Zabel; (2000). Writing for Computer Science; Springer-Verlag.

Technology Behind

This software was developed in a Linux machine using flex, a (fast) lexical lexical analyzer, a GNU (free) software. It was compiled using gcc, the GNU C compiler.