I'm struggling to add an image to the headers of an A4 paper document. Additionnally, my document is twoside
. That's the way I'd like it to look :
Basically the logo with the name and the triangles are one single image, spanning the full width of an A4 page (I've taken it from a Word template), and adapted to displaying on odd pages. I designed a second image for even pages.
I tried to put them in a fancyhdr
style, using the command \fancyhead[\includegraphics[width=\paperwidth]{even.png}]{\includegraphics[width=\paperwidth]{odd.png}}
. The thing is the image doesn't adjust to the exact edges of the page. I've tried different solutions : using \setlength
commands to modify the margins; using \fancyheadoffset
command to change the width of the header; splitting the image into three smaller images (triangles, inverted triangles and logo) that I could send into the corners using \fancyhead
's R and L options ... None of them would work. So I figured I needed your help.
So is it even possible to set an image in the header of a document to give the output above ?
Here's a MWE :
\documentclass[a4paper,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage[UTF8]{inputenc}
\usepackage{graphicx, fancyhdr, lipsum}
\usepackage[top=2.0cm, bottom=2.5cm, inner=2.5cm, outer=2.5cm, marginparwidth=0pt]{geometry}
\pagestyle{fancy}%
\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% These lines are my attempts at changing the layout
%\setlength\hoffset{0pt}
%\setlength\oddsidemargin{1cm}
%\setlength\voffset{0pt}
\setlength\headheight{85.0pt}
\addtolength{\textheight}{-85.0pt}
%\setlength\headwidth{\paperwidth}
%\fancyheadoffset{150pt}
%---
\fancyhead[RE, LO]{\includegraphics{logo.png}}
\fancyhead[LE]{\includegraphics{even.png}}
\fancyhead[RO]{\includegraphics{odd.png}} %
\begin{document}
\lipsum[1-15]
\end{document}
\thispagestyle{empty}
and it isn't a problem. Why ? – oowekyala Jun 27 '15 at 23:43fancyhdr
commands, but it won't adjust to the edges of the page... – oowekyala Jun 28 '15 at 12:21