xref: /netbsd-src/usr.bin/checknr/checknr.1 (revision eb7c1594f145c931049e1fd9eb056a5987e87e59)
1.\"	$NetBSD: checknr.1,v 1.14 2003/08/07 11:13:16 agc 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 a Ns Ar \&.x1.y1.x2.y2. ... \&.xn.yn
41.Op Fl c Ns Ar \&.x1.x2.x3 ... \&.xn
42.Op Fl f
43.Op Fl s
44.Ar file
45.Sh DESCRIPTION
46.Nm
47checks a list of
48.Xr nroff 1
49or
50.Xr troff 1
51input files for certain kinds of errors
52involving mismatched opening and closing delimiters
53and unknown commands.
54If no files are specified,
55.Nm
56checks the standard input.
57.Pp
58Recognized options are:
59.Bl -tag -width xxx -compact -offset indent
60.It Fl a
61Add additional pairs of macros to the list of known macros.
62This must be followed by groups of six characters, each group defining
63a pair of macros.
64The six characters are
65a period,
66the first macro name,
67another period,
68and the second macro name.
69For example, to define a pair .BS and .ES, use
70.Sq Li \-a.BS.ES .
71.It Fl c
72Define commands which would otherwise be complained about
73as undefined.
74.It Fl f
75Request
76.Nm
77to ignore
78.Ql \ef
79font changes.
80.It Fl s
81Ignore
82.Ql \es
83size changes.
84.El
85.Pp
86Delimiters checked are:
87.Bl -enum -compact -offset indent
88.It
89Font changes using \efx ... \efP.
90.It
91Size changes using \esx ... \es0.
92.It
93Macros that come in open ... close forms, for example,
94the .TS and .TE macros which must always come in pairs.
95.El
96.Pp
97.Nm
98is intended for use on documents that are prepared with
99.Nm
100in mind, much the same as
101.Xr lint 1 .
102It expects a certain document writing style for
103.Ql \ef
104and
105.Ql \es
106commands,
107in that each
108.Ql \efx
109must be terminated with
110.Ql \efP
111and
112each
113.Ql \esx
114must be terminated with
115.Ql \es0 .
116While it will work to directly go into the next font or explicitly
117specify the original font or point size,
118and many existing documents actually do this,
119such a practice will produce complaints from
120.Nm .
121Since it is probably better to use the
122.Ql \efP
123and
124.Ql \es0
125forms anyway,
126you should think of this as a contribution to your document
127preparation style.
128.Pp
129.Nm
130knows about the
131.Xr ms 7
132and
133.Xr me 7
134macro packages,
135as well as the macros from
136.Xr mdoc 7 .
137.Sh DIAGNOSTICS
138.Bd -ragged -compact
139Complaints about unmatched delimiters.
140Complaints about unrecognized commands.
141Various complaints about the syntax of commands.
142.Ed
143.Sh SEE ALSO
144.Xr nroff 1 ,
145.Xr troff 1 ,
146.Xr mdoc 7 ,
147.Xr me 7 ,
148.Xr ms 7
149.Sh HISTORY
150The
151.Nm
152command appeared in
153.Bx 4.0 .
154Basic
155.Xr mdoc 7
156support appeared in
157.Nx 1.6 .
158.Sh BUGS
159There is no way to define a 1 character macro name using
160.Fl a .
161.Pp
162Does not correctly recognize certain reasonable constructs,
163such as conditionals.
164.Pp
165.Xr mdoc 7
166macros that are not at the beginning of the line are not recognized.
167Among others, this results in too many
168.Ql Unmatched Zz
169errors.
170