Subject: lib/2603: groff -ms macros deviate from AT&T in indentation
To: None <gnats-bugs@NetBSD.ORG>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 07/04/1996 18:09:29
>Number:         2603
>Category:       lib
>Synopsis:       groff -ms macros deviate from AT&T in indentation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul  4 18:35:01 1996
>Last-Modified:
>Originator:     John Hawkinson
>Organization:
MIT SIPB
>Release:        1.1
>Environment:
System: NetBSD lola-granola 1.1B NetBSD 1.1B (LOLA) #1: Mon Jun 10 21:36:50 EDT 1996 mycroft@zygorthian-space-raiders:/afs/sipb.mit.edu/project/netbsd/dev/current-source/build/i386_nbsd1/sys/arch/i386/compile/LOLA i386


>Description:

	The -ms macros that come with groff are gratuitously different
in default indentation than those that come with standard AT&T nroff.

In particular, they add a default indentation (.po -- page offset)
of 1 inch to the output text. This indentation is not present
in the AT&T macro set.

This causes documents to format differently, and is particularly
annoying when formatting text to meet strict requirements (eg:
the RFC1543 nroff template breaks).

>How-To-Repeat:

	Under NetBSD with no macro package:

[lola-granola!jhawk] ~> echo foo | nroff | grep -v '^$' | od -cx
0000000    f   o   o  \n                                                
            6f66    0a6f                                                

	Under NetBSD with the -ms macros:

[lola-granola!jhawk] ~> echo foo | nroff -ms | grep -v '^$' | od -cx
0000000                                            f   o   o  \n        
            2020    2020    2020    2020    2020    6f66    0a6f        
0000016

	Under Solaris 2.3 with the -ms macros:
[lola-granola!jhawk] ~> echo foo | rsh btc nroff -ms | grep -v '^$' | od -cx
0000000    f   o   o  \n                                                
            6f66    0a6f    2020    2020    2020    2020    2020    2020
0000020                                                    J   u   l   y
            2020    2020    2020    2020    2020    2020    754a    796c
0000040        4   ,       1   9   9   6  \n                            
            3420    202c    3931    3639    000a                        
0000051

	Using the Solaris 2.3 macro package under NetBSD:

[lola-granola!jhawk] ~> ( cat \
  /afs/athena/system/sun4m_53/srvd/usr/share/lib/tmac/s ; echo foo ) | nroff \
  | grep -v '^$' | od -cx
0000000    f   o   o  \n                                                
            6f66    0a6f    2020    2020    2020    2020    2020    2020
0000020                                                    J   u   l   y
            2020    2020    2020    2020    2020    2020    754a    796c
0000040        4   ,       1   9   9   6  \n                            
            3420    202c    3931    3639    000a                        
0000051

	Under IRIX 5.2 with the -ms macros:

[lola-granola!jhawk] ~> echo foo | rsh opus nroff -ms | grep -v '^$' | od -cx0000000    f   o   o  \n                                                
            6f66    0a6f    2020    2020    2020    2020    2020    2020
0000020                                                    J   u   l   y
            2020    2020    2020    2020    2020    2020    754a    796c
0000040        4   ,       1   9   9   6  \n                            
            3420    202c    3931    3639    000a                        
0000051

	Under Ultrix 4.2:
[lola-granola!jhawk] ~> echo foo | rsh yaz nroff -ms | grep -v '^$' | od -cx
0000000    f   o   o  \n                                                
            6f66    0a6f    2020    2020    2020    2020    2020    2020
0000020                                                    J   u   l   y
            2020    2020    2020    2020    2020    2020    754a    796c
0000040        4   ,       1   9   9   6  \n                            
            3420    202c    3931    3639    000a                        
0000051

	Under VAX 4.3BSD:
[lola-granola!jhawk] ~> echo foo | rsh binkley nroff -ms | grep -v '^$' | od -cx 
0000000    f   o   o  \n                                                
            6f66    0a6f                                                
0000004

	Under IBM RT 4.3BSD:

[lola-granola!jhawk] ~> echo foo | rsh snork nroff -ms | grep -v '^$' | od -cx0000000    f   o   o  \n                                                
            6f66    0a6f                                                
0000004


It's clear that the more recent operating systems use a version of the -ms
macros that appends the date at the footer of the page. This hardly
seems critical, and certainly NetBSD -ms macro package is more consistent
with that of the older operating systems referenced above.

It's worth noting that NetBSD's -me macro package has a similar problem,
but I haven't gone to lengths to determine why as I have for -ms.

>Fix:

WORKAROUND:

	Add ".nr PO 0i" to the top of your nroff documents.

PATCH:

	/usr/share/tmac/tmac.s should be modified per:


[lola-granola!jhawk] ~> diff -c /usr/share/tmac/tmac.s /tmp/tmac.s
*** /usr/share/tmac/tmac.s      Tue Dec 19 01:16:45 1995
--- /tmp/tmac.s Thu Jul  4 17:53:32 1996
***************
*** 396,402 ****
  .nr pg@fn-colw 0
  .nr HM 1i
  .nr FM 1i
! .nr PO 1i
  .ds LF
  .ds CF
  .ds RF
--- 396,402 ----
  .nr pg@fn-colw 0
  .nr HM 1i
  .nr FM 1i
! .nr PO 0i
  .ds LF
  .ds CF
  .ds RF


As an aside, this bug seems like such a sore note that I really
wonder why no one has fixed it. I'd noticed it quite some time
ago (about 12 months) but didn't have the energy and 'roff knowledge
to try and figure what was going on.
>Audit-Trail:
>Unformatted: