ECN No Name Newsletter: September, 1991

The ECN No Name Newsletter is no longer being published. This is an archived issue.

[previous article] [next article]

Making Lines With TROFF

Stacey Clark

While troff, a text formatter, makes some functions easier, troff has unfortunately made one fuction more complex. Troff doesn't like to underline, because of the number of fonts available. However, sometimes you really want to draw a line! So, troff allows you to say ________________________________________ to draw a 4 inch line, leaving it up to you to calculate how long the line should be.

Suppose you want to tell Troff to "draw a line to the right margin" as in the following example:

name:_________________________________________
address:______________________________________
______________________________________________
phone:________________________________________

This can be done by the following command sequence:
 .tc _
 .ta 3iR

 name:^I
 address:^I

 phone:^I

To further explain, ".tc" changes the tab character to be an underscore. ".ta" means tab adjust, which enables us to define how long the tab field is. The length is defined by the "3i", meaning three inches. "R" indicates that the underscore is to be right-adjusted. Tab or "^I" (control-i) is necessary after the word so that troff draws a line in place of the tab character.

If you ever need to use a second type of horizontal line, a leader can be used by defining the leader character, such as .lc_. Therefore, when typing a "^A" (control-a) will cause the leader character to be printed. The next command sequence is an example:

 .ta
 .lc _
 .tc .
 ^I^A^I^A
This would print:

Hopefully, this will solve some of your underlining problems!


webmaster@ecn.purdue.edu
Last modified: Thursday, 23-Oct-97 18:44:42 EST

[HTML Check] HTML