From owner-freebsd-questions Fri Mar 20 15:28:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA29285 for freebsd-questions-outgoing; Fri, 20 Mar 1998 15:28:56 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA29078 for ; Fri, 20 Mar 1998 15:28:29 -0800 (PST) (envelope-from grog@lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.8.7/8.8.5) with ESMTP id JAA15831; Sat, 21 Mar 1998 09:58:19 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id JAA10366; Sat, 21 Mar 1998 09:58:18 +1030 (CST) (envelope-from grog) Message-ID: <19980321095818.28357@freebie.lemis.com> Date: Sat, 21 Mar 1998 09:58:18 +1030 From: Greg Lehey To: MALCOLM BOFF , freebsd-questions Subject: Re: man pages References: <199803200714_MC2-3768-EB0F@compuserve.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <199803200714_MC2-3768-EB0F@compuserve.com>; from MALCOLM BOFF on Fri, Mar 20, 1998 at 07:13:48AM -0500 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 20 March 1998 at 7:13:48 -0500, MALCOLM BOFF wrote: > (This note refers to 2.2.2-RELEASE) You'll be happy to know that in fact, the principles refer to all versions of UNIX. > I have been trying to understand how man works in order that I can get some > properly formatted printouts and come up with the following conclusions. > > assuming the command 'man man' is executed then > the following command is executed :- > zcat /usr/share/man/cat1/man.1.gz > this file after decompression is not in *roff format Correct. The *roff sources are in /usr/share/man/man*, and man puts formatted versions in /usr/share/man/cat* if these directories exist. >From then on, it only formats if the file in man* is newer than the corresponding file in cat*. > assuming that the command 'man -t man' is executed then > the following command is executed > zcat /usr/share/man/man1/man.1.gz | tbl | troff > the compressed file is in *roff format Correct. /usr/share/man/man1/man.1.gz is the source file. It doesn't change. > This operation by default will use the troff device 'devps' ie postscript > this does not seem to be the case however Well, in fact it generates intermediate code for one of the groff postprocessors. You'll note that the output starts with x T ps x res 72000 1 1 x init > so I tried executing the command manually as :- > > zcat /usr/share/man/man1/man.1.gz | tbl | troff -Tascii > > and expected an ascii printable but that didn't give me what I expected. In this case, it generates intermediate code for another of the groff postprocessors. Now the output starts with x T ascii x res 240 24 40 x init > Is the command troff working correctly ? Yes. > Should it be proceeded by 'groff'? No. > There seems to be something not quite right here or is my > understanding incorrect ? Mainly, it's confusing documentation :-) Historically, troff doesn't produce final output, so GNU troff doesn't either. For that, use groff instead of troff. In addition, you need to specify a macro package for just about any *roff source. In the case of man pages, it's either the 'an' package (traditional man pages) or the 'doc' package (GNU and similar). There's a third package, 'andoc', which decides which package to load, so you can format any man page with zcat | groff -mandoc -t -p The -t and -p options run tbl and pic respectively. This will give you PostScript output. If you want ASCII output, you could write this instead: zcat | nroff -mandoc -t -p Of course, in this case it's easier to write: man Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message