Page Layout ⇒ ToC and headers with book class
ToC and headers with book class
I'm using the book class of latex, and I want ToC and running title be different.
My code is:
\chapter[indicator for running title]{full title}
Unfortunately, running title is shown in ToC. Instead, I want the full title appears in ToC (but maintaining the running title in headers).
Thanks in advance...
%Sonia
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
ToC and headers with book class
you could modify the \@chapter command as defined in book.cls. Take a look at the following example:
Code: Select all
\documentclass{book}
\usepackage{lipsum}% just to generate some text
\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#2}%
\else
\addcontentsline{toc}{chapter}{#2}%
\fi
\else
\addcontentsline{toc}{chapter}{#2}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\makeatother
\begin{document}
\tableofcontents
\chapter[Short title]{Long title}
\lipsum[1-20]
\end{document}