12

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

cgnieder
  • 66,645
MSL
  • 121

1 Answers1

10

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}

caveman
  • 401
  • You might mention also the optional argument to add to the width only on one side. – egreg Mar 27 '12 at 16:04
  • 5
    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). – yo' Mar 27 '12 at 17:23