I am fiddling with various ways of filling a line with a vertically centered line and experimenting with the answers here: https://stackoverflow.com/questions/2553392/latex-rule-filling-the-line and here: Vertically centered horizontal rule filling the rest of a line?. Now, I would like the line to fill the beginning (left) of the line – not the rest. It seems "fill" commands do not do anything unless the line contains "something" before the fill part. How can I do this so that I can fill the line with a rule like this:
———————————————– Text
Where the text is flush right?
Best Answer
What you place before can be empty. The following example is taken from Vertically centered horizontal rule filling the rest of a line?:
\mbox{}
sets an empty box and initiates a paragraph (similar to what TeX's\leavevmode
does). Also, to avoid paragraph indentation, I've set\parindent
to0pt
. However, you can control this individually using\noindent
.