xref: /openbsd/usr.bin/deroff/deroff.1 (revision 17df1aa7)
1.\" $OpenBSD: deroff.1,v 1.8 2007/05/31 19:20:09 jmc Exp $
2.\"
3.\" Copyright (c) 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.\" Copyright (C) Caldera International Inc.  2001-2002.
31.\" All rights reserved.
32.\"
33.\" Redistribution and use in source and binary forms, with or without
34.\" modification, are permitted provided that the following conditions
35.\" are met:
36.\" 1. Redistributions of source code and documentation must retain the above
37.\"    copyright notice, this list of conditions and the following disclaimer.
38.\" 2. Redistributions in binary form must reproduce the above copyright
39.\"    notice, this list of conditions and the following disclaimer in the
40.\"    documentation and/or other materials provided with the distribution.
41.\" 3. All advertising materials mentioning features or use of this software
42.\"    must display the following acknowledgement:
43.\"	This product includes software developed or owned by Caldera
44.\"	International, Inc.
45.\" 4. Neither the name of Caldera International, Inc. nor the names of other
46.\"    contributors may be used to endorse or promote products derived from
47.\"    this software without specific prior written permission.
48.\"
49.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
50.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
51.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53.\" IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
54.\" INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
55.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
56.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
58.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
59.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60.\" POSSIBILITY OF SUCH DAMAGE.
61.\"
62.\"	@(#)deroff.1	8.1 (Berkeley) 6/6/93
63.\"
64.Dd $Mdocdate: May 31 2007 $
65.Dt DEROFF 1
66.Os
67.Sh NAME
68.Nm deroff
69.Nd remove nroff/troff, eqn, pic and tbl constructs
70.Sh SYNOPSIS
71.Nm deroff
72.Op Fl ikpw
73.Oo
74.Fl m
75.Ar a | e | l | m | s
76.Oc
77.Op Ar
78.Sh DESCRIPTION
79.Nm deroff
80reads each file in sequence and removes all
81.Xr nroff 1
82and
83.Xr troff 1
84command lines, backslash constructions, macro definitions,
85.Xr eqn 1
86constructs (between
87.Dq .EQ
88and
89.Dq .EN
90lines or between delimiters),
91.Xr pic 1
92pictures,
93and table descriptions and writes the remainder to the standard output.
94.Nm
95follows chains of included files
96.Po
97.Dq .so
98and
99.Dq .nx
100commands
101.Pc ;
102if a file has already been included, a
103.Dq .so
104is ignored and a
105.Dq .nx
106terminates execution.
107If no input file is given,
108.Nm
109reads from the standard input.
110.Pp
111The options are as follows:
112.Bl -tag -width Ds
113.It Fl i
114Ignore
115.Dq .so
116and
117.Dq .nx
118commands.
119.It Fl k
120Keep blocks of text intact.
121This is the default behavior unless the
122.Fl m
123option is given.
124.It Fl m
125Enable support for common macro packages.
126The
127.Fl m
128option takes the following arguments:
129.Pp
130.Bl -tag -width Ds -offset indent -compact
131.It a
132recognize
133.Xr man 7
134macros.
135.It e
136recognize
137.Xr me 7
138macros.
139.It l
140remove list constructs.
141.It m
142recognize
143.Xr mm 7
144macros.
145.It s
146recognize
147.Xr ms 7
148macros.
149.El
150.It Fl p
151Preserve paragraph macros.
152This option only has an effect if the
153.Fl m
154option is also specified.
155.It Fl w
156Output a word list, one
157.Sq word
158(string of letters, digits, and apostrophes, beginning with a letter;
159apostrophes are removed) per line, and all other characters ignored.
160Normally, the output follows the original, with the deletions mentioned above.
161.El
162.Sh SEE ALSO
163.Xr eqn 1 ,
164.Xr nroff 1 ,
165.Xr pic 1 ,
166.Xr tbl 1 ,
167.Xr troff 1
168.Sh HISTORY
169.Nm
170appeared in
171.At v7 .
172.Sh BUGS
173.Nm
174is not a complete
175.Xr troff 1
176interpreter, so it can be confused by subtle constructs.
177Most errors result in too much rather than too little output.
178.Pp
179The
180.Fl ml
181option does not correctly handle nested lists.
182