I'd like to define a new command that prints man pages to PostScript, but using a page size different than the default. For example, on Mac OS X you can run
man -t ls | open -f -a Skim
to open the man page for ls
as a PDF, which is almost exactly what I'd like. In fact, the only change I want to make is to print to a different page size. Since I'm never actually going to print these out on real paper, it would be nice to have the PDF sized to fit more neatly on my monitor. But I haven't been able to figure out how to do this in a simple way. The man page for man
says that the -t
switch will
Use
/usr/bin/groff -Tps -mandoc -c
to format the manual page, passing the output tostdout
.
To get a different page size it would appear that you need to change the arguments to groff
to something like groff -Tps -P-pa4
, so it looks like the straightforward way to do this is to give man
a different command to use for formatting the man page. But there doesn't seem to be a command line switch or an environment variable that allows you to do this. Is there a way to invoke man
so that it uses a command that I specify to format the man page?
(I would prefer to avoid doing something like
groff -Tps -P-pa4 -mandoc -c `man -w ls`
because sometimes the man pages are compressed as .gz
files and sometimes they aren't, and presumably man
could be making some other decisions about how to preprocess man pages.)