1

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

  • Read the part of the manual about laying out the page. This is the distance between the header and the top of the text. It is also explained in the manual via a drawing. – daleif Oct 23 '15 at 9:42
  • 1
    And you should not make it too small. – daleif Oct 23 '15 at 9:43
  • Will check up on that, @daleif. And I shall post an answer to it when found. – Rasmus Bækgaard Oct 23 '15 at 9:45
  • I think this one is headsep. – daleif Oct 23 '15 at 9:46
  • 1
    Post a full minimal example. Also, you text may end up being a bit wide (in harder to read with those 2.5cm margins) – daleif Oct 23 '15 at 10:14
3

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.