[Tex/LaTex] Controlling the white space: distance between headrule, text and footrule inconsistent

header-footerspacing

How to control the distance of white space between the rules and the body text?

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{.4pt}
\renewcommand{\footrulewidth}{.4pt}
}
\begin{document}
\thispagestyle{plain}
\lipsum[1-8]
\end{document}

As you can see, the distance between headrule and text is inconsistent with the distance between text and footrule.

I'm mostly in need of a solution for the distance between footrule and text, as the solution for headrule and text is already given here, but doesn't quite work here (?).

See the image:

enter image description here

Best Answer

You can adjust the value (length) of \footskip or \headsep to suit your needs. From the layouts package documentation:

enter image description here

In that sense, maybe the following would suffice:

enter image description here

\documentclass{article}
\usepackage{fancyhdr,lipsum}
\fancypagestyle{plain}{
  \renewcommand{\headrulewidth}{.4pt}
  \renewcommand{\footrulewidth}{.4pt}
}
\setlength{\footskip}{\dimexpr\headsep+1.5\baselineskip+.4pt}
\begin{document}
\thispagestyle{plain}
\lipsum[1-8]
\end{document}