I want to redefine \headrule such that there is a ruler in the header. The width of the ruler = text area width + marginparsep + marginparwidth.
I don't know how to make the head rule spans across marginpar.
Here is my minimal code snippet. In the code, I also implement \MARKER to be an example as which the ruler should be the same.
Code: Select all
\documentclass{book}
\usepackage{xcolor}
\usepackage{fancyhdr}
\renewcommand{\headrule}
{\strut\vrule%
\hrulefill~{\color{red}\scriptsize text area}~\hrulefill\vrule}
\newcommand*{\MARKER}{%
\noindent\strut\vrule%
\hrulefill~{\color{red}\scriptsize text area}~\hrulefill\vrule%
\marginpar{\strut\vrule\hrulefill~{\color{green}\scriptsize margin area}~\hrulefill\vrule}\\}
\usepackage{lipsum}
\pagestyle{fancy}\fancyhf{}
\begin{document}
\lipsum[1]
\MARKER
\lipsum[1-10]
\end{document}
Thank you.
regards,
LATEXIAN