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.

I am creating document with headers and footers. The problem that I faced with is that I cannot get nice view of first and the other pages: different spacing is set. See my code and picture.

\documentclass[]{article}
\usepackage
[
        a6paper,
        left=2.5cm,
        right=2cm,
        top=2.5cm,
        bottom=2.5cm,
]
{geometry}

\usepackage{graphicx}

\setlength{\headsep}{0.5in}
\usepackage{fancyhdr,lipsum}
\pagestyle{fancy}

\fancyhf{}
\lfoot{My Title \\ \today}
\rfoot{User Guide \\ version 1.0}
\lhead{\includegraphics[width=1cm]{blank.png}}
\rhead{\thepage}
%\setlength{\headsep}{1in}
\renewcommand{\headrulewidth}{0pt}

\begin{document}
\section{Section 1}
\newpage
\section{Section 2}
\end{document}

enter image description here

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Or use this new one to replace the old \lhead

\lhead{
\begin{picture}(0,0)
\includegraphics[width=1cm]{fig}
\end{picture}
}

without changing headheight and the figure size.

image 1enter image description here

image 2enter image description here

share|improve this answer
add comment

In your example I changed \includegraphics[width=1cm]{blank.png} to \rule{1cm}{1cm}. After compiling, I found the following warning in the log file.

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 32.05278pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

Adding headheight=33pt to the options for the geometry package eliminated the problem. You may need a different height if blank.png is not exactly square.

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.