[comp.unix.questions] troff formatting problems

brad@SSD.CSD.HARRIS.COM (Brad Appleton) (01/10/91)

I am using troff with NO macro packages and I am trying to write
a macro which, given 4 arguments, will print the following:

	arg1      arg2           arg3            arg4

Where:
	"arg1" starts at the beginning of the line,
	"arg2" starts at 1inch from the beginning of the line,
	"arg3" is ``perfectly'' centered between arg2 & arg4, and
	"arg4" ends at the maximum possible end of the line.

I have tried the following (remember I am not using any macros packages
like -ms or -mm etc, nor do I wish to):

	.ds LL 6.5i
	.ds IL 1.0i
	.\"-------------------
	.ll \*(LL
	.ta \*(IL \*(LLR
	.\"-------------------
	.de MM
	.nf
	.\"-----------------------------------------------------------------
	.\"-- find the number of total "spaces" between arg2 and arg 4
	.\"-- and divide the result by 2
	.\"-----------------------------------------------------------------
	.nr XX (\*(LL-\*(IL-\w'\\$2'u-\w'\\$3'u-\w'\\$4'u)/2
	\&\\$1\t\\$2\h'\\n(XX'\\$3\t\\$4
	.br
	.fi
	..

This is not working (the third argument is not in the desired place).
I have tried using tbl(1) instead but seem to have a problem using
.TS and .TE inside a macro definition.

If anyone has any solutions to this I would be much obliged. Tbl solutions
are okay too but I would prefer just plain {n,t}roff. Solutions using any
of the standard macro packages (-me, -mm, -ms, etc ...) are NOT wanted.

advTHANXance

______________________ "And miles to go before I sleep." ______________________
 Brad Appleton           brad@ssd.csd.harris.com       Harris Computer Systems
                             uunet!hcx1!brad           Fort Lauderdale, FL USA
~~~~~~~~~~~~~~~~~~~~ Disclaimer: I said it, not my company! ~~~~~~~~~~~~~~~~~~~