groff
[Top][All Lists]
Advanced

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

Re: [Groff] `centre' keyword, `u' and `z' specifiers in tbl, \= in items


From: Ralph Corderoy
Subject: Re: [Groff] `centre' keyword, `u' and `z' specifiers in tbl, \= in items
Date: Sat, 11 Aug 2001 23:21:15 +0100

Hi Werner,

I've got some answers by looking at the source of tbl from Plan 9 and
experiment on AIX 3.2.5.

> Can someone please check whether the English spelling `centre' works
> as an alternative to the `center' keyword in UNIX tbl also?  GNU tbl
> supports both.

No.

      6 } options [] = {
      7         "expand", &expflg,
      8         "EXPAND", &expflg,
      9         "center", &ctrflg,
     10         "CENTER", &ctrflg,
     11         "box", &boxflg,
     12         "BOX", &boxflg,
     13         "allbox", &allflg,
     14         "ALLBOX", &allflg,
     15         "doublebox", &dboxflg,
     16         "DOUBLEBOX", &dboxflg,
     17         "frame", &boxflg,
     18         "FRAME", &boxflg,
     19         "doubleframe", &dboxflg,
     20         "DOUBLEFRAME", &dboxflg,
     21         "tab", &tab,
     22         "TAB", &tab,
     23         "linesize", &linsize,
     24         "LINESIZE", &linsize,
     25         "delim", &delim1,
     26         "DELIM", &delim1,
     27         0, 0};

    $ strings `which tbl` | grep -i 'cent[er][er]'
    center
    CENTER

> Similarly, I need a check whether the `u' and `z' specifiers (which
> aren't documented in Lesk's tbl.ps) do exist in UNIX tbl also.  The
> current GNU tbl man page doesn't list them as extensions.
> 
>   u  Move the corresponding column up one half-line.
> 
>   z  Ignore the corresponding column for width-calculation purposes.

Yep.

    263                 case 'z': 
    264                 case 'Z': /* zero width-ignre width this item */
    265                         if (icol < 1) 
    266                                 continue;
    267                         flags[icol-1][nclin] |= ZEROW;
    268                         continue;
    269                 case 'u': 
    270                 case 'U': /* half line up */
    271                         if (icol < 1) 
    272                                 continue;
    273                         flags[icol-1][nclin] |= HALFUP;
    274                         continue;

    $ cat in
    .TS
    tab(:);
    l lz lu l.
    aaa:bbb:ccc:ddd
    aaa:bbbbbb:ccc:ddd
    .TE
    $ tbl <in | troff
    ...
    ca
    16a16a64b19b19bV24
    10c15c15cV40
    63d18d18dn40 0
    H240
    V80
    ca
    16a16a64b19b19b19b19b19bV64
    H384
    cc
    15c15cV80
    63d18d18dn40 0
    ...

> Finally, GNU tbl supports not only `\_' (to have a short horizontal
> line) but also `\=' to get a short double horizontal line.  Is this
> feature also available with UNIX tbl?

     66 ifline(char *s)
     67 {
     68         if (!point(s)) 
     69                 return(0);
     70         if (s[0] == '\\') 
     71                 s++;
     72         if (s[1] ) 
     73                 return(0);
     74         if (s[0] == '_') 
     75                 return('-');
     76         if (s[0] == '=') 
     77                 return('=');
     78         return(0);
     79 }

    $ cat in    # output is as I'd expect.
    .TS
    tab(:);
    c c c
    c c s.
    aaa:bbb:ccc
    aaa:\_
    aaa:\=
    aaa:bbb
    .TE


Ralph.


reply via email to

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