[comp.unix.questions] How to print man pages nicely?

weimer@garden.kodak.COM (Gary Weimer (588-0953)) (02/22/91)

In article <1991Feb21.155747.12018@javelin.es.com>,
pashdown@javelin.es.com (Pete Ashdown) writes:
|> 
|> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
postscript
|> printer.  I've tried dinking around with troff and nroff and had very little
|> success.  Any advice?

I just use:

man <topic> | lpr

Assuming your printer can handle the highlight control characters.

|> 		"If the real Jesus Christ were to stand up today
|> 		 He'd be gunned down cold by the CIA"  - The The

I wouldn't be surprised...

weimer@ssd.kodak.com ( Gary Weimer )

rich@boreas.whoi.edu (02/22/91)

In article <1991Feb21.165558.20454@ssd.kodak.com> weimer@ssd.kodak.com writes:
>
>In article <1991Feb21.155747.12018@javelin.es.com>,
>pashdown@javelin.es.com (Pete Ashdown) writes:
>|> 
>|> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
>postscript
>|> printer.  I've tried dinking around with troff and nroff and had very little
>|> success.  Any advice?
>
>I just use:
>
>man <topic> | lpr
>
>Assuming your printer can handle the highlight control characters.
>
>weimer@ssd.kodak.com ( Gary Weimer )


Surely this just prints the nroff-ed man pages....what you want to do is

1) find the path to your particular topic, usually something like

     /user/man/man<sec>/<topic>.<sec>
     
     
    for topic(sec) (i.e. read(1) ). grep can be useful here.
    
2) %troff -man -t  /user/man/man<sec>/<topic>.<sec>  > outfile
   %lpr -t outfile
   
   or
   
   %troff -man -t  /user/man/man<sec>/<topic>.<sec>  | lpr -t
   
   
   
   
   
--
Rich Pawlowicz ----------------- INTERNET: rich@boreas.whoi.edu
Woods Hole Oceanographic Institution
"Home of the 59-cent squid burger (cheese extra)"
--------------------------------------------------------------

khera@thneed.cs.duke.edu (Vick Khera) (02/22/91)

In article <1991Feb21.165558.20454@ssd.kodak.com> weimer@garden.kodak.COM (Gary Weimer (588-0953)) writes:

   In article <1991Feb21.155747.12018@javelin.es.com>,
   pashdown@javelin.es.com (Pete Ashdown) writes:
   |> 
   |> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
   postscript
   |> printer.  I've tried dinking around with troff and nroff and had very little
   |> success.  Any advice?

   I just use:

   man <topic> | lpr

as long as i can remember, i've used

  man -t <topic>

to get a printed version.  this works quite well on our Sun network,
and also worked on various BSD machines at my previous school.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vick Khera, Gradual Student/Systems Guy   Department of Computer Science
ARPA:   khera@cs.duke.edu                 Duke University
UUCP:   ...!mcnc!duke!khera               Durham, NC 27706     (919) 660-6528

gwyn@smoke.brl.mil (Doug Gwyn) (02/22/91)

In article <1991Feb21.155747.12018@javelin.es.com> pashdown@javelin.sim.es.com writes:
>I'm a bit baffled at how to get 'man' pages to typeset nicely on a postscript
>printer.  I've tried dinking around with troff and nroff and had very little
>success.  Any advice?

It obviously depends on how your DWB package is set up.  On some systems
	troff -Tps -man whatever.1 | dps
would suffice.

swamys@copper.ucs.indiana.edu (shankar n swamy) (02/22/91)

In article <1991Feb21.165558.20454@ssd.kodak.com> weimer@ssd.kodak.com writes:
>

>|> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
>postscript
>I just use:
>
>man <topic> | lpr
>
>Assuming your printer can handle the highlight control characters.
>
>weimer@ssd.kodak.com ( Gary Weimer)
 
  There should be some sort of nroff2ps program that would 
do it, so that it can be eventually printed on a ps printer.
Once in the post-script format, you get more than just highlightings.

  Also, when we are at it, is there a single command that can print
