groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Re: groff 1.19.1 complains when formatting its own man pages


From: Werner LEMBERG
Subject: [Groff] Re: groff 1.19.1 complains when formatting its own man pages
Date: Mon, 28 Jun 2004 08:16:18 +0200 (CEST)

[Formatting of `man groff.1' fails on platforms which use the system's
 man macros as the default.]

> > I rather suspect that /usr/share/lib/tmac/an is input without
> > activated compatibility mode.  Please tell me (looking again at
> > the truss output) which input files in which order are processed.
> [...]

I've identified the problem as follows.

  . For systems which use its native man macros instead of groff's
    macros as the default, groff provides a wrapper `an.tmac' file
    which activates compatibility mode and loads the native man
    macros.

  . Man pages like groff.1 explicitly need groff extensions, thus they
    currently contain `.cp 1'.  This makes the native man macros fail
    which often work only with `.cp 0'.

There are three solutions:

  1. Redefine the `cp' request in the an.tmac wrapper file to say

       This man page can only be handled with groff's version (-mgan)
       of the man macros.

     and abort.  Obviously not a good idea since it normally makes the
     man program fail.

  2. Redefine the .cp request to load groff's man macros (or rather,
     to make the `TH' macro load groff's man macros).  This has two
     limitations:

       - `.cp 0' must come before `.TH'.  While not a problem with
         groff, it might irritate other programs which parse man pages
         and expect `.TH' to be the first command (e.g. `apropos').

       - It won't work with multiple man pages processed in a single
         run of troff: Assume that we have foo.1 and bar.1, and that
         bar.1 needs the groff man macros.  After foo.1 has been
         processed it is no longer possible to load the groff version
         of the man macros.

         I don't know whether this is supported at all by non-groff
         versions of the man macros.

  3. Don't use the system's man macros but always activate
     compatibility mode (which is supported by groff's man macros).
     Man pages with groff extensions then still need the `.cp 1', but
     it is no longer necessary to have it before `.TH'.  This solution
     has the drawback that extensions to the system's man macros are
     not supported.

I favor item 2.  It is easy to hide the `.cp 0' for all platforms
which use groff as the default, limiting the parsing problem to the
system's programs.

Comments, please.


    Werner


reply via email to

[Prev in Thread] Current Thread [Next in Thread]