TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have loaded the fancyhdr package and I want to make the headers and footers wider (clamp them to the margin), so I inserted the following line after the package has loaded:

\fancyheadoffset[LE,RO]{\marginparsep + \marginparwidth}

This is from an example in the document Page layout in LaTeX. But when I try to compile I get the following error:

Missing number, treated as zero

two times, and equally many plus signs in my document. When I enter \marginparsep in the body text, I also found that this gave the same error message. Why is it missing? I need it! :P

share|improve this question
If you look closely, the line above the one you mention from the document you cite is precisely \usepackage{calc}. It's always best to try making a minimal example: very often this allows to sort out the problem. – egreg May 29 '12 at 21:35
Please consider accepting those answers that you think best solved your problems; in case of doubt, please see How do you accept an answer?. – Gonzalo Medina May 30 '12 at 13:50
@Gonzalo Medina: Done. For some reason almost no buttons on this page work from the computer I normally use so I couldn't accept your answer until now. – StrawberryFieldsForever Jun 1 '12 at 8:12
@StrawberryFieldsForever no problem, and thanks for accepting the answer. I will delete this comment and my previous one shortly. – Gonzalo Medina Jun 1 '12 at 20:18
up vote 6 down vote accepted

You have two options:

  1. Load the calc package:

    \fancyheadoffset[LE,RO]{\marginparsep + \marginparwidth}
  2. Use the e-TeX \dimexpr:

share|improve this answer
Thanks, both worked! – StrawberryFieldsForever Jun 1 '12 at 8:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.