groff
[Top][All Lists]
Advanced

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

RE: [Groff] Meta-tbl: a few bugs fixed


From: Ted Harding
Subject: RE: [Groff] Meta-tbl: a few bugs fixed
Date: Sun, 06 Aug 2000 15:46:45 +0100 (BST)

On 06-Aug-00 baruchel wrote:
> Hi, here is the new version of the program I talked to you about.
> 
> A bug remains: the macros don't work well on the last line

I don't know if this is what you mean by the above, but there is
a very nasty bug indeed.

Imagine that you want two versions of your document: one for your
boss, to whose eye essential things do not leap quickly so he needs
the important table cells to be highlighted, and one for your working
colleagues who do not have this problem, and who get irritated by
fussy highlighting. So you do

  .M4T
  .TS
  .....
  .TE
  .if \n[boss] .m4tfc 3 1 100
  etc.

If you put ".M4T" but in fact you do not use any of the fill commands
at all, then everything disappears from that point on. This is due to
the fact that your awk "state machine" never reaches the case

  if (m == 2) && ($1 != "m4t:")) {

which causes the accumulated array of "non-m4t" lines to be printed out.

I'm finding it difficult to see how to mend this cleanly in the awk
script alone. However, there is a simple solution which involves
an extra macro to close off .M4T -- call it ./M4T say:

  .de /M4T
  \\!m4t: end
  ..

and also change the above line in the awk file:

  if ( ((m == 2) && ($1 != "m4t:")) || ($1 == "m4t: end") ) {

Then there is no problem: just make sure that you have a "./M4T"
somewhere after the table. Of course you can have successive
.M4T  ....  ./M4T  ....  .M4t  ....  ./M4T  ....

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 06-Aug-00                                       Time: 15:46:45
------------------------------ XFMail ------------------------------

reply via email to

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