2

I have template in MS Word with image in header/footer. Image width is equal to width of page, left and right margins have 2 cm. I don't know how to do this in latex...

Here you have preview how it's looks in Word. Blue is total header margin, yellow is image

MS Word template

In a similar way is built footer.

  • I'm using geometry package, and I don't have problem with left/right margins. Problem is with header and image that I must put on the whole page width – Nolias Dec 8 '16 at 7:28
  • Should the header image be displayed on every page or just the first page? What's the page size, by the way: A4, US letter or legal, or something else? Does the header image really consist of a wide yellow bar? – Mico Dec 8 '16 at 7:30
  • a4paper. Image must be displayed on every page. And yes, image is on whole page width, from left to right. – Nolias Dec 8 '16 at 7:35
  • I have had a similar issue in the past and tried using fancyhead with the margins adjusted in the includeimage command but could never get it to sit nicely. It might work for you though. – swoop dewoop zoom Dec 8 '16 at 8:11
3

You could load package scrlayer-scrpage and declare additional layers for the pictures at the top and the bottom of the page. Then these layers can be added to all page styles.

\documentclass[a4paper]{article}
\usepackage[
    hmargin=2cm,
    vmargin=4cm,
    headsep=1em,% adjust the  vertical position of the header entry (e.g. section)
    footskip=2em% adjust the vertical position of the footer entry (e.g. page number)
]{geometry}
\usepackage{graphicx}

\usepackage[
    automark,% if you want to use section entries in the header/footer
    headwidth=paper,% if the header entries should also use the whole page width
    footwidth=head
]{scrlayer-scrpage}
\DeclareNewLayer[
    background,
    topmargin,
    mode=picture,
    contents=\putUL{\raisebox{-\height}{\includegraphics[width=\layerwidth,height=2.5cm]{example-image-A}}}
]{topmargin}
\DeclareNewLayer[
    background,
    bottommargin,
    mode=picture,
    contents=\putLL{\includegraphics[width=\layerwidth,height=2.5cm]{example-image-B}}
]{bottommargin}
\AddLayersToPageStyle{@everystyle@}{topmargin,bottommargin}

\clearpairofpagestyles
\cfoot*{\pagemark}% page number centred in footer
\chead{\headmark}% section entry centred in header

\ihead{inner}
\ohead{outer}

\usepackage{blindtext}
\begin{document}
\Blinddocument
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.