[Tex/LaTex] How to increase headrule length in fancyhdr

fancyhdrheader-footerlengthsmargins

It's pretty well-known how to increase the headrule width, but how do I increase its length (i.e. let it run into the margin).

Best Answer

Use the following command in your defs:

\fancyheadoffset{\textwidth}

Working example:

\documentclass{article}

\usepackage{lipsum}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyheadoffset{\textwidth}

\begin{document}
\lipsum
\end{document}

MWE \fancyheadoffset{\textwidth}