out the entire on-line manual?

  Thanks!

shankar swamy
----------------------------------------------------------------------
swamys@copper.ucs.indiana.edu

ian@ukpoit.co.uk (Ian Spare) (02/25/91)

In article <1991Feb22.022650.22489@bronze.ucs.indiana.edu> swamys@copper.ucs.indiana.edu (shankar n swamy) writes:
>In article <1991Feb21.165558.20454@ssd.kodak.com> weimer@ssd.kodak.com writes:
>>
>
>>|> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
>>postscript
>>I just use:
>>
>>man <topic> | lpr
>>
>>Assuming your printer can handle the highlight control characters.
>>
>>weimer@ssd.kodak.com ( Gary Weimer)

I thought that the trick was getting a good 'terminfo' entry for the 
printer , I have done this but on an HP Laser jet.
> 
>  Also, when we are at it, is there a single command that can print
>out the entire on-line manual?
>
WOW !!! Watch out trees !!!


-- 
Ian Spare , iT , Barker Lane , CHESTERFIELD , DERBYS , S40 1DY , GREAT BRITAIN

   E-mail : ian@ukpoit.uucp - VOICE : +44 246 214296 - FAX : +44 246 214353

fischer@iesd.auc.dk (Lars P. Fischer) (02/27/91)

>>>>> On 22 Feb 91, swamys@copper.ucs.indiana.edu (shankar n swamy) said:

shankar>   Also, when we are at it, is there a single command that can print
shankar> out the entire on-line manual?

Well, hacking up a shell script to do this would be simple, but are
you sure you *really* want to do it? On a typical UNIX system, this
would produce thousands of pages. I would suggest that you order a set
of printed docs from your vendor -- it will be cheaper and the manuals
will be nicer printed.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ

tchrist@convex.COM (Tom Christiansen) (02/27/91)

From the keyboard of fischer@iesd.auc.dk (Lars P. Fischer):
:>>>>> On 22 Feb 91, swamys@copper.ucs.indiana.edu (shankar n swamy) said:
:
:shankar>   Also, when we are at it, is there a single command that can print
:shankar> out the entire on-line manual?
:
:Well, hacking up a shell script to do this would be simple, but are
:you sure you *really* want to do it? On a typical UNIX system, this
:would produce thousands of pages. I would suggest that you order a set
:of printed docs from your vendor -- it will be cheaper and the manuals
:will be nicer printed.

We use 'man -t' to print our man pages.  Since the customer can also
do this (providing he's got a nice printer to output the troff to),
it should be equally pretty.    Of course, that assumes you've got
a man that groks -t.  

--tom
--
"UNIX was not designed to stop you from doing stupid things, because
 that would also stop you from doing clever things." -- Doug Gwyn

 Tom Christiansen                tchrist@convex.com      convex!tchrist

greywolf@unisoft.UUCP (The Grey Wolf) (03/07/91)

<1991Feb21.165558.20454@ssd.kodak.com> by weimer@ssd.kodak.com
& 
& In article <1991Feb21.155747.12018@javelin.es.com>,
& pashdown@javelin.es.com (Pete Ashdown) writes:
& |> 
& |> I'm a bit baffled at how to get 'man' pages to typeset nicely on a
& postscript
& |> printer.  I've tried dinking around with troff and nroff and had very little
& |> success.  Any advice?
& 
& I just use:
& 
& man <topic> | lpr
& 
& Assuming your printer can handle the highlight control characters.

I think he wants a troff output to go to a laser printer.  Unfortunately,
most versions of troff are specific to a CAT phototypesetter.  I forget where
we got it, but there's something out there called "psroff" (and a host of
other assorted utilities) which will make things come out real nice on a
laser printer.  It does, however, require a device-independent troff;
that is, you need to have a troff that is not device-specific.  And it
requires some translational libraries in order to work right.

Anyone else?

& weimer@ssd.kodak.com ( Gary Weimer )


