I'm using \leaders
to make a flexible width rule, with the statement \leaders 0pt plus 1fil\hrule
, but I also want to put text above this line. \rlap{text}\leaders
works fine, except that the text is very close to the line (which isn't very aesthetic). I like the look of \underbar{text}
, but I need the line to extend further, so I'm trying to use a more generic \leaders
to accomplish this. This can't be done with a \vbox
, as far as I can tell because once in a box that is not the one I'm trying to format, the glue doesn't expand as far as I'd like. So, I'm trying to use \lower 2pt\leaders
. This fails because \lower
requires a box as an argument. I had the thought that this might be improved by using a box, but there still has to be a leader statement for the box to be full size, and I can't find a way to set, for example, \box0
, to be this size (which appears impossible because if the box is already constructed, it's inflexible). I've tried both using \lastbox
and setting the box directly, but neither works because the box is already constructed.
The final product I imagine will look something like this minimal nonworking example (or maybe it will use a box with depth or another trick):
\line{\hfil\leaders\hbox{\lower2pt\hrule}\hfil}
It appears to me that this doesn't obviously violate any part of the TeX boxes-and-glue model, so I expect that it's possible. How can I construct this?
x\makebox[30ex][l]{\leaders\hbox to 1ex{\rule[-1ex]{1ex}{.5pt}}\hfill}x
?\leaders\vtop{\vskip2in\hrule width 1pt}
. Thank you for the reference.