From: jonas@msiw38.msi.se (Jonas Hvarfner)
Subject: Re: [HELP] Formatting man pages using groff
Date: 1996/03/18 [thread overview]
Message-ID: <4ijcuj$5j@msiw38.msi.se> (raw)
In-Reply-To: 4i9lrt$r8a@mrnews.mro.dec.com
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
prev parent reply other threads:[~1996-03-18 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-03-14 5:00 [HELP] Formatting man pages using groff Mohan Kannapareddy
1996-03-14 5:00 ` C. Thewalt
1996-03-18 5:00 ` Jonas Hvarfner [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox