I want a horizontal line to the left and right of some text, that is at most one line wide. The lines should be equally sized such that they fill the remaining horizontal space (like two \hfill
s in a \hbox
).
In case it's not clear what I want, at the top of this page there is a row of buttons labeled Questions | Tags | Users | Badges | Unanswered. And above that row of buttons are two horizontal lines filling the remaining space around a symbol. That is what I want to accomplish in LaTeX.
Best Answer
You can add the lines using
\hrulefill
and create the line using\makebox[\linewidth]
. The vertical alignment is a little tricky. I don't know how to raise the filler, so one way is to lower the text first and than raise it again with the lines.Result: