SYNOPSIS
From man(1):
-l
Format and display local manual files instead of searching through the system's manual collection.
-t
Use groff -mandoc to format the manual page to stdout.
From groff_tmac(5):
papersize
This macro file is already loaded at start-up by troff so it isn't necessary to call it explicitly. It provides an interface to set the paper size on the command line with the option -dpaper=size. Possible values for size are the same as the predefined papersize values in the DESC file (only lowercase; see groff_font(5) for more) except a7–d7. An appended l (ell) character denotes landscape orientation. Examples: a4, c3l, letterl.
Most output drivers need additional command-line switches -p and -l to override the default paper length and orientation as set in the driver-specific DESC file. For example, use the following for PS output on A4 paper in landscape orientation:
sh# groff -Tps -dpaper=a4l -P-pa4 -P-l -ms foo.ms > foo.ps
THE PROBLEM
I would like to use these to format local and system man pages to print out, but want to switch the paper size from letter to A4. Unfortunately I couldn't find anything in man(1) about passing options to the underlying roff formatter.
Right now I can use
zcat `man -w man` | groff -tman -dpaper=a4 -P-pa4
to format man(1) on stdout
, but that's kind of long and I'd rather have man build the pipeline for me if I can. In addition the above pipeline might need changing for more complicated man pages, and while I could use grog, even it doesn't detect things like accented characters (for groff's -k option), while man does (perhaps using locale settings).
The
man
command is typically intended only for searching for and displaying manual pages on a TTY device, not for producing typeset and paper printed output.Depending on the host system, and/or the programs of interest, the a fully typeset printable form of a manual page can sometimes be generated when a program (or the whole system) is compiled. This is more common for system documents and less common for manual pages though.
Note that depending on which manual pages you are trying to print there may be additional steps required. Traditionally the following pipeline would be used to cover all the bases:
Your best solution for simplifying your command line would probably be to write a little tiny script which encapsulates what you're doing. Note that
man -w
might find several different filenames, so you would probably want to print each separately (or maybe only print the first one).