2

I'm trying to use the fancy header package to come up with something that looks like this:

enter image description here

The left and right boxes are figures, and the lower box is text. The problem is that if I use fancy header, I can divide in left and right, but then how do I setup a combined header?

The code I currently have looks like this:

\usepackage{fancyhdr} % for fancy header and footer

\pagestyle{fancy}
\setlength\headheight{3cm}
\setlength\voffset{-2cm}
\setlength{\headsep}{1cm}
\rhead{ \includegraphics[height=2cm]{figure1.pdf} \\ }
\lhead{  \includegraphics[height=1.5cm] {figure2.pdf} \\}

1 Answer 1

3

Here is a mockup of a design using fancyhdr that you can use to insert figures and text in both the left/right parts of the header:

enter image description here

\documentclass{article}

\usepackage{lipsum}
\usepackage{fancyhdr,graphicx}

\pagestyle{fancy}
\setlength\headheight{\dimexpr2cm+1.5\baselineskip}
\fancyhead[L]{%
  \makebox[0pt][l]{\raisebox{\baselineskip}{\includegraphics[height=1.5cm]{example-image-a}}}%
  Left header}
\fancyhead[R]{%
  Right header%
  \makebox[0pt][r]{\raisebox{\baselineskip}{\includegraphics[height=2cm]{example-image-b}}}}%
\fancyhead[C]{%
  Centre header}

\begin{document}

\lipsum[1-20]

\end{document}

In principle, the placement of the images are done inside a zero-width box (horizontally) and raised into position.

4
  • The solution still does not address the problem, does it? The problem that I have is that I don't know how to have both left and right sections, and then a unified header just after the placement of the figures. So in a way, what I need is that what you wrote in text be a single left-aligned text.
    – aaragon
    Aug 14, 2017 at 14:01
  • @aaragon: It does based on the problem description. However, this new requirement should be easy to obtain. You can remove \fancyhead[C]{...} (to remove the Centred text, and the text associated with \fancyhead[R]{...} (leaving only the right image), only updating the text in \fancyhead[L]{...}.
    – Werner
    Aug 14, 2017 at 14:10
  • Yes! Almost got it. Now the problem is that I need to raise the right figure because it's superimposing with the text. Should I change the argument to raise box?
    – aaragon
    Aug 14, 2017 at 14:16
  • @aaragon: The image in \fancyhead[R] is already inside a \raisebox, just like the image in \fancyhead[L]...
    – Werner
    Aug 14, 2017 at 14:17

You must log in to answer this question.

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