[Tex/LaTex] How to make a long underscore in Plain TeX

plain-texrules

I have looked at this question as well as here and here but I cannot figure out how to produce a long underscore in plain TeX, as in the following example.

Date _____________________________

The closest I have come is the obviously undesirable concatenation which leaves gaps in the rendered output.

Date  \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Best Answer

Use a negative height and a slightly bigger depth:

\vrule height -3pt depth 3.4pt width 7cm

Adjust to suit.

enter image description here

The same idea can be used for “raised rules” (with a negative depth). No rule will appear if depth + height is negative.

If you want a “low rule” that fills up a given space, leaders should be used:

\def\lowhrulefill{%
  \leavevmode % be sure to be in horizontal mode
  \leaders\hrule height height -3pt depth 3.4pt\hfill % fill all available space
  \kern0pt % so \par won't remove the rule
}

Note that \leavevmode is necessary because the command appearing in vertical mode would raise an error because of \hfill (and would do nothing good either).

Related Question