I want to place an image behind everything on a specific page in my document to liven it up a bit. The first I tried to do was to do was put in a tikz-picture as background, and it worked pretty well, but infortunately the header gets drawn over.
Here is the essential code I have used so far, and its output:
\documentclass[11pt,a4paper,twoside]{scrbook}
\RequirePackage{microtype}
\RequirePackage{pdfpages}
\usepackage{lipsum}
\usepackage{lettrine}
\usepackage{tikz}
\usepackage{multicol}
% Dimensions:
\setlength\topmargin{-58pt}
\setlength\headheight{20pt}
\setlength\headsep{25pt}
\setlength\marginparwidth{-20pt}
\setlength\textwidth{\paperwidth - 82pt}
\setlength\textheight{\paperheight - 112pt}
\setlength\oddsidemargin{-30pt}
\setlength\evensidemargin{-30pt}
% Header and Footer:
\usepackage{fancyhdr}
% Header
\lhead[\thepage]{Edition}
\rhead[Name]{\thepage}
\chead{\sffamily HEADER}
% Headercolour
\renewcommand{\headrulewidth}{1pt}% 2pt header rule
\renewcommand{\headrule}{\hbox to\headwidth{%
\color{black}\leaders\hrule height \headrulewidth\hfill}}
% Footer
\lfoot{}
\rfoot{}
\cfoot{\vspace{-20pt}\textcolor{black}{\rule{\textwidth}{1pt}}}
% Fonts:
\usepackage{mathptmx} % Serif
\usepackage{DejaVuSans} % Sans-serif
\usepackage[T1]{fontenc}
\usepackage{xstring}
\begin{document}
\noindent
\begin{tikzpicture}[remember picture,overlay]
\node (background) at (0.5\textwidth,-0.5\textheight+15pt) {\includegraphics[height=\paperheight+20pt]{bak}};
\draw [white , fill=white, opacity=0.7](-15pt,-\topmargin+5pt) rectangle (\textwidth+10pt,-\topmargin-\headheight-10pt);
\draw [white , fill=white, opacity=0.7](-15pt,15pt) rectangle (\textwidth+10pt,-\textheight);
\draw [white , fill=white, opacity=0.7](-15pt,-\textheight-22pt) rectangle (\textwidth+10pt,-\textheight-30pt);
\end{tikzpicture}
\pagestyle{fancy}
\begin{multicols}{2}
\lettrine[loversize=0.1]{A}{S} I said, this is a test. \lipsum
\end{multicols}
\clearpage
\begin{multicols}{2}
\lipsum
\end{multicols}
\end{document}
Notice that of the two pages, only the second has a header. In the other the tikz-picture has drawn on top of it. If there is some way to make tikz draw underneath the header, or even to force a re-draw of the header, that would solve my problems. But I do not know how to do any of these.
Notice also that the footer does show up, whereas the header disappears behind the tikz drawing, for some reason. I don't know what to make of this.
Any ideas?
Best Answer
Here is a suggestion that needs an uptodate KOMA-Script: version 3.16 or newer. Then you can use
scrlayer-scrpage
insteadfancyhdr
and define a new pagestyles for the pages with a background image.