I wish to draw a horizontal line spanning the entire page. Previously I've been using the method in this answer, but I just found that it doesn't work properly on pages with asymmetric margins (say 2in on the left and 1in on the right, or vice versa).
I did come up with a method that works in all usual cases, but it is a little bit ugly:
\noindent\hspace*{-\paperwidth}\makebox[\linewidth]{\rule{4\paperwidth}{2pt}}
Do you have any suggestions?
Below is a MWE to play with.
\documentclass{article}
\usepackage[left=2in,right=1in]{geometry}
% \usepackage[left=1in,right=2in]{geometry}
% \usepackage[left=1in,right=1in]{geometry}
\begin{document}
\noindent\makebox[\linewidth]{\rule{\paperwidth}{2pt}}
% \noindent\hspace*{-\paperwidth}\makebox[\linewidth]{\rule{4\paperwidth}{2pt}}
\end{document}
