Tell me more ×
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 book and one of my chapter has a very long title. As it can't be displayed correctly on the top of even pages, I provide a "short title name" via the \chapter[short title]{long title} command. But then, "short title" appears in the table of contents, instead of the original/true/long one.

How can i have the "short title" in the header of even pages, and the "long title" in the ToC and in the "Title header"?

For reference, here is the code I use:

\documentclass[11pt,a4paper]{book}

\begin{document}

\tableofcontents

\chapter[Short title]{Very vey very very very very very very long title
    i can't display in the header}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\cleardoublepage

\end{document}
share|improve this question

3 Answers

up vote 27 down vote accepted
\chapter[toc version]{doc version}
\chaptermark{version for header}

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=runheadtoobig

share|improve this answer
1  
you were faster. :-) BTW, is this your third account? If yes, have you thought about asking a moderator to merge your accounts? – lockstep Dec 10 '10 at 13:39
That works perfectly, thanks! – Thomas ABBALLE Dec 10 '10 at 13:40
@lockstep I have asked at the meta of stackexchange if the other unregistered accounts could be merged with this one. I got the answer that is has been done but I don't know how much time it needs to show (or if it worked). Edit: It worked just now. – Ulrike Fischer Dec 10 '10 at 14:45
Right now, you hove 4459 reputation and a single badge. ;-) – lockstep Dec 10 '10 at 14:47

The sectioning commands of the memoir class feature a second optional argument:

\documentclass[11pt,a4paper]{memoir}

\begin{document}

\tableofcontents*% Starred form for not including the ToC in the ToC

\chapter[Title displayed in ToC][Title displayed in header]{Title}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\clearpage\null

\end{document}

EDIT: Since v3.10, the KOMA-Script classes allow to specify the usage of the optional argument of sectioning commands. The class options are headings=optiontohead, headings=optiontotoc, and headings=optiontoheadandtoc.

\documentclass[headings=optiontohead]{scrbook}

\begin{document}

\tableofcontents

\chapter[Title displayed in header]{Title; also displayed in ToC}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\clearpage\null

\end{document}
share|improve this answer

Another option is to use the truncate package, with fancyhdr, which truncates the header if it's too long, and adds an elypsis at the end:

 \usepackage[fit]{truncate}
 \usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhead[RO,LE]{\truncate{.95\headwidth}{\leftmark}}
 \fancyfoot[C]{\thepage}
share|improve this answer

Your Answer

 
discard

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