Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > C


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


checknr — check nroff/troff files


checknr [-s] [-f] [-a .x1.y1 .x2.y2 ... .xn.yn] [-c .x1.x2.x3 ...c .xn] [file ...]


checknr searches a list of nroff or troff input files for certain kinds of errors involving mismatched opening and closing delimiters and unknown commands. If no files are specified, checknr searches the standard input. checknr looks for the following:

  • Font changes using \fx ... \fP.

  • Size changes using \sx ... \s0.

  • Macros that come in open ... close forms, such as the .TS and .TE macros, which must appear in matched pairs.

checknr knows about the ms and me macro packages.


checknr recognizes the following options:


Define additional macro pairs in the list. -a is followed by groups of six characters, each group defining a pair of macros. Each six characters consist of a period, the first macro name, another period, and the second macro name. For example, to define the pairs .BS and .ES, and .XS and .XE, use:


No spaces are allowed between the option and its arguments.


Define commands that checknr would otherwise interpret as undefined.


Ignore \fx font changes.


Ignore \sx size changes.


International Code Set Support

Single-byte character code sets are supported.


checknr complains about unmatched delimiters, unrecognized commands, and bad command syntax.


Check file sorting for errors that involve mismatched opening and closing delimiters and unknown commands, but disregard errors caused by font changes:

checknr -f sorting


checknr is designed for use on documents prepared with the intent of using checknr, much the same as lint is used. It expects a certain document writing style for \f... and \s... commands, in which each \fx is terminated with \fP and each \sx is terminated with \s0. Although text files format properly when the next font or point size is coded directly instead of using \fP or \s0, such techniques produce complaints from checknr. If files are to be examined by checknr, the \fP and \s0 delimiting conventions should be used.

-a cannot be used to define single-character macro names.

checknr does not recognize certain reasonable constructs such as conditionals.


checknr was developed by the University of California, Berkeley.


checkeq(1), lint(1), nroff(1).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.