groff
[Top][All Lists]
Advanced

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

a Q quotation macro for man(7) (was: groff man(7) extensions)


From: G. Branden Robinson
Subject: a Q quotation macro for man(7) (was: groff man(7) extensions)
Date: Tue, 13 Dec 2022 09:45:54 -0600

[self-reply]

At 2022-12-12T12:38:42-0600, G. Branden Robinson wrote:
> Here's a list of man(7) extensions to which I have given consideration.
> 
>       KS/KE   Keeps.  Easy.[3]  Harmlessly ignorable by other
>               implementations.
>       LS/LE   List enclosure.  Throws a semantic hint (e.g., for HTML
>               output) and eliminates final use case of `PD` macro.[4]
>       DC/TG   Semantics at last.  Sure to rouse anger in people who
>               decided long ago that man(7) can't do this.[5]  Having
>               looked more closely at mdoc(7) since writing that, I
>               think `DC` should accept a _pair_ of arguments as its
>               second and third parameters for bracketing purposes.
>               But again, most man page authors would never need to
>               mess with `DC` at all.

There was one more.

        Q       Quotation macro.  It's madness that one doesn't already
                exist.  Its absence, the imperfect portability of
                special character identifiers for various types of
                quotation mark, and the bad ergonomics of introducing
                *roff strings just to serve this one purpose have made
                quotation such a pain point in man(7) writing that
                authors have tended to not bother with and instead abuse
                font style changes for it, putting things that should
                simply be quoted into stentorian italics or screaming
                bold instead, when these faces are already heavily
                burdened by other uses.

I experimentally implemented `Q` at one point but ran into a corner case
I wasn't happy with.  Looking back over it now I see that I got it
entangled with an extension to `SY`/`YS` to support arguments to help
the formatter compute tab stops.  I'm attaching "clone.man" so you can
have a look.

I've also pondered having private strings (i.e., not for use directly by
man pages) for opening and closing quotation marks that localization
packages can set.  This might save Helge Kreutzmann and collaborators
some tedium.

Even with that wrinkle, a `Q` macro would be dead simple.

Here's an an-ext.tmac portable version.

.\" Define opening and closing quotation marks as appropriate to your
.\" language and/or output device.
.ds oq \(lq
.ds cq \(rq
.
.\" Quote first argument with second argument immediately following.
.de Q
\*(oq\\$1\*(cq\\$2
..

Regards,
Branden

Attachment: clone.man
Description: Unix manual page

Attachment: signature.asc
Description: PGP signature


reply via email to

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