groff
[Top][All Lists]
Advanced

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

Re: [Groff] Meta-tbl: The bug is fixed


From: baruchel
Subject: Re: [Groff] Meta-tbl: The bug is fixed
Date: Mon, 7 Aug 2000 13:21:29 +0200
User-agent: Mutt/1.2.5i

Brest, le lundi 7 août

Thanks to an old message of Ted Harding, I have fixed the bug:

> PS if anyone does want to try doing it, don't forget that the
> \D'f ...' command implements, as a side effect, a horizontal
> motion equal to its argument in groff units. This has to be
> undone with an extra \h'...' command so as to suppress the motion.

I forgot the side effect of the output 'f' command. I put an extra
left motion after each of my 'f' commands. Now, everything seems to work
well.

Here are the commands:
.m4tshd n [d]    a shadow (always the first M4T command)
.m4tdbl [n]      fill the doublebox space (after .m4tshd but before all others)
.m4tfa n         fill the whole table (except doublebox space)
.m4tcf x n       fill a column
.m4tlf y n       fill a line
.m4tfc x y n     fill a cell
.m4tbdr x r [s]  adds a border aroune (x,y)

I don't see any bug for the moment.
================================================================================
.de M4T \" marks the beginning of the table
\\!# Here starts a new M4T table
\\!m4t: init
..
.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]]
.  \" Next lines is in case of doublebox:
.    nr m4th -\\n[3cd0]
.\}
\\!m4t: H\\n[m4tk]
\\!m4t: V\\n[3rt\\n[m4tj]]
.nr m4tk .25m
\\!m4t: v\\n[m4tk]
\\!m4t: Df \\$3 0
\\!m4t: h-\\$3
\\!m4t: DP \\n[m4tl] 0 0 \\n[m4th] -\\n[m4tl] 0 0 -\\n[m4th]
\\!m4t: Df 0 0
..
.de m4tlf
.nr m4tj \\$1-1
.nr m4tk \\n[3cd0]+\\n[3ind]+\\n(.o
.nr m4th \\n[3rt\\$1]-\\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]]
.  \" Next lines is in case of doublebox:
.    nr m4th -\\n[3cd0]
.\}
\\!m4t: H\\n[m4tk]
\\!m4t: V\\n[3rt\\n[m4tj]]
.nr m4tk .25m
\\!m4t: v\\n[m4tk]
\\!m4t: Df \\$2 0
\\!m4t: h-\\$2
.nr m4tk \\n(TW-\\n[3cd0]-\\n[3cd0] \" in case of double box
\\!m4t: DP \\n[m4tk] 0 0 \\n[m4th] -\\n[m4tk] 0 0 -\\n[m4th]
\\!m4t: Df 0 0
..
.de m4tcf
.nr m4tL \\n[3crow]+1 \" number of the last line
.nr m4ti \\$1-1
.nr m4tk \\n[3cd\\n[m4ti]]+\\n[3ind]+\\n(.o
.nr m4tl \\n[3cd\\$1]-\\n[3cd\\n[m4ti]]
.nr m4th \\n[3rt\\n[m4tL]]-\\n[3rt0] \" height if no border around the table
.if !(\\n[3rt\\n[m4tL]]-\\n[3rt\\n[3crow]]) .nr m4th \\n[3bot] \" with border
.nr m4th -\\n[3cd0] \" in case of doublebox
\\!m4t: H\\n[m4tk]
\\!m4t: V\\n[3rt0]
.nr m4tk .25m
\\!m4t: v\\n[m4tk]
\\!m4t: Df \\$2 0
\\!m4t: h-\\$2
\\!m4t: DP \\n[m4tl] 0 0 \\n[m4th] -\\n[m4tl] 0 0 -\\n[m4th]
\\!m4t: Df 0 0
..
.de m4tfa
.nr m4tL \\n[3crow]+1 \" number of the last line
.nr m4tj \\n[3rt0]+.25m
\\!m4t: V\\n[m4tj]
.nr m4ti \\n[3ind]+\\n(.o+\\n[3cd0]
\\!m4t: H\\n[m4ti]
\\!m4t: Df \\$1 0
\\!m4t: h-\\$1
.nr m4th \\n[3rt\\n[m4tL]]-\\n[3rt0] \" height if no border around the table
.if !(\\n[3rt\\n[m4tL]]-\\n[3rt\\n[3crow]]) .nr m4th \\n[3bot] \" with border
.nr m4th -\\n[3cd0] \" in case of doublebox
.nr m4tk \\n(TW-\\n[3cd0]-\\n[3cd0]
\\!m4t: DP \\n[m4tk] 0 0 \\n[m4th] -\\n[m4tk] 0 0 -\\n[m4th]
\\!m4t: Df 0 0
..
.de m4tshd
.nr m4tL \\n[3crow]+1 \" number of the last line
.nr m4tk \\$2*1p
.if !\\n[m4tk] .nr m4tk 2p
.nr m4tj \\n[3rt0]+.25m-\\n[3cd0]
\\!m4t: V\\n[m4tj]
.nr m4ti \\n[3ind]+\\n(.o
.nr m4tl \\n[m4ti]+\\n[m4tk]
\\!m4t: H\\n[m4tl]
\\!m4t: v\\n[m4tk]
\\!m4t: Df \\$1 0
\\!m4t: h-\\$1
.nr m4th \\n[3rt\\n[m4tL]]-\\n[3rt0] \" height if no border around the table
.if !(\\n[3rt\\n[m4tL]]-\\n[3rt\\n[3crow]]) .nr m4th \\n[3bot] \" with border
.nr m4th +\\n[3cd0] \" in case of doublebox
\\!m4t: DP \\n(TW 0 0 \\n[m4th] -\\n(TW 0 0 -\\n[m4th]
\\!m4t: V\\n[m4tj]
\\!m4t: H\\n[m4ti]
\\!m4t: Df 0 0
\\!m4t: DP \\n(TW 0 0 \\n[m4th] -\\n(TW 0 0 -\\n[m4th]
..
.de m4tbdr
.nr m4tm \\$3
.if !\\n[m4tm] .nr m4tm \\n(.s
.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]]
.  \" Next lines is in case of doublebox:
.    nr m4th -\\n[3cd0]
.\}
\\!m4t: H\\n[m4tk]
\\!m4t: V\\n[3rt\\n[m4tj]]
.nr m4tk .25m
\\!m4t: v\\n[m4tk]
\\!m4t: s\\n[m4tm]000
\\!m4t: Dp \\n[m4tl] 0 0 \\n[m4th] -\\n[m4tl] 0 0 -\\n[m4th]
\\!m4t: s\\n(.s000
..
.de m4tdbl
.ie !\\n[3cd0] .tm You can't use .m4tdbl without the 'doublebox' option
.el \{\
.  nr m4tL \\n[3crow]+1 \" number of the last line
.  nr m4tm \\$1
.  if !\\n[m4tm] .nr m4tm 1000
.  nr m4ti \\n[3ind]+\\n(.o
.  nr m4tj \\n[3rt0]+.25m-\\n[3cd0]
.  nr m4th \\n[3rt\\n[m4tL]]-\\n[3rt0] \" height if no border around the table
.  if !(\\n[3rt\\n[m4tL]]-\\n[3rt\\n[3crow]]) .nr m4th \\n[3bot] \" with border
.  nr m4th +\\n[3cd0] \" in case of doublebox
\\!m4t: V\\n[m4tj]
\\!m4t: H\\n[m4ti]
\\!m4t: Df \\n[m4tm] 0
\\!m4t: h-\\n[m4tm]
\\!m4t: DP \\n(TW 0 0 \\n[m4th] -\\n(TW 0 0 -\\n[m4th]
.  m4tfa 0   
.\}
..

reply via email to

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