xref: /netbsd/usr.bin/checknr/checknr.1 (revision 6550d01e)
1.\"	$NetBSD: checknr.1,v 1.15 2004/07/09 11:40:00 wiz Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)checknr.1	8.1 (Berkeley) 6/6/93
31.\"
32.Dd January 21, 2002
33.Dt CHECKNR 1
34.Os
35.Sh NAME
36.Nm checknr
37.Nd check nroff/troff files
38.Sh SYNOPSIS
39.Nm
40.Op Fl fs
41.Op Fl a Ns Ar \&.x1.y1.x2.y2. ... \&.xn.yn
42.Op Fl c Ns Ar \&.x1.x2.x3 ... \&.xn
43.Ar file
44.Sh DESCRIPTION
45.Nm
46checks a list of
47.Xr nroff 1
48or
49.Xr troff 1
50input files for certain kinds of errors
51involving mismatched opening and closing delimiters
52and unknown commands.
53If no files are specified,
54.Nm
55checks the standard input.
56.Pp
57Recognized options are:
58.Bl -tag -width xxx -compact -offset indent
59.It Fl a
60Add additional pairs of macros to the list of known macros.
61This must be followed by groups of six characters, each group defining
62a pair of macros.
63The six characters are
64a period,
65the first macro name,
66another period,
67and the second macro name.
68For example, to define a pair .BS and .ES, use
69.Sq Li \-a.BS.ES .
70.It Fl c
71Define commands which would otherwise be complained about
72as undefined.
73.It Fl f
74Request
75.Nm
76to ignore
77.Ql \ef
78font changes.
79.It Fl s
80Ignore
81.Ql \es
82size changes.
83.El
84.Pp
85Delimiters checked are:
86.Bl -enum -compact -offset indent
87.It
88Font changes using \efx ... \efP.
89.It
90Size changes using \esx ... \es0.
91.It
92Macros that come in open ... close forms, for example,
93the .TS and .TE macros which must always come in pairs.
94.El
95.Pp
96.Nm
97is intended for use on documents that are prepared with
98.Nm
99in mind, much the same as
100.Xr lint 1 .
101It expects a certain document writing style for
102.Ql \ef
103and
104.Ql \es
105commands,
106in that each
107.Ql \efx
108must be terminated with
109.Ql \efP
110and
111each
112.Ql \esx
113must be terminated with
114.Ql \es0 .
115While it will work to directly go into the next font or explicitly
116specify the original font or point size,
117and many existing documents actually do this,
118such a practice will produce complaints from
119.Nm .
120Since it is probably better to use the
121.Ql \efP
122and
123.Ql \es0
124forms anyway,
125you should think of this as a contribution to your document
126preparation style.
127.Pp
128.Nm
129knows about the
130.Xr ms 7
131and
132.Xr me 7
133macro packages,
134as well as the macros from
135.Xr mdoc 7 .
136.Sh DIAGNOSTICS
137.Bd -ragged -compact
138Complaints about unmatched delimiters.
139Complaints about unrecognized commands.
140Various complaints about the syntax of commands.
141.Ed
142.Sh SEE ALSO
143.Xr nroff 1 ,
144.Xr troff 1 ,
145.Xr mdoc 7 ,
146.Xr me 7 ,
147.Xr ms 7
148.Sh HISTORY
149The
150.Nm
151command appeared in
152.Bx 4.0 .
153Basic
154.Xr mdoc 7
155support appeared in
156.Nx 1.6 .
157.Sh BUGS
158There is no way to define a 1 character macro name using
159.Fl a .
160.Pp
161Does not correctly recognize certain reasonable constructs,
162such as conditionals.
163.Pp
164.Xr mdoc 7
165macros that are not at the beginning of the line are not recognized.
166Among others, this results in too many
167.Ql Unmatched Zz
168errors.
169