I would like to design the header (and footer) of my documents/letters in a rather fancy way. What I'm trying to achive is a colored background with some sort of shading pattern which is a little bit more elaborated than a simple gradient fill or something similar. I want this "bar" to span the complete paperwidth and to be placed right at the very top of the page.

I tried using the fancyhdr package to accomplish this, since I thought it might come handy later on if I use this in documents, but if I could place the background at the top with an option to write on it that would be sufficient for the moment.

So far, I've failed quite miserably in achieving any of the above mentioned points... to give you some kind of hint, what I dreamt might work is the following:

\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{mindmap, backgrounds}
\usepackage{fancyhdr}
\pagestyle{fancy}

\begin{tikzpicture}
\begin{pgfonlayer}{background}
\clip (-1.5,-5) rectangle ++(20,1);
\end{pgfonlayer}
\end{tikzpicture}

\begin{document}
...
\end{document}


And this is what the end product should look like:

You can use some rectangles with shading bilinear interpolation:

\documentclass{article}

\usepackage{tikz}
\usepackage{tikzpagenodes}

\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\node[inner sep=0,fit=(current page)] (cp){};
(cp.north west) rectangle +(4cm,-3cm);
([xshift=4cm]cp.north west) rectangle +(4cm,-3cm);
([xshift=2*4cm]cp.north west) rectangle +(4cm,-3cm);
([xshift=3*4cm]cp.north west) rectangle +(4cm,-3cm);
([xshift=4*4cm]cp.north west) rectangle ([yshift=-3cm]cp.north east);

\node[font=\Huge\bfseries] at ([yshift=-1.5cm]cp.north) {Hello World!};
\end{tikzpicture}
\end{document}


• The result is amazing; I wonder why this answer hasn't gotten more attention. – user9424 Mar 18 '18 at 16:53

You can start with something like this. You can use more advanced shading or pattern or even include a picture, the idea will remain the same.

\documentclass{article}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{mindmap,backgrounds}
\usepackage{fancyhdr}
\pagestyle{fancy}