#! /usr/bin/perl push (@ARGV, '-') if @ARGV == 0; for $file (@ARGV) { open (FILE, "$file"); while () { s/%.*//; /\btodays\b/i && lint ("`today's' takes an apostrophe"); /\bvia\./i && lint ("`via' is not an abbreviation"); /\bet\./ && lint ("`et' is not an abbreviation"); /\bin order to\b/i && lint ("`in order to' should be just `to'"); /\be\.g\.[^~]/ && lint ("`e.g.' should be followed by `~'"); /\be\.g\.$/ && lint ("`e.g.' should be followed by `~'"); /\be\.g\.,/ && lint ("`e.g.' should not be followed by `,'"); /\bi\.e\.[^~]/ && lint ("`i.e.' should be followed by `~'"); /\bi\.e\.$/ && lint ("`i.e.' should be followed by `~'"); /\bi\.e\.,/ && lint ("`i.e.' should not be followed by `,'"); /\bvs\.[^~]/ && lint ("`vs.' should be followed by `~'"); /\bvs\.$/ && lint ("`vs.' should be followed by `~'"); /~\\footnote/ && lint ("`\\footnote' should not be preceded by `~'"); # i.e. or e.g should be preceded by ( or , except at beginning of line. /(^\\ref)|([^~]\\ref)/ && lint ("`\\ref' should be preceded by `~'"); /(^\\cite)|([^~]\\cite)/ && lint ("`\\ref' should be preceded by `~'"); /\"/ && lint ("`\"' should not be used in TeX (outside of typewriter font)"); /\brun-time/i && lint ("`runtime' is not hyphenated"); /\brun\s+time/i && lint ("`runtime' is one word"); /\bshort\scoming\b/i && lint ("`shortcoming' is one word"); /[\w\d],[\w\d]/ && lint ("use a space after a comma"); /\bsecound\b/i && lint ("spell `second' correctly"); /,\s*however,/ && lint ("`, however,' possibly should be `. However' or `; however, '"); /\bala\./ && lint ("you mean `\\`a la'"); /''\./ && lint ("periods go inside quotes"); /\bdiffernt\b/i && lint ("spell `different' correctly"); /^~/ && lint ("~ should not appear at beginning of line"); /~$/ && lint ("~ should not appear at end of line"); /\s~|~\s/ && lint ("~ should not appear before or after white space"); /apriori/ && lint ("`a priori' is two words"); /mallicous/ && lint ("spell `malicious' properly"); /x86/ && lint ("you mean \\textit{x}86"); /\betc.\s/ && lint ("`etc.' should be followed by `\\ ' except at end of sentence"); /\betc.\)\s/ && lint ("`etc.)' should be followed by `\\ ' except when followed by punctuation"); /\s[,.]\s/ && lint ("isolated punctuation"); /\bzeros\b/i && lint ("although `zeros' is correct, we've standardized on `zeroes'"); } close (FILE); } sub lint { my ($msg) = @_; print "$file:$.: $msg\n"; }