Next: , Previous: , Up: Tabs and Fields   [Contents][Index]


5.10.1 Leaders

Sometimes it may may be desirable to use the tc request to fill a particular tab stop with a given glyph (for example dots in a table of contents), but also normal tab stops on the rest of the line. For this gtroff provides an alternate tab mechanism, called leaders, which does just that.

A leader character (character code 1) behaves similarly to a tab character: It moves to the next tab stop. The only difference is that for this movement, the fill glyph defaults to a period character and not to space.

Escape: \a

This escape is a non-interpreted leader character. In copy mode (see Copy-in Mode), \a is the same as a real leader character.

Request: .lc [fill-glyph]

Declare the leader repetition character.16 Without an argument, leaders act the same as tabs (i.e., using whitespace for filling). gtroff’s start-up value is a dot (‘.’). The value of the leader repetition character is associated with the current environment (see Environments).

For a table of contents, to name an example, tab stops may be defined so that the section number is one tab stop, the title is the second with the remaining space being filled with a line of dots, and then the page number slightly separated from the dots.

.ds entry 1.1\tFoo\a\t12
.lc .
.ta 1i 5i +.25i
\*[entry]

This produces

1.1  Foo..........................................  12

Next: , Previous: , Up: Tabs and Fields   [Contents][Index]