How to avoid section title at the top of the page overlap the section title in the page itself (screenshot attached)

I am having a problem where a longer \section title overlaps itself. I am using the memoir class and it's printed both at the beginning of the page and in the page itself (see screenshot), and in my case they overlap.

Anyone knows how to fix this?

-
You can use the optional argument of section[toc - header]{printed} or you can use the command \markboth to reduce the section title in the header. –  Marco Daniel May 13 '11 at 16:03
your titles are too long I guess. You should try to rethink them. I do not think a title is supposed to be a full sentence. –  pluton May 13 '11 at 16:21
minimal example please –  daleif May 13 '11 at 16:42

Here's a minimal document that reproduces the problem mentioned:

\documentclass{memoir}
\usepackage{lipsum}

\begin{document}

\chapter{test with a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title}
\newpage
\section{test}
\lipsum[1-30]

\end{document}


As Marco suggested in a comment, one possible solution would be to use the optional argument of the sectioning commands to prevent having excessively long headings:

\documentclass{memoir}
\usepackage{lipsum}

\begin{document}

\chapter[Title in headings and in ToC]{test with a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title}
\newpage
\section{test}
\lipsum[1-30]

\end{document}


If, for some reason, you must mantain the long title in the heading (which I would not recommend for such long titles), then you can increase the length \headheight; however, this will produce really poor results in the pages not containing the long heading (too much white space at the top) and you will also have to modify the bottom margin. The following code illustrates the change of the length and the poor results obtained:

\documentclass{memoir}
\usepackage{lipsum}

\begin{document}

{

\chapter{test with a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title}
\newpage
\section{test}
\lipsum[1-30]
}

\end{document}


Note the curly braces I use in my example to keep the change local.

-
\documentclass[a4paper]{memoir}