How do you increase headrule length in fancyhdr?

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).

-
according to the fancyhdr manual \fancyhfoffset[L]{1cm} will make the header stick out an extra cm on the left –  David Carlisle Mar 27 '12 at 15:13

Use the following command in your defs:

\fancyheadoffset{\textwidth}


Working example:

\documentclass{article}

\usepackage{lipsum}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

As well, you are adding \textwidth length at an inappropriate place. Try to add \usepackage[textwidth=2.7in]{geometry} before the \fancy... commands: you get a different result (the line is not across the whole page). –  tohecz Mar 27 '12 at 17:23