[Top][All Lists]

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

Re: [Groff] Introduction

From: Zvezdan Petkovic
Subject: Re: [Groff] Introduction
Date: Mon, 17 Oct 2005 23:47:20 -0400
User-agent: Mutt/1.4.2i

On Mon, Oct 17, 2005 at 05:50:55PM -0600, D. E. Evans wrote:
>    The removal of the escape characters, etc., for a compatible output
>    with OpenBSD's default, (this would be a configure option).  For
>    now, I guess a simple note (to the INSTALL file) that man -R needs
>    to be set globally to the system profile.

Other people will certainly know about configuration more.

There are several options, though, without changing groff configuration.

        1. Set in a user .profile or .login
           (or /etc/profile _and_ /etc/csh.login if you want it for the
           whole system)
                MANPAGER="more -R"
                export MANPAGER
           or for csh users
                setenv MANPAGER "more -R"

           (PAGER works also if MANPAGER is not defined [but it is])

           I use this solution in my .profile because it doesn't
           subtract anything.  It only adds value, making my man pager,
           more, which is a hard link for less on OpenBSD, understand
           colour escapes.

        2. Set in a user .profile or .login
           (or /etc/profile _and_ /etc/csh.login if you want it for the
           whole system)
                export GROFF_NO_SGR
           or for csh users
                setenv GROFF_NO_SGR 1

           I used this solution initially when I started working with
           1.18 version of groff.  I abandoned it because it subtracts
           value from all possible uses of nroff.
           In other words, I wanted it for man pages, but not for other
           applications of nroff.
        3. In /etc/man.conf on OpenBSD 3.7 there are exactly ten
           appearances of /usr/bin/nroff between the lines 19 and 28.
           Nine of them use the option -man, and one uses -me.
           Replace 'nroff' with 'groff -Tascii -P-c'.

           Let me explain.  I didn't replace system's groff installation
           in /usr/bin, but I did the following experiment:
                a) my PATH is already set to use my own installation of
                   groff-1.19.2 in $HOME/opt/bin.
                b) unset MANPAGER
                c) unset GROFF_NO_SGR
                        When I try 'man ImageMagick' now, the output is
                        garbled because /etc/man.conf calls
                        /usr/bin/nroff (version 1.15), which calls
                        grotty (found in my path; version 1.19.2).
                d) cp /etc/man.conf ~/
                e) edit it as described above (only $HOME/opt/bin/groff
                   instead of /usr/bin/groff because of my setup)
                        Now, try
                                man -C ~/man.conf ImageMagick
                        and it works like a charm.
           The conclusion: if I put this changed man.conf in
           /etc/man.conf it will work for the whole system under the
           condition that groff-1.19.2 is first in everybody's PATH.
           That should be true if you installed it over the original
           system files.

           I just got this idea, noticing that I used such options on a
           personal document I needed in PDF, HTML, and ASCII text.  To
           produce ASCII text I passed options to groff (this is from my

                GROFFTEXTOPTS   ?= ${GROFFOPTS} -Tascii -P-bcou

           Of these, -P-bcou are passed to grotty to avoid making any
           extra output.  Neither the colour escapes, nor the old
           overstriking to produce bold and underline.
           Just plain ASCII.
           Of interest here is -c only, because we do want overstriking
           for the old style man pages.

           Thus, the benefit of this third approach, in comparison to 1.
           above is that you get the old style man pages if you prefer
           them.  The benefit in comparison to 2. above is that you get
           the new groff/nroff behaviour for other applications that are
           not related to man pages.

Obviously, I chose 1. for my personal use, but for the use on the
system level, you can pick whichever you find the most suitable.

> Perhaps Zvezdan could clarify how this was done under
> /usr/src/gnu/usr.bin/groff (of the OpenBSD source) with 1.15?
> (Or was this a change made with a newer edition of groff?)

This one is easy and short.
Nothing was changed, because this feature was made default in 1.18.

Best regards,

        Zvezdan Petkovic

reply via email to

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