man page formatting with groff-1.18.1 fixed

Steve Jones sljones3 at
Thu Oct 31 12:56:23 PST 2002

After several days of studying the groff info pages I finally have a
patch to man-1.5k that fixes the problem the correct way according to
the groff developers.  This patch will cause the man page to be formated
to the correct width of any terminal. I have tested it in text mode at
40, 80, and 132 columns and in an xterm at many different widths. 
Before pages were formatted for 80 columns in any term greater than 80
columns, I don't know about less than.

Since this problem occures even in xterms and the solution was defined
by the groff developers I think it should be included in the book.

Steve Jones
sljones3 at
-------------- next part --------------
diff -Nuar man-1.5k/src/man.c man-1.5k-fixed/src/man.c
--- man-1.5k/src/man.c	2002-07-17 16:33:20.000000000 -0500
+++ man-1.5k-fixed/src/man.c	2002-10-31 13:52:59.000000000 -0600
@@ -540,7 +540,9 @@
 	       /* we should set line length and title line length */
 	       /* however, a .lt command here fails, only
 		  .ev 1; .lt ...; .ev helps for my version of groff */
-	       sprintf(eos(bufh), "echo \".ll %d.%di\"; ", ll/10, ll%10);
+	       /* use the LL register instead of .ll to keep up with
+		* changes in the groff-1.18 series */
+	       sprintf(eos(bufh), "echo \".nr LL %d.%di\"; ", ll/10, ll%10);
 #if 0
 	       sprintf(eos(bufh), "echo \".lt %d.%di\"; ", ll/10, ll%10);

More information about the lfs-dev mailing list