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

Using LaTeX, I'm trying to fit into the header a minipage containing the page number above a logo. However,

  1. The minipage is pushed out of the header into the head separation space;
  2. The distance between the page number and the logo varies from page to page.

How do I get it right without using fancyhdr?

Here is the code:

\ProvidesClass{blabla}[2012/01/22 v2.0.2 blabla class]
\LoadClass[12pt, legalpaper, oneside, final]{article}
\geometry{top=6mm, headheight=40mm, headsep=40mm, total={165mm,243mm}, includeheadfoot}

Page \arabic{page}


\def\@evenhead{\@oddhead} \def\@evenfoot{\@oddfoot}}

share|improve this question
Why is fancyhdr not an option? – Werner May 30 '12 at 18:26

I don't see why using a complicated way, when fancyhdr can do it more easily:


\geometry{top=6mm, headheight=40mm, headsep=40mm, total={165mm,243mm}, includeheadfoot}

  Page \arabic{page}\\[6pt]




The demo option to graphicx is just for avoiding to have the picture. Note that a figure environment is not necessary for using \includegraphics.

You can fix the height reserved for the header by not setting headheight and letting fancyhdr suggest the suitable value; for example, with this code fancyhdr tells that the height is 86.90962pt, so setting headheight=90pt will be sufficient.

share|improve this answer
Thank you for the valuable advice concerning the redundancy of a figure environment for using \includegraphics. It seems to me that in fancyhdr one can manage without minipages. – Christopher Jun 2 '12 at 15:23
@Christopher It should be pointed out that figure environments are not actually redundant to \includegraphics. @egreg's hint refers to your specific purpose being not a common use case for a float, which is what a figure defines. – dgs Jun 2 '12 at 16:54

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.