[Tex/LaTex] Memoir: reduce the space in the top of the page

marginsmemoirspacing

I'm using the memoir package to create my master thesis.

When I write a page with text and it goes to the next page, it gives me a vertical space after my header and down to my text.

What could cause this?
And how can I fix it?

enter image description here

MWE:

\documentclass[english, oneside, 12pt]{memoir}

\usepackage{lipsum}
%Setup for the 'memoir' package (replace 'article')

%Margin
\usepackage[left=3.5cm,right=2.0cm,top=1.5cm,bottom=1.5cm]{geometry}

\linespread{1.15}

\newcommand{\HRule}{\rule{\linewidth}{0.8mm}}

%Text in footer
\usepackage{lastpage} %Finds last page number
\usepackage{xspace} %Inserts necesary space bestween the page number, the dash and the total pagenumber
\newcommand{\footerText}{\thepage\xspace /\pageref{LastPage}}

% Specific chapter style.
% See more at: ftp://ftp.tex.ac.uk/tex-archive/info/MemoirChapStyles/MemoirChapStyles.pdf
\chapterstyle{hangnum}

\nouppercaseheads
\makepagestyle{mystyle} 

\makeevenhead{mystyle}{}{\\ \leftmark}{} 
\makeoddhead{mystyle}{}{\\ \leftmark}{} 

\makeevenfoot{mystyle}{}{\footerText}{} 
\makeoddfoot{mystyle}{}{\footerText}{} 

\makeatletter
    \makepsmarks{mystyle}{% Title in the header
  \createmark{chapter}{left}{shownumber}{\@chapapp\ }{.\ }} 
\makeatother

\makefootrule{mystyle}{\textwidth}{\normalrulethickness}{0.4pt}
\makeheadrule{mystyle}{\textwidth}{\normalrulethickness}

\makepagestyle{plain}
\makeevenhead{plain}{}{}{}
\makeoddhead{plain}{}{}{}
\makeevenfoot{plain}{}{\footerText}{}
\makeoddfoot{plain}{}{\footerText}{}
\makefootrule{plain}{\textwidth}{\normalrulethickness}{0.4pt}

\pagestyle{mystyle}

\setlength{\beforechapskip}{-40pt} 
\setlength{\afterchapskip}{0pt} 
\setlength{\headsep}{0pt}
\setlength{\topmargin}{35pt}
\setlength{\headheight}{102pt}
% \setlength{\textheight}{322pt}
\renewcommand\afterchaptertitle{\par\nobreak\vskip \afterchapskip}

\setlrmarginsandblock{2.5cm}{2.5cm}{*}
\setulmarginsandblock{2.5cm}{2.5cm}{*} %Space from top of paper to header

\setheadfoot{29pt}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
%%----------------------------------------------------------------------

\begin{document}
\chapter{MVE}

\lipsum[1-10]
\end{document}

This gives the following:
enter image description here

Best Answer

Solution seems to be the extra space added with these two properties:

\setheadfoot{29pt}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}

The 2\onelineskip defines (at least in this case) how much space there is from the horizontal line to the text starts/stops. Setting this to '1' gives a better result:

\setheadfoot{29pt}{1\onelineskip}
\setheaderspaces{*}{1\onelineskip}{*}

The difference can be seen here: enter image description here

Related Question