groff
[Top][All Lists]
Advanced

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

Re: Leaders


From: Lennart Jablonka
Subject: Re: Leaders
Date: Sun, 3 Sep 2023 23:27:44 +0000

Quoth Peter Schaffter:
On Sat, Sep 02, 2023, G. Branden Robinson wrote:
> Question 2:
> What is causing the erroneous justification of the third line?
> There's more than enough room for "air" and some leader.

There is not, in the example you provided.  You set one tab stop, at the
line length (meaning at the right margin), so there was no hope of
"air"+leader fitting on the line.

That's not at all how I interpret what I see in the output, which
is:

 The château into which my valet had ventured to make forcible en‐
 trance,  rather  than  permit me, in my deparately wounded condi‐
 tion,     to     pass     a      night      in      the      open
 air..................................

Since this can be rendered as

 The château into which my valet had ventured to make forcible en‐
 trance,  rather  than  permit me, in my deparately wounded condi‐
 tion, to pass a night in the open air............................|<=unique tab 
stop

Let’s try not filling the last two lines like that.

        tion,     to     pass     a      night      in      the      open
        air..................................

with spaces and the newline collapsed to a single space each becomes

        tion, to pass a night in the open air..................................

which occupies 71 cells instead of 65.

i.e. there's plenty of room.  The leader character is introduced at
a point in the line where it should, according to

 "A leader character...behaves similarly to a tab character: it
  moves to the next tab stop.  The difference is that for this
  movement, the default fill character is a period '.'."

move to the tab stop at the right margin and fill the space with
leaders, no?  I can see where there might be problems in situations
similar what the docs have to say about \R, but here I don't think
that's the case.

> Question 3:
> Why do the leaders not respect .ta \n[.l]u?

As I understand your example, the leader respected your tab stop
precisely; it was of the correct length to reach the configured right
margin _relative to the horizontal drawing position corresponding to the
start of the input line_, was formatted, was too long, could not be
hyphenated, and so was kicked to the next line.  Leaders, like tabs, are
not considered break points.

I'll repeat my example here for ease of discussion.

 cat <<EOF | groff -Kutf8 -k -Tutf8
 .pl 3v
 .ta \n[.l]u
 The château into which my valet had ventured to make forcible
 entrance, rather than permit me, in my deparately wounded condition,
 to pass a night in the open air^A
 EOF

As nearly as I can fathom, "the horizontal drawing position
corresponding to the start of the input line" is at the word "to",
which still leaves plenty of room for "air"+leaders (see above).
I still don't understand what's going on.

Yes, it’s at the word to.   So what is the leader’s position?

        01234567890123456789012345678901234567890123456789012345678901234
        to pass a night in the open air^A

It’s |31n.   From the start of the input line, 31n to the right.

So, how wide need the leader be? The next tab stop is 65n to the right of the start of the line. 65n - 31n = 34n. Thus, the leader consists of periods with a total width of 34n. Setting that we get:

        01234567890123456789012345678901234567890123456789012345678901234
        to pass a night in the open air..................................

Fits perfectly!   Now do the filling:

        01234567890123456789012345678901234567890123456789012345678901234
        The château into which my valet had ventured to make forcible en‐
        trance,  rather  than  permit me, in my deparately wounded condi‐
        tion,     to     pass     a      night      in      the      open
        air..................................

Voilà!

Do you now understand what’s going on, ignoring how useful or useless a design this is?



reply via email to

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