[comp.text] ditroff - leading chars and tables

hecht@hsi.UUCP (Alice Hecht) (04/07/89)

I am using troff with the ms macro package and would like to
be able to use leading characters WITHIN tables.  The problem
is that the table macro .TS and .TE does not allow the specification
of the .lc or .tc commands.  Here is what I would like the output
to resemble:

	--------------------------------
	|                              |
 	| Name________________________ |
	| ____________________________ |
	| Address_____________________ |
	| Code Number_________________ |
	|                              | 
	|______________________________|

It would even be nice to use a doublebox or some other table
functions for my example.  But the I cannot use the table command
with the leading characters.  Has anyone ever done this and if so how?

Please e-mail all responses.
Thanks.
Alice

-- 
Alice Hecht                                       ...!uunet!hsi!hecht
Health Systems International                      hecht@hsi.uu.net

kg@elan.UUCP (Ken Greer) (04/08/89)

From article <1108@hsi.UUCP>, by hecht@hsi.UUCP (Alice Hecht):
> 
> I am using troff with the ms macro package and would like to
> be able to use leading characters WITHIN tables.
> Here is what I would like the output to resemble:
> 
> 	--------------------------------
> 	|                              |
>  	| Name________________________ |
> 	| ____________________________ |
> 	| Address_____________________ |
> 	| Code Number_________________ |
> 	|                              | 
> 	|______________________________|
> 

Have you tried \a and set your leader character to underscore?

Alternately, this should work:

	.de _
	'nr x_ \\w'\\$1\ 'u
	'nr y_ \\$2-\\n(x_
	\\$1\ \l'\\n(y_u'\\c
	..
	.de __
	\\h'\\n(x_u'\l'\\n(y_u'
	..

Then
	.nf
	._ Name 4i
	.__
	._ Address 4i
	._ "Code Number" 4i

Ken Greer
Elan Computer Group, Inc.
{ames,uunet}!elan!kg
415-964-2200

lmui@ora.UUCP (Linda Mui) (04/15/89)

In response to a recent request for help in generating troff leader
characters within tables:

I don't recommend fiddling with .lc or .tc within tbl.
Instead, use \l and specify the leader there.  If the text you want
within the table is:
		Name______________________
		__________________________
		Address___________________
		Code Number_______________
Then if the width is meant to be 4 inches, do something like: 
		Name\l'4i-\w'Name'u_'
		\l'4i_'
		Address\l'4i-\w'Address'u_'
		Code Number\l'4i-\w'Code Number'u_'
If you're not familiar with these, "\l" draws a line of the specified 
length with the given character (if any -- underscore (_), in this case). 
"\w" captures the width of the specified string, to ensure that the
lines will be justified.

If these lines need to appear within an already existing table, .T&
will have to be used to redefine the format line to span all columns
but the first (e.g., "l s s.").  

This is hairy, but will pass through tbl unscathed.
-- 
Val Quercia (617) 354-5800 
O'Reilly & Associates, Inc., Publishers of Nutshell Handbooks
90 Sherman Street, Cambridge, MA 02140
UUCP:	uunet!ora!val      ARPA:   val@ora.uu.net