groff
[Top][All Lists]
Advanced

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

Re: .ad l/.ad b


From: G. Branden Robinson
Subject: Re: .ad l/.ad b
Date: Mon, 13 Sep 2021 01:41:33 +1000
User-agent: NeoMutt/20180716

Hi Oliver,

At 2021-09-12T13:33:38+0200, Oliver Corff wrote:
> .ad Begin line adjustment for output lines in current
> adjust mode.
> .ad c Start line adjustment in mode c (c=l,r,c,b,n).
> 
> That looks like left, right, centered, block and neutral?

Yes, pretty much.

> Just my uninformed guess, and I am not at all sure about my impromptu
> Interpretation of 'n'.

Adjustment modes 'b' and 'n' are strictly synonymous and are in every
implementation I'm aware of going back to AT&T troff in Unix Version
7 (1979)[1].  I suppose that the mnemonics for them are "both" (or
"block") and "normal".

In my opinion, the .ad request entangles the concepts of alignment and
adjustment, something that would be more clear in a *roff that supported
right-to-left and/or boustrophedonic languages[2].  Really, the term
"adjustment" should apply _only_ to the distribution of extra space on
an output line for the purpose of producing straight vertical margins on
both sides of the text.

If we ever contemplate a groff 2.x that grants itself permission to
merrily break with tradition, such a conceptual separation is one of the
items on my wish list.

Regards,
Branden

[1] See
<https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/troff/n5.c>,
lines 104-128.

casead(){
        register i;

        ad = 1;
        /*leave admod alone*/
        if(skip())return;
        switch(i = getch() & CMASK){
                case 'r':       /*right adj, left ragged*/
                        admod = 2;
                        break;
                case 'l':       /*left adj, right ragged*/
                        admod = ad = 0; /*same as casena*/
                        break;
                case 'c':       /*centered adj*/
                        admod = 1;
                        break;
                case 'b': case 'n':
                        admod = 0;
                        break;
                case '0': case '2': case '4':
                        ad = 0;
                case '1': case '3': case '5':
                        admod = (i - '0')/2;
        }
}

[2] I think neatroff is capable of handling RTL scripts.

Attachment: signature.asc
Description: PGP signature


reply via email to

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