I'm trying to produce a horizontal rule 2/3 the textwidth
and centred. It's much harder than expected, as it pulls to the left. I've tried putting noindent
but that makes it worse, as this MNWE shows:
\documentclass[12pt]{article}
\begin{document}
This line is 2/3 textwidth with hspace\{stretch\} either side and no indent:
\noindent\hspace{\stretch{1}}\rule{0.67\textwidth}{0.1pt}\hspace{\stretch{1}}
This line is 2/3 textwidth with hspace\{stretch\} either side:
\hspace{\stretch{1}}\rule{0.67\textwidth}{0.1pt}\hspace{\stretch{1}}
This line is 4/5 textwidth with hspace\{stretch\} either side:
\hspace{\stretch{1}}\rule{0.8\textwidth}{0.1pt}\hspace{\stretch{1}}
This line is 9/10 textwidth with hspace\{stretch\} either side:
\hspace{\stretch{1}}\rule{0.9\textwidth}{0.1pt}\hspace{\stretch{1}}
This line is full textwidth:
\hspace{\stretch{1}}\rule{\textwidth}{0.1pt}\hspace{\stretch{1}}
This line is full linewidth:
\hspace{\stretch{1}}\rule{\linewidth}{0.1pt}\hspace{\stretch{1}}
\end{document}
I've also tried just using \hfill
s instead of the \hspace{\stretch{1}}
s, but that produces the same effect. What am I missing?
Best Answer
And a very short version:
\centerline{\rule{0.6667\linewidth}{.2pt}}
: