groff
[Top][All Lists]
Advanced

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

[Groff] Meta-tbl: last know bug fixed


From: baruchel
Subject: [Groff] Meta-tbl: last know bug fixed
Date: Sun, 6 Aug 2000 18:21:20 +0200
User-agent: Mutt/1.2.5i

Brest, le dimanche 6 août

Hi boys,

there was still a known bug (bottom line of a doublebox). It's now fixed

I would be very happy if you try that tool, and tell me the other bugs.
Anyway, I think this macro can now be really and fully used in many cases.
Let me know if you like it.
Last time I forgot to tell the name of the col-filling command.
The three command are:
.m4tfc x y n (fill cell x,y with darkness of n)
.m4tlf y n   (fill line y with darkness of n)
.m4tcf x n   (fill column x with darkness of n)

The main usage has been already told in prevouis messages.
===tmac.4t================================================
.de M4T \" marks the beginning of the table
\\!# Here starts a new M4T table
\\!m4t: init
.M4Tinitc 1
.M4Tinitl 1
.rr ZZ
..
.de M4Tinitc \" remove some registers in case of greater previous table
.if \\n[3cd\\$1] \{\
.                   rr 3cd\\$1
.                   nr ZZ \\$1+1
.                   M4Tinitc \\n(ZZ \}
..
.de M4Tinitl \" remove some registers in case of greater previous table
.if \\n[3rt\\$1] \{\
.                   rr 3rt\\$1
.                   nr ZZ \\$1+1
.                   M4Tinitl \\n(ZZ \}
..
.de M4Tlastc \" looks for the last column
.nr ZZ \\$1+1
.if \\n[3cd\\n(ZZ] \{\
.                     M4Tlastc \\n(ZZ
.                     nr M4TLC +1 \}
..
.de M4Tlastl \" looks for the last line
.nr ZZ \\$1+1
.if \\n[3rt\\n(ZZ] \{\
.                     M4Tlastl \\n(ZZ
.                     nr M4TLL +1 \}
..
.de m4tfc
.nr m4ti \\$1-1
.nr m4tj \\$2-1
.nr m4tk \\n[3cd\\n[m4ti]]+\\n[3ind]+\\n(.o
.nr m4tl \\n[3cd\\$1]-\\n[3cd\\n[m4ti]]
.nr m4th \\n[3rt\\$2]-\\n[3rt\\n[m4tj]]
.\" Next lines seem to fix the bug for the last line of the table
.  if !\\n[m4th] \{\
.  nr m4th \\n[3rt0]+\\n[3bot]-\\n[3rt\\n[m4tj]]
.  \" Three next lines are in case of doublebox:
.    nr M4TLC 0
.    M4Tlastc 0 \" looks for the last column
.    nr m4th -(\\n(TW-\\n[3cd\\n[M4TLC]]) \}
\\!m4t: H\\n[m4tk]
\\!m4t: V\\n[3rt\\n[m4tj]]
.nr m4tk .25m
\\!m4t: v\\n[m4tk]
\\!m4t: Df \\$3 0
\\!m4t: DP \\n[m4tl] 0 0 \\n[m4th] -\\n[m4tl] 0 0 -\\n[m4th]
\\!m4t: Df 0 0
..
.de m4tlf
.nr M4TLC 0
.M4Tlastc 0 \" looks for the last column
.M4TfillL \\n[M4TLC] \\$1 \\$2
.rr ZZ
..
.de M4TfillL
.m4tfc \\$1 \\$2 \\$3
.nr ZZ \\$1-1
.if \\n(ZZ .M4TfillL \\n(ZZ \\$2 \\$3
..
.de m4tcf
.nr M4TLL 0
.M4Tlastl 0 \" looks for the last line
.M4TfillC \\n[M4TLL] \\$1 \\$2
.rr ZZ
..
.de M4TfillC
.m4tfc \\$2 \\$1 \\$3
.nr ZZ \\$1-1
.if \\n(ZZ .M4TfillC \\n(ZZ \\$2 \\$3
..
===m4t==========================================================
#!/bin/sh
awk '
BEGIN { m = 0 }
{
  if ((m == 0) && ($1 != "m4t:")) {
    print $0
  }
  if ((m == 1) && ($1 != "m4t:")) {
    n++
    l[n] = $0
  }
  if ((m == 2) && ($1 != "m4t:")) {
    m = 0
    for (i=1; i<=n; i++) {
      print l[i]
    }
    print $0
  }
  if ((m > 0) && ($1 == "m4t:")) {
    m = 2
    gsub("m4t: ","")
    print $0
  }
  if ((m == 0) && ($0 == "m4t: init")) {
    n = 0
    m = 1
  }
}
' $1

reply via email to

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