5

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

  • 2
    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
7

You have two options:

  1. Load the calc package:

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

    \fancyheadoffset[LE,RO]{\dimexpr\marginparsep+\marginparwidth\relax}
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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