nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] manpage table help

2013-02-20 20:28:09
Hi Ken,

        .PP
        .RS 5
        .nf
        .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
        FOLDER  \0\0\0\0\0\0# MESSAGES  RANGE   CUR     (OTHERS)
        ff      has \0no messages.
        inbox+  has \016 messages       (\03\-\022);    cur=\05.
        mh      has \076 messages       (15\-\076);     cur=70.
        .fi
        .RE
        .PP

Ok, I understand that ".PP" is new paragraph, ".RS" is an indent
(although I'm not sure what the units are),

It's `n' if none is given;  as in en and ems of a font.

and .nf is "no fill".  And I understand that .ta sets tab stops ....
but I'm confused by the syntax.  Specifically, what are the
\w'/rnd/phyl/Mail/EP ' stuff (it doesn't even appear in the output!),
the 'u. and the +\w', etc etc.

.ta's parameters are

    \w'/rnd/phyl/Mail/EP 'u
    +\w'has ddd messages 'u
    +\w'(ddd\-ddd); 'u

\w'foo'u is the width of the string `foo' in the current font, etc., in
`u' units, the fundamental unit for the device.  So the first tab stop
is far enough across that `/rnd/phyl/Mail/EP' at the start of the line
won't meet the tabbed text;  note the space in the string before the
closing '.

Similarly for the next two tab stops except the leading + means they're
not absolute from the start of the line, as the first one was, but
relative to the previous.  It's a common idiom for setting the column
width based on content rather than fixed sizes.  tbl(1) uses it in its
output.

I understand that after that the cells are separated by tabs, but I
don't understand waht the \0 is for.

\0 is a digit-width space.

Also ... why, exactly, do we use \- instead of -?

Because \- is a true minus sign in the current font whereas - is a
hyphen.

    $ printf '1-2\n.br\n1\-2\n' | nroff | grep .
    1‐2
    1−2
    $ 

Sorry to sound like a n00b, but when I came to town there was always
an amazing lack of documentation on troff, so I never ended up using
it.

May I suggest Kernighan's delightfully succinct and precise CSTR 54, a
PDF copy is http://troff.org/54.pdf.  The groff mailing list is also
very friendly, lots of old timers, and happy to discuss troff in general
rather than just groff, https://lists.gnu.org/mailman/listinfo/groff.

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>