I am new to LaTeX and I am trying to place a rectangle (filled in red for instance) at the very top of all the pages of my document. The rectangle should be 0.5 cm high and with the page width.
I saw a lot of complicated threads to do that, but cannot manage to reproduce it.
My basic attempt by drawing a rectangle with \tikzpicture:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[red] (0,0) rectangle (\paperwidth, 0.5cm)
\end{tikzpicture}
\end{document}
The problem is that LaTeX only starts drawing at the top left corner of the margin and not of the page. I tried to use \voffset but nothing changes.