I am trying to draw a horizontal line to the right of some text and to the end of the page, but as the text lengths are variable, I have opted to use \hrulefill instead of \rule so that the length of the horizontal line drawn is calculated automatically.
For example, MWE 1 below shows how the default \hrulefill works.
MWE 1
\documentclass{article}
\begin{document}
Hi \hrulefill
Hello \hrulefill
\end{document}
Subsequently, I wanted to customise its thickness and found some code to do it. In particular, MWE 2 below changes the line's thickness from a default of 0.4 pt to 1.5 pt.
MWE 2
\documentclass{article}
\renewcommand{\hrulefill}{%
\leavevmode\leaders\hrule height 1.5 pt\hfill\kern 0 pt}
\begin{document}
Hi \hrulefill
Hello \hrulefill
\end{document}
Finally, I would like the line to be drawn from the centre of the words i.e. slightly higher than what the above MWEs produce. Thus, I was wondering how I could further adapt the \renewcommand code to include how "high" the line is drawn as well.
I note that a similar question has been asked and some solutions have been given here, but I am hoping to find a solution that simply adapts the \renewcommand code above!
Any intuitive explanations or suggestions will be greatly appreciated!