How to adjust man page line length

Polytropon freebsd at edvax.de
Tue Jan 18 19:40:01 UTC 2011


On Tue, 18 Jan 2011 06:48:13 -0600, David Kelly <dkelly at hiwaay.net> wrote:
> 
> On Jan 17, 2011, at 9:40 PM, David J. Weller-Fahy wrote:
> 
> > To expand on the question in the subject: How does one tell `man` not to
> > automatically format man pages to 80 columns?  I'm looking for a fairly
> > easy way to do this, or confirmation it would involve internal
> > gymnastics I may not be willing to perform.
> 
> Perhaps FreeBSD should look into using man from MacOS X where "man -c"
> will do as requested above. Will format to the output device width.
> 
> For FreeBSD I suspect the solution involves "man -t" and then studying
> how to tell groff(1) to format for one's console rather than the default
> Postscript output. "man -t" generates very nice printable man pages.

I'd like to mention - although this might not be a full
answer to the OP's initial question - that this is
similarly done when converting manual pages to PS or
PDF output for better printing.

man2pdf.sh:

	#!/bin/sh
	[ "$1" != "" ] && zcat `man -w $1` | \
	groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf - $1.pdf

This would cause groff to format for A4 paper width.
It's fully possible that a similar approach can be used
for requesting a specific terminal width given in
characters, rather than inches or centimeters (from
a predefined value).


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list