Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

the footer on my first TOC page is not showing in the right position. My code (very simplified, I made a copy of the class and document used, made cuts until I found out the problem and generated this code snipet) is below:

\documentclass[10.5pt,twoside]{report}

\usepackage{fancyhdr}
\usepackage[a4paper,vmargin={3cm,3.2cm},hmargin={3cm,3cm}]{geometry}
\usepackage[demo]{graphicx} 

\pagestyle{fancyplain}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}

%if I comment the line below it works
\fancyhead[C]{\includegraphics[height=38pt]{sampleimage.png}}

\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\cfoot{\includegraphics[height=28pt]{anyimage.png}}
\renewcommand{\footrulewidth}{0pt}

\begin{document}

\tableofcontents
\cleardoublepage

\part{First Part}
\cleardoublepage
\chapter{firstchapter}

\end{document}

If I comment the mentioned line it works, but the header won't show as I wish. Anyone know why this is happening? How can I fix it (maintaining the header the way I want)?

Thanks in advance.

share|improve this question
1  
Do you get a warning of the fancyhdr package? For example, Package Fancyhdr Warning: \headheight is too small would refer to that. In that case adjust it using \setlength{\headheight}{...} then or your layout might be harmed - your image is bigger than the default head height. –  Stefan Kottwitz Feb 22 '11 at 19:34
    
@Stefan The problem is indeed the size of the image. I did set up the headheight and it worked! Please add this as answer so I can accept your answer. Thanks again. –  Weslei Feb 22 '11 at 19:48
add comment

1 Answer 1

up vote 3 down vote accepted

If the content of the header is too big such that it doesn't match the value of \headheight, the layout can be damaged. In such cases the fancyhdr package would print out a warning:

Package Fancyhdr Warning: \headheight is too small

It can be repaired by adjusting that length by \setlength{\headheight}{...}.

share|improve this answer
add comment

Your Answer

 
discard

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.