From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a58fd7e509d8d2ad X-Google-Attributes: gidfee84,public From: jonas@msiw38.msi.se (Jonas Hvarfner) Subject: Re: [HELP] Formatting man pages using groff Date: 1996/03/18 Message-ID: <4ijcuj$5j@msiw38.msi.se>#1/1 X-Deja-AN: 143351574 references: <4i9lrt$r8a@mrnews.mro.dec.com> content-type: text/plain; charset=iso-8859-1 organization: Detp. of Atomic Physics, Univ. of Stockholm, Sweden mime-version: 1.0 newsgroups: comp.unix.osf.osf1 The following shellscript uses groff to print manual pages. Groff needs some additional macro (-mad) information to produce good output. The macros are included below. I keep the macro file (tmac.ad) in my ~/lib and use -M to tell groff where to look for it. The -t and -e switches tells groff to run its input through eqn and tbl (or geqn or gtbl). Additinonally, the pages get printed double sided, with changed page offset. That is done by pstops by Angus Duggan. Use archie to find it. If you don't want/need double sided printing, just send the output from groff to lpr. Hope this helps! Regards, Jonas Hvarfner jonas@atom.msi.se #!/bin/sh # Print manual pages nicely. Jonas Hvarfner 941110. if [ $# -lt 1 ]; then echo Doublesided printing of manual pages. Output goes to ps5. echo Syntax: $0 path/manpage.mansect echo Example: $0 /usr/share/man/man1/f77.1 exit fi groff -t -e -M/users/jonas/lib -mad -man $1 > /tmp/$$ pstops "2:0,1(-0.5cm,0cm)" /tmp/$$ | lpr -Plps17 -K2 echo Spooled to lps17. rm /tmp/$$ # End of shellscript Here follow the macros in tmac.ad. I took them from Digitals tmac.man. .de EE \" End example .in -\\n(EXu .fi .}f \" restore basic text attributes .if n .sp 1 .if t .sp .5v .. .de MS .ie t \&\f5\\$1\fP\fR(\\$2)\fP\\$3 .el \fI\\$1\fP(\\$2)\\$3 .. .de PN .ie t \&\f5\\$1\fP\\$2 .el \fI\\$1\fP\\$2 .. -- Jonas Hvarfner Dept. of Atomic Physics jonas@atom.msi.se University of Stockholm, Sweden