[Tex/LaTex] \fancypage border to surround header and footer

boxesheader-footerrules

I am trying to create a page border that encapsulates the header and footer not just the body of a TeX document.

Here is what i've got:

\documentclass[a4paper]{article}

\usepackage[a4paper,vmargin={20mm,20mm},hmargin={20mm,20mm}, includehead, includefoot]{geometry}
\usepackage{fancybox}

\begin{document}

\fancypage{\setlength{\fboxsep}{0pt}\fbox}{}

Document text goes here...

\end{document}

When I take out the includehead and includefoot tags the border stays at 2cm on all sides but page numbers are still on the outside of the border. When I include these tags page numbers stay on the outside and the border on top/bottom is no longer 20mm. I theorise that this is due to header/footer. Any pointers?

Best Answer

try this \fancypage{}{\fbox}

Related Question