0

I have a problem with fancyheader. The pagestyle is defined like this:

\fancypagestyle{companypagestyle}{
\fancyhf{}

\fancyhead[R]{
    Page \thepage
}
\fancyhead[L]{
    Lorem datasheet
}
\fancyfoot[L]{      
    \url{http://company.com}
}   
\fancyfoot[R]{
    \includegraphics[width=2.5cm]{logoCompany.png}
}

\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{2pt}
\renewcommand{\headrule}{\hbox to\headwidth{%
    \color{cyan}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrule}{\hbox to\headwidth{%
    \color{cyan}\leaders\hrule height \footrulewidth\hfill}}
}

Which produces perfectly what I wanted. The problem is the first section is somehow missplaced (closer to the header boundary than other sections).

It looks like this:

First section placement

Second section placement

Does anybody know what could be the cause? Thank you very much.

6
  • 3
    Welcome to TeX.SE. Please provide the document that causes this issue, not fragments only
    – user31729
    Commented Jun 4, 2017 at 8:55
  • 1
    We cannot reproduce what you show in the pictures, so answering the question is currently impossible. Please add a minimal working example to your question.
    – Johannes_B
    Commented Jun 4, 2017 at 9:00
  • Check the log file for a headheight too small warning. If there is one, fix it.
    – Johannes_B
    Commented Jun 4, 2017 at 9:22
  • @Johannes_B thank you very much, that solved it. \setlength{\headheight}{25pt}
    – tingdling
    Commented Jun 4, 2017 at 9:40
  • 1
    @ChristianHupfer I'm sorry for not doing so, next time i will attach the whole document. There seems to be no need to do it right now, as the solution is already there.
    – tingdling
    Commented Jun 4, 2017 at 9:40

1 Answer 1

-1

Check the log file for a headheight too small warning. If there is one, fix it. – Johannes_B Jun 4 '17 at 9:22

This is fix. @Johannes_B gave the correct answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .