1.\" $OpenBSD: deroff.1,v 1.9 2010/10/28 20:45:19 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: October 28 2010 $ 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 roff 81command lines, backslash constructions, macro definitions, 82eqn constructs (between 83.Dq .EQ 84and 85.Dq .EN 86lines or between delimiters), 87pic pictures, 88and table descriptions and writes the remainder to the standard output. 89.Nm 90follows chains of included files 91.Po 92.Dq .so 93and 94.Dq .nx 95commands 96.Pc ; 97if a file has already been included, a 98.Dq .so 99is ignored and a 100.Dq .nx 101terminates execution. 102If no input file is given, 103.Nm 104reads from the standard input. 105.Pp 106The options are as follows: 107.Bl -tag -width Ds 108.It Fl i 109Ignore 110.Dq .so 111and 112.Dq .nx 113commands. 114.It Fl k 115Keep blocks of text intact. 116This is the default behavior unless the 117.Fl m 118option is given. 119.It Fl m 120Enable support for common macro packages. 121The 122.Fl m 123option takes the following arguments: 124.Pp 125.Bl -tag -width Ds -offset indent -compact 126.It a 127recognize 128.Xr man 7 129macros. 130.It e 131recognize me macros. 132.It l 133remove list constructs. 134.It m 135recognize mm macros. 136.It s 137recognize ms macros. 138.El 139.It Fl p 140Preserve paragraph macros. 141This option only has an effect if the 142.Fl m 143option is also specified. 144.It Fl w 145Output a word list, one 146.Sq word 147(string of letters, digits, and apostrophes, beginning with a letter; 148apostrophes are removed) per line, and all other characters ignored. 149Normally, the output follows the original, with the deletions mentioned above. 150.El 151.Sh SEE ALSO 152.Xr man 7 153.Sh HISTORY 154.Nm 155appeared in 156.At v7 . 157.Sh BUGS 158.Nm 159is not a complete troff interpreter, 160so it can be confused by subtle constructs. 161Most errors result in too much rather than too little output. 162.Pp 163The 164.Fl ml 165option does not correctly handle nested lists. 166