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