groff
[Top][All Lists]
Advanced

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

Re: [Groff] tbl query


From: Ralph Corderoy
Subject: Re: [Groff] tbl query
Date: Sat, 14 Jun 2003 10:51:00 +0100

[Robert replied off-list, I guess accidentally, so I'm quoting more than
I normally would.]

Hi Robert,

> > Have you tried `.na' immediately prior to the .TS?  I'd expect it to
> > last for the duration of the table.  If you look at tbl's output, it
> > does
> >
> >     .de 3init
> >     ...
> >     .ad \n[.j]
> >
> > and then uses 3init quite often.
> 
> No, .na *only* seems to have an effect if it occurs within the T{...T}
> block.

Not here it doesn't with 1.17.2.

    $ cat foo.tr
    .ll 2i
    .TS
    tab(:);
    l l.
    abc:def
    T{
    An in on of is to my so.
    T}:T{
    An in on of is to my so.
    T}
    xyz:123
    .TE

    $ for f in '' .na '.ad r' '.ad c'; do
    >     echo ==== $f
    >     (echo $f; cat foo.tr) | groff -t -Tascii | cat -s
    > done
    ====

    abc       def
    An   in   An   in
    on   of   on   of
    is   to   is   to
    my  so.   my  so.
    xyz       123

    ==== .na
    abc      def
    An in    An in
    on of    on of
    is to    is to
    my so.   my so.
    xyz      123

    ==== .ad r
    abc       def
      An in     An in
      on of     on of
      is to     is to
     my so.    my so.
    xyz       123

    ==== .ad c
    abc      def
     An in    An in
     on of    on of
     is to    is to
    my so.   my so.
    xyz      123

> This is what the problem seems to be.  tbl makes a valiant effort to
> save the current adjustment and fill modes and apply them to the text
> block.  Suppose that I have the following file:
> 
> .TS
> tab(&);
> lw(1.5i).
> T{
> The rain in Spain falls mainly in the plain.
> She sells seashells by the seashore.
> T}
> .TE
> 
> Then, after processing by tbl, the section around the block looks like this:
> 
> .di 3tbd0,0
> .if \n[3fll] .fi
> .in 0
> .ll (n;1.5i)>?\n[3w0]u
> .cp \n(3c
> .lf 5 rubbish.roff
> The rain in Spain falls mainly in the plain.
> She sells seashells by the seashore.
> .br
> .di
> 
> The register 3fll is set to the fill-mode of the text outside the
> table; but, by trying to maintain the fill-mode with a .fi request,
> groff implicitly turns on adjustment (if I understand the groff manual
> correctly), even though earlier on in the output it tries to maintain
> the adjustment, as you say, in the 3init macro.

My tbl output has `.if \n[3fll] .fi' too.

> But, according to the old tbl manual, this is the correct behaviour of
> tbl, which will only adjust if a .na request is placed within the text
> block.  So, I guess it shouldn't be changed, even if groff tbl seems
> to have stumbled on the `correct' behaviour by a side-effect.

Cheers,


Ralph.


reply via email to

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