19.10 \hrulefill & \dotfill

Synopsis, one of:


Produce an infinite horizontal rubber length (see Lengths) that LaTeX fills with a rule (that is, a line) or with dots, instead of white space.

This outputs a line 2 inches long.


This example, when placed between blank lines, creates a paragraph that is left and right justified and where the middle is filled with evenly spaced dots.

\noindent John Aubrey, RN \dotfill{} Melbury Lodge

To make the rule or dots go to the line’s end use \null at the start or end.

To change the rule’s thickness, copy the definition and adjust it, as here

  \leavevmode\leaders\hrule height 1pt\hfill\kern0pt }

which changes the default thickness of 0.4pt to 1pt. Similarly, adjust the dot spacing as with

  \leavevmode\cleaders\hbox to 1.00em{\hss .\hss }\hfill\kern0pt }

which changes the default length of 0.33em to 1.00em.

This example produces a line for a signature.


The line is 4cm long.

Unofficial LaTeX2e reference manual