I am trying to customize the header rule using fancyhdr
and tikz
packages. I wish the rule could overpass the margins. In order to do so I thought that drawing a line with tikz
from (-1,0) to (18,0)
would get 1 cm over the margins in each side, but what I got was the line crossing over just the left margin and not the right. Here's a MWE of my code:
\documentclass[12pt,a4paper]{report}
\usepackage{geometry}
\geometry{
left = 2cm,
right = 2cm,
top = 3cm,
bottom = 2cm
}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Ex Tunc}
\chead{\( \circledast \)}
\rhead{Ex Nunc}
\renewcommand{\headrule}{%
\raisebox{.3cm}{%
\begin{tikzpicture}[x=1cm,y=1cm]
\draw (-1,0) to (18,0);
\end{tikzpicture}
}
}
\begin{document}
\lipsum[1-20]
\end{document}
Here's an image of what I got (above) and what I'd like to have (below):