# How to get a line break in a title on the page head?

I am writing a document using the amsart and the title is just very long. Now I wonder, how I could get a linebreak such that it would not overfill the heade of each page. I tried \protect\\\ but this did not work. Here is a minimal example:

\documentclass[11pt]{amsart}
\usepackage{lipsum}

\begin{document}

\title[An annoyingly long title that almost makes me \protect\\ cry and I do not see how to fit it into the head so the question is what I can do?]{An annoyingly long title that almost makes me cry and I do not see how to fit it into the head so the question is what I can do?}
{\maketitle}
\lipsum
\lipsum[3-56]
\end{document}

-

\documentclass[11pt]{amsart}
\usepackage{lipsum}
\newcommand{\mylongtitle}[1]{%
\ifodd\value{page}%
\protect\parbox{0.97\linewidth}{#1}\hfill%
\else%
\hfill\protect\parbox{0.97\linewidth}{#1}%
\fi%
}

\calclayout

\begin{document}

\title[\mylongtitle{An annoyingly long title that almost makes me cry and I
do not see how to fit it into the head so the question is what I can do?}]
{An annoyingly long title that almost makes me cry and I do not see how to
fit it into the head so the question is what I can do?}
\maketitle
\lipsum
\lipsum[3-56]
\end{document}


I've defined a new command \mylongtitle to be used inside the optional argument of \title that ensures correct spacing on odd and even pages.

\headsep=1cm


to balance the distance between header and text (better not to use geometry since it messes up amsart settings). \calclayout after it recalculates the page layout.

-
+1 for making this work even when a (short) author name is present, and for warning not to use geometry. (but i agree with @Herbert's comment that a one-line title heading is preferable.) but why is {\maketitle} in braces? (perhaps to avoid undefining some elements?) and a comment: the first page is significantly longer than the other pages; this is partly because 11pt text doesn't provide an integral number of lines and there's no vertical stretch to compensate, but also because \calclayout hasn't been rerun to adjust the page length after you increased \headsep. –  barbara beeton Dec 21 '13 at 13:52
@barbara Thanks. \maketitle was in braces because I didn't notice it... I, too, would't use such long title headings. In regards of the first page, the text is simply a little shifted down as in other pages, or am I missing something? –  karlkoeller Dec 21 '13 at 15:15
on the first page, i'm pretty sure there's some stretch (i didn't check), so \flushbottom is applied, and the enlargement of \headsep without recalculating the whole does increase the page length (look at \calclayout in amsclass.dtx). since \flushbottom won't apply on non-first pages (no stretch), the discrepancy becomes more obvious. –  barbara beeton Dec 21 '13 at 15:21
@barbara \calclayout added! –  karlkoeller Dec 21 '13 at 15:58
Thank you very much! –  Ben Dec 21 '13 at 19:21

use a \parbox:

\title[\hfill\protect\parbox{0.975\linewidth}{An annoyingly
long title that almost makes me\\ cry and I do not see how to fit it
into the head so the question is what I can do?}]{An annoyingly
long title that almost makes me cry and I do not see how to fit it
into the head so the question is what I can do?}

-
That is already great. However the problem that I get when I use your solution is that it completly messes up with the distance from the header to the text.. –  Ben Dec 21 '13 at 9:55
sure, that's the reason why you should use a one line alternative heading and not the long one. –  Herbert Dec 21 '13 at 10:05
Ok, I see. Thanx! –  Ben Dec 21 '13 at 10:17