[Tex/LaTex] Decrease space between paragraph and header

fancyhdrgeometryheader-footer

l

How can I decrease the white space marked with blue? I tried \vspace with negative marks but to no avail (it normally does the trick but not this time). I am using the 'fancyhdr'-package.

\documentclass[12pt, a4paper]{article}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern, amsmath, amssymb, fancyhdr, eulervm}

\setlength{\parindent}{0in}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\lhead{Left header, text}
\rhead{Right header, text}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\[
\int \!\! \int f(x,y) \, \text{d}x\text{d}y \quad \text{och} \quad \sum_{n=0}^{\infty}         \Big( n^2 + n + n! \Big)
\]
\end{document}

Best Answer

You can simply change the length of \headsep using the \setlength command, for example: \setlength{\headsep}{10pt}.

If I add at the end of your code:

\clearpage
\setlength{\headsep}{1pt}
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I get the following result:

enter image description here