-- 
# On the 'Net:  Why are more and more fourth-level wizard(-wannabe)s trying
# to invoke ninth-level magic instead of taking the time to climb the other
# (quite essential) thirteen or fourteen levels so they can do this properly?
# ...!{uunet,ucbvax}!unisoft!greywolf

tchrist@convex.COM (Tom Christiansen) (03/07/91)

From the keyboard of greywolf@unisoft.UUCP (The Grey Wolf):
:I think he wants a troff output to go to a laser printer.  Unfortunately,
:most versions of troff are specific to a CAT phototypesetter.  I forget where
:we got it, but there's something out there called "psroff" (and a host of
:other assorted utilities) which will make things come out real nice on a
:laser printer.  

The hard part is you need "ditroff".  After that, you can use any of
several conversion utils to go from device independent troff to
postscript.  I tried psroff, but after it kept dumping core, I switched to
tpscript and have been happy ever since.

--tom
--
	I get so tired of utilities with arbitrary, undocumented,
	compiled-in limits.  Don't you?

Tom Christiansen		tchrist@convex.com	convex!tchrist

adrianho@barkley.watt.berkeley.edu (Adrian J Ho) (03/07/91)

In article <1991Mar06.221505.19743@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>The hard part is you need "ditroff".  After that, you can use any of
>several conversion utils to go from device independent troff to
>postscript.  I tried psroff, but after it kept dumping core, I switched to
>tpscript and have been happy ever since.

Overkill, perhaps, but you can get groff from prep.ai.mit.edu
(18.71.0.38).  It's an enhancement of standard troff, has rewrites of
various tmac files (including man) and it's FREE.

There's a catch, though -- you need a C++ compiler, but you can get
g++ from the same site.  G++ needs gcc, though, so you'll have to get
that too.

Overkill?  I'll let you decide, but I compiled all three and it wasn't
really tedious, either.

>--tom
>--
	   I get so tired of utilities with arbitrary, undocumented,
	   compiled-in limits.  Don't you?

>Tom Christiansen		tchrist@convex.com	convex!tchrist
--
-----------------------------------------------------------------------------
Adrian Ho, EECS (pronounced "eeks!") Dept.		Phone: (415) 642-5563
UC Berkeley					adrianho@barkley.berkeley.edu
Domain: sesame-street (telly,bigbird,snuffy,oscar,kermit,bert,grover,barkley)
Favorite expression: "There's no business like monkey business."

les@chinet.chi.il.us (Leslie Mikesell) (03/08/91)

In article <1991Mar06.221505.19743@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of greywolf@unisoft.UUCP (The Grey Wolf):
>:I think he wants a troff output to go to a laser printer.  Unfortunately,
>:most versions of troff are specific to a CAT phototypesetter.  I forget where
>:we got it, but there's something out there called "psroff" (and a host of
>:other assorted utilities) which will make things come out real nice on a
>:laser printer.  

>The hard part is you need "ditroff".  After that, you can use any of
>several conversion utils to go from device independent troff to
>postscript.  I tried psroff, but after it kept dumping core, I switched to
>tpscript and have been happy ever since.

Chris Lewis's psroff will work with "old" troff and will generate postscript
or HP output (perhaps others, I've only done postscript) from the CAT codes.

There's no pic/grap but it is great for making nice looking man pages. 

Les Mikesell
  les@chinet.chi.il.us

clewis@ferret.ocunix.on.ca (Chris Lewis) (03/09/91)

In article <1991Mar06.221505.19743@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of greywolf@unisoft.UUCP (The Grey Wolf):
>:I think he wants a troff output to go to a laser printer.  Unfortunately,
>:most versions of troff are specific to a CAT phototypesetter.  I forget where
>:we got it, but there's something out there called "psroff" (and a host of
>:other assorted utilities) which will make things come out real nice on a
>:laser printer.  It does, however, require a device-independent troff;
>:that is, you need to have a troff that is not device-specific.  And it
>:requires some translational libraries in order to work right.

