Why does the following command not produce a horizontal rule filling the space until the end of the line?
Hello \rule[0.5em]{\fill}{1pt}
It is my understanding that this should print the text “Hello
” followed by a horizontal rule that extends until the end of the line, analogously to the macro \hfill
which is effectively equivalent to \hspace\fill
. – But in effect, this command just produces the text “Hello
”, no rule.
I am aware that the effect can be produced by \hrulefill
but it can’t be used here because I want a raised rule and \hrulefill
doesn’t work together with \raisebox
and I want my rule to hang above the baseline (at best in the middle of the line).
\hfill
is outside the\hbox
but it works like a charm, thanks. – Knell