Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

2 Answers 2

up vote 10 down vote accepted

Some improvements at Herbert's answer:

\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%
}

\headsep=1cm
\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} 

enter image description here

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.

Also I've added

\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.

share|improve this answer
    
+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?}
share|improve this answer
    
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
2  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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