I am using a horizontal rule to to separate texts, and I would like the rule to start to the left of the current left margin. I am using the following code, but apparently it is not the correct way to do that, as I get the warning: "Overfull \hbox (2.22221pt too wide) in paragraph"
What is the correct way?
thanks.
\documentclass{article}
\usepackage{xcolor}
\usepackage[english]{babel}
\usepackage{blindtext}
\newcommand{\blockline}{\noindent\hspace{-0.05\textwidth}
\textcolor{orange}{\rule{1.05\textwidth}{5pt}}}
\begin{document}
\noindent\blindtext
\blockline
\noindent\blindtext
\end{document}
Best Answer
There's a spurious blank space at the end of the first line (which you should comment out). Also, I would use
\par
at the beginning of the definition so\blockline
always ends a paragraph; to prevent the line to be left as a widow, I would use something like\par\nobreak
at the end of the definition: