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