4

I'm trying to create a template for my article, which has an image on the header, and on on the footer. I also want to put text on these images. The result would look like this :

Result

(Blue and green zone are images)

I need :

  • Full page width footer/header
  • Image in their backgrounds
  • Text written on these, positioned where i want

I already have my header and my footer full width (with the fancyhdr package), but i'm struggling to write on it.

I already have this for the header (works but i don't know how to position the text) :

\usepackage{fancyhdr}
 \newcommand{\imageheader}{
 \begin{titlepage}
  \begin{center}
   \begin{textblock*}{3cm}(0mm,-3mm)
    \includegraphics[scale=0.75]{header}
   \end{textblock*}
  \end{center}
 \end{titlepage} 
}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\imageheader **my title**}

And for the footer :

\lfoot{
 \makebox[\textwidth]{\includegraphics[width=\paperwidth]{footer}
 }
}

\makebox was the only thing i found to have a full-width footer, i've used several packages without really knowing how they work, so now i'm a bit lost.

6
  • positioned where i want... Please specify where you want them...
    – user11232
    Commented Nov 3, 2015 at 13:05
  • A titlepage environment in a header? What should this do? Commented Nov 3, 2015 at 14:25
  • Is that stuff supposed to be on every page or just the title page?
    – Johannes_B
    Commented Nov 4, 2015 at 14:12
  • Harish Kumar --> as described on the image, but it's better if there are more possibilities Commented Nov 4, 2015 at 15:54
  • Ulrike Fischer --> only thing i found to have a pagewitdh image header Commented Nov 4, 2015 at 15:55

2 Answers 2

4

If you know how to use tikz:

\documentclass{article}
\usepackage{everypage}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{mwe}

\pagestyle{empty}

\AddEverypageHook{\begin{tikzpicture}[remember picture,overlay]
\fill[blue] (current page.north west) rectangle (current page text area.north -| current page.east);
\node[fill=white] at (current page header area) {Insert pretty much anything anywhere};
\fill[blue] (current page.south west) rectangle (current page footer area.north -| current page.east);
\end{tikzpicture}}

\begin{document}
\lipsum[1-8]
\end{document}

full page with headers

2

Here is another suggestion using package scrlayer-scrpage. There you can define and use a new page style by different new layers.

Example:

enter image description here

Code:

\documentclass{article}
\usepackage{blindtext}
\usepackage[vmargin=3cm]{geometry}
%\usepackage{graphicx}
\usepackage{xcolor}

\newcommand\barrule{\rule[-\dp\strutbox]{1pt}{\dimexpr\ht\strutbox+\dp\strutbox\relax}}

\usepackage[automark,autooneside=false]{scrlayer-scrpage}
\addtokomafont{pageheadfoot}{\upshape}

\renewcommand\pagemark{\usekomafont{pagenumber}Page~\thepage}
\renewcommand\sectionmarkformat{}% no section number in the header
\renewcommand\subsectionmarkformat{}% no subsection number in the header

\DeclareNewPageStyleByLayers[oninit={%
    \addtokomafont{pageheadfoot}{\color{white}\bfseries\large\sffamily}%
    \setkomafont{pagenumber}{}%
  }]{backgroundimages}{head.image,head.text,foot.image,foot.text}

\DeclareNewLayer[
  background,
  mode=picture,
  width=\paperwidth,
  height={\dimexpr 1in+\topmargin+\headheight+\headsep-1ex\relax},
  contents={%
    \putLL{\put(0,0){%
      %\includegraphics[width=\layerwidth,height=\layerheight]{example-image-A.pdf}%
      \textcolor{blue!50!black}{\rule{\layerwidth}{\layerheight}}%
  }}}]{head.image}

\DeclareNewLayer[
  background,
  head,
  addhoffset=-1cm,
  addwidth=2cm,
  addheight=-.5cm,
  contents={\usekomafont{pageheadfoot}\usekomafont{pagehead}%
    \parbox[b][\layerheight][b]{\layerwidth}{\raggedleft%
      title \barrule{} \leftmark%
      \ifstr{\rightmark}{\leftmark}{}{ \barrule{} \rightmark}%
  }}]{head.text}
\DeclareNewLayer[
  background,
  mode=picture,
  align=b,
  voffset=\paperheight,
  width=\paperwidth,
  height={\dimexpr\paperheight-(1in+\topmargin+\headheight+\headsep+\textheight+1ex)\relax},
  contents={%
    \putLL{\put(0,0){%
      %\includegraphics[width=\layerwidth,height=\layerheight]{example-image-B.pdf}%
      \textcolor{green!50!blue!60!black}{\rule{\layerwidth}{\layerheight}}%
  }}}]{foot.image}
\DeclareNewLayer[
  foreground,
  foot,
  addhoffset=-1cm,
  addwidth=2cm,
  contents={\usekomafont{pageheadfoot}\usekomafont{pagefoot}%
    \parbox[t]{\layerwidth}{%
      \begin{tabular}[t]{l}
        Title\\
        [2ex]My name
      \end{tabular}%
      \hfill%
      \begin{tabular}[t]{r}
        \pagemark\\[2ex]
        My cursus \barrule{} date%
      \end{tabular}%
  }}]{foot.text}

\begin{document}
\pagestyle{backgroundimages}
\section{A section}
\Blindtext[7]
\subsection{A subsection}
\Blindtext[10]
\Blinddocument
\end{document}

You must log in to answer this question.

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