>The hard part is you need "ditroff".  After that, you can use any of
>several conversion utils to go from device independent troff to
>postscript.  I tried psroff, but after it kept dumping core, I switched to
>tpscript and have been happy ever since.

There seems to be some confusion here.  The version of psroff I wrote
works with CAT troff (aka old troff) only.  And works very well.
It also turns out that there is a "psroff" utility in Adobe's Transcript.
(it wasn't me that named my package psroff, but never mind).  Adobe's
psroff works with ditroff (I think - actually Transcript supports both
CAT troff and ditroff).  tpscript works only with ditroff.

Tom, if my psroff is core dumping I'd like to hear about it.  I try to
support psroff just as well as Larry supports perl.  You report problems
to Larry don't you? ;-)  I know of NO instances where psroff doesn't work -
it is running on a very broad range of machines, all the way from 286's/68K's
with elderly versions of Xenix to MIPS, Sun 4, Ultrix, Vaxen, Apollos, HP's,
RS/6000's, RT's etc.  Generating output for HP Laserjets & clones (w/wo
Postcript cartridges), Postscript printers, and ditroff backends (tpscript,
psdit, jetroff, xtroff/xditview on X windows) and works with Pageview and
Display Postscript amongst other things.  (well, there is one difficulty -
compilers with small case table limits sometimes have problems - but Perl
is worse in that respect)

Every bug report has been fixed and every configuration problem has been
solved - no-one reporting a problem has gone away disappointed in either
the support or psroff itself.  Ask Mark Biggers for one...  I REALLY
do support it - that's why my phone number is in the psroff distribution
and my signature (please don't call during dinner hours ;-)

If you fed my psroff ditroff input, no wonder it's coredumped.
(Other than feeding psroff ditroff by accident, the ONLY core dumps ever
reported to me were about a utility program in psroff release 1, patch 0.
That was fixed in patch 1.  Since then there's been 8 patches to release 1,
and psroff release 2 has gone thru 7 more (psroff 2 was distributed over
alt.sources and didn't get around too widely - the patches were primarily
configuration/installability/odd versions of troff improvements)

Psroff is about to rereleased in its entirety, including full support
(in addition to the previously mentioned stuff) for HP Laserjet III
scaleable fonts and, now psroff supports ditroff *input* too.  As such,
it can be used to replace tpscript, jetroff, psdit and most other
ditroff backends.  With the Laserjet font support and both CAT and ditroff
input capability, it is more fully functional than ANY other commercial or
PD package for driving printers from any kind of troff.

This time I'm going to *try* to change the name to something *other* than
psroff to try to end the confusion.
-- 
Chris Lewis,
clewis@ferret.ocunix.on.ca or ...uunet!mitel!cunews!latour!ecicrl!clewis
Psroff support: psroff-request@eci386.uucp, or call 613-832-0541 (Canada)

stuart@amc-gw.amc.com (Stuart Poulin) (03/09/91)

I print man pages under SunOS 4.1 to a postscript laser printer using:

troff -man -t file.1 | lpr -Pprinter -t

This is useful when you find some software on the net and want to
keep the man page in a binder.

tchrist@convex.COM (Tom Christiansen) (03/09/91)

From the keyboard of clewis@ferret.ocunix.on.ca.UUCP (Chris Lewis):
:There seems to be some confusion here.  The version of psroff I wrote
:works with CAT troff (aka old troff) only.  And works very well.
:It also turns out that there is a "psroff" utility in Adobe's Transcript.

It's this that I was trying to use, the one from Adobe.  I believe it
doesn't like come line-drawing magic that that least my ditroff will spit
out.  I wasn't aware there were two programs of the same name.

Sorry for any confusion,

--tom

ronald@robobar.co.uk (Ronald S H Khoo) (03/11/91)

clewis@ferret.ocunix.on.ca.UUCP (Chris Lewis) writes:

> This time I'm going to *try* to change the name to something *other* than
> psroff to try to end the confusion.

What about ferretroff ? Or do you that'd give the game away with \(bs ? 
-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)