Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need something like the following

.....................................................................................................................................................................

and something like

(a word)........................................................................................................................................(a word)

How can I do them?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

Plain TeX provides \dotfill in case of the period. \leaders and friends can be used for other characters or arbitrary stuff:

Hello \leaders\hbox{word}\hfill\null

H \leaders\hbox{word}\hfill\null

C \cleaders\hbox{word}\hfill\null

X \xleaders\hbox{word}\hfill\null

A\dotfill B

\bye

Result

Remarks:

  • \null or something that is not a glue prevents that TeX removes the latest horizontal glue at the end of the paragraph.

  • \leaders is often used in the table of contents. Then the dots are vertically aligned.

  • \cleaders centers the stuff in the available space. Remaining space that cannot be filled by the leaders box is put at both ends.

  • \xleaders puts the remaining space at each side of the repeated leaders boxes.

share|improve this answer
3  
hey you stole my tick:-) –  David Carlisle May 29 at 9:22

use \dotfill ..................................................

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.