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

When answering this question: Using fancyhdr to create an image based header and footer

I needed to get the distance from the left edge of the paper to the beginning of \textwidth and the distance from the end of \textwidth to the right edge of the paper. For the distance from the left edge I used \oddsidemargin + \hoffset + 1in to adjust \headwidth via \fancyhfoffset and it put the start of the header on the left edge of the paper. For the distance from the right edge, I thought it was \evensidemargin + \marginparwidth + \marginparsep, but this resulted in the header overshooting the right edge of the page. It appears the correct distance is \evensidemargin + \marginparwidth - \marginparsep.

I think I am missing something about how \marginparsep (or some other page "margin") works.



\fancyhfoffset[L]{\oddsidemargin + \hoffset + 1in}
\fancyhfoffset[R]{\evensidemargin + \marginparwidth - \marginparsep}

First page


Second page
share|improve this question
up vote 9 down vote accepted

The layout package gives you a graphical display and listing of your current layout parameters:







enter image description here

Does that help?

share|improve this answer
It shows the problem. Is the distance between the right edge of the margin notes and the edge of the paper \evensidemargin or is it just some unnamed leftover space? – StrongBad Jan 26 '12 at 17:07

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.