Printing man pages on a Mac on US-sized paper

(A brief note for anyone who needs this.)

First, set the default paper size in the groff driver by:
  sudo find /usr/share/groff -name DESC -exec perl -pi -e 's/^papersize a4/papersize letter/' {} \;

Then, the following command will create a PostScript file for a page without equations or tables:
     groff -Tps -mandoc -c -dpaper=letter `man -w rtcontrib` >t.ps

t.ps can then be opened in "preview" and printed.

Bah!

···

--
Randolph M. Fritz • [email protected]
Environmental Energy Technologies Division • Lawrence Berkeley Labs

What's wrong with this:

groff -Tps -P-pletter -mandoc -c `man -w rtcontrib` > t.ps

Works for me without fiddling with system files.

Taken from the groff man-page, btw.

Thomas

···

On Wed, Jan 5, 2011 at 5:46 PM, Randolph M. Fritz <[email protected]> wrote:

(A brief note for anyone who needs this.)

First, set the default paper size in the groff driver by:
sudo find /usr/share/groff -name DESC -exec perl -pi -e 's/^papersize
a4/papersize letter/' {} \;

Then, the following command will create a PostScript file for a page without
equations or tables:
groff -Tps -mandoc -c -dpaper=letter `man -w rtcontrib` >t.ps

t.ps can then be opened in "preview" and printed.

Bah!
--
Randolph M. Fritz • [email protected]
Environmental Energy Technologies Division • Lawrence Berkeley Labs

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Randolph,

man -t rtcontrib | open -f -a /Applications/Preview.app/

Yay Mac. =8-)

Rob Guglielmetti IESNA, LEED AP
Commercial Buildings Research Group
National Renewable Energy Laboratory
1617 Cole Blvd MS:RSF202
Golden, CO 80401
T. 303.275.4319
F. 303.630.2055
E. [email protected]

···

On 1/5/11 3:46 PM, "Randolph M. Fritz" <[email protected]> wrote:

(A brief note for anyone who needs this.)

First, set the default paper size in the groff driver by:
sudo find /usr/share/groff -name DESC -exec perl -pi -e 's/^papersize
a4/papersize letter/' {} \;

Then, the following command will create a PostScript file for a page
without equations or tables:
    groff -Tps -mandoc -c -dpaper=letter `man -w rtcontrib` >t.ps

t.ps can then be opened in "preview" and printed.

Bah!
--
Randolph M. Fritz € [email protected]
Environmental Energy Technologies Division € Lawrence Berkeley Labs

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

groff -Tps -P-pletter -mandoc -c `man -w rtcontrib` > t.ps

This also needs a "-dpaper=letter" to get the typography correct; the paper size is set in two places, and both have to be touched.

man -t rtcontrib | open -f -a /Applications/Preview.app/

I didn't know that open can accept input from the standard input! (And it's not documented in the general case, only for text files.) This will produce an a4-size page, though. Preview will stretch and squash it for printing.

I think the following command is an improvement on all three methods. It creates the typeset document correctly and does not require a change to system files.

groff -Tps -mandoc -c -dpaper=letter -P-pletter `man -w rtcontrib` | open -f -a Preview

Wish this stuff just worked.

Randolph

Back to the bit mines...

Has anyone over there tried Skim to view/print man pages? I've no idea how it handles paper size, but it's worth a go. Here's the command (similar to Rob's) set to alias 'manp' in my .tcshrc file:

alias manp "man -t \!* | open -f -a Skim"

Skim is a very neat PDF viewer and allows annotations / notes similar to Acrobat Pro (but not compatible with A Pro).

John

···

-----------------------------------------------
Dr. John Mardaljevic
Reader in Daylight Modelling
Institute of Energy and Sustainable Development
De Montfort University
The Gateway
Leicester
LE1 9BH, UK
+44 (0) 116 257 7972
+44 (0) 116 257 7981 (fax)

[email protected]
http://www.iesd.dmu.ac.uk/~jm

Skim looks really cool--I'll have to try it.

Randolph

···

On 2011-01-06 00:46:01 -0800, John Mardaljevic said:

Has anyone over there tried Skim to view/print man pages? I've no
idea how it handles paper size, but it's worth a go. Here's the
command (similar to Rob's) set to alias 'manp' in my .tcshrc file:

alias manp "man -t \!* | open -f -a Skim"

Skim is a very neat PDF viewer and allows annotations / notes similar
to Acrobat Pro (but not compatible with A Pro).

John

For anyone else thinking of using Skim -- you need to know that any notes you make to a PDF are stored as metadata (this makes is very different to Acrobat Pro). I made the mistake of annotating a PDF in Skim and then e-mailed it to myself to work on at home -- what I got was the un-annotated original. What I should have done was Mail (or Save) as an Archive. Of course, I could have just read the instructions in the first place...

John

···

-----------------------------------------------
Dr. John Mardaljevic
Reader in Daylight Modelling
Institute of Energy and Sustainable Development
De Montfort University
The Gateway
Leicester
LE1 9BH, UK
+44 (0) 116 257 7972
+44 (0) 116 257 7981 (fax)

[email protected]
http://www.iesd.dmu.ac.uk/~jm