groff
[Top][All Lists]
Advanced

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

Re: [Groff] tbl problem


From: Werner LEMBERG
Subject: Re: [Groff] tbl problem
Date: Thu, 15 Nov 2001 10:10:12 +0100 (CET)

> So, if anything, it's rather the behaviour of grotty which needs
> revising, in my opinion -- unless a detailed analysis shows that the
> behaviour of tbl is indeed anomalous.

Thanks for your detailed analysis.  It really seems easier to fix
grotty's behaviour.

> By the way, there are no warnings with "-Tps", with or without
> ".sp".

Of course not, because grops doesn't do page clipping by itself.

> if I have it right, 'grotty' "rounds up" fractional lines to
> character-size units, while what is needed to correct this behaviour
> is "rounding down".

I'll check that soon.

> Furthermore, the "error" "character above first line discarded" only
> arises because, as you gave the example, this character occurs in
> line (-1), i.e. the first "real" line of the table is "line 0" of
> the document. If you use a macro package (e.g. -ms) which puts a
> header margin in, then you do not get this behaviour. Even if you
> merely put a line of text ("This is text") preceding ".TS", it still
> does not occur (but then you do get "|" on the same line as "This is
> text").

Hehe.  Yesterday I've committed the following change to the man
macros:

  .de1 TS
  .  if n \{\
  .    nr an-pl \\n[.p]
  .    pl \\n[nl]u
  .    bp
  .    pl \\n[an-pl]u
  .  \}
  ..

As you remember, the man macros don't use any vertical traps in nroff
mode to achieve the effect of a single long page without any
intervening headers and footers.  This is much better than setting the
page length to a unreasonable amount like 10000i for two reasons:

  . A large page length value causes grotty to allocate a huge chunk
    of memory.

  . Displaying can be slower since grotty emits its data pagewise.

[The man program maintainers should be informed about this fact also
 to fix this.]

The only remaining problem was tbl.  First, it draws lines, and
second, it uses .ne to assure it can draw vertical lines upwards.  To
fix this also, my .TS definition sets the page length to the current
vertical position, emits a page break, and restores the page length to
the previous value.  This is the very reason I discovered the
discussed anomaly in tbl/grotty.


    Werner

reply via email to

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